[Libreoffice-commits] .: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Aug 21 07:26:33 PDT 2012
sw/source/core/unocore/unotext.cxx | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 12ce1c3a06e07f16fefe11fce9ae35c94ef657e7
Author: Miklos Vajna <vmiklos at suse.cz>
Date: Tue Aug 21 16:15:09 2012 +0200
n#775899 SwXText::convertToTextFrame fix removing fake paragraph
In case the textrange contains a single table, the DelFullPara() call to
remove the ending fake paragraph failed. When this happens, we now find
the paragraph in question manually to delete it.
Change-Id: I7055d4489192a8a694aef118f7646d8db87a64df
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index a36cc9c..a8b91c8 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -1755,7 +1755,14 @@ throw (lang::IllegalArgumentException, uno::RuntimeException)
if (bParaAfterInserted)
{
xFrameTextCursor->gotoEnd(sal_False);
- m_pImpl->m_pDoc->DelFullPara(*pFrameCursor->GetPaM());
+ if (!m_pImpl->m_pDoc->DelFullPara(*pFrameCursor->GetPaM()))
+ {
+ // In case the frame has a table only, the cursor points to the end of the first cell of the table.
+ SwPaM aPaM(*pFrameCursor->GetPaM()->GetNode()->FindSttNodeByType(SwFlyStartNode)->EndOfSectionNode());
+ // Now we have the end of the frame -- the node before that will be the paragraph we want to remove.
+ aPaM.GetPoint()->nNode--;
+ m_pImpl->m_pDoc->DelFullPara(aPaM);
+ }
}
}
More information about the Libreoffice-commits
mailing list