diff --git a/oox/source/drawingml/customshapes/generatePresetsCXX.pl b/oox/source/drawingml/customshapes/generatePresetsCXX.pl index 2ce96f58d8b3..29a3c1915546 100755 --- a/oox/source/drawingml/customshapes/generatePresetsCXX.pl +++ b/oox/source/drawingml/customshapes/generatePresetsCXX.pl @@ -7,6 +7,54 @@ # file, You can obtain one at http://mozilla.org/MPL/2.0/. # +sub loadData() +{ + open (IN, ") + { + if (/==csdata== /) + { + if (/shape name: '/) + { + chop; + s/.*shape name: '([^']+)'.*/$1/; + $name = $_; + } + else + { + if (/==csdata== begin/) + { + $inside = true; + @code = (); + } + else + { + if (/==csdata== end/) + { + s/^ <\/([^>]+)>/$1/; + undef $inside; + $sources{$name} = [ @code ]; + } + } + } + } + else + { + if ($inside) + { + push @code, $_; + } + } + } + + close (IN); + + return \%sources; +} + sub loadSourceCode() { open (IN, "oox-drawingml-cs-presets"); + + foreach $shape (sort(keys %$sources)) + { + printf OUT "/* %s */\n", $shape; + print OUT @{$sources->{$shape}}; + } + + close OUT; +} + +my $arg = shift; + +if ($arg eq "--data") +{ + generateData(loadData()); +} else +{ + generateSource (loadSourceCode ()); +} # vim:set ft=perl shiftwidth=4 softtabstop=4 expandtab: # diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index c1d00f65a42a..f7150db048d1 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -895,6 +895,7 @@ Reference< XShape > Shape::createAndInsert( } SAL_INFO("oox.cscode", "==cscode== shape name: '" << msName << "'"); + SAL_INFO("oox.csdata", "==csdata== shape name: '" << msName << "'"); mpCustomShapePropertiesPtr->pushToPropSet( rFilterBase, xSet, mxShape, maSize ); } else if( getTextBody() )