diff options
Diffstat (limited to 'sw/source/filter')
-rw-r--r-- | sw/source/filter/html/swhtml.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 32 | ||||
-rw-r--r-- | sw/source/filter/ww8/wrtw8esh.cxx | 17 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8graf.cxx | 15 |
4 files changed, 29 insertions, 45 deletions
diff --git a/sw/source/filter/html/swhtml.cxx b/sw/source/filter/html/swhtml.cxx index f984100ab9a4..f401e7ac2451 100644 --- a/sw/source/filter/html/swhtml.cxx +++ b/sw/source/filter/html/swhtml.cxx @@ -4722,13 +4722,9 @@ void SwHTMLParser::SetTextCollAttrs( HTMLAttrContext *pContext ) } // remove previous hard attribution of paragraph - if( !m_aParaAttrs.empty() ) - { - for( auto pParaAttr : m_aParaAttrs ) - pParaAttr->Invalidate(); - - m_aParaAttrs.clear(); - } + for( auto pParaAttr : m_aParaAttrs ) + pParaAttr->Invalidate(); + m_aParaAttrs.clear(); // set the style m_xDoc->SetTextFormatColl( *m_pPam, pCollToSet ); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index a7851e49e49f..01b1aa4b0319 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -649,17 +649,14 @@ void DocxAttributeOutput::EndParagraph( ww8::WW8TableNodeInfoInner::Pointer_t pT m_pSerializer->mergeTopMarks(Tag_StartParagraph_1); // Write framePr - if(!aFramePrTextbox.empty()) + for ( const auto & pFrame : aFramePrTextbox ) { - for ( const auto & pFrame : aFramePrTextbox ) - { - DocxTableExportContext aTableExportContext(*this); - m_pCurrentFrame = pFrame.get(); - m_rExport.SdrExporter().writeOnlyTextOfFrame(pFrame.get()); - m_pCurrentFrame = nullptr; - } - aFramePrTextbox.clear(); + DocxTableExportContext aTableExportContext(*this); + m_pCurrentFrame = pFrame.get(); + m_rExport.SdrExporter().writeOnlyTextOfFrame(pFrame.get()); + m_pCurrentFrame = nullptr; } + aFramePrTextbox.clear(); // Check for end of cell, rows, tables here FinishTableRowCell( pTextNodeInfoInner ); @@ -2376,20 +2373,17 @@ void DocxAttributeOutput::WriteCollectedRunProperties() m_pSerializer->singleElementNS( XML_w, XML_lang, xAttrList ); } - if (!m_aTextEffectsGrabBag.empty()) + for (beans::PropertyValue & i : m_aTextEffectsGrabBag) { - for (beans::PropertyValue & i : m_aTextEffectsGrabBag) + boost::optional<sal_Int32> aElementId = lclGetElementIdForName(i.Name); + if(aElementId) { - boost::optional<sal_Int32> aElementId = lclGetElementIdForName(i.Name); - if(aElementId) - { - uno::Sequence<beans::PropertyValue> aGrabBagSeq; - i.Value >>= aGrabBagSeq; - lclProcessRecursiveGrabBag(*aElementId, aGrabBagSeq, m_pSerializer); - } + uno::Sequence<beans::PropertyValue> aGrabBagSeq; + i.Value >>= aGrabBagSeq; + lclProcessRecursiveGrabBag(*aElementId, aGrabBagSeq, m_pSerializer); } - m_aTextEffectsGrabBag.clear(); } + m_aTextEffectsGrabBag.clear(); } void DocxAttributeOutput::EndRunProperties( const SwRedlineData* pRedlineData ) diff --git a/sw/source/filter/ww8/wrtw8esh.cxx b/sw/source/filter/ww8/wrtw8esh.cxx index 849ede23b070..4f455cdb1921 100644 --- a/sw/source/filter/ww8/wrtw8esh.cxx +++ b/sw/source/filter/ww8/wrtw8esh.cxx @@ -1102,19 +1102,16 @@ void MSWord_SdrAttrIter::OutAttr( sal_Int32 nSwPos ) //duplicate attributes in docx export. Doesn't matter in doc //export as later props just override earlier ones. std::set<sal_uInt16> aUsedRunWhichs; - if (!aTextAtrArr.empty()) + for(const auto& rTextAtr : aTextAtrArr) { - for(const auto& rTextAtr : aTextAtrArr) + if (nSwPos >= rTextAtr.nStart && nSwPos < rTextAtr.nEnd) { - if (nSwPos >= rTextAtr.nStart && nSwPos < rTextAtr.nEnd) - { - sal_uInt16 nWhich = rTextAtr.pAttr->Which(); - aUsedRunWhichs.insert(nWhich); - } - - if( nSwPos < rTextAtr.nStart ) - break; + sal_uInt16 nWhich = rTextAtr.pAttr->Which(); + aUsedRunWhichs.insert(nWhich); } + + if( nSwPos < rTextAtr.nStart ) + break; } OutParaAttr(true, &aUsedRunWhichs); diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx index ec4425b1da8c..41855fdbf6b9 100644 --- a/sw/source/filter/ww8/ww8graf.cxx +++ b/sw/source/filter/ww8/ww8graf.cxx @@ -2746,16 +2746,13 @@ SwFrameFormat* SwWW8ImplReader::Read_GrafLayer( long nGrafAnchorCp ) /* Insert text if necessary into textboxes contained in groups. */ - if (!aData.empty()) + for (const auto& it : aData) { - for (const auto& it : aData) - { - pRecord = it.get(); - if (pRecord->pObj && pRecord->aTextId.nTxBxS) - { // #i52825# pRetFrameFormat can be NULL - pRetFrameFormat = MungeTextIntoDrawBox( - pRecord, nGrafAnchorCp, pRetFrameFormat); - } + pRecord = it.get(); + if (pRecord->pObj && pRecord->aTextId.nTxBxS) + { // #i52825# pRetFrameFormat can be NULL + pRetFrameFormat = MungeTextIntoDrawBox( + pRecord, nGrafAnchorCp, pRetFrameFormat); } } } |