diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-08-21 16:15:09 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-09-28 14:17:56 +0200 |
commit | d624809600adf874e954f57a305afe5cf354ea0e (patch) | |
tree | f818556f19da52300844655a31ddb1f18e768300 /sw | |
parent | f91d0026c903e911c82b6acd7eed475a9a85deaf (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
(cherry picked from commit 12ce1c3a06e07f16fefe11fce9ae35c94ef657e7)
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 241aae3068ea..1366db163565 100644 --- a/sw/source/core/unocore/unotext.cxx +++ b/sw/source/core/unocore/unotext.cxx @@ -1753,7 +1753,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); + } } } |