diff options
Diffstat (limited to 'include/vcl/weld.hxx')
-rw-r--r-- | include/vcl/weld.hxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 5a9ee5a92f39..93ba45794500 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -564,6 +564,7 @@ class VCL_DLLPUBLIC ComboBox : virtual public Container { private: OUString m_sSavedValue; + std::vector<OUString> m_aSavedValues; protected: Link<ComboBox&, void> m_aChangeHdl; @@ -597,6 +598,10 @@ public: { insert(-1, rStr, &rId, nullptr, &rImage); } + void append(int pos, const OUString& rId, const OUString& rStr) + { + insert(pos, rStr, &rId, nullptr, nullptr); + } virtual void insert_separator(int pos, const OUString& rId) = 0; void append_separator(const OUString& rId) { insert_separator(-1, rId); } @@ -651,8 +656,20 @@ public: void connect_entry_activate(const Link<ComboBox&, bool>& rLink) { m_aEntryActivateHdl = rLink; } void save_value() { m_sSavedValue = get_active_text(); } + void save_values_by_id(const OUString& rId) + { + m_aSavedValues.push_back(get_text(find_id(rId))); + } OUString const& get_saved_value() const { return m_sSavedValue; } + OUString const& get_saved_values(int pos) const { return m_aSavedValues[pos]; } bool get_value_changed_from_saved() const { return m_sSavedValue != get_active_text(); } + bool get_values_changed_from_saved() const + { + return !m_aSavedValues.empty() + && std::find(m_aSavedValues.begin(), m_aSavedValues.end(), get_active_text()) + == m_aSavedValues.end(); + } + void removeSavedValues() { m_aSavedValues.clear(); } }; class VCL_DLLPUBLIC TreeIter |