diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-01-13 18:52:46 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-01-13 19:39:58 +0100 |
commit | 2c2ace30ec9f671042c94ee83dfdc5d6fd5ddd32 (patch) | |
tree | 995754e7295720ff449b16af6ddb9502bd27bfb6 /sw | |
parent | 8c59c30153b8a67d9455d70a66b4a42c35120f97 (diff) |
SwTxtNode::RstTxtAttr() depends on some implementation details..
... of the hints array, attempt to document those with assertions.
Change-Id: I5e0310e7a213c7c8fd2e1f992ae91b739a7923a5
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/txtedt.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx index 9abddfa470b3..f885990542e4 100644 --- a/sw/source/core/txtnode/txtedt.cxx +++ b/sw/source/core/txtnode/txtedt.cxx @@ -533,6 +533,7 @@ void SwTxtNode::RstTxtAttr( else // Fall: 3 { m_pSwpHints->NoteInHistory( pHt ); + // UGLY: this may temporarily destroy the sorting! *pHt->GetStart() = nEnd; m_pSwpHints->NoteInHistory( pHt, sal_True ); @@ -543,6 +544,10 @@ void SwTxtNode::RstTxtAttr( InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST ); } + // this case appears to rely on InsertHint not re-sorting + // and pNew being inserted behind pHt + assert(pHt == m_pSwpHints->GetTextHint(i)); + bChanged = true; } } @@ -562,6 +567,7 @@ void SwTxtNode::RstTxtAttr( const sal_Int32 nAttrEnd = *pAttrEnd; m_pSwpHints->NoteInHistory( pHt ); + // UGLY: this may temporarily destroy the sorting! *pAttrEnd = nStt; m_pSwpHints->NoteInHistory( pHt, sal_True ); @@ -571,6 +577,10 @@ void SwTxtNode::RstTxtAttr( *pStyleHandle, nStt, nAttrEnd ); InsertHint( pNew, nsSetAttrMode::SETATTR_NOHINTADJUST ); } + + // this case appears to rely on InsertHint not re-sorting + // and pNew being inserted behind pHt + assert(pHt == m_pSwpHints->GetTextHint(i)); } else if( nLen ) // Fall: 4 { @@ -583,6 +593,7 @@ void SwTxtNode::RstTxtAttr( bChanged = true; const sal_Int32 nTmpEnd = *pAttrEnd; m_pSwpHints->NoteInHistory( pHt ); + // UGLY: this may temporarily destroy the sorting! *pAttrEnd = nStt; m_pSwpHints->NoteInHistory( pHt, sal_True ); @@ -611,6 +622,10 @@ void SwTxtNode::RstTxtAttr( // ein anderes auf die Position geschoben hat ! continue; } + + // this case appears to rely on InsertHint not re-sorting + // and pNew being inserted behind pHt + assert(pHt == m_pSwpHints->GetTextHint(i)); } } } |