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

Fridrich Å trba fridrich.strba at bluewin.ch
Sat Nov 30 13:15:54 PST 2013


 src/conv/raw/cdr2raw.cpp |   12 ++++++++----
 src/conv/raw/cmx2raw.cpp |   12 ++++++++----
 2 files changed, 16 insertions(+), 8 deletions(-)

New commits:
commit 098016594ada45f56fb9777db723f98ec963fb14
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Sat Nov 30 22:15:19 2013 +0100

    Allow cdr/cmx2raw output callgraph
    
    Change-Id: I62441d16abbcd7f51a223568f93ad9252398c2f1

diff --git a/src/conv/raw/cdr2raw.cpp b/src/conv/raw/cdr2raw.cpp
index 2e1c49e..687f86e 100644
--- a/src/conv/raw/cdr2raw.cpp
+++ b/src/conv/raw/cdr2raw.cpp
@@ -43,6 +43,7 @@ int printUsage()
   printf("Usage: cdr2raw [OPTION] <Corel Draw Document>\n");
   printf("\n");
   printf("Options:\n");
+  printf("--callgraph           Display the call graph nesting level\n");
   printf("--help                Shows this help message\n");
   return -1;
 }
@@ -51,14 +52,17 @@ int printUsage()
 
 int main(int argc, char *argv[])
 {
+  bool printIndentLevel = false;
+  char *file = 0;
+
   if (argc < 2)
     return printUsage();
 
-  char *file = 0;
-
   for (int i = 1; i < argc; i++)
   {
-    if (!file && strncmp(argv[i], "--", 2))
+    if (!strcmp(argv[i], "--callgraph"))
+      printIndentLevel = true;
+    else if (!file && strncmp(argv[i], "--", 2))
       file = argv[i];
     else
       return printUsage();
@@ -75,7 +79,7 @@ int main(int argc, char *argv[])
     return 1;
   }
 
-  librevenge::RVNGRawDrawingGenerator painter;
+  librevenge::RVNGRawDrawingGenerator painter(printIndentLevel);
   libcdr::CDRDocument::parse(&input, &painter);
 
   return 0;
diff --git a/src/conv/raw/cmx2raw.cpp b/src/conv/raw/cmx2raw.cpp
index 7eab9e1..3b2a560 100644
--- a/src/conv/raw/cmx2raw.cpp
+++ b/src/conv/raw/cmx2raw.cpp
@@ -43,6 +43,7 @@ int printUsage()
   printf("Usage: cmx2raw [OPTION] <Corel Binary Metafile>\n");
   printf("\n");
   printf("Options:\n");
+  printf("--callgraph           Display the call graph nesting level\n");
   printf("--help                Shows this help message\n");
   return -1;
 }
@@ -51,14 +52,17 @@ int printUsage()
 
 int main(int argc, char *argv[])
 {
+  bool printIndentLevel = false;
+  char *file = 0;
+
   if (argc < 2)
     return printUsage();
 
-  char *file = 0;
-
   for (int i = 1; i < argc; i++)
   {
-    if (!file && strncmp(argv[i], "--", 2))
+    if (!strcmp(argv[i], "--callgraph"))
+      printIndentLevel = true;
+    else if (!file && strncmp(argv[i], "--", 2))
       file = argv[i];
     else
       return printUsage();
@@ -75,7 +79,7 @@ int main(int argc, char *argv[])
     return 1;
   }
 
-  librevenge::RVNGRawDrawingGenerator painter;
+  librevenge::RVNGRawDrawingGenerator painter(printIndentLevel);
   libcdr::CMXDocument::parse(&input, &painter);
 
   return 0;


More information about the Libreoffice-commits mailing list