3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 open (IN
, "<custom-shapes.log");
23 s/.*shape name: '([^']+)'.*/$1/;
28 if (/==cscode== begin/)
39 $sources{$name} = [ @code ];
40 #print "added ", $name, "\n";
63 open (OUT
, ">customshapepresets" . $count . ".cxx");
65 // this file was generated by
: $0
68 #include \"oox/drawingml/customshapeproperties.hxx\"
69 #include \"oox/token/tokenmap.hxx\"
70 #include <com/sun/star/awt/Rectangle.hpp>
71 #include <com/sun/star/awt/Size.hpp>
72 #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
73 #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
74 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
75 #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
78 using namespace
::com
::sun
::star
;
79 using namespace
::com
::sun
::star
::beans
;
80 using namespace
::com
::sun
::star
::drawing
;
81 using namespace
::com
::sun
::star
::uno
;
83 namespace oox
{ namespace drawingml
{
96 $endBrace > 0 && print OUT
"}\n\n";
98 print OUT
"} // anonymous namespace\n";
99 print OUT
"void CustomShapeProperties::initializePresetsMap" . $count . "()\n";
101 for my $class (@
{$classes})
103 print OUT
" maPresetsMap [ StaticTokenMap::get().getTokenFromUnicode( OUString( RTL_CONSTASCII_USTRINGPARAM( \"", $class, "\" ) ) ) ] = new ShapeC".$class."();\n";
107 } } // oox // drawingml
118 startSource
(++$count);
121 foreach $shape (keys %$sources)
123 push @classes, $shape;
124 print OUT
"class ShapeC".$shape." : public CustomShapeProvider\n";
126 print OUT
" virtual PropertyMap getProperties()\n";
128 print OUT
" PropertyMap aPropertyMap;\n\n";
129 print OUT @
{$sources->{$shape}};
130 print OUT
" aPropertyMap [ PROP_Type ] <<= OUString(\"ooxml-", $shape, "\");\n\n";
131 print OUT
" return aPropertyMap;\n";
137 if ($shCount >= 35) {
140 endSource
($count, \
@classes);
142 startSource
(++$count);
147 endSource
($count, \
@classes);
151 void
::oox
::drawingml
::CustomShapeProperties
::initializePresetsMap
()
156 for ($i=1; $i <= $count; $i++) {
157 print OUT
"initializePresetsMap" . $i . "();\n";
165 generateSource
(loadSourceCode
());