summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2023-11-17 08:31:41 +0100
committerMiklos Vajna <vmiklos@collabora.com>2023-11-17 10:13:58 +0100
commit871ca5dd73b34086fad1e57d4697f43a6739a11d (patch)
tree554c1a7c196404bbb5d571eab916be9a9f0f1e8f /sw/inc
parent63a5687e84c5f75990a6052658fb5676f7cc2767 (diff)
sw floattable, delete UI: add an uno command to unfloat frame from context menu
Word has an easy UI to turn floating tables into inline ones. Writer had a similar button, but that had a few shortcomings: 1) It was only visible if a non-split frame was too large to fit the page. 2) It was a separate VCL widget, so invisible to LOK clients. 3) It only worked for frames which had a single table in them. Researching the problem, it's interesting how deleting a frame always deletes its content as well, but e.g. deleting a section just removes the container but leaves the content in the body text. Fix the problem by adding a new menu item in the context menu that always allows converting the frame to inline content at the anchor point. This can share a bit of code with the old unfloat button. The undo/redo still needs fixing, in a follow-up change. Change-Id: I8ce05c9f958b08cb599fd5d2a27e770182f28cc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159550 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/cmdid.h1
-rw-r--r--sw/inc/fesh.hxx2
2 files changed, 3 insertions, 0 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 74ab5cf8c554..165b6aa60a30 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -242,6 +242,7 @@ class SwUINumRuleItem;
#define FN_INSERT_IDX_ENTRY_DLG (FN_INSERT + 35) /* insert index entry */
#define FN_INSERT_FRAME_INTERACT_NOCOL (FN_INSERT + 36) /*insert interactive non column frame*/
+#define FN_UNFLOAT_FRAME TypedWhichId<SfxUInt16Item>(FN_INSERT + 37) /* Unfloat Frame */
#define FN_TOOL_ANCHOR_PAGE (FN_INSERT + 50) /* anchor Draw object to page */
#define FN_TOOL_ANCHOR_PARAGRAPH (FN_INSERT + 51) /* anchor Draw object to paragraph */
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index ce1cdc79f3fd..a0a3a64176d7 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -268,6 +268,8 @@ public:
void SelectFlyFrame( SwFlyFrame& rFrame );
+ void UnfloatFlyFrame();
+
/// Is selected frame within another frame?
const SwFrameFormat* IsFlyInFly();