diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/access/accmap.cxx | 14 | ||||
-rw-r--r-- | sw/source/core/undo/undel.cxx | 17 | ||||
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 35 | ||||
-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 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 39 | ||||
-rw-r--r-- | sw/source/ui/frmdlg/frmpage.cxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/app/docsh2.cxx | 11 | ||||
-rw-r--r-- | sw/source/uibase/docvw/PostItMgr.cxx | 13 |
11 files changed, 88 insertions, 124 deletions
diff --git a/sw/source/core/access/accmap.cxx b/sw/source/core/access/accmap.cxx index bd77f85b5edb..a720020a7fc4 100644 --- a/sw/source/core/access/accmap.cxx +++ b/sw/source/core/access/accmap.cxx @@ -1389,16 +1389,14 @@ void SwAccessibleMap::InvalidateShapeInParaSelection() mpSeletedFrameMap->clear(); } - if( !mapTemp.empty() ) + SwAccessibleContextMap_Impl::iterator aIter = mapTemp.begin(); + while( aIter != mapTemp.end() ) { - SwAccessibleContextMap_Impl::iterator aIter = mapTemp.begin(); - while( aIter != mapTemp.end() ) - { - mpSeletedFrameMap->emplace( (*aIter).first, (*aIter).second ); - ++aIter; - } - mapTemp.clear(); + mpSeletedFrameMap->emplace( (*aIter).first, (*aIter).second ); + ++aIter; } + mapTemp.clear(); + if( bMarkChanged && mpFrameMap) { for (SwAccessibleContext* pAccPara : vecAdd) diff --git a/sw/source/core/undo/undel.cxx b/sw/source/core/undo/undel.cxx index f979890d3b9b..1e4cb8e7fcd9 100644 --- a/sw/source/core/undo/undel.cxx +++ b/sw/source/core/undo/undel.cxx @@ -54,18 +54,15 @@ */ static void lcl_MakeAutoFrames( const SwFrameFormats& rSpzArr, sal_uLong nMovedIndex ) { - if( !rSpzArr.empty() ) + for( size_t n = 0; n < rSpzArr.size(); ++n ) { - for( size_t n = 0; n < rSpzArr.size(); ++n ) + SwFrameFormat * pFormat = rSpzArr[n]; + const SwFormatAnchor* pAnchor = &pFormat->GetAnchor(); + if (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_CHAR) { - SwFrameFormat * pFormat = rSpzArr[n]; - const SwFormatAnchor* pAnchor = &pFormat->GetAnchor(); - if (pAnchor->GetAnchorId() == RndStdIds::FLY_AT_CHAR) - { - const SwPosition* pAPos = pAnchor->GetContentAnchor(); - if( pAPos && nMovedIndex == pAPos->nNode.GetIndex() ) - pFormat->MakeFrames(); - } + const SwPosition* pAPos = pAnchor->GetContentAnchor(); + if( pAPos && nMovedIndex == pAPos->nNode.GetIndex() ) + pFormat->MakeFrames(); } } } diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx index 0776b3325261..1ba5b3f760a5 100644 --- a/sw/source/core/unocore/unoportenum.cxx +++ b/sw/source/core/unocore/unoportenum.cxx @@ -1176,29 +1176,26 @@ static void lcl_ExportAnnotationStarts( SwAnnotationStartPortion_ImplList& rAnnotationStartArr, const sal_Int32 nIndex) { - if ( !rAnnotationStartArr.empty() ) + for ( SwAnnotationStartPortion_ImplList::iterator aIter = rAnnotationStartArr.begin(), aEnd = rAnnotationStartArr.end(); + aIter != aEnd; ) { - for ( SwAnnotationStartPortion_ImplList::iterator aIter = rAnnotationStartArr.begin(), aEnd = rAnnotationStartArr.end(); - aIter != aEnd; ) + SwAnnotationStartPortion_ImplSharedPtr pPtr = (*aIter); + if ( nIndex > pPtr->getIndex() ) { - SwAnnotationStartPortion_ImplSharedPtr pPtr = (*aIter); - if ( nIndex > pPtr->getIndex() ) - { - aIter = rAnnotationStartArr.erase(aIter); - continue; - } - if ( pPtr->getIndex() > nIndex ) - { - break; - } - - SwXTextPortion* pPortion = - new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION ); - pPortion->SetTextField( pPtr->mxAnnotationField ); - rPortions.emplace_back(pPortion); - aIter = rAnnotationStartArr.erase(aIter); + continue; } + if ( pPtr->getIndex() > nIndex ) + { + break; + } + + SwXTextPortion* pPortion = + new SwXTextPortion( pUnoCursor, xParent, PORTION_ANNOTATION ); + pPortion->SetTextField( pPtr->mxAnnotationField ); + rPortions.emplace_back(pPortion); + + aIter = rAnnotationStartArr.erase(aIter); } } 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); } } } diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index fdd0f4f6a733..e41cd8237137 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -474,29 +474,26 @@ void SwEditRegionDlg::RecurseList(const SwSectionFormat* pFormat, SvTreeListEntr SwSections aTmpArr; SvTreeListEntry* pNEntry; pFormat->GetChildSections(aTmpArr, SectionSort::Pos); - if( !aTmpArr.empty() ) + for( const auto pSect : aTmpArr ) { - for( const auto pSect : aTmpArr ) + SectionType eTmpType; + pFormat = pSect->GetFormat(); + if( pFormat->IsInNodesArr() && + (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION + && TOX_HEADER_SECTION != eTmpType ) { - SectionType eTmpType; - pFormat = pSect->GetFormat(); - if( pFormat->IsInNodesArr() && - (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION - && TOX_HEADER_SECTION != eTmpType ) - { - SectRepr* pSectRepr=new SectRepr( - FindArrPos( pSect->GetFormat() ), *pSect ); - Image aImage = BuildBitmap( pSect->IsProtect(), - pSect->IsHidden()); - pNEntry = m_pTree->InsertEntry( - pSect->GetSectionName(), aImage, aImage, pEntry); - pNEntry->SetUserData(pSectRepr); - RecurseList( pSect->GetFormat(), pNEntry ); - if( pNEntry->HasChildren()) - m_pTree->Expand(pNEntry); - if (pCurrSect==pSect) - pSelEntry = pNEntry; - } + SectRepr* pSectRepr=new SectRepr( + FindArrPos( pSect->GetFormat() ), *pSect ); + Image aImage = BuildBitmap( pSect->IsProtect(), + pSect->IsHidden()); + pNEntry = m_pTree->InsertEntry( + pSect->GetSectionName(), aImage, aImage, pEntry); + pNEntry->SetUserData(pSectRepr); + RecurseList( pSect->GetFormat(), pNEntry ); + if( pNEntry->HasChildren()) + m_pTree->Expand(pNEntry); + if (pCurrSect==pSect) + pSelEntry = pNEntry; } } } diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx index 0c24cc563f7e..52f4f97474e9 100644 --- a/sw/source/ui/frmdlg/frmpage.cxx +++ b/sw/source/ui/frmdlg/frmpage.cxx @@ -2680,13 +2680,10 @@ void SwFrameURLPage::Reset( const SfxItemSet *rSet ) { std::unique_ptr<TargetList> pList(new TargetList); SfxFrame::GetDefaultTargetList(*pList); - if( !pList->empty() ) + size_t nCount = pList->size(); + for (size_t i = 0; i < nCount; ++i) { - size_t nCount = pList->size(); - for (size_t i = 0; i < nCount; ++i) - { - m_xFrameCB->append_text(pList->at(i)); - } + m_xFrameCB->append_text(pList->at(i)); } } diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index 68fe77ff8a9f..e4271f9058bb 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -1032,15 +1032,12 @@ void SwDocShell::Execute(SfxRequest& rReq) bool bOutline[MAXLEVEL] = {false}; const SwOutlineNodes& rOutlNds = m_xDoc->GetNodes().GetOutLineNds(); - if( !rOutlNds.empty() ) + for( size_t n = 0; n < rOutlNds.size(); ++n ) { - for( size_t n = 0; n < rOutlNds.size(); ++n ) + const int nLevel = rOutlNds[n]->GetTextNode()->GetAttrOutlineLevel(); + if( nLevel > 0 && ! bOutline[nLevel-1] ) { - const int nLevel = rOutlNds[n]->GetTextNode()->GetAttrOutlineLevel(); - if( nLevel > 0 && ! bOutline[nLevel-1] ) - { - bOutline[nLevel-1] = true; - } + bOutline[nLevel-1] = true; } } diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 442400bdb173..2355151e851c 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -1311,16 +1311,13 @@ void SwPostItMgr::AddPostIts(bool bCheckExistence, bool bFocus) void SwPostItMgr::RemoveSidebarWin() { - if (!mvPostItFields.empty()) + for (auto const& postItField : mvPostItFields) { - for (auto const& postItField : mvPostItFields) - { - EndListening( *const_cast<SfxBroadcaster*>(postItField->GetBroadCaster()) ); - postItField->pPostIt.disposeAndClear(); - delete postItField; - } - mvPostItFields.clear(); + EndListening( *const_cast<SfxBroadcaster*>(postItField->GetBroadCaster()) ); + postItField->pPostIt.disposeAndClear(); + delete postItField; } + mvPostItFields.clear(); // all postits removed, no items should be left in pages PreparePageContainer(); |