summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-01-09 10:27:22 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-01-17 10:07:10 +0200
commit2757ee9fe610e253e4ccc37423fa420004d0f388 (patch)
treea5a505f12a1c17cfab2001c2cbf43bd721633f0f /sw
parentee2bd1ee97194f4d39d4d6ab95c9b926b5077cb8 (diff)
used std::map in SfxItemSet
instead of naked array SfxItemIter ended up needing to take copies of stuff because various code likes to iterate over the items and delete items inside the loop. The gdb pretty printer is no longer quite as pretty as it was before, but it still prints useful info. Change-Id: I59b07ea42f6b1c74798a15402970b9dbd8233dbe
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/findattr.cxx8
-rw-r--r--sw/source/core/undo/undobj1.cxx3
-rw-r--r--sw/source/uibase/app/docstyle.cxx3
3 files changed, 6 insertions, 8 deletions
diff --git a/sw/source/core/crsr/findattr.cxx b/sw/source/core/crsr/findattr.cxx
index 73b577712c86..5e347f9fbac7 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 = aCmpSet.GetWhichByPos( aIter.GetFirstPos() );
- nArrLen = aCmpSet.GetWhichByPos( aIter.GetLastPos() ) - nArrStart+1;
+ nArrStart = aIter.GetFirstWhich();
+ nArrLen = aIter.GetLastWhich() - 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 = aCmpSet.GetWhichByPos( aIter.GetCurPos() );
+ nWhich = aIter.GetCurWhich();
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 = rCmpSet.GetWhichByPos( aIter.GetCurPos() );
+ nWhich = aIter.GetCurWhich();
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 ab7d5ff9612a..73556ba96eb6 100644
--- a/sw/source/core/undo/undobj1.cxx
+++ b/sw/source/core/undo/undobj1.cxx
@@ -532,8 +532,7 @@ void SwUndoSetFlyFormat::UndoImpl(::sw::UndoRedoContext & rContext)
while( pItem )
{
if( IsInvalidItem( pItem ))
- pFrameFormat->ResetFormatAttr( pItemSet->GetWhichByPos(
- aIter.GetCurPos() ));
+ pFrameFormat->ResetFormatAttr( aIter.GetCurWhich() );
else
pFrameFormat->SetFormatAttr( *pItem );
diff --git a/sw/source/uibase/app/docstyle.cxx b/sw/source/uibase/app/docstyle.cxx
index a4257fa71fb3..7a8a5f848822 100644
--- a/sw/source/uibase/app/docstyle.cxx
+++ b/sw/source/uibase/app/docstyle.cxx
@@ -1677,8 +1677,7 @@ void SwDocStyleSheet::SetItemSet( const SfxItemSet& rSet,
{
// use method <SwDoc::ResetAttrAtFormat(..)> in order to
// create an Undo object for the attribute reset.
- rDoc.ResetAttrAtFormat( rSet.GetWhichByPos(aIter.GetCurPos()),
- *pFormat );
+ rDoc.ResetAttrAtFormat( aIter.GetCurWhich(), *pFormat );
}
if( aIter.IsAtEnd() )