diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-08-21 16:15:09 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-08-21 16:26:16 +0200 |
commit | 12ce1c3a06e07f16fefe11fce9ae35c94ef657e7 (patch) | |
tree | 10dbfc2f371f6ceff6e69c0b0df4da6990da2dbe /sw | |
parent | f4d996ceaa4d127b37868a47b302d466193a3cbc (diff) |
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
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/unocore/unotext.cxx | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx index a36cc9ce32d5..a8b91c8a7ae2 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); + } } } |