[Libreoffice-commits] libvisio.git: src/conv

Fridrich Å trba fridrich.strba at bluewin.ch
Tue Nov 5 14:45:29 CET 2013


 src/conv/text/Makefile.am  |    3 ++
 src/conv/text/vsd2text.cpp |   67 +--------------------------------------------
 src/conv/text/vss2text.cpp |   67 +--------------------------------------------
 3 files changed, 7 insertions(+), 130 deletions(-)

New commits:
commit 325248eff211f52fbd8fd41835b942194b94a7a4
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Tue Nov 5 14:45:02 2013 +0100

    Use RVNGTextDrawingGenerator
    
    Change-Id: Ie775928694fd562d380e6f9600d31e5911d48b8c

diff --git a/src/conv/text/Makefile.am b/src/conv/text/Makefile.am
index 7b08e81..6be006f 100644
--- a/src/conv/text/Makefile.am
+++ b/src/conv/text/Makefile.am
@@ -6,6 +6,7 @@ AM_CXXFLAGS = \
 	-I$(top_srcdir)/inc \
 	$(LIBVISIO_CXXFLAGS) \
 	$(REVENGE_STREAM_CFLAGS) \
+	$(REVENGE_GENERATORS_CFLAGS) \
 	$(DEBUG_CXXFLAGS)
 
 vsd2text_DEPENDENCIES = @VSD2TEXT_WIN32_RESOURCE@
@@ -14,12 +15,14 @@ vss2text_DEPENDENCIES = @VSS2TEXT_WIN32_RESOURCE@
 
 vsd2text_LDADD = \
 	../../lib/libvisio- at VSD_MAJOR_VERSION@. at VSD_MINOR_VERSION@.la \
+	$(REVENGE_GENERATORS_LIBS) \
 	$(LIBVISIO_LIBS) \
 	$(REVENGE_STREAM_LIBS) \
 	@VSD2TEXT_WIN32_RESOURCE@
 
 vss2text_LDADD = \
 	../../lib/libvisio- at VSD_MAJOR_VERSION@. at VSD_MINOR_VERSION@.la \
+	$(REVENGE_GENERATORS_LIBS) \
 	$(LIBVISIO_LIBS) \
 	$(REVENGE_STREAM_LIBS) \
 	@VSS2TEXT_WIN32_RESOURCE@
diff --git a/src/conv/text/vsd2text.cpp b/src/conv/text/vsd2text.cpp
index ff1652b..e843fa4 100644
--- a/src/conv/text/vsd2text.cpp
+++ b/src/conv/text/vsd2text.cpp
@@ -32,73 +32,10 @@
 #include <string.h>
 
 #include <librevenge-stream/librevenge-stream.h>
+#include <librevenge-generators/librevenge-generators.h>
 #include <librevenge/librevenge.h>
 #include <libvisio/libvisio.h>
 
-class TextPainter : public librevenge::RVNGDrawingInterface
-{
-public:
-  TextPainter();
-
-  void startDocument(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void endDocument() {}
-  void setDocumentMetaData(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void startPage(const librevenge::RVNGPropertyList &) {}
-  void endPage() {}
-  void startLayer(const librevenge::RVNGPropertyList &) {}
-  void endLayer() {}
-  void startEmbeddedGraphics(const librevenge::RVNGPropertyList &) {}
-  void endEmbeddedGraphics() {}
-
-  void setStyle(const librevenge::RVNGPropertyList &, const librevenge::RVNGPropertyListVector &) {}
-
-  void drawRectangle(const librevenge::RVNGPropertyList &) {}
-  void drawEllipse(const librevenge::RVNGPropertyList &) {}
-  void drawPolyline(const librevenge::RVNGPropertyListVector &) {}
-  void drawPolygon(const librevenge::RVNGPropertyListVector &) {}
-  void drawPath(const librevenge::RVNGPropertyListVector &) {}
-  void drawGraphicObject(const librevenge::RVNGPropertyList &, const librevenge::RVNGBinaryData &) {}
-  void startTextObject(const librevenge::RVNGPropertyList &, const librevenge::RVNGPropertyListVector &) {}
-  void endTextObject() {}
-
-
-  void openOrderedListLevel(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void closeOrderedListLevel() {}
-
-  void openUnorderedListLevel(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void closeUnorderedListLevel() {}
-
-  void openListElement(const librevenge::RVNGPropertyList & /*propList*/, const librevenge::RVNGPropertyListVector & /* tabStops */) {}
-  void closeListElement() {}
-
-  void openParagraph(const librevenge::RVNGPropertyList & /*propList*/, const librevenge::RVNGPropertyListVector & /* tabStops */) {}
-  void closeParagraph();
-
-  void openSpan(const librevenge::RVNGPropertyList & /* propList */) {}
-  void closeSpan() {}
-
-  void insertTab() {}
-  void insertSpace() {}
-  void insertText(const librevenge::RVNGString &text);
-  void insertLineBreak() {}
-  void insertField(const librevenge::RVNGString & /* type */, const librevenge::RVNGPropertyList & /*propList*/) {}
-
-};
-
-TextPainter::TextPainter(): librevenge::RVNGDrawingInterface()
-{
-}
-
-void TextPainter::insertText(const librevenge::RVNGString &str)
-{
-  printf("%s", str.cstr());
-}
-
-void TextPainter::closeParagraph()
-{
-  printf("\n");
-}
-
 namespace
 {
 
@@ -139,7 +76,7 @@ int main(int argc, char *argv[])
     return 1;
   }
 
-  TextPainter painter;
+  librevenge::RVNGTextDrawingGenerator painter;
   if (!libvisio::VisioDocument::parse(&input, &painter))
   {
     fprintf(stderr, "ERROR: Parsing of document failed!\n");
diff --git a/src/conv/text/vss2text.cpp b/src/conv/text/vss2text.cpp
index aa5b55a..217dc62 100644
--- a/src/conv/text/vss2text.cpp
+++ b/src/conv/text/vss2text.cpp
@@ -32,73 +32,10 @@
 #include <string.h>
 
 #include <librevenge-stream/librevenge-stream.h>
+#include <librevenge-generators/librevenge-generators.h>
 #include <librevenge/librevenge.h>
 #include <libvisio/libvisio.h>
 
-class TextPainter : public librevenge::RVNGDrawingInterface
-{
-public:
-  TextPainter();
-
-  void startDocument(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void endDocument() {}
-  void setDocumentMetaData(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void startPage(const librevenge::RVNGPropertyList &) {}
-  void endPage() {}
-  void startLayer(const librevenge::RVNGPropertyList &) {}
-  void endLayer() {}
-  void startEmbeddedGraphics(const librevenge::RVNGPropertyList &) {}
-  void endEmbeddedGraphics() {}
-
-  void setStyle(const librevenge::RVNGPropertyList &, const librevenge::RVNGPropertyListVector &) {}
-
-  void drawRectangle(const librevenge::RVNGPropertyList &) {}
-  void drawEllipse(const librevenge::RVNGPropertyList &) {}
-  void drawPolyline(const librevenge::RVNGPropertyListVector &) {}
-  void drawPolygon(const librevenge::RVNGPropertyListVector &) {}
-  void drawPath(const librevenge::RVNGPropertyListVector &) {}
-  void drawGraphicObject(const librevenge::RVNGPropertyList &, const librevenge::RVNGBinaryData &) {}
-  void startTextObject(const librevenge::RVNGPropertyList &, const librevenge::RVNGPropertyListVector &) {}
-  void endTextObject() {}
-
-
-  void openOrderedListLevel(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void closeOrderedListLevel() {}
-
-  void openUnorderedListLevel(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void closeUnorderedListLevel() {}
-
-  void openListElement(const librevenge::RVNGPropertyList & /*propList*/, const librevenge::RVNGPropertyListVector & /* tabStops */) {}
-  void closeListElement() {}
-
-  void openParagraph(const librevenge::RVNGPropertyList & /*propList*/, const librevenge::RVNGPropertyListVector & /* tabStops */) {}
-  void closeParagraph();
-
-  void openSpan(const librevenge::RVNGPropertyList & /*propList*/) {}
-  void closeSpan() {}
-
-  void insertTab() {}
-  void insertSpace() {}
-  void insertText(const librevenge::RVNGString &text);
-  void insertLineBreak() {}
-  void insertField(const librevenge::RVNGString & /* type */, const librevenge::RVNGPropertyList & /*propList*/) {}
-
-};
-
-TextPainter::TextPainter(): librevenge::RVNGDrawingInterface()
-{
-}
-
-void TextPainter::insertText(const librevenge::RVNGString &str)
-{
-  printf("%s", str.cstr());
-}
-
-void TextPainter::closeParagraph()
-{
-  printf("\n");
-}
-
 namespace
 {
 
@@ -139,7 +76,7 @@ int main(int argc, char *argv[])
     return 1;
   }
 
-  TextPainter painter;
+  librevenge::RVNGTextDrawingGenerator painter;
   if (!libvisio::VisioDocument::parseStencils(&input, &painter))
   {
     fprintf(stderr, "ERROR: Parsing of document failed!\n");


More information about the Libreoffice-commits mailing list