[Libreoffice-commits] core.git: 2 commits - oox/source

Miklos Vajna vmiklos at collabora.co.uk
Tue Apr 15 09:08:44 PDT 2014


 oox/source/drawingml/customshapes/README                |   10 -
 oox/source/drawingml/customshapes/generatePresetsCXX.pl |  124 ++++++++--------
 2 files changed, 64 insertions(+), 70 deletions(-)

New commits:
commit a55e2d2a27ac2e2ed7ee439079914d8086610309
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Apr 15 17:25:25 2014 +0200

    oox: tabs to spaces in generatePresetsCXX.pl
    
    Change-Id: Icc8edbc9d49c4f48dbe9521627dbf5d4e602ffda

diff --git a/oox/source/drawingml/customshapes/generatePresetsCXX.pl b/oox/source/drawingml/customshapes/generatePresetsCXX.pl
index 7ff58b3..2ce96f5 100755
--- a/oox/source/drawingml/customshapes/generatePresetsCXX.pl
+++ b/oox/source/drawingml/customshapes/generatePresetsCXX.pl
@@ -9,59 +9,59 @@
 
 sub loadSourceCode()
 {
-	open (IN, "<custom-shapes.log");
-
-	my %sources;
-
-	while (<IN>)
-	{
-		if (/==cscode== /)
-		{
-			if (/shape name: '/)
-			{
-				chop;
-				s/.*shape name: '([^']+)'.*/$1/;
-				$name = $_;
-			}
-			else
-			{
-				if (/==cscode== begin/)
-				{
-					$inside = true;
-					@code = ();
-				}
-				else
-				{
-					if (/==cscode== end/)
-					{
-						s/^  <\/([^>]+)>/$1/;
-						undef $inside;
-						$sources{$name} = [ @code ];
-						#print "added ", $name, "\n";
-					}
-				}
-			}
-		}
-		else
-		{
-			if ($inside)
-			{
-				push @code, $_;
-			}
-		}
-	}
-
-	close (IN);
-
-	return \%sources;
+    open (IN, "<custom-shapes.log");
+
+    my %sources;
+
+    while (<IN>)
+    {
+        if (/==cscode== /)
+        {
+            if (/shape name: '/)
+            {
+                chop;
+                s/.*shape name: '([^']+)'.*/$1/;
+                $name = $_;
+            }
+            else
+            {
+                if (/==cscode== begin/)
+                {
+                    $inside = true;
+                    @code = ();
+                }
+                else
+                {
+                    if (/==cscode== end/)
+                    {
+                        s/^  <\/([^>]+)>/$1/;
+                        undef $inside;
+                        $sources{$name} = [ @code ];
+                        #print "added ", $name, "\n";
+                    }
+                }
+            }
+        }
+        else
+        {
+            if ($inside)
+            {
+                push @code, $_;
+            }
+        }
+    }
+
+    close (IN);
+
+    return \%sources;
 }
 
 sub startSource
 {
-	my $count = shift;
+    my $count = shift;
 
-	open (OUT, ">customshapepresets" . $count . ".cxx");
-	print OUT << "EOS"
+    open (OUT, ">customshapepresets" . $count . ".cxx");
+    print OUT << "EOS"
 
 // This file was generated by: $0
 
@@ -123,17 +123,17 @@ sub generateSource
     my @classes = ();
     foreach $shape (sort(keys %$sources))
     {
-	push @classes, $shape;
-	print OUT "class ShapeC".$shape." : public CustomShapeProvider\n";
-	print OUT "{\n";
+    push @classes, $shape;
+    print OUT "class ShapeC".$shape." : public CustomShapeProvider\n";
+    print OUT "{\n";
         print OUT "  virtual PropertyMap getProperties() SAL_OVERRIDE\n";
-	print OUT "  {\n";
-	print OUT "    PropertyMap aPropertyMap;\n\n";
-	print OUT @{$sources->{$shape}};
-	print OUT "    aPropertyMap.setProperty( PROP_Type, OUString(\"ooxml-", $shape, "\"));\n\n";
-	print OUT "    return aPropertyMap;\n";
-	print OUT "  }\n";
-	print OUT "};\n";
+    print OUT "  {\n";
+    print OUT "    PropertyMap aPropertyMap;\n\n";
+    print OUT @{$sources->{$shape}};
+    print OUT "    aPropertyMap.setProperty( PROP_Type, OUString(\"ooxml-", $shape, "\"));\n\n";
+    print OUT "    return aPropertyMap;\n";
+    print OUT "  }\n";
+    print OUT "};\n";
         print OUT "\n";
         print OUT "// This is a generated source file. DO NOT EDIT.\n";
         print OUT "\n";
@@ -143,10 +143,10 @@ sub generateSource
         if ($shCount >= 35) {
             $shCount = 0;
 
-	    endSource ($count, \@classes);
-	    close OUT;
-	    startSource (++$count);
-	    @classes = ();
+        endSource ($count, \@classes);
+        close OUT;
+        startSource (++$count);
+        @classes = ();
         }
     }
 
commit b1017281562a0b6e35fb17bc2af5585411a0dacd
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Tue Apr 15 17:19:48 2014 +0200

    oox custom shape code generator: stop running LO interactively
    
    Change-Id: Ic90f40c10b7d640d3dadc3c21d0060b351d08195

diff --git a/oox/source/drawingml/customshapes/README b/oox/source/drawingml/customshapes/README
index 2376520..69d1b5e 100755
--- a/oox/source/drawingml/customshapes/README
+++ b/oox/source/drawingml/customshapes/README
@@ -25,17 +25,11 @@ make oox.clean && make oox dbglevel=2
 (cd oox/source/drawingml/customshapes && ./generatePresetsPPTXs.pl)
 
 
-# Then load it and store the debugging output. Note that this will run
-# an *interactive* LO, and you need to quit it manually.
-
-echo
-echo "Starting LibreOffice, quit once you see the slide."
-echo
-
+# Then load it and store the debugging output.
 # We need only the SAL_INFO output with tag "oox.cscode", plus stderr
 # for PropertyMap::dumpCode() output.
 
-SAL_LOG='+INFO.oox.cscode-WARN' instdir/program/soffice oox/source/drawingml/customshapes/pptx/cshape-all.pptx > oox/source/drawingml/customshapes/custom-shapes.log 2>&1
+SAL_LOG='+INFO.oox.cscode-WARN' instdir/program/soffice --headless --convert-to odp --outdir oox/source/drawingml/customshapes/ oox/source/drawingml/customshapes/pptx/cshape-all.pptx > oox/source/drawingml/customshapes/custom-shapes.log 2>&1
 
 
 # Now run a script that reads the above log file and generates the


More information about the Libreoffice-commits mailing list