diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-10-01 10:20:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-02 20:28:28 +0200 |
commit | bab77fcf8b80594fb49561254dfbaea381da8934 (patch) | |
tree | be5deb3285355ea8df73f4eb10f0a83a889754e0 /vcl/unx | |
parent | 21c00be1677638fc18e30425658ac7c1a6fe541c (diff) |
weld PrintDialog
Change-Id: Id4adbe484f88be74f45dab8e7ef426c66e5cbc8b
Reviewed-on: https://gerrit.libreoffice.org/80002
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 60 |
1 files changed, 40 insertions, 20 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 7b5356bee72e..7e4741f1440f 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -5024,26 +5024,6 @@ private: return OString(pStr, pStr ? strlen(pStr) : 0); } - OString get_page_ident(int nPage) const - { - auto nMainLen = gtk_notebook_get_n_pages(m_pNotebook); - auto nOverFlowLen = m_bOverFlowBoxActive ? gtk_notebook_get_n_pages(m_pOverFlowNotebook) - 1 : 0; - if (m_bOverFlowBoxIsStart) - { - if (nPage < nOverFlowLen) - return get_page_ident(m_pOverFlowNotebook, nPage); - nPage -= nOverFlowLen; - return get_page_ident(m_pNotebook, nPage); - } - else - { - if (nPage < nMainLen) - return get_page_ident(m_pNotebook, nPage); - nPage -= nMainLen; - return get_page_ident(m_pOverFlowNotebook, nPage); - } - } - static gint get_page_number(GtkNotebook *pNotebook, const OString& rIdent) { gint nPages = gtk_notebook_get_n_pages(pNotebook); @@ -5070,6 +5050,11 @@ private: return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8); } + static void set_tab_label_text(GtkNotebook *pNotebook, guint nPage, const OUString& rText) + { + gtk_notebook_set_tab_label_text(pNotebook, gtk_notebook_get_nth_page(pNotebook, nPage), rText.toUtf8().getStr()); + } + void append_useless_page(GtkNotebook *pNotebook) { disable_notify_events(); @@ -5381,6 +5366,26 @@ public: return nPage; } + virtual OString get_page_ident(int nPage) const override + { + auto nMainLen = gtk_notebook_get_n_pages(m_pNotebook); + auto nOverFlowLen = m_bOverFlowBoxActive ? gtk_notebook_get_n_pages(m_pOverFlowNotebook) - 1 : 0; + if (m_bOverFlowBoxIsStart) + { + if (nPage < nOverFlowLen) + return get_page_ident(m_pOverFlowNotebook, nPage); + nPage -= nOverFlowLen; + return get_page_ident(m_pNotebook, nPage); + } + else + { + if (nPage < nMainLen) + return get_page_ident(m_pNotebook, nPage); + nPage -= nMainLen; + return get_page_ident(m_pOverFlowNotebook, nPage); + } + } + virtual OString get_current_page_ident() const override { return get_page_ident(get_current_page()); @@ -5475,6 +5480,21 @@ public: return OUString(); } + virtual void set_tab_label_text(const OString& rIdent, const OUString& rText) override + { + gint nPageNum = get_page_number(m_pNotebook, rIdent); + if (nPageNum != -1) + { + set_tab_label_text(m_pNotebook, nPageNum, rText); + return; + } + nPageNum = get_page_number(m_pOverFlowNotebook, rIdent); + if (nPageNum != -1) + { + set_tab_label_text(m_pOverFlowNotebook, nPageNum, rText); + } + } + virtual void disable_notify_events() override { g_signal_handler_block(m_pNotebook, m_nSwitchPageSignalId); |