Kaydet (Commit) 9d319865 authored tarafından Tamás Zolnai's avatar Tamás Zolnai

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: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 9d79fb32
...@@ -114,12 +114,24 @@ void UnfloatTableButton::MouseButtonDown(const MouseEvent& /*rMEvt*/) ...@@ -114,12 +114,24 @@ void UnfloatTableButton::MouseButtonDown(const MouseEvent& /*rMEvt*/)
// of the text node otherwise LO will create a page break after the table // of the text node otherwise LO will create a page break after the table
if (pTextFrame->GetTextNodeFirst()) if (pTextFrame->GetTextNodeFirst())
{ {
SfxItemSet aSet(GetEditWin()->GetView().GetWrtShell().GetAttrPool(), const SwPageDesc* pPageDesc
svl::Items<RES_PAGEDESC, RES_PAGEDESC>{}); = pTextFrame->GetPageDescItem().GetPageDesc(); // First text node of the page has this
aSet.Put(SwFormatPageDesc(nullptr)); if (pPageDesc)
SwPaM aPaM(*pTextFrame->GetTextNodeFirst()); {
rDoc.getIDocumentContentOperations().InsertItemSet(aPaM, aSet, SetAttrMode::DEFAULT, // First set the existing page desc for the table node
GetPageFrame()->getRootFrame()); 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 // Move the table outside of the text frame
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment