diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-01-13 18:52:46 +0100 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2014-01-13 22:04:39 +0200 |
commit | a639a08892a6ebe5d2fe4b284ff21ca83e38bd7c (patch) | |
tree | b55b3e92a4bd515e84d874e77cc92ff87d50ee5b | |
parent | fed66bb28573edb0276c42eb5f1fa1ca4626738d (diff) |
SwTxtNode::RstTxtAttr() depends on some implementation details..
... of the hints array, attempt to document those with assertions.
Change-Id: I5e0310e7a213c7c8fd2e1f992ae91b739a7923a5
-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)); } } } |