summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-29 15:50:47 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-30 13:02:39 +0200
commitb32a962897bd3dfeb012d971a0c3349c8d58c7fd (patch)
tree515ab105ba8fcdb834e9401375c05b4e85e37d00 /sw
parent6a7db071c75609093fc3a9cbc297b8069726a33e (diff)
tdf#125372 writer, file with lots of hints very slow to open, part6
Takes load time from 2m11 to 1m45 Since we're only interested in hints with end <= nIdx, GetLastPosSortedByEnd to avoid scanning some of the list Change-Id: Ibd80cb247176419aac5b6956593e5b7807c23cbf Reviewed-on: https://gerrit.libreoffice.org/73194 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/txtnode/ndtxt.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx
index 4a8ee16f7503..691c20f6490b 100644
--- a/sw/source/core/txtnode/ndtxt.cxx
+++ b/sw/source/core/txtnode/ndtxt.cxx
@@ -1615,17 +1615,17 @@ bool SwTextNode::DontExpandFormat( const SwIndex& rIdx, bool bFlag,
if ( HasHints() )
{
m_pSwpHints->SortIfNeedBe();
- const size_t nEndCnt = m_pSwpHints->Count();
- size_t nPos = nEndCnt;
- while( nPos )
+ int nPos = m_pSwpHints->GetLastPosSortedByEnd(nIdx);
+ for ( ; nPos >= 0; --nPos)
{
- SwTextAttr *pTmp = m_pSwpHints->GetSortedByEnd( --nPos );
+ SwTextAttr *pTmp = m_pSwpHints->GetSortedByEnd( nPos );
const sal_Int32 *pEnd = pTmp->GetEnd();
- if( !pEnd || *pEnd > nIdx )
+ if( !pEnd )
continue;
+ assert( *pEnd <= nIdx );
if( nIdx != *pEnd )
- nPos = 0;
- else if( bFlag != pTmp->DontExpand() && !pTmp->IsLockExpandFlag()
+ break;
+ if( bFlag != pTmp->DontExpand() && !pTmp->IsLockExpandFlag()
&& *pEnd > pTmp->GetStart())
{
bRet = true;