summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-04-18 08:28:56 +0200
committerStephan Bergmann <sbergman@redhat.com>2018-04-18 08:31:44 +0200
commit200aa825c8905a7f5e636301fc0d3b0c39793e4e (patch)
tree5390a6a5480c068313643978c4420044e14401d9 /vcl
parent606852089e32a2065ee5fc3224f7b2940e6b1323 (diff)
Translate::GetReadStringHook() may be null
e.g., during CppunitTest_sc_screenshots Change-Id: I71bd617df629dab57c73252db0e46ab51eee2a18
Diffstat (limited to 'vcl')
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx24
1 files changed, 15 insertions, 9 deletions
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 640f14a3c8ef..f18ea71869de 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -4119,26 +4119,32 @@ private:
if (GTK_IS_BUTTON(pWidget))
{
GtkButton* pButton = GTK_BUTTON(pWidget);
- set_label(pButton, (*m_pStringReplace)(get_label(pButton)));
+ if (m_pStringReplace != nullptr) {
+ set_label(pButton, (*m_pStringReplace)(get_label(pButton)));
+ }
if (gtk_button_get_use_underline(pButton))
m_aMnemonicButtons.push_back(pButton);
}
else if (GTK_IS_LABEL(pWidget))
{
GtkLabel* pLabel = GTK_LABEL(pWidget);
- set_label(pLabel, (*m_pStringReplace)(get_label(pLabel)));
+ if (m_pStringReplace != nullptr) {
+ set_label(pLabel, (*m_pStringReplace)(get_label(pLabel)));
+ }
if (gtk_label_get_use_underline(pLabel))
m_aMnemonicLabels.push_back(pLabel);
}
else if (GTK_IS_WINDOW(pWidget))
{
- GtkWindow* pWindow = GTK_WINDOW(pWidget);
- set_title(pWindow, (*m_pStringReplace)(get_title(pWindow)));
- if (GTK_IS_MESSAGE_DIALOG(pWindow))
- {
- GtkMessageDialog* pMessageDialog = GTK_MESSAGE_DIALOG(pWindow);
- set_primary_text(pMessageDialog, (*m_pStringReplace)(get_primary_text(pMessageDialog)));
- set_secondary_text(pMessageDialog, (*m_pStringReplace)(get_secondary_text(pMessageDialog)));
+ if (m_pStringReplace != nullptr) {
+ GtkWindow* pWindow = GTK_WINDOW(pWidget);
+ set_title(pWindow, (*m_pStringReplace)(get_title(pWindow)));
+ if (GTK_IS_MESSAGE_DIALOG(pWindow))
+ {
+ GtkMessageDialog* pMessageDialog = GTK_MESSAGE_DIALOG(pWindow);
+ set_primary_text(pMessageDialog, (*m_pStringReplace)(get_primary_text(pMessageDialog)));
+ set_secondary_text(pMessageDialog, (*m_pStringReplace)(get_secondary_text(pMessageDialog)));
+ }
}
}
}