[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.2' - vcl/inc vcl/jsdialog vcl/source

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed May 13 14:04:49 UTC 2020


 vcl/inc/jsdialog/jsdialogbuilder.hxx |   24 ++++
 vcl/inc/salvtables.hxx               |  171 +++++++++++++++++++++--------------
 vcl/jsdialog/jsdialogbuilder.cxx     |   58 +++++++++++
 vcl/source/app/salvtables.cxx        |    4 
 4 files changed, 190 insertions(+), 67 deletions(-)

New commits:
commit 3e87a9dfe2763ab3eebfc7cf5b21f700b08a343f
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Feb 25 13:03:34 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed May 13 16:04:13 2020 +0200

    jsdialog: weld::ComboBox
    
    Change-Id: I672d2fd170e94e0b3e05384461983e5ae4a0ab35
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94072
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 956c3001fc22..a82732d05f5a 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -7,6 +7,7 @@
 #include <vcl/virdev.hxx>
 #include <vcl/builder.hxx>
 #include <salvtables.hxx>
+#include <vcl/combobox.hxx>
 
 class JSDialogSender
 {
@@ -31,6 +32,8 @@ public:
                                                     bool bTakeOwnership = false) override;
     virtual std::unique_ptr<weld::Entry> weld_entry(const OString& id,
                                                     bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString& id,
+                                                           bool bTakeOwnership = false) override;
 };
 
 class VCL_DLLPUBLIC JSLabel : public SalInstanceLabel, public JSDialogSender
@@ -49,4 +52,25 @@ public:
     virtual void set_text(const OUString& rText) override;
 };
 
+class VCL_DLLPUBLIC JSListBox : public SalInstanceComboBoxWithoutEdit, public JSDialogSender
+{
+public:
+    JSListBox(VclPtr<vcl::Window> aOwnedToplevel, ::ListBox* pListBox, SalInstanceBuilder* pBuilder,
+              bool bTakeOwnership);
+    virtual void insert(int pos, const OUString& rStr, const OUString* pId,
+                        const OUString* pIconName, VirtualDevice* pImageSurface) override;
+    virtual void remove(int pos) override;
+};
+
+class VCL_DLLPUBLIC JSComboBox : public SalInstanceComboBoxWithEdit, public JSDialogSender
+{
+public:
+    JSComboBox(VclPtr<vcl::Window> aOwnedToplevel, ::ComboBox* pComboBox,
+               SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+    virtual void insert(int pos, const OUString& rStr, const OUString* pId,
+                        const OUString* pIconName, VirtualDevice* pImageSurface) override;
+    virtual void remove(int pos) override;
+    virtual void set_entry_text(const OUString& rText) override;
+};
+
 #endif
\ No newline at end of file
diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx
index f9e0ebafcaba..977f8e343c99 100644
--- a/vcl/inc/salvtables.hxx
+++ b/vcl/inc/salvtables.hxx
@@ -20,73 +20,103 @@ class SalInstanceBuilder : public weld::Builder
 protected:
     std::unique_ptr<VclBuilder> m_xBuilder;
     VclPtr<vcl::Window> m_aOwnedToplevel;
+
 public:
     SalInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile);
 
     VclBuilder& get_builder() const;
 
-    virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OString &id, bool bTakeOwnership = true) override;
+    virtual std::unique_ptr<weld::MessageDialog>
+    weld_message_dialog(const OString& id, bool bTakeOwnership = true) override;
 
-    virtual std::unique_ptr<weld::Dialog> weld_dialog(const OString &id, bool bTakeOwnership = true) override;
+    virtual std::unique_ptr<weld::Dialog> weld_dialog(const OString& id,
+                                                      bool bTakeOwnership = true) override;
 
-    virtual std::unique_ptr<weld::Window> weld_window(const OString &id, bool bTakeOwnership = true) override;
+    virtual std::unique_ptr<weld::Window> weld_window(const OString& id,
+                                                      bool bTakeOwnership = true) override;
 
-    virtual std::unique_ptr<weld::Widget> weld_widget(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Widget> weld_widget(const OString& id,
+                                                      bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Container> weld_container(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Container> weld_container(const OString& id,
+                                                            bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Frame> weld_frame(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Frame> weld_frame(const OString& id,
+                                                    bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::ScrolledWindow> weld_scrolled_window(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::ScrolledWindow>
+    weld_scrolled_window(const OString& id, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Notebook> weld_notebook(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Notebook> weld_notebook(const OString& id,
+                                                          bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Button> weld_button(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Button> weld_button(const OString& id,
+                                                      bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::MenuButton> weld_menu_button(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::MenuButton>
+    weld_menu_button(const OString& id, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::ToggleButton> weld_toggle_button(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::ToggleButton>
+    weld_toggle_button(const OString& id, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::RadioButton> weld_radio_button(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::RadioButton>
+    weld_radio_button(const OString& id, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::CheckButton> weld_check_button(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::CheckButton>
+    weld_check_button(const OString& id, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Scale> weld_scale(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Scale> weld_scale(const OString& id,
+                                                    bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::ProgressBar> weld_progress_bar(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::ProgressBar>
+    weld_progress_bar(const OString& id, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Image> weld_image(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Image> weld_image(const OString& id,
+                                                    bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Entry> weld_entry(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Entry> weld_entry(const OString& id,
+                                                    bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::SpinButton> weld_spin_button(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::SpinButton>
+    weld_spin_button(const OString& id, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::MetricSpinButton> weld_metric_spin_button(const OString& id, FieldUnit eUnit,
-                                                                            bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::MetricSpinButton>
+    weld_metric_spin_button(const OString& id, FieldUnit eUnit,
+                            bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::FormattedSpinButton> weld_formatted_spin_button(const OString& id,
-                                                                                  bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::FormattedSpinButton>
+    weld_formatted_spin_button(const OString& id, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::TimeSpinButton> weld_time_spin_button(const OString& id, TimeFieldFormat eFormat,
-                                                        bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::TimeSpinButton>
+    weld_time_spin_button(const OString& id, TimeFieldFormat eFormat,
+                          bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::ComboBox> weld_combo_box(const OString& id,
+                                                           bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::EntryTreeView> weld_entry_tree_view(const OString& containerid, const OString& entryid,
-                                    const OString& treeviewid, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::EntryTreeView>
+    weld_entry_tree_view(const OString& containerid, const OString& entryid,
+                         const OString& treeviewid, bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::TreeView> weld_tree_view(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::TreeView> weld_tree_view(const OString& id,
+                                                           bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Label> weld_label(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Label> weld_label(const OString& id,
+                                                    bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::TextView> weld_text_view(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::TextView> weld_text_view(const OString& id,
+                                                           bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Expander> weld_expander(const OString &id, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::Expander> weld_expander(const OString& id,
+                                                          bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::DrawingArea> weld_drawing_area(const OString &id, const a11yref& rA11yImpl = nullptr,
-            FactoryFunction pUITestFactoryFunction = nullptr, void* pUserData = nullptr, bool bTakeOwnership = false) override;
+    virtual std::unique_ptr<weld::DrawingArea>
+    weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr,
+                      FactoryFunction pUITestFactoryFunction = nullptr, void* pUserData = nullptr,
+                      bool bTakeOwnership = false) override;
 
-    virtual std::unique_ptr<weld::Menu> weld_menu(const OString &id, bool bTakeOwnership = true) override;
+    virtual std::unique_ptr<weld::Menu> weld_menu(const OString& id,
+                                                  bool bTakeOwnership = true) override;
 
     virtual std::unique_ptr<weld::SizeGroup> create_size_group() override;
 
@@ -198,7 +228,8 @@ public:
 
     virtual void connect_key_release(const Link<const KeyEvent&, bool>& rLink) override;
 
-    virtual bool get_extents_relative_to(Widget& rRelative, int& x, int &y, int& width, int &height) override;
+    virtual bool get_extents_relative_to(Widget& rRelative, int& x, int& y, int& width,
+                                         int& height) override;
 
     virtual void grab_add() override;
 
@@ -228,7 +259,7 @@ public:
 
     virtual void help_hierarchy_foreach(const std::function<bool(const OString&)>& func) override;
 
-    virtual OUString strip_mnemonic(const OUString &rLabel) const override;
+    virtual OUString strip_mnemonic(const OUString& rLabel) const override;
 
     SystemWindow* getSystemWindow();
 };
@@ -237,8 +268,9 @@ class SalInstanceLabel : public SalInstanceWidget, public virtual weld::Label
 {
 private:
     VclPtr<FixedText> m_xLabel;
+
 public:
-    SalInstanceLabel(FixedText* pLabel, SalInstanceBuilder *pBuilder, bool bTakeOwnership);
+    SalInstanceLabel(FixedText* pLabel, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
 
     virtual void set_label(const OUString& rText) override;
 
@@ -251,8 +283,10 @@ class SalInstanceContainer : public SalInstanceWidget, public virtual weld::Cont
 {
 private:
     VclPtr<vcl::Window> m_xContainer;
+
 public:
-    SalInstanceContainer(vcl::Window* pContainer, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+    SalInstanceContainer(vcl::Window* pContainer, SalInstanceBuilder* pBuilder,
+                         bool bTakeOwnership);
     virtual void move(weld::Widget* pWidget, weld::Container* pNewParent) override;
 };
 
@@ -313,15 +347,18 @@ private:
 public:
     SalInstanceDialog(::Dialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
 
-    virtual bool runAsync(std::shared_ptr<weld::DialogController> aOwner, const std::function<void(sal_Int32)> &rEndDialogFn) override;
+    virtual bool runAsync(std::shared_ptr<weld::DialogController> aOwner,
+                          const std::function<void(sal_Int32)>& rEndDialogFn) override;
 
-    virtual void SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink) override;
+    virtual void
+    SetInstallLOKNotifierHdl(const Link<void*, vcl::ILibreOfficeKitNotifier*>& rLink) override;
 
     virtual int run() override;
 
     virtual void response(int nResponse) override;
 
-    virtual void add_button(const OUString& rText, int nResponse, const OString& rHelpId = OString()) override;
+    virtual void add_button(const OUString& rText, int nResponse,
+                            const OString& rHelpId = OString()) override;
 
     virtual weld::Button* get_widget_for_response(int nResponse) override;
 
@@ -334,10 +371,11 @@ class WeldTextFilter : public TextFilter
 {
 private:
     Link<OUString&, bool>& m_rInsertTextHdl;
+
 public:
     WeldTextFilter(Link<OUString&, bool>& rInsertTextHdl);
 
-    virtual OUString filter(const OUString &rText) override;
+    virtual OUString filter(const OUString& rText) override;
 };
 
 class SalInstanceEntry : public SalInstanceWidget, public virtual weld::Entry
@@ -350,6 +388,7 @@ private:
     DECL_LINK(ActivateHdl, Edit&, bool);
 
     WeldTextFilter m_aTextFilter;
+
 public:
     SalInstanceEntry(Edit* pEntry, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
 
@@ -365,7 +404,7 @@ public:
 
     virtual void select_region(int nStartPos, int nEndPos) override;
 
-    bool get_selection_bounds(int& rStartPos, int &rEndPos) override;
+    bool get_selection_bounds(int& rStartPos, int& rEndPos) override;
 
     virtual void set_position(int nCursorPos) override;
 
@@ -406,7 +445,8 @@ private:
     int fromField(double fValue) const;
 
 public:
-    SalInstanceSpinButton(FormattedField* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+    SalInstanceSpinButton(FormattedField* pButton, SalInstanceBuilder* pBuilder,
+                          bool bTakeOwnership);
 
     virtual int get_value() const override;
 
@@ -440,7 +480,7 @@ class SalInstanceComboBox : public SalInstanceContainer, public virtual weld::Co
 {
 protected:
     // owner for ListBox/ComboBox UserData
-    std::vector<std::unique_ptr<OUString>> m_aUserData;
+    std::vector<std::shared_ptr<OUString>> m_aUserData;
     VclPtr<vcl_type> m_xComboBox;
 
 public:
@@ -493,10 +533,7 @@ public:
         m_xComboBox->SelectEntryPos(pos);
     }
 
-    virtual OUString get_text(int pos) const override
-    {
-        return m_xComboBox->GetEntry(pos);
-    }
+    virtual OUString get_text(int pos) const override { return m_xComboBox->GetEntry(pos); }
 
     virtual OUString get_id(int pos) const override
     {
@@ -508,11 +545,12 @@ public:
 
     virtual void set_id(int row, const OUString& rId) override
     {
-        m_aUserData.emplace_back(o3tl::make_unique<OUString>(rId));
+        m_aUserData.emplace_back(std::make_unique<OUString>(rId));
         m_xComboBox->SetEntryData(row, m_aUserData.back().get());
     }
 
-    virtual void insert_vector(const std::vector<weld::ComboBoxEntry>& rItems, bool bKeepExisting) override
+    virtual void insert_vector(const std::vector<weld::ComboBoxEntry>& rItems,
+                               bool bKeepExisting) override
     {
         freeze();
         if (!bKeepExisting)
@@ -525,10 +563,7 @@ public:
         thaw();
     }
 
-    virtual int get_count() const override
-    {
-        return m_xComboBox->GetEntryCount();
-    }
+    virtual int get_count() const override { return m_xComboBox->GetEntryCount(); }
 
     virtual int find_text(const OUString& rStr) const override
     {
@@ -562,10 +597,7 @@ public:
         m_xComboBox->SetStyle(m_xComboBox->GetStyle() | WB_SORT);
     }
 
-    virtual bool get_popup_shown() const override
-    {
-        return m_xComboBox->IsInDropDown();
-    }
+    virtual bool get_popup_shown() const override { return m_xComboBox->IsInDropDown(); }
 };
 
 class SalInstanceComboBoxWithoutEdit : public SalInstanceComboBox<ListBox>
@@ -574,13 +606,15 @@ private:
     DECL_LINK(SelectHdl, ListBox&, void);
 
 public:
-    SalInstanceComboBoxWithoutEdit(ListBox* pListBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+    SalInstanceComboBoxWithoutEdit(ListBox* pListBox, SalInstanceBuilder* pBuilder,
+                                   bool bTakeOwnership);
 
     virtual OUString get_active_text() const override;
 
     virtual void remove(int pos) override;
 
-    virtual void insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) override;
+    virtual void insert(int pos, const OUString& rStr, const OUString* pId,
+                        const OUString* pIconName, VirtualDevice* pImageSurface) override;
 
     virtual void insert_separator(int pos) override;
 
@@ -607,8 +641,10 @@ private:
     DECL_LINK(ChangeHdl, Edit&, void);
     DECL_LINK(EntryActivateHdl, Edit&, bool);
     WeldTextFilter m_aTextFilter;
+
 public:
-    SalInstanceComboBoxWithEdit(::ComboBox* pComboBox, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+    SalInstanceComboBoxWithEdit(::ComboBox* pComboBox, SalInstanceBuilder* pBuilder,
+                                bool bTakeOwnership);
 
     virtual bool has_entry() const override;
 
@@ -618,7 +654,8 @@ public:
 
     virtual void remove(int pos) override;
 
-    virtual void insert(int pos, const OUString& rStr, const OUString* pId, const OUString* pIconName, VirtualDevice* pImageSurface) override;
+    virtual void insert(int pos, const OUString& rStr, const OUString* pId,
+                        const OUString* pIconName, VirtualDevice* pImageSurface) override;
 
     virtual void insert_separator(int pos) override;
 
@@ -639,9 +676,10 @@ class SalInstanceButton : public SalInstanceContainer, public virtual weld::Butt
 {
 private:
     VclPtr<::Button> m_xButton;
-    Link<::Button*,void> const m_aOldClickHdl;
+    Link<::Button*, void> const m_aOldClickHdl;
 
     DECL_LINK(ClickHdl, ::Button*, void);
+
 public:
     SalInstanceButton(::Button* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
 
@@ -697,8 +735,10 @@ class SalInstanceMessageDialog : public SalInstanceDialog, public virtual weld::
 {
 private:
     VclPtr<::MessageDialog> m_xMessageDialog;
+
 public:
-    SalInstanceMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
+    SalInstanceMessageDialog(::MessageDialog* pDialog, SalInstanceBuilder* pBuilder,
+                             bool bTakeOwnership);
 
     virtual void set_primary_text(const OUString& rText) override;
 
@@ -717,6 +757,7 @@ private:
     VclPtr<CheckBox> m_xCheckButton;
 
     DECL_LINK(ToggleHdl, CheckBox&, void);
+
 public:
     SalInstanceCheckButton(CheckBox* pButton, SalInstanceBuilder* pBuilder, bool bTakeOwnership);
 
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index fc1c7a0159e9..62fd9e16b24a 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -72,6 +72,18 @@ std::unique_ptr<weld::Entry> JSInstanceBuilder::weld_entry(const OString& id, bo
                   : nullptr;
 }
 
+std::unique_ptr<weld::ComboBox> JSInstanceBuilder::weld_combo_box(const OString& id,
+                                                                  bool bTakeOwnership)
+{
+    vcl::Window* pWidget = m_xBuilder->get<vcl::Window>(id);
+    ::ComboBox* pComboBox = dynamic_cast<::ComboBox*>(pWidget);
+    if (pComboBox)
+        return std::make_unique<JSComboBox>(m_aOwnedToplevel, pComboBox, this, bTakeOwnership);
+    ListBox* pListBox = dynamic_cast<ListBox*>(pWidget);
+    return pListBox ? std::make_unique<JSListBox>(m_aOwnedToplevel, pListBox, this, bTakeOwnership)
+                    : nullptr;
+}
+
 JSLabel::JSLabel(VclPtr<vcl::Window> aOwnedToplevel, FixedText* pLabel,
                  SalInstanceBuilder* pBuilder, bool bTakeOwnership)
     : SalInstanceLabel(pLabel, pBuilder, bTakeOwnership)
@@ -97,3 +109,49 @@ void JSEntry::set_text(const OUString& rText)
     SalInstanceEntry::set_text(rText);
     notifyDialogState();
 }
+
+JSListBox::JSListBox(VclPtr<vcl::Window> aOwnedToplevel, ::ListBox* pListBox,
+                     SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+    : SalInstanceComboBoxWithoutEdit(pListBox, pBuilder, bTakeOwnership)
+    , JSDialogSender(aOwnedToplevel)
+{
+}
+
+void JSListBox::insert(int pos, const OUString& rStr, const OUString* pId,
+                       const OUString* pIconName, VirtualDevice* pImageSurface)
+{
+    SalInstanceComboBoxWithoutEdit::insert(pos, rStr, pId, pIconName, pImageSurface);
+    notifyDialogState();
+}
+
+void JSListBox::remove(int pos)
+{
+    SalInstanceComboBoxWithoutEdit::remove(pos);
+    notifyDialogState();
+}
+
+JSComboBox::JSComboBox(VclPtr<vcl::Window> aOwnedToplevel, ::ComboBox* pComboBox,
+                       SalInstanceBuilder* pBuilder, bool bTakeOwnership)
+    : SalInstanceComboBoxWithEdit(pComboBox, pBuilder, bTakeOwnership)
+    , JSDialogSender(aOwnedToplevel)
+{
+}
+
+void JSComboBox::insert(int pos, const OUString& rStr, const OUString* pId,
+                        const OUString* pIconName, VirtualDevice* pImageSurface)
+{
+    SalInstanceComboBoxWithEdit::insert(pos, rStr, pId, pIconName, pImageSurface);
+    notifyDialogState();
+}
+
+void JSComboBox::remove(int pos)
+{
+    SalInstanceComboBoxWithEdit::remove(pos);
+    notifyDialogState();
+}
+
+void JSComboBox::set_entry_text(const OUString& rText)
+{
+    SalInstanceComboBoxWithEdit::set_entry_text(rText);
+    notifyDialogState();
+}
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index fb8d1a9b8354..4700e7acc73f 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -2922,7 +2922,7 @@ void SalInstanceComboBoxWithoutEdit::insert(int pos, const OUString& rStr, const
         nInsertedAt = m_xComboBox->InsertEntry(rStr, createImage(*pImageSurface), nInsertPos);
     if (pId)
     {
-        m_aUserData.emplace_back(o3tl::make_unique<OUString>(*pId));
+        m_aUserData.emplace_back(std::make_unique<OUString>(*pId));
         m_xComboBox->SetEntryData(nInsertedAt, m_aUserData.back().get());
     }
 }
@@ -3023,7 +3023,7 @@ void SalInstanceComboBoxWithEdit::insert(int pos, const OUString& rStr, const OU
         nInsertedAt = m_xComboBox->InsertEntryWithImage(rStr, createImage(*pImageSurface), nInsertPos);
     if (pId)
     {
-        m_aUserData.emplace_back(o3tl::make_unique<OUString>(*pId));
+        m_aUserData.emplace_back(std::make_unique<OUString>(*pId));
         m_xComboBox->SetEntryData(nInsertedAt, m_aUserData.back().get());
     }
 }


More information about the Libreoffice-commits mailing list