diff options
author | Michael Stahl <mstahl@redhat.com> | 2015-01-29 13:26:36 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2015-01-29 21:48:14 +0100 |
commit | 8ef489eeb3b3249d73cd29d0a36cd822d20fac24 (patch) | |
tree | d1dbd3ccc60a6fc11687897fdda7049f2c998ee9 /sw | |
parent | 4704f3d84f5ecf2f7c9334552510679b2ad9fd8f (diff) |
sw: replace pointless unused position update in SwTxtNode::Update()
... with a more useful assertion.
Change-Id: I43f0a3e123d9dc9f9fd9548e84b8619c7d4f1262
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/txtnode/ndtxt.cxx | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/sw/source/core/txtnode/ndtxt.cxx b/sw/source/core/txtnode/ndtxt.cxx index e063459cff60..1afaea285b94 100644 --- a/sw/source/core/txtnode/ndtxt.cxx +++ b/sw/source/core/txtnode/ndtxt.cxx @@ -1044,20 +1044,11 @@ void SwTxtNode::Update( if (nChangePos == rIdx.GetIndex()) { rIdx.Assign( &aTmpIdxReg, rIdx.GetIndex() ); - // mst: FIXME: why does this adjust the unused position??? - SwIndex * pIdx; - if ( &pRedl->GetBound( true ) == pRedl->GetPoint() ) - { - pRedl->GetBound( false ) = pRedl->GetBound( true ); - pIdx = &pRedl->GetBound( false ).nContent; - } - else - { - pRedl->GetBound( true ) = pRedl->GetBound( false ); - pIdx = &pRedl->GetBound( true ).nContent; - } - pIdx->Assign( &aTmpIdxReg, pIdx->GetIndex() ); } + // the unused position must not be on a SwTxtNode + bool const isOneUsed(&pRedl->GetBound(true) == pRedl->GetPoint()); + assert(!pRedl->GetBound(!isOneUsed).nNode.GetNode().IsTxtNode()); + assert(!pRedl->GetBound(!isOneUsed).nContent.GetIdxReg()); } } |