[Libreoffice-commits] core.git: oox/source

Joren De Cuyper jorendc at libreoffice.org
Sun May 10 12:42:11 PDT 2015


 oox/source/export/vmlexport.cxx |   22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

New commits:
commit 8908f10fe3b6566db469a1f2bd2674d8d0425165
Author: Joren De Cuyper <jorendc at libreoffice.org>
Date:   Sun May 10 12:47:01 2015 +0200

    Code is executed in both cases so take it outside the statement
    
    Change-Id: I8d4c3a62d4e63d2666bfce18d6af772a29e271d4
    Reviewed-on: https://gerrit.libreoffice.org/15695
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx
index a7ed878..9e8e6d2 100644
--- a/oox/source/export/vmlexport.cxx
+++ b/oox/source/export/vmlexport.cxx
@@ -1109,24 +1109,16 @@ sal_Int32 VMLExport::StartShape()
     if (!sAnchorId.isEmpty())
         m_pShapeAttrList->addNS(XML_wp14, XML_anchorId, OUStringToOString(sAnchorId, RTL_TEXTENCODING_UTF8));
 
-    if ( nShapeElement >= 0 && !m_pShapeAttrList->hasAttribute( XML_type ) )
+    if ( nShapeElement >= 0 && !m_pShapeAttrList->hasAttribute( XML_type ) && bReferToShapeType )
     {
-        if ( bReferToShapeType )
-        {
-            m_pShapeAttrList->add( XML_type, OStringBuffer( 20 )
-                    .append( "shapetype_" ).append( sal_Int32( m_nShapeType ) )
-                    .makeStringAndClear() );
-        }
-
-        // start of the shape
-        m_pSerializer->startElementNS( XML_v, nShapeElement, XFastAttributeListRef( m_pShapeAttrList ) );
-    }
-    else
-    {
-        // start of the shape
-        m_pSerializer->startElementNS( XML_v, nShapeElement, XFastAttributeListRef( m_pShapeAttrList ) );
+        m_pShapeAttrList->add( XML_type, OStringBuffer( 20 )
+                .append( "shapetype_" ).append( sal_Int32( m_nShapeType ) )
+                .makeStringAndClear() );
     }
 
+    // start of the shape
+    m_pSerializer->startElementNS( XML_v, nShapeElement, XFastAttributeListRef( m_pShapeAttrList ) );
+
     // now check if we have some editeng text (not associated textbox) and we have a text exporter registered
     const SdrTextObj* pTxtObj = PTR_CAST(SdrTextObj, m_pSdrObject);
     if (pTxtObj && m_pTextExport && msfilter::util::HasTextBoxContent(m_nShapeType) && !IsWaterMarkShape(m_pSdrObject->GetName()) && !lcl_isTextBox(m_pSdrObject))


More information about the Libreoffice-commits mailing list