[Libreoffice-commits] .: 2 commits - oox/source

Radek Doulík rodo at kemper.freedesktop.org
Mon Dec 12 06:06:08 PST 2011


 oox/source/drawingml/customshapepresets1.cxx   |   20 ++++++++++----------
 oox/source/drawingml/customshapepresets2.cxx   |    4 ++--
 oox/source/drawingml/customshapepresets3.cxx   |   18 +++++++++---------
 oox/source/drawingml/customshapepresets4.cxx   |   14 +++++++-------
 oox/source/drawingml/customshapepresets5.cxx   |    8 ++++----
 oox/source/drawingml/customshapeproperties.cxx |   10 ++++++----
 6 files changed, 38 insertions(+), 36 deletions(-)

New commits:
commit cd77642f2b2aa9a0f07a7b161b16b34d2b511828
Author: Radek Doulik <rodo at novell.com>
Date:   Mon Dec 12 15:04:36 2011 +0100

    pptx: updated custom shapes presets after latest fix in equations import

diff --git a/oox/source/drawingml/customshapepresets1.cxx b/oox/source/drawingml/customshapepresets1.cxx
index 2075b4e..faf8841 100644
--- a/oox/source/drawingml/customshapepresets1.cxx
+++ b/oox/source/drawingml/customshapepresets1.cxx
@@ -6312,8 +6312,8 @@ void CustomShapeProperties::initializePresetsMap1()
         aStringSequence[183] = CREATE_OUSTRING ("?16 *cos(pi*(?4 )/10800000)");
         aStringSequence[184] = CREATE_OUSTRING ("?15 *(cos(atan2(?182 ,?183 )))");
         aStringSequence[185] = CREATE_OUSTRING ("?16 *(sin(atan2(?182 ,?183 )))");
-        aStringSequence[186] = CREATE_OUSTRING ("?21 +?123 -0");
-        aStringSequence[187] = CREATE_OUSTRING ("?23 +?124 -0");
+        aStringSequence[186] = CREATE_OUSTRING ("?21 +?184 -0");
+        aStringSequence[187] = CREATE_OUSTRING ("?23 +?185 -0");
         aStringSequence[188] = CREATE_OUSTRING ("?4 +0-5400000");
         aStringSequence[189] = CREATE_OUSTRING ("?49 +5400000-0");
         aStringSequence[190] = CREATE_OUSTRING ("?49 +10800000-0");
@@ -7568,14 +7568,14 @@ void CustomShapeProperties::initializePresetsMap1()
         aStringSequence[42] = CREATE_OUSTRING ("?29 +0-?40 ");
         aStringSequence[43] = CREATE_OUSTRING ("sqrt(?41 *?41 +?42 *?42 +0*0)");
         aStringSequence[44] = CREATE_OUSTRING ("(10800000*atan2(?41 ,?42 ))/pi");
-        aStringSequence[45] = CREATE_OUSTRING ("?4 *sin(pi*(?0 )/10800000)");
-        aStringSequence[46] = CREATE_OUSTRING ("?4 *cos(pi*(?0 )/10800000)");
+        aStringSequence[45] = CREATE_OUSTRING ("?4 *sin(pi*(?44 )/10800000)");
+        aStringSequence[46] = CREATE_OUSTRING ("?4 *cos(pi*(?44 )/10800000)");
         aStringSequence[47] = CREATE_OUSTRING ("?39 +?45 -0");
         aStringSequence[48] = CREATE_OUSTRING ("?40 +?46 -0");
         aStringSequence[49] = CREATE_OUSTRING ("?27 +0-?45 ");
         aStringSequence[50] = CREATE_OUSTRING ("?29 +0-?46 ");
-        aStringSequence[51] = CREATE_OUSTRING ("?3 *sin(pi*(?0 )/10800000)");
-        aStringSequence[52] = CREATE_OUSTRING ("?3 *cos(pi*(?0 )/10800000)");
+        aStringSequence[51] = CREATE_OUSTRING ("?3 *sin(pi*(?44 )/10800000)");
+        aStringSequence[52] = CREATE_OUSTRING ("?3 *cos(pi*(?44 )/10800000)");
         aStringSequence[53] = CREATE_OUSTRING ("?48 +?51 -0");
         aStringSequence[54] = CREATE_OUSTRING ("?47 +0-?52 ");
         aStringSequence[55] = CREATE_OUSTRING ("?50 +?51 -0");
@@ -7608,14 +7608,14 @@ void CustomShapeProperties::initializePresetsMap1()
         aStringSequence[82] = CREATE_OUSTRING ("?69 +0-?80 ");
         aStringSequence[83] = CREATE_OUSTRING ("sqrt(?81 *?81 +?82 *?82 +0*0)");
         aStringSequence[84] = CREATE_OUSTRING ("(10800000*atan2(?81 ,?82 ))/pi");
-        aStringSequence[85] = CREATE_OUSTRING ("?4 *sin(pi*(?1 )/10800000)");
-        aStringSequence[86] = CREATE_OUSTRING ("?4 *cos(pi*(?1 )/10800000)");
+        aStringSequence[85] = CREATE_OUSTRING ("?4 *sin(pi*(?84 )/10800000)");
+        aStringSequence[86] = CREATE_OUSTRING ("?4 *cos(pi*(?84 )/10800000)");
         aStringSequence[87] = CREATE_OUSTRING ("?79 +?85 -0");
         aStringSequence[88] = CREATE_OUSTRING ("?80 +?86 -0");
         aStringSequence[89] = CREATE_OUSTRING ("?68 +0-?85 ");
         aStringSequence[90] = CREATE_OUSTRING ("?69 +0-?86 ");
-        aStringSequence[91] = CREATE_OUSTRING ("?3 *sin(pi*(?1 )/10800000)");
-        aStringSequence[92] = CREATE_OUSTRING ("?3 *cos(pi*(?1 )/10800000)");
+        aStringSequence[91] = CREATE_OUSTRING ("?3 *sin(pi*(?84 )/10800000)");
+        aStringSequence[92] = CREATE_OUSTRING ("?3 *cos(pi*(?84 )/10800000)");
         aStringSequence[93] = CREATE_OUSTRING ("?88 +?91 -0");
         aStringSequence[94] = CREATE_OUSTRING ("?87 +0-?92 ");
         aStringSequence[95] = CREATE_OUSTRING ("?90 +?91 -0");
diff --git a/oox/source/drawingml/customshapepresets2.cxx b/oox/source/drawingml/customshapepresets2.cxx
index 58f62ff..2dda792 100644
--- a/oox/source/drawingml/customshapepresets2.cxx
+++ b/oox/source/drawingml/customshapepresets2.cxx
@@ -14498,7 +14498,7 @@ void CustomShapeProperties::initializePresetsMap2()
         aStringSequence[12] = CREATE_OUSTRING ("(1+?11 )/12");
         aStringSequence[13] = CREATE_OUSTRING ("?12 *logwidth/1");
         aStringSequence[14] = CREATE_OUSTRING ("?12 *logheight/1");
-        aStringSequence[15] = CREATE_OUSTRING ("logwidth+0-?10 ");
+        aStringSequence[15] = CREATE_OUSTRING ("logwidth+0-?13 ");
         aStringSequence[16] = CREATE_OUSTRING ("logheight+0-?14 ");
         aStringSequence[17] = CREATE_OUSTRING ("logwidth/2");
         aStringSequence[18] = CREATE_OUSTRING ("logheight*?17 /?4 ");
@@ -14680,7 +14680,7 @@ void CustomShapeProperties::initializePresetsMap2()
                     EnhancedCustomShapeParameterPair aParameterPair;
                     {
                         EnhancedCustomShapeParameter aParameter;
-                        Any aAny ((sal_Int32) 10);
+                        Any aAny ((sal_Int32) 13);
                         aParameter.Value = aAny;
                         aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
                         aParameterPair.First = aParameter;
diff --git a/oox/source/drawingml/customshapepresets3.cxx b/oox/source/drawingml/customshapepresets3.cxx
index 7b58f4c..854aa45 100644
--- a/oox/source/drawingml/customshapepresets3.cxx
+++ b/oox/source/drawingml/customshapepresets3.cxx
@@ -1078,7 +1078,7 @@ void CustomShapeProperties::initializePresetsMap3()
         aStringSequence[21] = CREATE_OUSTRING ("?16 *?20 /1");
         aStringSequence[22] = CREATE_OUSTRING ("logwidth+0-?20 ");
         aStringSequence[23] = CREATE_OUSTRING ("logheight*?0 /100000");
-        aStringSequence[24] = CREATE_OUSTRING ("?17 +0-?15 ");
+        aStringSequence[24] = CREATE_OUSTRING ("?23 +0-?15 ");
         aStringSequence[25] = CREATE_OUSTRING ("?9 *?9 /logwidth");
         aStringSequence[26] = CREATE_OUSTRING ("?9 +0-?25 ");
         aStringSequence[27] = CREATE_OUSTRING ("?16 *?26 /1");
@@ -1086,7 +1086,7 @@ void CustomShapeProperties::initializePresetsMap3()
         aStringSequence[29] = CREATE_OUSTRING ("?15 +?24 -?28 ");
         aStringSequence[30] = CREATE_OUSTRING ("?29 +?15 -0");
         aStringSequence[31] = CREATE_OUSTRING ("?30 +?24 -0");
-        aStringSequence[32] = CREATE_OUSTRING ("logheight+0-?17 ");
+        aStringSequence[32] = CREATE_OUSTRING ("logheight+0-?23 ");
         aStringSequence[33] = CREATE_OUSTRING ("?15 *14/16");
         aStringSequence[34] = CREATE_OUSTRING ("(?33 +?32 )/2");
         aStringSequence[35] = CREATE_OUSTRING ("?27 +?32 -0");
@@ -1097,7 +1097,7 @@ void CustomShapeProperties::initializePresetsMap3()
         aStringSequence[40] = CREATE_OUSTRING ("logwidth+0-?37 ");
         aStringSequence[41] = CREATE_OUSTRING ("?31 +?32 -0");
         aStringSequence[42] = CREATE_OUSTRING ("?19 +?24 -0");
-        aStringSequence[43] = CREATE_OUSTRING ("?17 +?17 -?42 ");
+        aStringSequence[43] = CREATE_OUSTRING ("?23 +?23 -?42 ");
         aStringSequence[44] = CREATE_OUSTRING ("logheight+0-?15 ");
         aStringSequence[45] = CREATE_OUSTRING ("logheight");
         aStringSequence[46] = CREATE_OUSTRING ("logwidth");
@@ -1119,7 +1119,7 @@ void CustomShapeProperties::initializePresetsMap3()
                 }
                 {
                     EnhancedCustomShapeParameter aParameter;
-                    Any aAny ((sal_Int32) 17);
+                    Any aAny ((sal_Int32) 23);
                     aParameter.Value = aAny;
                     aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
                     aParameterPair.Second = aParameter;
@@ -2575,7 +2575,7 @@ void CustomShapeProperties::initializePresetsMap3()
                     }
                     {
                         EnhancedCustomShapeParameter aParameter;
-                        Any aAny ((sal_Int32) 17);
+                        Any aAny ((sal_Int32) 23);
                         aParameter.Value = aAny;
                         aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
                         aParameterPair.Second = aParameter;
@@ -17813,14 +17813,14 @@ void CustomShapeProperties::initializePresetsMap3()
         aStringSequence[42] = CREATE_OUSTRING ("?29 +0-?40 ");
         aStringSequence[43] = CREATE_OUSTRING ("sqrt(?41 *?41 +?42 *?42 +0*0)");
         aStringSequence[44] = CREATE_OUSTRING ("(10800000*atan2(?41 ,?42 ))/pi");
-        aStringSequence[45] = CREATE_OUSTRING ("?4 *sin(pi*(?0 )/10800000)");
-        aStringSequence[46] = CREATE_OUSTRING ("?4 *cos(pi*(?0 )/10800000)");
+        aStringSequence[45] = CREATE_OUSTRING ("?4 *sin(pi*(?44 )/10800000)");
+        aStringSequence[46] = CREATE_OUSTRING ("?4 *cos(pi*(?44 )/10800000)");
         aStringSequence[47] = CREATE_OUSTRING ("?39 +?45 -0");
         aStringSequence[48] = CREATE_OUSTRING ("?40 +?46 -0");
         aStringSequence[49] = CREATE_OUSTRING ("?27 +0-?45 ");
         aStringSequence[50] = CREATE_OUSTRING ("?29 +0-?46 ");
-        aStringSequence[51] = CREATE_OUSTRING ("?3 *sin(pi*(?0 )/10800000)");
-        aStringSequence[52] = CREATE_OUSTRING ("?3 *cos(pi*(?0 )/10800000)");
+        aStringSequence[51] = CREATE_OUSTRING ("?3 *sin(pi*(?44 )/10800000)");
+        aStringSequence[52] = CREATE_OUSTRING ("?3 *cos(pi*(?44 )/10800000)");
         aStringSequence[53] = CREATE_OUSTRING ("?48 +?51 -0");
         aStringSequence[54] = CREATE_OUSTRING ("?47 +0-?52 ");
         aStringSequence[55] = CREATE_OUSTRING ("?50 +?51 -0");
diff --git a/oox/source/drawingml/customshapepresets4.cxx b/oox/source/drawingml/customshapepresets4.cxx
index 6d53c1f..185cec2 100644
--- a/oox/source/drawingml/customshapepresets4.cxx
+++ b/oox/source/drawingml/customshapepresets4.cxx
@@ -15624,7 +15624,7 @@ void CustomShapeProperties::initializePresetsMap4()
         aStringSequence[23] = CREATE_OUSTRING ("logheight+0-?22 ");
         aStringSequence[24] = CREATE_OUSTRING ("logwidth+0-?21 ");
         aStringSequence[25] = CREATE_OUSTRING ("logheight*?0 /100000");
-        aStringSequence[26] = CREATE_OUSTRING ("?17 +0-?15 ");
+        aStringSequence[26] = CREATE_OUSTRING ("?25 +0-?15 ");
         aStringSequence[27] = CREATE_OUSTRING ("?9 *?9 /logwidth");
         aStringSequence[28] = CREATE_OUSTRING ("?9 +0-?27 ");
         aStringSequence[29] = CREATE_OUSTRING ("?16 *?28 /1");
@@ -15634,7 +15634,7 @@ void CustomShapeProperties::initializePresetsMap4()
         aStringSequence[33] = CREATE_OUSTRING ("?32 +?15 -0");
         aStringSequence[34] = CREATE_OUSTRING ("?33 +?26 -0");
         aStringSequence[35] = CREATE_OUSTRING ("logheight+0-?34 ");
-        aStringSequence[36] = CREATE_OUSTRING ("logheight+0-?17 ");
+        aStringSequence[36] = CREATE_OUSTRING ("logheight+0-?25 ");
         aStringSequence[37] = CREATE_OUSTRING ("?15 *14/16");
         aStringSequence[38] = CREATE_OUSTRING ("(?37 +?36 )/2");
         aStringSequence[39] = CREATE_OUSTRING ("logheight+0-?38 ");
@@ -15651,7 +15651,7 @@ void CustomShapeProperties::initializePresetsMap4()
         aStringSequence[50] = CREATE_OUSTRING ("logheight+0-?49 ");
         aStringSequence[51] = CREATE_OUSTRING ("?19 +?26 -0");
         aStringSequence[52] = CREATE_OUSTRING ("logheight+0-?51 ");
-        aStringSequence[53] = CREATE_OUSTRING ("?17 +?17 -?51 ");
+        aStringSequence[53] = CREATE_OUSTRING ("?25 +?25 -?51 ");
         aStringSequence[54] = CREATE_OUSTRING ("logheight+0-?53 ");
         aStringSequence[55] = CREATE_OUSTRING ("logheight");
         aStringSequence[56] = CREATE_OUSTRING ("logwidth");
@@ -15995,7 +15995,7 @@ void CustomShapeProperties::initializePresetsMap4()
                 }
                 {
                     EnhancedCustomShapeParameter aParameter;
-                    Any aAny ((sal_Int32) 17);
+                    Any aAny ((sal_Int32) 25);
                     aParameter.Value = aAny;
                     aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
                     aParameterPair.Second = aParameter;
@@ -16139,7 +16139,7 @@ void CustomShapeProperties::initializePresetsMap4()
                 }
                 {
                     EnhancedCustomShapeParameter aParameter;
-                    Any aAny ((sal_Int32) 17);
+                    Any aAny ((sal_Int32) 25);
                     aParameter.Value = aAny;
                     aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
                     aParameterPair.Second = aParameter;
@@ -16373,7 +16373,7 @@ void CustomShapeProperties::initializePresetsMap4()
                 }
                 {
                     EnhancedCustomShapeParameter aParameter;
-                    Any aAny ((sal_Int32) 17);
+                    Any aAny ((sal_Int32) 25);
                     aParameter.Value = aAny;
                     aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
                     aParameterPair.Second = aParameter;
@@ -16517,7 +16517,7 @@ void CustomShapeProperties::initializePresetsMap4()
                 }
                 {
                     EnhancedCustomShapeParameter aParameter;
-                    Any aAny ((sal_Int32) 17);
+                    Any aAny ((sal_Int32) 25);
                     aParameter.Value = aAny;
                     aParameter.Type = EnhancedCustomShapeParameterType::EQUATION;
                     aParameterPair.Second = aParameter;
diff --git a/oox/source/drawingml/customshapepresets5.cxx b/oox/source/drawingml/customshapepresets5.cxx
index 8157602..809afcf 100644
--- a/oox/source/drawingml/customshapepresets5.cxx
+++ b/oox/source/drawingml/customshapepresets5.cxx
@@ -901,8 +901,8 @@ void CustomShapeProperties::initializePresetsMap5()
         aStringSequence[196] = CREATE_OUSTRING ("?16 *cos(pi*(?4 )/10800000)");
         aStringSequence[197] = CREATE_OUSTRING ("?15 *(cos(atan2(?195 ,?196 )))");
         aStringSequence[198] = CREATE_OUSTRING ("?16 *(sin(atan2(?195 ,?196 )))");
-        aStringSequence[199] = CREATE_OUSTRING ("?21 +?132 -0");
-        aStringSequence[200] = CREATE_OUSTRING ("?23 +?133 -0");
+        aStringSequence[199] = CREATE_OUSTRING ("?21 +?197 -0");
+        aStringSequence[200] = CREATE_OUSTRING ("?23 +?198 -0");
         aStringSequence[201] = CREATE_OUSTRING ("?4 +5400000-0");
         aStringSequence[202] = CREATE_OUSTRING ("?52 +0-5400000");
         aStringSequence[203] = CREATE_OUSTRING ("?52 +10800000-0");
@@ -12397,8 +12397,8 @@ void CustomShapeProperties::initializePresetsMap5()
         aStringSequence[156] = CREATE_OUSTRING ("?16 *cos(pi*(?4 )/10800000)");
         aStringSequence[157] = CREATE_OUSTRING ("?15 *(cos(atan2(?155 ,?156 )))");
         aStringSequence[158] = CREATE_OUSTRING ("?16 *(sin(atan2(?155 ,?156 )))");
-        aStringSequence[159] = CREATE_OUSTRING ("?21 +?117 -0");
-        aStringSequence[160] = CREATE_OUSTRING ("?23 +?118 -0");
+        aStringSequence[159] = CREATE_OUSTRING ("?21 +?157 -0");
+        aStringSequence[160] = CREATE_OUSTRING ("?23 +?158 -0");
         aStringSequence[161] = CREATE_OUSTRING ("?4 +0-?48 ");
         aStringSequence[162] = CREATE_OUSTRING ("?15 *sin(pi*(?161 )/10800000)");
         aStringSequence[163] = CREATE_OUSTRING ("?16 *cos(pi*(?161 )/10800000)");
commit cc65d9fe56dbbf77ed48d5dacd9d1a11a450e5a6
Author: Radek Doulik <rodo at novell.com>
Date:   Mon Dec 12 15:00:25 2011 +0100

    pptx: fix custom shape equations import
    
     - guide names can be reused and in that case current one used
       in following equations is the last one

diff --git a/oox/source/drawingml/customshapeproperties.cxx b/oox/source/drawingml/customshapeproperties.cxx
index 77eb296..c433d76 100644
--- a/oox/source/drawingml/customshapeproperties.cxx
+++ b/oox/source/drawingml/customshapeproperties.cxx
@@ -84,14 +84,16 @@ sal_Int32 CustomShapeProperties::SetCustomShapeGuideValue( std::vector< CustomSh
 // if the return value is < 0 then the guide value could not be found
 sal_Int32 CustomShapeProperties::GetCustomShapeGuideValue( const std::vector< CustomShapeGuide >& rGuideList, const rtl::OUString& rFormulaName )
 {
-    sal_Int32 nIndex = 0;
-    for( ; nIndex < static_cast< sal_Int32 >( rGuideList.size() ); nIndex++ )
+    // traverse the list from the end, because guide names can be reused
+    // and current is the last one
+    // see a1 guide in gear6 custom shape preset as example
+    sal_Int32 nIndex = static_cast< sal_Int32 >( rGuideList.size() ) - 1;
+    for( ; nIndex >= 0; nIndex-- )
     {
         if ( rGuideList[ nIndex ].maName == rFormulaName )
             break;
     }
-    if ( nIndex == static_cast< sal_Int32 >( rGuideList.size() ) )
-        nIndex = -1;
+
     return nIndex;
 }
 


More information about the Libreoffice-commits mailing list