[Libreoffice-commits] core.git: sw/source
Michael Stahl
mstahl at redhat.com
Wed May 13 15:13:20 PDT 2015
sw/source/core/unocore/unotext.cxx | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
New commits:
commit 847b4537928ff64cfdd6532704f7c48d947ac00f
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed May 13 23:48:51 2015 +0200
tdf#85424: sw: fix ~SwIndexReg assert in SwXText::insertControlCharacter()
Remove pointless duplicate temporary PaM.
Change-Id: I28a1937928b6c3c21442bbfcb77377372c1cf40b
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 488f8e9..59d586a 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:
More information about the Libreoffice-commits
mailing list