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

Radek Doulík rodo at kemper.freedesktop.org
Tue Jan 10 04:38:59 PST 2012


 oox/source/drawingml/customshapegeometry.cxx |   11 ++--
 oox/source/drawingml/customshapepresets1.cxx |   22 +++------
 oox/source/drawingml/customshapepresets2.cxx |   22 +++------
 oox/source/drawingml/customshapepresets3.cxx |   22 +++------
 oox/source/drawingml/customshapepresets5.cxx |   66 +++++++++------------------
 5 files changed, 55 insertions(+), 88 deletions(-)

New commits:
commit d0521e28a12e6fbba70d6d866ba37fb6565701f9
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Jan 10 13:09:51 2012 +0100

    pptx: regenerate presets after custom shapes moveto/close fix

diff --git a/oox/source/drawingml/customshapepresets1.cxx b/oox/source/drawingml/customshapepresets1.cxx
index d0b5c42..4013557 100644
--- a/oox/source/drawingml/customshapepresets1.cxx
+++ b/oox/source/drawingml/customshapepresets1.cxx
@@ -12524,7 +12524,7 @@ void CustomShapeProperties::initializePresetsMap1()
         }
         {
             aPropSequence [1].Name = CREATE_OUSTRING ("Segments");
-            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (13);
+            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (12);
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
@@ -12557,51 +12557,45 @@ void CustomShapeProperties::initializePresetsMap1()
             }
             {
                 EnhancedCustomShapeSegment aSegment;
-                aSegment.Command = 4;
-                aSegment.Count = 0;
-                aSegmentSeq [5] = aSegment;
-            }
-            {
-                EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 1;
-                aSegmentSeq [6] = aSegment;
+                aSegmentSeq [5] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [7] = aSegment;
+                aSegmentSeq [6] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [8] = aSegment;
+                aSegmentSeq [7] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
                 aSegment.Count = 1;
-                aSegmentSeq [9] = aSegment;
+                aSegmentSeq [8] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 1;
-                aSegmentSeq [10] = aSegment;
+                aSegmentSeq [9] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [11] = aSegment;
+                aSegmentSeq [10] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [12] = aSegment;
+                aSegmentSeq [11] = aSegment;
             }
             aPropSequence [1].Value = makeAny (aSegmentSeq);
         }
diff --git a/oox/source/drawingml/customshapepresets2.cxx b/oox/source/drawingml/customshapepresets2.cxx
index 9cccf75..8f6a98b 100644
--- a/oox/source/drawingml/customshapepresets2.cxx
+++ b/oox/source/drawingml/customshapepresets2.cxx
@@ -16609,7 +16609,7 @@ void CustomShapeProperties::initializePresetsMap2()
         }
         {
             aPropSequence [1].Name = CREATE_OUSTRING ("Segments");
-            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (14);
+            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (13);
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
@@ -16648,51 +16648,45 @@ void CustomShapeProperties::initializePresetsMap2()
             }
             {
                 EnhancedCustomShapeSegment aSegment;
-                aSegment.Command = 4;
-                aSegment.Count = 0;
-                aSegmentSeq [6] = aSegment;
-            }
-            {
-                EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 1;
-                aSegmentSeq [7] = aSegment;
+                aSegmentSeq [6] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [8] = aSegment;
+                aSegmentSeq [7] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [9] = aSegment;
+                aSegmentSeq [8] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
                 aSegment.Count = 1;
-                aSegmentSeq [10] = aSegment;
+                aSegmentSeq [9] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 1;
-                aSegmentSeq [11] = aSegment;
+                aSegmentSeq [10] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [12] = aSegment;
+                aSegmentSeq [11] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [13] = aSegment;
+                aSegmentSeq [12] = aSegment;
             }
             aPropSequence [1].Value = makeAny (aSegmentSeq);
         }
diff --git a/oox/source/drawingml/customshapepresets3.cxx b/oox/source/drawingml/customshapepresets3.cxx
index fddebab..c6f6af8 100644
--- a/oox/source/drawingml/customshapepresets3.cxx
+++ b/oox/source/drawingml/customshapepresets3.cxx
@@ -11808,7 +11808,7 @@ void CustomShapeProperties::initializePresetsMap3()
         }
         {
             aPropSequence [1].Name = CREATE_OUSTRING ("Segments");
-            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (13);
+            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (12);
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
@@ -11841,51 +11841,45 @@ void CustomShapeProperties::initializePresetsMap3()
             }
             {
                 EnhancedCustomShapeSegment aSegment;
-                aSegment.Command = 4;
-                aSegment.Count = 0;
-                aSegmentSeq [5] = aSegment;
-            }
-            {
-                EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 1;
-                aSegmentSeq [6] = aSegment;
+                aSegmentSeq [5] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [7] = aSegment;
+                aSegmentSeq [6] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [8] = aSegment;
+                aSegmentSeq [7] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
                 aSegment.Count = 1;
-                aSegmentSeq [9] = aSegment;
+                aSegmentSeq [8] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 3;
-                aSegmentSeq [10] = aSegment;
+                aSegmentSeq [9] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [11] = aSegment;
+                aSegmentSeq [10] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [12] = aSegment;
+                aSegmentSeq [11] = aSegment;
             }
             aPropSequence [1].Value = makeAny (aSegmentSeq);
         }
diff --git a/oox/source/drawingml/customshapepresets5.cxx b/oox/source/drawingml/customshapepresets5.cxx
index 7442570..8745283 100644
--- a/oox/source/drawingml/customshapepresets5.cxx
+++ b/oox/source/drawingml/customshapepresets5.cxx
@@ -533,7 +533,7 @@ void CustomShapeProperties::initializePresetsMap5()
         }
         {
             aPropSequence [1].Name = CREATE_OUSTRING ("Segments");
-            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (14);
+            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (13);
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
@@ -572,51 +572,45 @@ void CustomShapeProperties::initializePresetsMap5()
             }
             {
                 EnhancedCustomShapeSegment aSegment;
-                aSegment.Command = 4;
-                aSegment.Count = 0;
-                aSegmentSeq [6] = aSegment;
-            }
-            {
-                EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 1;
-                aSegmentSeq [7] = aSegment;
+                aSegmentSeq [6] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [8] = aSegment;
+                aSegmentSeq [7] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [9] = aSegment;
+                aSegmentSeq [8] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
                 aSegment.Count = 1;
-                aSegmentSeq [10] = aSegment;
+                aSegmentSeq [9] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 3;
-                aSegmentSeq [11] = aSegment;
+                aSegmentSeq [10] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [12] = aSegment;
+                aSegmentSeq [11] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [13] = aSegment;
+                aSegmentSeq [12] = aSegment;
             }
             aPropSequence [1].Value = makeAny (aSegmentSeq);
         }
@@ -13968,7 +13962,7 @@ void CustomShapeProperties::initializePresetsMap5()
         }
         {
             aPropSequence [1].Name = CREATE_OUSTRING ("Segments");
-            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (14);
+            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (13);
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
@@ -14007,51 +14001,45 @@ void CustomShapeProperties::initializePresetsMap5()
             }
             {
                 EnhancedCustomShapeSegment aSegment;
-                aSegment.Command = 4;
-                aSegment.Count = 0;
-                aSegmentSeq [6] = aSegment;
-            }
-            {
-                EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 1;
-                aSegmentSeq [7] = aSegment;
+                aSegmentSeq [6] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [8] = aSegment;
+                aSegmentSeq [7] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [9] = aSegment;
+                aSegmentSeq [8] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
                 aSegment.Count = 1;
-                aSegmentSeq [10] = aSegment;
+                aSegmentSeq [9] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 2;
-                aSegmentSeq [11] = aSegment;
+                aSegmentSeq [10] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [12] = aSegment;
+                aSegmentSeq [11] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [13] = aSegment;
+                aSegmentSeq [12] = aSegment;
             }
             aPropSequence [1].Value = makeAny (aSegmentSeq);
         }
@@ -18375,7 +18363,7 @@ void CustomShapeProperties::initializePresetsMap5()
         }
         {
             aPropSequence [1].Name = CREATE_OUSTRING ("Segments");
-            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (13);
+            Sequence< EnhancedCustomShapeSegment > aSegmentSeq (12);
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
@@ -18408,51 +18396,45 @@ void CustomShapeProperties::initializePresetsMap5()
             }
             {
                 EnhancedCustomShapeSegment aSegment;
-                aSegment.Command = 4;
-                aSegment.Count = 0;
-                aSegmentSeq [5] = aSegment;
-            }
-            {
-                EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 1;
-                aSegmentSeq [6] = aSegment;
+                aSegmentSeq [5] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [7] = aSegment;
+                aSegmentSeq [6] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [8] = aSegment;
+                aSegmentSeq [7] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 1;
                 aSegment.Count = 1;
-                aSegmentSeq [9] = aSegment;
+                aSegmentSeq [8] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 2;
                 aSegment.Count = 2;
-                aSegmentSeq [10] = aSegment;
+                aSegmentSeq [9] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 6;
                 aSegment.Count = 0;
-                aSegmentSeq [11] = aSegment;
+                aSegmentSeq [10] = aSegment;
             }
             {
                 EnhancedCustomShapeSegment aSegment;
                 aSegment.Command = 5;
                 aSegment.Count = 0;
-                aSegmentSeq [12] = aSegment;
+                aSegmentSeq [11] = aSegment;
             }
             aPropSequence [1].Value = makeAny (aSegmentSeq);
         }
commit 15a19d71f357d1d929cd5d19af7e882e3d589341
Author: Radek Doulik <rodo at novell.com>
Date:   Tue Jan 10 13:08:39 2012 +0100

    pptx: custom shapes import, ignore close segment after moveto segment

diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index 3c7a15c..d9e2aa7 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -1034,10 +1034,13 @@ Reference< XFastContextHandler > Path2DContext::createFastChildContext( sal_Int3
     {
         case A_TOKEN( close ) :
         {
-            EnhancedCustomShapeSegment aNewSegment;
-            aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
-            aNewSegment.Count = 0;
-            mrSegments.push_back( aNewSegment );
+            // ignore close after move to (ppt does seems to do the same, see accentCallout2 preset for example)
+            if ( mrSegments.empty() || ( mrSegments.back().Command != EnhancedCustomShapeSegmentCommand::MOVETO ) ) {
+                EnhancedCustomShapeSegment aNewSegment;
+                aNewSegment.Command = EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
+                aNewSegment.Count = 0;
+                mrSegments.push_back( aNewSegment );
+            }
         }
         break;
         case A_TOKEN( moveTo ) :


More information about the Libreoffice-commits mailing list