diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-01-30 12:08:41 +0100 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-01-30 16:31:13 +0100 |
commit | 9d319865f8bf78d25ca2e614d148420054a6461a (patch) | |
tree | 165ae49a0c92634a46d21677353952e71899d20c /sw | |
parent | 9d79fb32b76762394f68f80c1cd3dec8864f4d17 (diff) |
Unfloat: Need to move the page desc into the table node AttrSet
Change-Id: Ib9868bb31238905dd178fcf54c79f013079a037b
Reviewed-on: https://gerrit.libreoffice.org/67126
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/docvw/UnfloatTableButton.cxx | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/sw/source/uibase/docvw/UnfloatTableButton.cxx b/sw/source/uibase/docvw/UnfloatTableButton.cxx index 3c564b95024a..0592378ec768 100644 --- a/sw/source/uibase/docvw/UnfloatTableButton.cxx +++ b/sw/source/uibase/docvw/UnfloatTableButton.cxx @@ -114,12 +114,24 @@ void UnfloatTableButton::MouseButtonDown(const MouseEvent& /*rMEvt*/) // of the text node otherwise LO will create a page break after the table if (pTextFrame->GetTextNodeFirst()) { - SfxItemSet aSet(GetEditWin()->GetView().GetWrtShell().GetAttrPool(), - svl::Items<RES_PAGEDESC, RES_PAGEDESC>{}); - aSet.Put(SwFormatPageDesc(nullptr)); - SwPaM aPaM(*pTextFrame->GetTextNodeFirst()); - rDoc.getIDocumentContentOperations().InsertItemSet(aPaM, aSet, SetAttrMode::DEFAULT, - GetPageFrame()->getRootFrame()); + const SwPageDesc* pPageDesc + = pTextFrame->GetPageDescItem().GetPageDesc(); // First text node of the page has this + if (pPageDesc) + { + // First set the existing page desc for the table node + SfxItemSet aSet(GetEditWin()->GetView().GetWrtShell().GetAttrPool(), + svl::Items<RES_PAGEDESC, RES_PAGEDESC>{}); + aSet.Put(SwFormatPageDesc(pPageDesc)); + SwPaM aPaMTable(*pTableNode); + rDoc.getIDocumentContentOperations().InsertItemSet( + aPaMTable, aSet, SetAttrMode::DEFAULT, GetPageFrame()->getRootFrame()); + + // Then remove pagedesc from the attributes of the text node + aSet.Put(SwFormatPageDesc(nullptr)); + SwPaM aPaMTextNode(*pTextFrame->GetTextNodeFirst()); + rDoc.getIDocumentContentOperations().InsertItemSet( + aPaMTextNode, aSet, SetAttrMode::DEFAULT, GetPageFrame()->getRootFrame()); + } } // Move the table outside of the text frame |