summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-07-16 10:26:19 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-07-16 13:43:28 +0200
commit5cc423efe304edc20ec92e126bf9ff9e285906b7 (patch)
tree6f06f1b638bfe5cffb0736d798fa38ab368ddfe7
parent140d9b832621df291ad58bdb85fd85465b2a6257 (diff)
move freeze/thaw to Widget
Change-Id: I3944092c26ca81028912f6fb206b148b49e4f172 Reviewed-on: https://gerrit.libreoffice.org/57489 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--include/vcl/weld.hxx9
-rw-r--r--vcl/source/app/salvtables.cxx30
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx18
3 files changed, 27 insertions, 30 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index a7f2ab8d0543..fe391c8e26d4 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -103,6 +103,9 @@ public:
virtual bool get_direction() const = 0;
virtual void set_direction(bool bRTL) = 0;
+ virtual void freeze() = 0;
+ virtual void thaw() = 0;
+
virtual Container* weld_parent() const = 0;
virtual ~Widget() {}
@@ -277,9 +280,6 @@ public:
virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) = 0;
virtual void set_entry_completion(bool bEnable) = 0;
- virtual void freeze() = 0;
- virtual void thaw() = 0;
-
void connect_entry_activate(const Link<ComboBoxText&, void>& rLink)
{
m_aEntryActivateHdl = rLink;
@@ -313,9 +313,6 @@ public:
virtual void clear() = 0;
virtual int get_height_rows(int nRows) const = 0;
- virtual void freeze() = 0;
- virtual void thaw() = 0;
-
virtual void set_selection_mode(bool bMultiple) = 0;
virtual int count_selected_rows() const = 0;
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 3921b850db8b..0b2535414c32 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -393,6 +393,16 @@ public:
m_xWidget->EnableRTL(bRTL);
}
+ virtual void freeze() override
+ {
+ m_xWidget->SetUpdateMode(false);
+ }
+
+ virtual void thaw() override
+ {
+ m_xWidget->SetUpdateMode(true);
+ }
+
virtual weld::Container* weld_parent() const override;
virtual ~SalInstanceWidget() override
@@ -1583,16 +1593,6 @@ public:
return nRet;
}
- virtual void freeze() override
- {
- m_xTreeView->SetUpdateMode(false);
- }
-
- virtual void thaw() override
- {
- m_xTreeView->SetUpdateMode(true);
- }
-
virtual void set_selection_mode(bool bMultiple) override
{
m_xTreeView->EnableMultiSelection(bMultiple);
@@ -2117,16 +2117,6 @@ public:
m_xComboBoxText->SetStyle(m_xComboBoxText->GetStyle() | WB_SORT);
}
- virtual void freeze() override
- {
- m_xComboBoxText->SetUpdateMode(false);
- }
-
- virtual void thaw() override
- {
- m_xComboBoxText->SetUpdateMode(true);
- }
-
virtual ~SalInstanceComboBoxText() override
{
clear();
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 40e43df22ae0..f890a4f0c862 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1462,6 +1462,16 @@ public:
gtk_widget_set_direction(m_pWidget, bRTL ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR);
}
+ virtual void freeze() override
+ {
+ gtk_widget_freeze_child_notify(m_pWidget);
+ }
+
+ virtual void thaw() override
+ {
+ gtk_widget_thaw_child_notify(m_pWidget);
+ }
+
virtual ~GtkInstanceWidget() override
{
if (m_nFocusInSignalId)
@@ -3742,7 +3752,7 @@ public:
{
disable_notify_events();
g_object_ref(m_pListStore);
- gtk_widget_freeze_child_notify(GTK_WIDGET(m_pTreeView));
+ GtkInstanceContainer::freeze();
gtk_tree_view_set_model(m_pTreeView, nullptr);
enable_notify_events();
}
@@ -3751,7 +3761,7 @@ public:
{
disable_notify_events();
gtk_tree_view_set_model(m_pTreeView, GTK_TREE_MODEL(m_pListStore));
- gtk_widget_thaw_child_notify(GTK_WIDGET(m_pTreeView));
+ GtkInstanceContainer::thaw();
g_object_unref(m_pListStore);
enable_notify_events();
}
@@ -4759,7 +4769,7 @@ public:
virtual void freeze() override
{
- gtk_widget_freeze_child_notify(GTK_WIDGET(m_pComboBoxText));
+ GtkInstanceContainer::freeze();
if (m_xSorter)
{
GtkTreeModel* pModel = gtk_combo_box_get_model(GTK_COMBO_BOX(m_pComboBoxText));
@@ -4776,7 +4786,7 @@ public:
GtkTreeSortable* pSortable = GTK_TREE_SORTABLE(pModel);
gtk_tree_sortable_set_sort_column_id(pSortable, 0, GTK_SORT_ASCENDING);
}
- gtk_widget_thaw_child_notify(GTK_WIDGET(m_pComboBoxText));
+ GtkInstanceContainer::thaw();
}
virtual ~GtkInstanceComboBoxText() override