From 8908f10fe3b6566db469a1f2bd2674d8d0425165 Mon Sep 17 00:00:00 2001 From: Joren De Cuyper Date: Sun, 10 May 2015 12:47:01 +0200 Subject: Code is executed in both cases so take it outside the statement MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8d4c3a62d4e63d2666bfce18d6af772a29e271d4 Reviewed-on: https://gerrit.libreoffice.org/15695 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- oox/source/export/vmlexport.cxx | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'oox') diff --git a/oox/source/export/vmlexport.cxx b/oox/source/export/vmlexport.cxx index a7ed878b59c8..9e8e6d29de20 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)) -- cgit