summaryrefslogtreecommitdiff
path: root/oox/source
diff options
context:
space:
mode:
authorRadek Doulik <rodo@novell.com>2011-04-28 14:17:22 +0200
committerRadek Doulik <rodo@novell.com>2011-04-28 14:18:06 +0200
commit8465c9a0a15b25cb3db66a30f84d9728fb698ea2 (patch)
tree6f21ed37e4497745b4bbf73409f91da603a33e35 /oox/source
parent3c594c6e5daacc49600e22b22be6692c23ae88b8 (diff)
added striped-right-arrow custom shape preset
Diffstat (limited to 'oox/source')
-rw-r--r--oox/source/drawingml/customshapeproperties.cxx482
1 files changed, 479 insertions, 3 deletions
diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index fed268537c07..3224d52d0a44 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -96,9 +96,483 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
{
if ( maShapePresetType.getLength() )
{
+ OSL_TRACE("preset: %s", USS(maShapePresetType));
+
static OUString sRightArrow = CREATE_OUSTRING("right-arrow");
- if ( maShapePresetType.equals( sRightArrow ) ) {
+ static OUString sStripedRightArrow = CREATE_OUSTRING("striped-right-arrow");
+
+ if ( maShapePresetType.equals( sStripedRightArrow ) ) {
+ PropertyMap aPropertyMap;
+
+ Sequence< EnhancedCustomShapeAdjustmentValue > aAdjSequence (2);
+ {
+ Any aAny ((sal_Int32) 10000);
+ aAdjSequence [0].Value = aAny;
+ }
+ {
+ Any aAny ((sal_Int32) 10000);
+ aAdjSequence [1].Value = aAny;
+ }
+ aPropertyMap [PROP_AdjustmentValues] <<= aAdjSequence;
+
+ Sequence< OUString > aStringSequence (17);
+ aStringSequence[0] = CREATE_OUSTRING ("min(width,height)");
+ aStringSequence[1] = CREATE_OUSTRING ("16875*width/?0 ");
+ aStringSequence[2] = CREATE_OUSTRING ("if(0-$0 ,0,if(20000-$0 ,$0 ,20000))");
+ aStringSequence[3] = CREATE_OUSTRING ("if(0-$1 ,0,if(?1 -$1 ,$1 ,?1 ))");
+ aStringSequence[4] = CREATE_OUSTRING ("?0 *1/6");
+ aStringSequence[5] = CREATE_OUSTRING ("?0 *?3 /20000");
+ aStringSequence[6] = CREATE_OUSTRING ("width+0-?5 ");
+ aStringSequence[7] = CREATE_OUSTRING ("height*?2 /40000");
+ aStringSequence[8] = CREATE_OUSTRING ("height/2");
+ aStringSequence[9] = CREATE_OUSTRING ("?8 +0-?7 ");
+ aStringSequence[10] = CREATE_OUSTRING ("?8 +?7 -0");
+ aStringSequence[11] = CREATE_OUSTRING ("height/2");
+ aStringSequence[12] = CREATE_OUSTRING ("?7 *?5 /?11 ");
+ aStringSequence[13] = CREATE_OUSTRING ("width+0-?12 ");
+ aStringSequence[14] = CREATE_OUSTRING ("height");
+ aStringSequence[15] = CREATE_OUSTRING ("width");
+ aStringSequence[16] = CREATE_OUSTRING ("min(width,height)/8");
+ aPropertyMap [PROP_Equations] <<= aStringSequence;
+
+ Sequence< Sequence < PropertyValue > > aPropSequenceSequence (2);
+ {
+ Sequence< PropertyValue > aPropSequence (4);
+ {
+ aPropSequence [0].Name = CREATE_OUSTRING ("Position");
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 9);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aPropSequence [0].Value = makeAny (aParameterPair);
+ }
+ {
+ aPropSequence [1].Name = CREATE_OUSTRING ("RangeYMaximum");
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 20000);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aPropSequence [1].Value = makeAny (aParameter);
+ }
+ {
+ aPropSequence [2].Name = CREATE_OUSTRING ("RangeYMinimum");
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 0);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aPropSequence [2].Value = makeAny (aParameter);
+ }
+ {
+ aPropSequence [3].Name = CREATE_OUSTRING ("RefY");
+ Any aAny ((sal_Int32) 0);
+ aPropSequence [3].Value = makeAny (aAny);
+ }
+ aPropSequenceSequence [0] = aPropSequence;
+ }
+ {
+ Sequence< PropertyValue > aPropSequence (4);
+ {
+ aPropSequence [0].Name = CREATE_OUSTRING ("Position");
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 6);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ aParameterPair.Second = aParameter;
+ }
+ aPropSequence [0].Value = makeAny (aParameterPair);
+ }
+ {
+ aPropSequence [1].Name = CREATE_OUSTRING ("RangeXMaximum");
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 1);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aPropSequence [1].Value = makeAny (aParameter);
+ }
+ {
+ aPropSequence [2].Name = CREATE_OUSTRING ("RangeXMinimum");
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 0);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aPropSequence [2].Value = makeAny (aParameter);
+ }
+ {
+ aPropSequence [3].Name = CREATE_OUSTRING ("RefX");
+ Any aAny ((sal_Int32) 1);
+ aPropSequence [3].Value = makeAny (aAny);
+ }
+ aPropSequenceSequence [1] = aPropSequence;
+ }
+ aPropertyMap [PROP_Handles] <<= aPropSequenceSequence;
+
+ aPropertyMap [PROP_MirroredX] <<= Any ((sal_Bool) sal_False);
+
+ aPropertyMap [PROP_MirroredY] <<= Any ((sal_Bool) sal_False);
+
+ Sequence< PropertyValue > aPropSequence (2);
+ {
+ aPropSequence [0].Name = CREATE_OUSTRING ("Coordinates");
+ Sequence< EnhancedCustomShapeParameterPair > aParameterPairSeq (15);
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 9);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [0] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ OUString str = CREATE_OUSTRING ("ssd32");
+ aParameter.Value = makeAny (str);
+ aParameter.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 9);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [1] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ OUString str = CREATE_OUSTRING ("ssd32");
+ aParameter.Value = makeAny (str);
+ aParameter.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 10);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [2] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 10);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [3] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ OUString str = CREATE_OUSTRING ("ssd16");
+ aParameter.Value = makeAny (str);
+ aParameter.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 9);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [4] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 16);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 9);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [5] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 16);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 10);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [6] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ OUString str = CREATE_OUSTRING ("ssd16");
+ aParameter.Value = makeAny (str);
+ aParameter.Type = EnhancedCustomShapeParameterType::NORMAL;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 10);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [7] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 4);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 9);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [8] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 6);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 9);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [9] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 6);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [10] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 15);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 8);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [11] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 6);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 14);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [12] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 6);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 10);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [13] = aParameterPair;
+ }
+ {
+ EnhancedCustomShapeParameterPair aParameterPair;
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 4);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.First = aParameter;
+ }
+ {
+ EnhancedCustomShapeParameter aParameter;
+ Any aAny ((sal_Int32) 10);
+ aParameter.Value = aAny;
+ aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
+ aParameterPair.Second = aParameter;
+ }
+ aParameterPairSeq [14] = aParameterPair;
+ }
+ aPropSequence [0].Value = makeAny (aParameterPairSeq);
+ }
+ {
+ aPropSequence [1].Name = CREATE_OUSTRING ("Segments");
+ Sequence< EnhancedCustomShapeSegment > aSegmentSeq (10);
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 1;
+ aSegment.Count = 1;
+ aSegmentSeq [0] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 2;
+ aSegment.Count = 3;
+ aSegmentSeq [1] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 4;
+ aSegment.Count = 0;
+ aSegmentSeq [2] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 1;
+ aSegment.Count = 1;
+ aSegmentSeq [3] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 2;
+ aSegment.Count = 3;
+ aSegmentSeq [4] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 4;
+ aSegment.Count = 0;
+ aSegmentSeq [5] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 1;
+ aSegment.Count = 1;
+ aSegmentSeq [6] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 2;
+ aSegment.Count = 6;
+ aSegmentSeq [7] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 4;
+ aSegment.Count = 0;
+ aSegmentSeq [8] = aSegment;
+ }
+ {
+ EnhancedCustomShapeSegment aSegment;
+ aSegment.Command = 5;
+ aSegment.Count = 0;
+ aSegmentSeq [9] = aSegment;
+ }
+ aPropSequence [1].Value = makeAny (aSegmentSeq);
+ }
+ aPropertyMap [PROP_Path] <<= aPropSequence;
+ awt::Rectangle aRectangle;
+ aRectangle.X = 0;
+ aRectangle.Y = 0;
+ aRectangle.Width = 4663800;
+ aRectangle.Height = 283680;
+ aPropertyMap [PROP_ViewBox] <<= aRectangle;
+
+ aPropertyMap [ PROP_Type ] <<= CREATE_OUSTRING("ooxml-striped-right-arrow");
+
+ Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence();
+ PropertySet aPropSet( xPropSet );
+ aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq );
+ OSL_TRACE("created ooxml preset for ooxml-striped-right-arrow");
+
+ } else if ( maShapePresetType.equals( sRightArrow ) ) {
PropertyMap aPropertyMap;
Sequence< EnhancedCustomShapeAdjustmentValue > aAdjSequence (2);
@@ -555,9 +1029,11 @@ void CustomShapeProperties::pushToPropSet( const ::oox::core::FilterBase& /* rFi
}
aPropertyMap[ PROP_Handles ] <<= aHandles;
+#ifdef DEBUG
+ aPropertyMap.dump();
+ aPropertyMap.dumpCode();
+#endif
// converting the vector to a sequence
- // aPropertyMap.dump();
- // aPropertyMap.dumpCode();
Sequence< PropertyValue > aSeq = aPropertyMap.makePropertyValueSequence();
PropertySet aPropSet( xPropSet );
aPropSet.setProperty( PROP_CustomShapeGeometry, aSeq );