[Libreoffice-commits] core.git: vcl/unx
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Sat Oct 19 19:06:48 UTC 2019
vcl/unx/gtk3/gtk3gtkinst.cxx | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
New commits:
commit feb21e498afa8d6fd12a82fb56a2456b2db83e24
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sat Oct 19 17:20:23 2019 +0100
Commit: Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Oct 19 21:05:58 2019 +0200
Resolves: tdf#128241 reuse label to retain buildable_name
Change-Id: Ib5cb31279fdf6e2fa83ea46625c320185992bca1
Reviewed-on: https://gerrit.libreoffice.org/81136
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 0d8f4d30b7c1..0b93a5a3f270 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -5370,7 +5370,21 @@ private:
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());
+ OString sUtf8(rText.toUtf8());
+
+ GtkWidget* pPage = gtk_notebook_get_nth_page(pNotebook, nPage);
+
+ // tdf#128241 if there's already a label here, reuse it so the buildable
+ // name remains the same, gtk_notebook_set_tab_label_text will replace
+ // the label widget with a new one
+ GtkWidget* pTabWidget = gtk_notebook_get_tab_label(pNotebook, pPage);
+ if (pTabWidget && GTK_IS_LABEL(pTabWidget))
+ {
+ gtk_label_set_label(GTK_LABEL(pTabWidget), sUtf8.getStr());
+ return;
+ }
+
+ gtk_notebook_set_tab_label_text(pNotebook, pPage, sUtf8.getStr());
}
void append_useless_page(GtkNotebook *pNotebook)
More information about the Libreoffice-commits
mailing list