diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-23 10:38:15 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-23 13:19:56 +0200 |
commit | 00aa9f622c29aecc6bb9c5ee4b3aa35a9afb095d (patch) | |
tree | 6b10baae17781ad810d0f7b7c08cc30945fa6246 /sw | |
parent | b0730ff656848f005838b10bef0cf88f5ac0ba32 (diff) |
Revert "used std::map in SfxItemSet"
This reverts commit 2757ee9fe610e253e4ccc37423fa420004d0f388.
Besides causing a performance regression, I now notice that
there is code in SW that relies on iterating over two different
SfxItemSet's in parallel, and assumes that missing items are
returned as nullptr, which is not the case for my std::map based
change.
Change-Id: I2b1110350fe4c4b74e5508558e9661ef1e1a103e
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/crsr/findattr.cxx | 8 | ||||
-rw-r--r-- | sw/source/core/undo/undobj1.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/app/docstyle.cxx | 3 |
3 files changed, 8 insertions, 6 deletions
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx index 5e347f9fbac7..73b577712c86 100644 --- a/sw/source/core/crsr/findattr.cxx +++ b/sw/source/core/crsr/findattr.cxx @@ -235,8 +235,8 @@ SwAttrCheckArr::SwAttrCheckArr( const SfxItemSet& rSet, bool bFwd, // determine area of Fnd/Stack array (Min/Max) SfxItemIter aIter( aCmpSet ); - nArrStart = aIter.GetFirstWhich(); - nArrLen = aIter.GetLastWhich() - nArrStart + 1; + nArrStart = aCmpSet.GetWhichByPos( aIter.GetFirstPos() ); + nArrLen = aCmpSet.GetWhichByPos( aIter.GetLastPos() ) - nArrStart+1; char* pFndChar = new char[ nArrLen * sizeof(SwSrchChrAttr) ]; char* pStackChar = new char[ nArrLen * sizeof(SwSrchChrAttr) ]; @@ -287,7 +287,7 @@ void SwAttrCheckArr::SetNewSet( const SwTextNode& rTextNd, const SwPaM& rPam ) { if( IsInvalidItem( pItem ) ) { - nWhich = aIter.GetCurWhich(); + nWhich = aCmpSet.GetWhichByPos( aIter.GetCurPos() ); if( RES_TXTATR_END <= nWhich ) break; // end of text attributes @@ -861,7 +861,7 @@ static bool lcl_Search( const SwContentNode& rCNd, const SfxItemSet& rCmpSet, bo { if( IsInvalidItem( pItem )) { - nWhich = aIter.GetCurWhich(); + nWhich = rCmpSet.GetWhichByPos( aIter.GetCurPos() ); if( SfxItemState::SET != rNdSet.GetItemState( nWhich, !bNoColls, &pNdItem ) || CmpAttr( *pNdItem, rNdSet.GetPool()->GetDefaultItem( nWhich ) )) return false; diff --git a/sw/source/core/undo/undobj1.cxx b/sw/source/core/undo/undobj1.cxx index 331470225d06..0b0b21f33e69 100644 --- a/sw/source/core/undo/undobj1.cxx +++ b/sw/source/core/undo/undobj1.cxx @@ -531,7 +531,8 @@ void SwUndoSetFlyFormat::UndoImpl(::sw::UndoRedoContext & rContext) while( pItem ) { if( IsInvalidItem( pItem )) - pFrameFormat->ResetFormatAttr( aIter.GetCurWhich() ); + pFrameFormat->ResetFormatAttr( pItemSet->GetWhichByPos( + aIter.GetCurPos() )); else pFrameFormat->SetFormatAttr( *pItem ); diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx index 7a8a5f848822..a4257fa71fb3 100644 --- a/sw/source/uibase/app/docstyle.cxx +++ b/sw/source/uibase/app/docstyle.cxx @@ -1677,7 +1677,8 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet, { // use method <SwDoc::ResetAttrAtFormat(..)> in order to // create an Undo object for the attribute reset. - rDoc.ResetAttrAtFormat( aIter.GetCurWhich(), *pFormat ); + rDoc.ResetAttrAtFormat( rSet.GetWhichByPos(aIter.GetCurPos()), + *pFormat ); } if( aIter.IsAtEnd() ) |