Kaydet (Commit) a55e2d2a authored tarafından Miklos Vajna's avatar Miklos Vajna

oox: tabs to spaces in generatePresetsCXX.pl

Change-Id: Icc8edbc9d49c4f48dbe9521627dbf5d4e602ffda
üst b1017281
...@@ -9,59 +9,59 @@ ...@@ -9,59 +9,59 @@
sub loadSourceCode() sub loadSourceCode()
{ {
open (IN, "<custom-shapes.log"); open (IN, "<custom-shapes.log");
my %sources; my %sources;
while (<IN>) while (<IN>)
{ {
if (/==cscode== /) if (/==cscode== /)
{ {
if (/shape name: '/) if (/shape name: '/)
{ {
chop; chop;
s/.*shape name: '([^']+)'.*/$1/; s/.*shape name: '([^']+)'.*/$1/;
$name = $_; $name = $_;
} }
else else
{ {
if (/==cscode== begin/) if (/==cscode== begin/)
{ {
$inside = true; $inside = true;
@code = (); @code = ();
} }
else else
{ {
if (/==cscode== end/) if (/==cscode== end/)
{ {
s/^ <\/([^>]+)>/$1/; s/^ <\/([^>]+)>/$1/;
undef $inside; undef $inside;
$sources{$name} = [ @code ]; $sources{$name} = [ @code ];
#print "added ", $name, "\n"; #print "added ", $name, "\n";
} }
} }
} }
} }
else else
{ {
if ($inside) if ($inside)
{ {
push @code, $_; push @code, $_;
} }
} }
} }
close (IN); close (IN);
return \%sources; return \%sources;
} }
sub startSource sub startSource
{ {
my $count = shift; my $count = shift;
open (OUT, ">customshapepresets" . $count . ".cxx"); open (OUT, ">customshapepresets" . $count . ".cxx");
print OUT << "EOS" print OUT << "EOS"
// This file was generated by: $0 // This file was generated by: $0
...@@ -123,17 +123,17 @@ sub generateSource ...@@ -123,17 +123,17 @@ sub generateSource
my @classes = (); my @classes = ();
foreach $shape (sort(keys %$sources)) foreach $shape (sort(keys %$sources))
{ {
push @classes, $shape; push @classes, $shape;
print OUT "class ShapeC".$shape." : public CustomShapeProvider\n"; print OUT "class ShapeC".$shape." : public CustomShapeProvider\n";
print OUT "{\n"; print OUT "{\n";
print OUT " virtual PropertyMap getProperties() SAL_OVERRIDE\n"; print OUT " virtual PropertyMap getProperties() SAL_OVERRIDE\n";
print OUT " {\n"; print OUT " {\n";
print OUT " PropertyMap aPropertyMap;\n\n"; print OUT " PropertyMap aPropertyMap;\n\n";
print OUT @{$sources->{$shape}}; print OUT @{$sources->{$shape}};
print OUT " aPropertyMap.setProperty( PROP_Type, OUString(\"ooxml-", $shape, "\"));\n\n"; print OUT " aPropertyMap.setProperty( PROP_Type, OUString(\"ooxml-", $shape, "\"));\n\n";
print OUT " return aPropertyMap;\n"; print OUT " return aPropertyMap;\n";
print OUT " }\n"; print OUT " }\n";
print OUT "};\n"; print OUT "};\n";
print OUT "\n"; print OUT "\n";
print OUT "// This is a generated source file. DO NOT EDIT.\n"; print OUT "// This is a generated source file. DO NOT EDIT.\n";
print OUT "\n"; print OUT "\n";
...@@ -143,10 +143,10 @@ sub generateSource ...@@ -143,10 +143,10 @@ sub generateSource
if ($shCount >= 35) { if ($shCount >= 35) {
$shCount = 0; $shCount = 0;
endSource ($count, \@classes); endSource ($count, \@classes);
close OUT; close OUT;
startSource (++$count); startSource (++$count);
@classes = (); @classes = ();
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment