summaryrefslogtreecommitdiff
path: root/sw/source/core/edit/edfld.cxx
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2014-12-13 19:30:48 +0100
committerBjörn Michaelsen <bjoern.michaelsen@canonical.com>2014-12-15 21:05:23 +0000
commitbbf59cb82eabee984926fb11dc5281dc84e62fb6 (patch)
treedbdc2205a2c6b11a12e5bafc6a6625b208b5ef9f /sw/source/core/edit/edfld.cxx
parent3fcd2ccb443653740d114b3e4dc371c6b0b6525b (diff)
Related fdo#86929: Kill FOREACHPAM_START for good (part2)
Change-Id: Ia6e166a4158d28f1a4145e51040f2f5637827197 Reviewed-on: https://gerrit.libreoffice.org/13466 Reviewed-by: Björn Michaelsen <bjoern.michaelsen@canonical.com> Tested-by: Björn Michaelsen <bjoern.michaelsen@canonical.com>
Diffstat (limited to 'sw/source/core/edit/edfld.cxx')
-rw-r--r--sw/source/core/edit/edfld.cxx18
1 files changed, 10 insertions, 8 deletions
diff --git a/sw/source/core/edit/edfld.cxx b/sw/source/core/edit/edfld.cxx
index 5ab5ea073ced..3540ab7bfbd7 100644
--- a/sw/source/core/edit/edfld.cxx
+++ b/sw/source/core/edit/edfld.cxx
@@ -204,11 +204,12 @@ void SwEditShell::Insert2(SwField& rFld, const bool bForceExpandHints)
? nsSetAttrMode::SETATTR_FORCEHINTEXPAND
: nsSetAttrMode::SETATTR_DEFAULT;
- FOREACHPAM_START(GetCrsr()) // for each PaM
- const bool bSuccess(GetDoc()->getIDocumentContentOperations().InsertPoolItem(*PCURCRSR, aFld, nInsertFlags));
+ for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) // for each PaM
+ {
+ const bool bSuccess(GetDoc()->getIDocumentContentOperations().InsertPoolItem(rPaM, aFld, nInsertFlags));
OSL_ENSURE( bSuccess, "Doc->Insert(Field) failed");
(void) bSuccess;
- FOREACHPAM_END()
+ }
EndAllAction();
}
@@ -284,12 +285,13 @@ void SwEditShell::UpdateFlds( SwField &rFld )
SwMsgPoolItem aFldHint( RES_TXTATR_FIELD ); // Search-Hint
SwMsgPoolItem aAnnotationFldHint( RES_TXTATR_ANNOTATION );
SwMsgPoolItem aInputFldHint( RES_TXTATR_INPUTFIELD );
- FOREACHPAM_START(GetCrsr()) // for each PaM
- if( PCURCRSR->HasMark() && bOkay ) // ... with selection
+ for(SwPaM& rPaM : GetCrsr()->GetRingContainer()) // for each PaM
+ {
+ if( rPaM.HasMark() && bOkay ) // ... with selection
{
// copy of the PaM
- SwPaM aCurPam( *PCURCRSR->GetMark(), *PCURCRSR->GetPoint() );
- SwPaM aPam( *PCURCRSR->GetPoint() );
+ SwPaM aCurPam( *rPaM.GetMark(), *rPaM.GetPoint() );
+ SwPaM aPam( *rPaM.GetPoint() );
SwPosition *pCurStt = aCurPam.Start(), *pCurEnd =
aCurPam.End();
@@ -331,7 +333,7 @@ void SwEditShell::UpdateFlds( SwField &rFld )
if( bTblSelBreak ) // If table section and table formula are updated -> finish
break;
- FOREACHPAM_END()
+ }
}
GetDoc()->getIDocumentState().SetModified();
EndAllAction();