diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2022-05-06 13:48:46 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2022-05-06 15:17:34 +0200 |
commit | 9ca44e925a8e06e0946fa9e7bd80cfdbfbb83c62 (patch) | |
tree | e045267ac4d0233ad2727568c468d8b385885a37 /sw/inc | |
parent | d357c9fdf9581ba27314dbf6c2433cbdd3e3b602 (diff) |
sw content controls, drop-down: select list item on click
- remember the selected list item in
SwDropDownContentControlButton::ListBoxHandler()
- extend SwWrtShell::GotoContentControl() to update the document text,
somewhat similar to how checkboxes are already handled
- improve SwSelPaintRects::HighlightContentControl():
- re-create the vcl widget in case a different content control was
selected
- adjust position/size and re-show the dropdown button after selecting
an item + doc text was updated
Change-Id: Id3b89b6132697bfec7046caeb1f0c5fe93e99b37
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133915
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/formatcontentcontrol.hxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx index c25036fc5d15..e3debfb77bf4 100644 --- a/sw/inc/formatcontentcontrol.hxx +++ b/sw/inc/formatcontentcontrol.hxx @@ -117,6 +117,9 @@ class SAL_DLLPUBLIC_RTTI SwContentControl : public sw::BroadcastingModify std::vector<SwContentControlListItem> m_aListItems; + /// Stores a list item index, in case the doc model is not yet updated. + std::optional<size_t> m_oSelectedListItem; + public: SwTextContentControl* GetTextAttr() const; @@ -176,6 +179,13 @@ public: m_aListItems = rListItems; } + void SetSelectedListItem(std::optional<size_t> oSelectedListItem) + { + m_oSelectedListItem = oSelectedListItem; + } + + std::optional<size_t> GetSelectedListItem() const { return m_oSelectedListItem; } + virtual void dumpAsXml(xmlTextWriterPtr pWriter) const; }; |