summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-05-13 23:48:51 +0200
committerMichael Stahl <mstahl@redhat.com>2015-05-14 00:07:49 +0200
commit847b4537928ff64cfdd6532704f7c48d947ac00f (patch)
tree95523e22005c65619f8eb34cb2c03ce133fcdfa4
parentcb5a0b03bef4eb8ab0d8689ec73ed83bb73ef5c0 (diff)
tdf#85424: sw: fix ~SwIndexReg assert in SwXText::insertControlCharacter()
Remove pointless duplicate temporary PaM. Change-Id: I28a1937928b6c3c21442bbfcb77377372c1cf40b
-rw-r--r--sw/source/core/unocore/unotext.cxx19
1 files changed, 10 insertions, 9 deletions
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 488f8e9cc8f2..59d586a6338e 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -411,10 +411,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
? ( SwInsertFlags::FORCEHINTEXPAND | SwInsertFlags::EMPTYEXPAND)
: SwInsertFlags::EMPTYEXPAND;
- SwPaM aTmp(*aPam.Start());
if (bAbsorb && aPam.HasMark())
{
m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin(aPam);
+ aPam.DeleteMark();
}
sal_Unicode cIns = 0;
@@ -422,13 +422,13 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
{
case text::ControlCharacter::PARAGRAPH_BREAK :
// a table cell now becomes an ordinary text cell!
- m_pImpl->m_pDoc->ClearBoxNumAttrs( aTmp.GetPoint()->nNode );
- m_pImpl->m_pDoc->getIDocumentContentOperations().SplitNode( *aTmp.GetPoint(), false );
+ m_pImpl->m_pDoc->ClearBoxNumAttrs(aPam.GetPoint()->nNode);
+ m_pImpl->m_pDoc->getIDocumentContentOperations().SplitNode(*aPam.GetPoint(), false);
break;
case text::ControlCharacter::APPEND_PARAGRAPH:
{
- m_pImpl->m_pDoc->ClearBoxNumAttrs( aTmp.GetPoint()->nNode );
- m_pImpl->m_pDoc->getIDocumentContentOperations().AppendTxtNode( *aTmp.GetPoint() );
+ m_pImpl->m_pDoc->ClearBoxNumAttrs(aPam.GetPoint()->nNode);
+ m_pImpl->m_pDoc->getIDocumentContentOperations().AppendTxtNode(*aPam.GetPoint());
const uno::Reference<lang::XUnoTunnel> xRangeTunnel(
xTextRange, uno::UNO_QUERY);
@@ -439,12 +439,12 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
xRangeTunnel);
if (pRange)
{
- pRange->SetPositions(aTmp);
+ pRange->SetPositions(aPam);
}
else if (pCursor)
{
SwPaM *const pCrsr = pCursor->GetPaM();
- *pCrsr->GetPoint() = *aTmp.GetPoint();
+ *pCrsr->GetPoint() = *aPam.GetPoint();
pCrsr->DeleteMark();
}
}
@@ -456,7 +456,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
}
if (cIns)
{
- m_pImpl->m_pDoc->getIDocumentContentOperations().InsertString( aTmp, OUString(cIns), nInsertFlags );
+ m_pImpl->m_pDoc->getIDocumentContentOperations().InsertString(
+ aPam, OUString(cIns), nInsertFlags);
}
if (bAbsorb)
@@ -468,7 +469,7 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
OTextCursorHelper *const pCursor =
::sw::UnoTunnelGetImplementation<OTextCursorHelper>(xRangeTunnel);
- SwCursor aCrsr(*aTmp.GetPoint(),0,false);
+ SwCursor aCrsr(*aPam.GetPoint(), 0, false);
SwUnoCursorHelper::SelectPam(aCrsr, true);
aCrsr.Left(1, CRSR_SKIP_CHARS, false, false);
// here, the PaM needs to be moved: