summaryrefslogtreecommitdiff
path: root/sw/source/core
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-03-02 01:23:12 +0100
committerMiklos Vajna <vmiklos@suse.cz>2013-03-04 09:55:05 +0000
commitaa1d118f9474ca0be4b1fcdc2749dd4020e05ffc (patch)
tree396d1d79c3bdd398ba8ca02f21e3f4b3adb7c448 /sw/source/core
parente69aa2d29342e90558e1d86b0f89418b8bdb0e34 (diff)
fdo#60886: _SetGetExpFlds: use the custom operator<
The calls to upper_bound in SwDoc::FldsToExpand and SwDoc::FldsToCalc unfortunately compare the pointers and not the values pointed to, which causes all sorts of trouble around non-updated fields. (regression from 2815396a1813cb3956c5aba066de49a7f34bc657) Conflicts: sw/source/core/doc/docfld.cxx Change-Id: I48817247719671a16821fcb851b17b628c960a66 (cherry picked from commit 9ca5383abfb7f2f785e9f2e2d5b2565b9a60bbab) Reviewed-on: https://gerrit.libreoffice.org/2504 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'sw/source/core')
-rw-r--r--sw/source/core/doc/docfld.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/sw/source/core/doc/docfld.cxx b/sw/source/core/doc/docfld.cxx
index 0fc9f4483856..c2d1dbc063e5 100644
--- a/sw/source/core/doc/docfld.cxx
+++ b/sw/source/core/doc/docfld.cxx
@@ -1097,9 +1097,8 @@ void SwDoc::FldsToCalc( SwCalc& rCalc, const _SetGetExpFld& rToThisFld )
if( !pUpdtFlds->GetSortLst()->empty() )
{
- _SetGetExpFlds::const_iterator const itLast = std::upper_bound(
- pUpdtFlds->GetSortLst()->begin(),
- pUpdtFlds->GetSortLst()->end(),
+ _SetGetExpFlds::const_iterator const itLast =
+ pUpdtFlds->GetSortLst()->upper_bound(
const_cast<_SetGetExpFld*>(&rToThisFld));
for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it )
lcl_CalcFld( *this, rCalc, **it, pMgr );
@@ -1143,10 +1142,9 @@ void SwDoc::FldsToExpand( SwHash**& ppHashTbl, sal_uInt16& rTblSize,
ppHashTbl = new SwHash*[ rTblSize ];
memset( ppHashTbl, 0, sizeof( _HashStr* ) * rTblSize );
- _SetGetExpFlds::const_iterator const itLast = std::upper_bound(
- pUpdtFlds->GetSortLst()->begin(),
- pUpdtFlds->GetSortLst()->end(),
- const_cast<_SetGetExpFld*>(&rToThisFld));
+ _SetGetExpFlds::const_iterator const itLast =
+ pUpdtFlds->GetSortLst()->upper_bound(
+ const_cast<_SetGetExpFld*>(&rToThisFld));
for( _SetGetExpFlds::const_iterator it = pUpdtFlds->GetSortLst()->begin(); it != itLast; ++it )
{