summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2014-06-06 09:44:34 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2014-09-30 09:56:36 +0200
commitf48e44a7bebe97ba3eefcdbf869c3fa4b6217a07 (patch)
treef4e6ac3c25f1ce7a092d028e21c438da8d81964f
parent5e460ad24f4d61b9f0870d7c8e60609b327a9ee1 (diff)
Directly convert frame name tails to Int32
This is a little optimization for large mail merge jobs with many frames. The current alorithm doesn't only try to produce unique but also reasonable names for the frames. Per se the algorithm is horrible ineffective for large numbers of frames, but this is impossible to fix without changing the underlying vector of frames to a sorted one to find and check just the correctly prefixed frames. This patch directly converts the frame names tail instead of creating substring of the number tail, which saves billions of malloc and free calls seen with my sample document. (cherry picked from commit 5f6db9260ec42a040a4ce21e93af2f1e18746fe6) Conflicts: sw/source/core/doc/doclay.cxx Change-Id: Iefdee4053480f40f106c49867bc5a64ec207ba1b
-rw-r--r--sw/source/core/doc/doclay.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 926a8c701f2f..74a9ac2b3a7b 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1926,7 +1926,7 @@ static String lcl_GetUniqueFlyName( const SwDoc* pDoc, sal_uInt16 nDefStrId )
pFlyFmt->GetName().Match( aName ) == nNmLen )
{
// Only get and set the Flag
- nNum = static_cast< sal_uInt16 >( pFlyFmt->GetName().Copy( nNmLen ).ToInt32() );
+ nNum = static_cast< sal_uInt16 >( rtl_ustr_toInt32( pFlyFmt->GetName().GetBuffer() + nNmLen, 10 ) );
if( nNum-- && nNum < rFmts.size() )
pSetFlags[ nNum / 8 ] |= (0x01 << ( nNum & 0x07 ));
}