summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2012-03-02 20:40:04 +0100
committerRadek Doulik <rodo@novell.com>2012-03-02 20:43:10 +0100
commite3c0a952a7607436224fe57f9e1665597702f6b2 (patch)
tree60e56c959cfe8f9757925f1f355abd86771f5d4e /oox
parentf6dcf2878a6d7a8cd3bd9761e2f03b085d2060cd (diff)
generate more pptx test documents with preset shapes
- before we only generated custom shapes used as presets definition - preset-*.pptx documents might be used for testing the presets
Diffstat (limited to 'oox')
-rwxr-xr-xoox/source/drawingml/customshapes/generatePresetsPPTXs.pl25
1 files changed, 20 insertions, 5 deletions
diff --git a/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl b/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl
index c9eb3141edd5..28127f85fd67 100755
--- a/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl
+++ b/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl
@@ -29,10 +29,17 @@ sub generatePPTX
mkdir ("pptx");
system ("unzip -qq -o -d cshape cshape.pptx");
- generateSlide ($shapes, $type, ">cshape/ppt/slides/slide1.xml");
+ # custom shape(s) slide with preset definition
+ generateSlide ($shapes, $type, ">cshape/ppt/slides/slide1.xml", 0);
$pptx = "../pptx/cshape-" . (defined $type ? $type : "all") . ".pptx";
system ("cd cshape\nrm -rf ". $pptx . "\nzip -q -r " . $pptx . " .\ncd ..");
+
+ # preset(s) slide, for testing
+ generateSlide ($shapes, $type, ">cshape/ppt/slides/slide1.xml", 1);
+
+ $pptx = "../pptx/preset-cshape-" . (defined $type ? $type : "all") . ".pptx";
+ system ("cd cshape\nrm -rf ". $pptx . "\nzip -q -r " . $pptx . " .\ncd ..");
}
sub loadShapes()
@@ -79,6 +86,7 @@ sub generateSlide
$shapes = shift;
$type = shift;
$file = shift;
+ $preset = shift;
open (OUT, $file);
@@ -132,11 +140,18 @@ sub generateSlide
<a:off x=\"" . (350000 + $col++*$size) . "\" y=\"" . (450000 + $row*$size) . "\"/>
<a:ext cx=\"" . (4*$size/5) . "\" cy=\"" . (4*$size/5) . "\"/>
</a:xfrm>
- <a:custGeom>
";
- print OUT @{$shapes->{$shape}};
- print OUT " </a:custGeom>
- <a:solidFill>
+ if ($preset) {
+ print OUT " <a:prstGeom prst=\"" . $shape . "\"><a:avLst/></a:prstGeom>
+";
+ } else {
+ print OUT " <a:custGeom>
+";
+ print OUT @{$shapes->{$shape}};
+ print OUT " </a:custGeom>
+";
+ }
+ print OUT " <a:solidFill>
<a:srgbClr val=\"FFFF7F\"/>
</a:solidFill>
<a:ln w=\"19080\">