summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-05-13 23:48:51 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-05-14 09:20:18 +0000
commit1a2a094795e10f514eb421e68bbd705ea5251b76 (patch)
treed3a5cc365a62fb0f918f4318a6c04db5795d9dc6
parent098817edf3c5d16ab476fbb996807e7654597990 (diff)
tdf#85424: sw: fix ~SwIndexReg assert in SwXText::insertControlCharacter()
Remove pointless duplicate temporary PaM. Change-Id: I28a1937928b6c3c21442bbfcb77377372c1cf40b (cherry picked from commit 847b4537928ff64cfdd6532704f7c48d947ac00f) Reviewed-on: https://gerrit.libreoffice.org/15725 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-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 2be0de2e7198..f2ad3464c0d0 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -415,10 +415,10 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
IDocumentContentOperations::INS_EMPTYEXPAND)
: IDocumentContentOperations::INS_EMPTYEXPAND;
- SwPaM aTmp(*aPam.Start());
if (bAbsorb && aPam.HasMark())
{
m_pImpl->m_pDoc->getIDocumentContentOperations().DeleteAndJoin(aPam);
+ aPam.DeleteMark();
}
sal_Unicode cIns = 0;
@@ -426,13 +426,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);
@@ -443,12 +443,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();
}
}
@@ -460,7 +460,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)
@@ -472,7 +473,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: