Kaydet (Commit) 5cc423ef authored tarafından Caolán McNamara's avatar Caolán McNamara

move freeze/thaw to Widget

Change-Id: I3944092c26ca81028912f6fb206b148b49e4f172
Reviewed-on: https://gerrit.libreoffice.org/57489
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 140d9b83
...@@ -103,6 +103,9 @@ public: ...@@ -103,6 +103,9 @@ public:
virtual bool get_direction() const = 0; virtual bool get_direction() const = 0;
virtual void set_direction(bool bRTL) = 0; virtual void set_direction(bool bRTL) = 0;
virtual void freeze() = 0;
virtual void thaw() = 0;
virtual Container* weld_parent() const = 0; virtual Container* weld_parent() const = 0;
virtual ~Widget() {} virtual ~Widget() {}
...@@ -277,9 +280,6 @@ public: ...@@ -277,9 +280,6 @@ public:
virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) = 0; virtual bool get_entry_selection_bounds(int& rStartPos, int& rEndPos) = 0;
virtual void set_entry_completion(bool bEnable) = 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) void connect_entry_activate(const Link<ComboBoxText&, void>& rLink)
{ {
m_aEntryActivateHdl = rLink; m_aEntryActivateHdl = rLink;
...@@ -313,9 +313,6 @@ public: ...@@ -313,9 +313,6 @@ public:
virtual void clear() = 0; virtual void clear() = 0;
virtual int get_height_rows(int nRows) const = 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 void set_selection_mode(bool bMultiple) = 0;
virtual int count_selected_rows() const = 0; virtual int count_selected_rows() const = 0;
......
...@@ -393,6 +393,16 @@ public: ...@@ -393,6 +393,16 @@ public:
m_xWidget->EnableRTL(bRTL); 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 weld::Container* weld_parent() const override;
virtual ~SalInstanceWidget() override virtual ~SalInstanceWidget() override
...@@ -1583,16 +1593,6 @@ public: ...@@ -1583,16 +1593,6 @@ public:
return nRet; 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 virtual void set_selection_mode(bool bMultiple) override
{ {
m_xTreeView->EnableMultiSelection(bMultiple); m_xTreeView->EnableMultiSelection(bMultiple);
...@@ -2117,16 +2117,6 @@ public: ...@@ -2117,16 +2117,6 @@ public:
m_xComboBoxText->SetStyle(m_xComboBoxText->GetStyle() | WB_SORT); 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 virtual ~SalInstanceComboBoxText() override
{ {
clear(); clear();
......
...@@ -1462,6 +1462,16 @@ public: ...@@ -1462,6 +1462,16 @@ public:
gtk_widget_set_direction(m_pWidget, bRTL ? GTK_TEXT_DIR_RTL : GTK_TEXT_DIR_LTR); 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 virtual ~GtkInstanceWidget() override
{ {
if (m_nFocusInSignalId) if (m_nFocusInSignalId)
...@@ -3742,7 +3752,7 @@ public: ...@@ -3742,7 +3752,7 @@ public:
{ {
disable_notify_events(); disable_notify_events();
g_object_ref(m_pListStore); g_object_ref(m_pListStore);
gtk_widget_freeze_child_notify(GTK_WIDGET(m_pTreeView)); GtkInstanceContainer::freeze();
gtk_tree_view_set_model(m_pTreeView, nullptr); gtk_tree_view_set_model(m_pTreeView, nullptr);
enable_notify_events(); enable_notify_events();
} }
...@@ -3751,7 +3761,7 @@ public: ...@@ -3751,7 +3761,7 @@ public:
{ {
disable_notify_events(); disable_notify_events();
gtk_tree_view_set_model(m_pTreeView, GTK_TREE_MODEL(m_pListStore)); 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); g_object_unref(m_pListStore);
enable_notify_events(); enable_notify_events();
} }
...@@ -4759,7 +4769,7 @@ public: ...@@ -4759,7 +4769,7 @@ public:
virtual void freeze() override virtual void freeze() override
{ {
gtk_widget_freeze_child_notify(GTK_WIDGET(m_pComboBoxText)); GtkInstanceContainer::freeze();
if (m_xSorter) if (m_xSorter)
{ {
GtkTreeModel* pModel = gtk_combo_box_get_model(GTK_COMBO_BOX(m_pComboBoxText)); GtkTreeModel* pModel = gtk_combo_box_get_model(GTK_COMBO_BOX(m_pComboBoxText));
...@@ -4776,7 +4786,7 @@ public: ...@@ -4776,7 +4786,7 @@ public:
GtkTreeSortable* pSortable = GTK_TREE_SORTABLE(pModel); GtkTreeSortable* pSortable = GTK_TREE_SORTABLE(pModel);
gtk_tree_sortable_set_sort_column_id(pSortable, 0, GTK_SORT_ASCENDING); 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 virtual ~GtkInstanceComboBoxText() override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment