diff options
author | Justin Luth <jluth@mail.com> | 2022-11-28 14:16:57 -0500 |
---|---|---|
committer | Justin Luth <jluth@mail.com> | 2022-12-01 21:26:49 +0100 |
commit | 64ad923652a11dc68a93f41044df9719c15dec86 (patch) | |
tree | 94487586b0c4cebeb9f1516253e5909f7ae39318 /sw/inc | |
parent | d7e80e272a83f960b06521595bd494f2dc84038a (diff) |
tdf#151548 ContentControls: improve GetSelectedListItem
Before there was only an option to get the temporarily
selected list item that had not yet been committed to text.
Add a function that checks whether there is a valid
selected item, regardless of whether it has been
written out or not.
Change-Id: I1199bdccd2e665089750eefa5c3a445d56935556
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143420
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Diffstat (limited to 'sw/inc')
-rw-r--r-- | sw/inc/formatcontentcontrol.hxx | 4 | ||||
-rw-r--r-- | sw/inc/textcontentcontrol.hxx | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sw/inc/formatcontentcontrol.hxx b/sw/inc/formatcontentcontrol.hxx index 88d32e83d31a..94399d6818e8 100644 --- a/sw/inc/formatcontentcontrol.hxx +++ b/sw/inc/formatcontentcontrol.hxx @@ -306,6 +306,10 @@ public: const std::optional<size_t>& GetSelectedListItem() const { return m_oSelectedListItem; } + /// Get a copy of selected list item's index, + /// potentially even if the selection is already written out to text (i.e. validated). + std::optional<size_t> GetSelectedListItem(bool bCheckDocModel) const; + void SetSelectedDate(std::optional<double> oSelectedDate) { m_oSelectedDate = oSelectedDate; } const std::optional<double>& GetSelectedDate() const { return m_oSelectedDate; } diff --git a/sw/inc/textcontentcontrol.hxx b/sw/inc/textcontentcontrol.hxx index 8c8a3b3ee044..a9bc4e4a1054 100644 --- a/sw/inc/textcontentcontrol.hxx +++ b/sw/inc/textcontentcontrol.hxx @@ -42,6 +42,8 @@ public: void ChgTextNode(SwTextNode* pNode); SwTextNode* GetTextNode() const; + /// Get the current (potentially invalid) string from the doc + OUString ToString() const; void Invalidate(); void dumpAsXml(xmlTextWriterPtr pWriter) const override; |