[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - oox/source

Andras Timar andras.timar at collabora.com
Mon Nov 23 03:32:39 PST 2015


 oox/source/export/drawingml.cxx |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

New commits:
commit 7cb41280ca4eb9e33c9ef06ea296bf91ba5a83ee
Author: Andras Timar <andras.timar at collabora.com>
Date:   Thu Nov 19 11:37:56 2015 +0100

    tdf#92527 construct default Segments sequence, when there is none
    
    ODF export in xmloff does the same
    
    Reviewed-on: https://gerrit.libreoffice.org/20051
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    (cherry picked from commit 11b7a2c89b8e155bf1da79107878f066847b46eb)
    
    Change-Id: I78ddbef3ac96f10f334c45a467dafb95bb9e3453
    Reviewed-on: https://gerrit.libreoffice.org/20066
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx
index ecb66e3..493a894 100644
--- a/oox/source/export/drawingml.cxx
+++ b/oox/source/export/drawingml.cxx
@@ -2282,9 +2282,22 @@ void DrawingML::WriteCustomGeometry( Reference< XShape > rXShape )
                         rPathProp.Value >>= aPathSize;
                 }
 
-                if ( !aPairs.hasElements() || !aSegments.hasElements() )
+                if ( !aPairs.hasElements() )
                     return;
 
+                if ( !aSegments.hasElements() )
+                {
+                    aSegments = uno::Sequence<drawing::EnhancedCustomShapeSegment>(4);
+                    aSegments[0].Count = 1;
+                    aSegments[0].Command = drawing::EnhancedCustomShapeSegmentCommand::MOVETO;
+                    aSegments[1].Count = (sal_Int16)std::min( aPairs.getLength() - 1, (sal_Int32)32767 );
+                    aSegments[1].Command = drawing::EnhancedCustomShapeSegmentCommand::LINETO;
+                    aSegments[2].Count = 0;
+                    aSegments[2].Command = drawing::EnhancedCustomShapeSegmentCommand::CLOSESUBPATH;
+                    aSegments[3].Count = 0;
+                    aSegments[3].Command = drawing::EnhancedCustomShapeSegmentCommand::ENDSUBPATH;
+                }
+
                 int nExpectedPairCount = 0;
                 for( int j = 0; j < aSegments.getLength(); ++j )
                 {


More information about the Libreoffice-commits mailing list