summaryrefslogtreecommitdiff
path: root/sw/inc
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.com>2022-05-12 08:17:02 +0200
committerMiklos Vajna <vmiklos@collabora.com>2022-05-12 17:48:51 +0200
commit9f37840b0d7778ab4fc3294c44f62198ea932e3f (patch)
tree5178fd0927ce62bb5edebcff87a76ea55f49c0fe /sw/inc
parente98a68b23e14580dfa236536254b6ff80cd10df7 (diff)
sw content controls, dropdown: add insert UI
- introduce a SwContentControlListItem::ToString() that tries to use the display text of the list item, otherwise falls back to its value and use it while building the dropdown widget and when inserting selected list item - handle the dropdown case in SwWrtShell::InsertContentControl() - expose this as a new .uno:InsertDropdownContentControl command - mention the new and all previous content control commands in the MS-compatible forms menu as well Change-Id: I075f77933c1466b5258357d5a661e173c34de34f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134215 Reviewed-by: Miklos Vajna <vmiklos@collabora.com> Tested-by: Jenkins
Diffstat (limited to 'sw/inc')
-rw-r--r--sw/inc/cmdid.h3
-rw-r--r--sw/inc/formatcontentcontrol.hxx2
-rw-r--r--sw/inc/strings.hrc1
3 files changed, 5 insertions, 1 deletions
diff --git a/sw/inc/cmdid.h b/sw/inc/cmdid.h
index 355d607a5bc5..a11bfd4e21df 100644
--- a/sw/inc/cmdid.h
+++ b/sw/inc/cmdid.h
@@ -217,10 +217,11 @@ class SwUINumRuleItem;
#define FN_INSERT_LINEBREAK (FN_INSERT + 18) /* Newline */
#define FN_INSERT_FIELD_DATA_ONLY (FN_INSERT + 19) /* Field dialog for mail merge*/
-#define FN_INSERT_CONTENT_CONTROL (FN_INSERT + 20) /* Content control */
+#define FN_INSERT_CONTENT_CONTROL (FN_INSERT + 20) /* Rich text content control */
#define FN_INSERT_CHECKBOX_CONTENT_CONTROL (FN_INSERT + 21) /* Checkbox content control */
#define FN_INSERT_OBJECT_DLG (FN_INSERT + 22) /* Object */
#define FN_INSERT_PAGEBREAK (FN_INSERT + 23) /* Page break*/
+#define FN_INSERT_DROPDOWN_CONTENT_CONTROL (FN_INSERT + 24) /* Dropdown content control */
#define FN_POSTIT (FN_INSERT + 29) /* Insert/edit PostIt */
#define FN_INSERT_TABLE (FN_INSERT + 30) /* Insert Table */
#define FN_INSERT_STRING (FN_INSERT+31)
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx
index e3debfb77bf4..09797fd00b0a 100644
--- a/sw/inc/formatcontentcontrol.hxx
+++ b/sw/inc/formatcontentcontrol.hxx
@@ -84,6 +84,8 @@ public:
void dumpAsXml(xmlTextWriterPtr pWriter) const;
+ OUString ToString() const;
+
static void ItemsToAny(const std::vector<SwContentControlListItem>& rItems,
css::uno::Any& rVal);
diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index c19ebe69fc9b..75ffb71a3441 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1430,6 +1430,7 @@
#define STR_WRAP_PANEL_CUSTOM_STR NC_("sidebarwrap|customlabel", "Custom")
#define STR_CONTENT_CONTROL_PLACEHOLDER NC_("STR_CONTENT_CONTROL_PLACEHOLDER", "Click here to enter text")
+#define STR_DROPDOWN_CONTENT_CONTROL_PLACEHOLDER NC_("STR_DROPDOWN_CONTENT_CONTROL_PLACEHOLDER", "Choose an item")
#endif