sw/source/core/fields/reffld.cxx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
New commits: commit 458d56d9b35f2ecb2eea2589737079390b10ee26 Author: Cédric Bosdonnat <cedric.bosdonnat....@free.fr> Date: Mon Jan 30 11:35:42 2012 +0100 fdo#35669: more robust references merging diff --git a/sw/source/core/fields/reffld.cxx b/sw/source/core/fields/reffld.cxx index 5f1aa3a..05c3eda 100644 --- a/sw/source/core/fields/reffld.cxx +++ b/sw/source/core/fields/reffld.cxx @@ -974,11 +974,13 @@ void _RefIdsMap::Init( SwDoc& rDoc, SwDoc& rDestDoc, sal_Bool bField ) GetFieldIdsFromDoc( rDoc, aDstIds ); // Define the mappings now - sal_uInt16 nMaxDstId = *aIds.end(); + sal_uInt16 nMaxDstId = -1; + if ( !aIds.empty() ) + nMaxDstId = *aIds.rbegin(); // Map all the src fields to their value + nMaxDstId for ( std::set<sal_uInt16>::iterator pIt = aDstIds.begin(); pIt != aDstIds.end(); ++pIt ) - AddId( nMaxDstId++, *pIt ); + AddId( ++nMaxDstId, *pIt ); // Change the Sequence number of all the SetExp fields in the destination document SwFieldType* pType = rDoc.GetFldType( RES_SETEXPFLD, aName, false );
_______________________________________________ Libreoffice-commits mailing list Libreoffice-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits