[Libreoffice-commits] .: oox/source
Radek DoulÃk
rodo at kemper.freedesktop.org
Fri Mar 2 11:43:18 PST 2012
oox/source/drawingml/customshapes/generatePresetsPPTXs.pl | 25 +++++++++++---
1 file changed, 20 insertions(+), 5 deletions(-)
New commits:
commit e3c0a952a7607436224fe57f9e1665597702f6b2
Author: Radek Doulik <rodo at novell.com>
Date: Fri Mar 2 20:40:04 2012 +0100
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
diff --git a/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl b/oox/source/drawingml/customshapes/generatePresetsPPTXs.pl
index c9eb314..28127f8 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\">
More information about the Libreoffice-commits
mailing list