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");
66 // This file was generated by
: $0
68 // Please
, DO NOT EDIT
.
72 #include <oox/drawingml/customshapeproperties.hxx>
73 #include <oox/token/tokenmap.hxx>
74 #include <com/sun/star/awt/Rectangle.hpp>
75 #include <com/sun/star/awt/Size.hpp>
76 #include <com/sun/star/drawing/EnhancedCustomShapeAdjustmentValue.hpp>
77 #include <com/sun/star/drawing/EnhancedCustomShapeSegment.hpp>
78 #include <com/sun/star/drawing/EnhancedCustomShapeParameterPair.hpp>
79 #include <com/sun/star/drawing/EnhancedCustomShapeParameterType.hpp>
81 using namespace
::com
::sun
::star
;
82 using namespace
::com
::sun
::star
::beans
;
83 using namespace
::com
::sun
::star
::drawing
;
84 using namespace
::com
::sun
::star
::uno
;
86 namespace oox
{ namespace drawingml
{
99 $endBrace > 0 && print OUT
"}\n\n";
101 print OUT
"} // anonymous namespace\n";
102 print OUT
"void CustomShapeProperties::initializePresetsMap" . $count . "()\n";
104 for my $class (@
{$classes})
106 print OUT
" maPresetsMap [ StaticTokenMap::get().getTokenFromUnicode( \"", $class, "\" ) ] = new ShapeC".$class."();\n";
110 } } // oox // drawingml
121 startSource
(++$count);
124 foreach $shape (keys %$sources)
126 push @classes, $shape;
127 print OUT
"class ShapeC".$shape." : public CustomShapeProvider\n";
129 print OUT
" virtual PropertyMap getProperties()\n";
131 print OUT
" PropertyMap aPropertyMap;\n\n";
132 print OUT @
{$sources->{$shape}};
133 print OUT
" aPropertyMap [ PROP_Type ] <<= OUString(\"ooxml-", $shape, "\");\n\n";
134 print OUT
" return aPropertyMap;\n";
138 print OUT
"// This is a generated source file. DO NOT EDIT.\n";
143 if ($shCount >= 35) {
146 endSource
($count, \
@classes);
148 startSource
(++$count);
153 endSource
($count, \
@classes);
157 void
::oox
::drawingml
::CustomShapeProperties
::initializePresetsMap
()
162 for ($i=1; $i <= $count; $i++) {
163 print OUT
"initializePresetsMap" . $i . "();\n";
171 generateSource
(loadSourceCode
());