The first file wasn't part of the patch...
From: Vincent van Ravesteijn<v...@lyx.org>
---
src/Converter.cpp | 47 +++
src/Converter.h | 14 +
3 files changed, 701 insertions(+), 0 deletions(-)
create mode 100644 development/coding/#newfile1.lyx#
diff --git a/src/Converter.cpp b/src/Converter.cpp
index c76b574..ecd209a 100644
--- a/src/Converter.cpp
+++ b/src/Converter.cpp
@@ -93,6 +93,17 @@ private:
} // namespace anon
+struct Converters::QueuedItem
+{
+ Buffer const * buffer;
+ FileName from_file;
+ FileName to_file;
+ FileName orig_from;
+ string from_format;
+ string to_format;
+ ErrorList * errorList;
+ int conversionFlags;
+};
Converter::Converter(string const& f, string const& t,
string const& c, string const& l)
@@ -257,6 +268,42 @@ OutputParams::FLAVOR Converters::getFlavor(Graph::EdgePath
const& path)
}
+void Converters::addToQueue(Buffer const * buffer,
+ FileName const& from_file, FileName const& to_file,
+ FileName const& orig_from,
+ string const& from_format, string const& to_format,
+ ErrorList * errorList, int conversionflags)
+{
+ QueuedItem * item = new QueuedItem;
+ item->buffer = buffer;
+ item->from_file = from_file;
+ item->to_file = to_file;
+ item->orig_from = orig_from;
+ item->from_format = from_format;
+ item->to_format = to_format;
+ item->errorList = errorList;
+ item->conversionFlags = conversionflags;
+ queue.push_back(item);
+}
+
+
+list<Converters::QueuedItem *> Converters::getQueue() const
+{
+ return queue;
+}
+
+
+bool Converters::convert(Buffer const * buffer, Converters::QueuedItem * item)
+{
+ ErrorList el;
+ bool const success = convert(buffer, item->from_file, item->to_file,
item->orig_from,
+ item->from_format, item->to_format, el, item->conversionFlags);
+ queue.remove(item);
+ delete item;
+ return success;
+}
+
+
bool Converters::convert(Buffer const * buffer,
FileName const& from_file, FileName const& to_file,
FileName const& orig_from,
diff --git a/src/Converter.h b/src/Converter.h
index f71f123..5433239 100644
--- a/src/Converter.h
+++ b/src/Converter.h
@@ -141,6 +141,18 @@ public:
const_iterator end() const { return converterlist_.end(); }
///
void buildGraph();
+ ///
+ struct QueuedItem;
+ std::list<Converters::QueuedItem *> getQueue() const;
+ ///
+ void addToQueue(Buffer const * buffer,
+ support::FileName const& from_file, support::FileName
const& to_file,
+ support::FileName const& orig_from,
+ std::string const& from_format, std::string const&
to_format,
+ ErrorList * errorList, int conversionflags = 0);
+ ///
+ bool convert(Buffer const * buffer, QueuedItem * item);
+
private:
///
std::vector<Format const *> const
@@ -164,6 +176,8 @@ private:
bool copy);
///
Graph G_;
+ ///
+ std::list<QueuedItem *> queue;
};
/// The global instance.