cui/source/options/connpooloptions.cxx  |   10 +++
 cui/source/options/dbregister.cxx       |    5 +
 cui/source/options/fontsubs.cxx         |   10 +++
 cui/source/options/optaccessibility.cxx |   10 +++
 cui/source/options/optasian.cxx         |   10 +++
 cui/source/options/optbasic.cxx         |   10 +++
 cui/source/options/optchart.cxx         |   10 +++
 cui/source/options/optcolor.cxx         |    5 +
 cui/source/options/optctl.cxx           |   15 ++++-
 cui/source/options/optdeepl.cxx         |    8 ++-
 cui/source/options/optfltr.cxx          |   20 ++++++-
 cui/source/options/optgdlg.cxx          |   33 ++++++++++--
 cui/source/options/optgenrl.cxx         |    5 +
 cui/source/options/opthtml.cxx          |   10 +++
 cui/source/options/optinet2.cxx         |   28 ++++++++--
 cui/source/options/optjava.cxx          |   15 ++++-
 cui/source/options/optjsearch.cxx       |   10 +++
 cui/source/options/optlanguagetool.cxx  |   13 +++--
 cui/source/options/optlingu.cxx         |    5 +
 cui/source/options/optopencl.cxx        |    5 +
 cui/source/options/optpath.cxx          |    4 +
 cui/source/options/optsave.cxx          |   10 +++
 cui/source/options/optupdt.cxx          |   15 ++++-
 cui/source/options/personalization.cxx  |    8 ++-
 cui/source/tabpages/tparea.cxx          |    5 +
 sc/source/ui/optdlg/opredlin.cxx        |    5 +
 sc/source/ui/optdlg/tpcalc.cxx          |   15 ++++-
 sc/source/ui/optdlg/tpcompatibility.cxx |    5 +
 sc/source/ui/optdlg/tpdefaults.cxx      |    5 +
 sc/source/ui/optdlg/tpformula.cxx       |   15 ++++-
 sc/source/ui/optdlg/tpprint.cxx         |   10 +++
 sc/source/ui/optdlg/tpusrlst.cxx        |   10 +++
 sc/source/ui/optdlg/tpview.cxx          |   25 +++++++--
 sd/source/ui/dlg/prntopts.cxx           |   15 ++++-
 sd/source/ui/dlg/tpoption.cxx           |   20 ++++++-
 sfx2/source/dialog/printopt.cxx         |   15 ++++-
 starmath/source/dialog.cxx              |   15 ++++-
 svx/source/dialog/optgrid.cxx           |   10 +++
 sw/source/ui/config/mailconfigpage.cxx  |   15 ++++-
 sw/source/ui/config/optcomp.cxx         |    5 +
 sw/source/ui/config/optload.cxx         |   23 ++++++--
 sw/source/ui/config/optpage.cxx         |   83 +++++++++++++++++++++++++-------
 42 files changed, 452 insertions(+), 118 deletions(-)

New commits:
commit 0eb05b47a6d89fdfc533515483584fc739962b65
Author:     Bayram Çiçek <bayramcicek2...@gmail.com>
AuthorDate: Wed Sep 20 14:37:08 2023 +0300
Commit:     Andreas Heinisch <andreas.heini...@yahoo.de>
CommitDate: Mon Sep 25 11:05:25 2023 +0200

    tdf#49895: search in Options: check if label exists (related to tdf#157266)
    
    - since ids in ui files can be changed or removed,
    we have to check if they are exits or not, to prevent
    any crash or misbehavior.
    - Proper solution will be iterating over the
    widget ids and collecting their strings without
    based on a list of identifiers.
    
    Change-Id: I2088af6842ad0acd00838a37295dc2e6140096f2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/157103
    Reviewed-by: Andreas Heinisch <andreas.heini...@yahoo.de>
    Tested-by: Andreas Heinisch <andreas.heini...@yahoo.de>

diff --git a/cui/source/options/connpooloptions.cxx 
b/cui/source/options/connpooloptions.cxx
index b13561898ab0..00101bed4fb6 100644
--- a/cui/source/options/connpooloptions.cxx
+++ b/cui/source/options/connpooloptions.cxx
@@ -165,12 +165,18 @@ namespace offapp
         OUString labels[] = { "label1", "driverslabel", "driverlabel", 
"timeoutlabel", "driver" };
 
         for (const auto& label : labels)
-            sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+        {
+            if (const auto& pString = m_xBuilder->weld_label(label))
+                sAllStrings += pString->get_label() + " ";
+        }
 
         OUString checkButton[] = { "connectionpooling", "enablepooling" };
 
         for (const auto& check : checkButton)
-            sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + 
" ";
+        {
+            if (const auto& pString = m_xBuilder->weld_check_button(check))
+                sAllStrings += pString->get_label() + " ";
+        }
 
         return sAllStrings.replaceAll("_", "");
     }
diff --git a/cui/source/options/dbregister.cxx 
b/cui/source/options/dbregister.cxx
index d1c8abb4d102..8386cc546595 100644
--- a/cui/source/options/dbregister.cxx
+++ b/cui/source/options/dbregister.cxx
@@ -133,7 +133,10 @@ std::unique_ptr<SfxTabPage> 
DbRegistrationOptionsPage::Create( weld::Container*
 
 OUString DbRegistrationOptionsPage::GetAllStrings()
 {
-    OUString sAllStrings = m_xBuilder->weld_label("label1")->get_label() + " ";
+    OUString sAllStrings;
+
+    if (const auto& pString = m_xBuilder->weld_label("label1"))
+        sAllStrings += pString->get_label() + " ";
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx
index b2fb0604dcf8..eaf00e2364dd 100644
--- a/cui/source/options/fontsubs.cxx
+++ b/cui/source/options/fontsubs.cxx
@@ -146,12 +146,18 @@ OUString SvxFontSubstTabPage::GetAllStrings()
     OUString labels[] = { "label4", "label2", "label3", "label1", "label8", 
"label9" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "usetable", "nonpropfontonly" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optaccessibility.cxx 
b/cui/source/options/optaccessibility.cxx
index e0667d51304d..f81c893673ca 100644
--- a/cui/source/options/optaccessibility.cxx
+++ b/cui/source/options/optaccessibility.cxx
@@ -54,13 +54,19 @@ OUString SvxAccessibilityOptionsTabPage::GetAllStrings()
     OUString labels[] = { "label1", "label2", "label13" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "acctool",      "textselinreadonly", 
"animatedgraphics",
                                "animatedtext", "autofontcolor",     
"systempagepreviewcolor" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optasian.cxx b/cui/source/options/optasian.cxx
index 533768d5d54b..f0e24653e823 100644
--- a/cui/source/options/optasian.cxx
+++ b/cui/source/options/optasian.cxx
@@ -148,13 +148,19 @@ OUString SvxAsianLayoutPage::GetAllStrings()
         = { "label1", "label2", "label3", "languageft", "startft", "endft", 
"hintft" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "charkerning", "charpunctkerning", 
"nocompression",
                                "punctcompression", "punctkanacompression" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     sAllStrings += m_xStandardCB->get_label() + " ";
 
diff --git a/cui/source/options/optbasic.cxx b/cui/source/options/optbasic.cxx
index dc46c8ef0f86..bbe20fd01eee 100644
--- a/cui/source/options/optbasic.cxx
+++ b/cui/source/options/optbasic.cxx
@@ -59,13 +59,19 @@ OUString SvxBasicIDEOptionsPage::GetAllStrings()
     OUString labels[] = { "label1", "label2", "label3" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "codecomplete_enable", "autocorrect",    
"autoclose_quotes",
                                "autoclose_paren",     "autoclose_proc", 
"extendedtypes_enable" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx
index 77ca75176c31..66ab40df6e22 100644
--- a/cui/source/options/optchart.cxx
+++ b/cui/source/options/optchart.cxx
@@ -149,12 +149,18 @@ OUString SvxDefaultColorOptPage::GetAllStrings()
     OUString labels[] = { "label20", "label1" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString buttons[] = { "add", "delete", "default" };
 
     for (const auto& btn : buttons)
-        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_button(btn))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optcolor.cxx b/cui/source/options/optcolor.cxx
index 0c8502a5d6e0..c8841205f3b4 100644
--- a/cui/source/options/optcolor.cxx
+++ b/cui/source/options/optcolor.cxx
@@ -807,7 +807,10 @@ OUString SvxColorOptionsTabPage::GetAllStrings()
     OUString labels[] = { "label2", "label3", "autocolor", "uielements", 
"colorsetting" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optctl.cxx b/cui/source/options/optctl.cxx
index dae4909c9973..10140c2eab50 100644
--- a/cui/source/options/optctl.cxx
+++ b/cui/source/options/optctl.cxx
@@ -64,17 +64,26 @@ OUString SvxCTLOptionsPage::GetAllStrings()
     OUString labels[] = { "label1", "label2", "label3", "label4", "label5" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "sequencechecking", "restricted", 
"typeandreplace" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "movementlogical", "movementvisual" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optdeepl.cxx b/cui/source/options/optdeepl.cxx
index b02edf84473a..ba068fe28af7 100644
--- a/cui/source/options/optdeepl.cxx
+++ b/cui/source/options/optdeepl.cxx
@@ -49,9 +49,13 @@ OUString OptDeeplTabPage::GetAllStrings()
     OUString labels[] = { "label1", "label2", "label3" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
-    sAllStrings += m_xBuilder->weld_link_button("privacy")->get_label() + " ";
+    if (const auto& pString = m_xBuilder->weld_link_button("privacy"))
+        sAllStrings += pString->get_label() + " ";
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx
index 9e636ac8c6d7..0f1df6ef6755 100644
--- a/cui/source/options/optfltr.cxx
+++ b/cui/source/options/optfltr.cxx
@@ -77,13 +77,19 @@ OUString OfaMSFilterTabPage::GetAllStrings()
     OUString labels[] = { "label1", "label2", "label3" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "wo_basic", "wo_exec",     "wo_saveorig", 
"ex_basic",
                                "ex_exec",  "ex_saveorig", "pp_basic",    
"pp_saveorig" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -178,12 +184,18 @@ OUString OfaMSFilterTabPage2::GetAllStrings()
     OUString labels[] = { "label1", "label2", "label3", "label4", "label5", 
"label6" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "highlighting", "shading" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     sAllStrings += m_xMSOLockFileCB->get_label() + " ";
 
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 22d3d75f6fcf..089580cdae49 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -225,16 +225,23 @@ OUString OfaMiscTabPage::GetAllStrings()
                           "toyear", "label7", "label8", "label9" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "exthelp",   "popupnohelp", "cbShowTipOfTheDay", "filedlg",
             "docstatus", "crashreport", "quicklaunch",       
"cbPerformFileExtCheck" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
-    sAllStrings += m_xBuilder->weld_button("assocfiles")->get_label() + " ";
+    if (const auto& pString = m_xBuilder->weld_button("assocfiles"))
+        sAllStrings += pString->get_label() + " ";
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -712,13 +719,19 @@ OUString OfaViewTabPage::GetAllStrings()
                           "label2",  "skiaenabled", "skiadisabled", "label5", 
"aafrom" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "useaccel", "useaa", "useskia", "forceskiaraster", 
"showfontpreview", "aafont" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     sAllStrings += m_xSkiaLog->get_label() + " " + m_xRunGPTests->get_label() 
+ " ";
 
@@ -1257,13 +1270,19 @@ OUString OfaLanguagesTabPage::GetAllStrings()
             "label6", "dataaccpatterns", "label2", "western",         "label3" 
};
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "decimalseparator", "asiansupport", 
"ctlsupport", "currentdoc",
                                "ignorelanguagechange" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx
index 4245ac946e5a..f22eb6467f11 100644
--- a/cui/source/options/optgenrl.cxx
+++ b/cui/source/options/optgenrl.cxx
@@ -351,7 +351,10 @@ OUString SvxGeneralTabPage::GetAllStrings()
             "faxft",      "cryptographylabel", "signingkeylabel", 
"encryptionkeylabel" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     sAllStrings += m_xUseDataCB->get_label() + " " + 
m_xEncryptToSelfCB->get_label() + " ";
 
diff --git a/cui/source/options/opthtml.cxx b/cui/source/options/opthtml.cxx
index 15e4b39fb444..379ccf253c1d 100644
--- a/cui/source/options/opthtml.cxx
+++ b/cui/source/options/opthtml.cxx
@@ -75,13 +75,19 @@ OUString OfaHtmlTabPage::GetAllStrings()
                           "size3FT", "size4FT", "size5FT", "size6FT", 
"size7FT" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "numbersenglishus", "unknowntag",     
"ignorefontnames", "starbasic",
                                "starbasicwarning", "printextension", 
"savegrflocal" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx
index 1d0ef95796bd..22cd480eb6a2 100644
--- a/cui/source/options/optinet2.cxx
+++ b/cui/source/options/optinet2.cxx
@@ -343,7 +343,10 @@ OUString SvxProxyTabPage::GetAllStrings()
                           "noproxyft", "httpportft", "httpsportft", 
"ftpportft", "noproxydesc" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -857,20 +860,28 @@ OUString SvxSecurityTabPage::GetAllStrings()
                           "label11" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "savepassword", "usemasterpassword" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     // TODO: Should we exclude button strings from the search?
     // button id: "browse" is excluded
-    OUString buttons[]
-        = { "options", "connections", "masterpassword", "macro", "cert", 
"tsas" };
+    OUString buttons[] = { "options", "connections", "masterpassword", 
"macro", "cert", "tsas" };
 
     for (const auto& btn : buttons)
-        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_button(btn))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -964,7 +975,10 @@ OUString SvxEMailTabPage::GetAllStrings()
     OUString labels[] = { "label1", "label2", "browsetitle", "suppress" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 60eba677c427..a35a6cb42130 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -473,17 +473,26 @@ OUString SvxJavaOptionsPage::GetAllStrings()
     OUString labels[] = { "label1", "label2", "javapath", "selectruntime", 
"label12" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "javaenabled", "experimental", "macrorecording" 
};
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString buttons[] = { "add", "parameters", "classpath", "expertconfig" };
 
     for (const auto& btn : buttons)
-        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_button(btn))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optjsearch.cxx 
b/cui/source/options/optjsearch.cxx
index d9f285b69c8c..3f83d602ce82 100644
--- a/cui/source/options/optjsearch.cxx
+++ b/cui/source/options/optjsearch.cxx
@@ -207,7 +207,10 @@ OUString SvxJSearchOptionsPage::GetAllStrings()
     OUString labels[] = { "label1", "label2" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "matchcase",
                                "matchfullhalfwidth",
@@ -230,7 +233,10 @@ OUString SvxJSearchOptionsPage::GetAllStrings()
                                "ignoremiddledot" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optlanguagetool.cxx 
b/cui/source/options/optlanguagetool.cxx
index 9c8cccba9054..4e1b909cc0a8 100644
--- a/cui/source/options/optlanguagetool.cxx
+++ b/cui/source/options/optlanguagetool.cxx
@@ -91,14 +91,21 @@ OUString OptLanguageToolTabPage::GetAllStrings()
                           "apikeydesc",       "restlbl",     "restdesc" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "activate", "verifyssl" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
-    sAllStrings += m_xBuilder->weld_link_button("policy")->get_label() + " ";
+    if (const auto& pString = m_xBuilder->weld_link_button("policy"))
+        sAllStrings += pString->get_label() + " ";
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx
index 6bc7d5a7e0ed..1fda06663fa8 100644
--- a/cui/source/options/optlingu.cxx
+++ b/cui/source/options/optlingu.cxx
@@ -927,7 +927,10 @@ OUString SvxLinguTabPage::GetAllStrings()
     OUString labels[] = { "lingumodulesft", "lingudictsft", "label4" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     sAllStrings += m_xMoreDictsLink->get_label() + " ";
 
diff --git a/cui/source/options/optopencl.cxx b/cui/source/options/optopencl.cxx
index 866e84302e6c..c3e154083c97 100644
--- a/cui/source/options/optopencl.cxx
+++ b/cui/source/options/optopencl.cxx
@@ -56,7 +56,10 @@ OUString SvxOpenCLTabPage::GetAllStrings()
     OUString labels[] = { "label1", "openclnotused", "openclused" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     sAllStrings += mxUseOpenCL->get_label() + " ";
 
diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx
index bb77a5f4abdc..af3df0d15e28 100644
--- a/cui/source/options/optpath.cxx
+++ b/cui/source/options/optpath.cxx
@@ -223,7 +223,9 @@ std::unique_ptr<SfxTabPage> SvxPathTabPage::Create( 
weld::Container* pPage, weld
 
 OUString SvxPathTabPage::GetAllStrings()
 {
-    OUString sAllStrings = m_xBuilder->weld_label("label1")->get_label();
+    OUString sAllStrings;
+    if (const auto& pString = m_xBuilder->weld_label("label1"))
+        sAllStrings += pString->get_label() + " ";
     return sAllStrings.replaceAll("_", "");
 }
 
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx
index 2042c9ca9205..c3c5ead06fe0 100644
--- a/cui/source/options/optsave.cxx
+++ b/cui/source/options/optsave.cxx
@@ -245,7 +245,10 @@ OUString SvxSaveTabPage::GetAllStrings()
                           "label5", "label6", "saveas_label",  
"odfwarning_label" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "load_settings", "load_docprinter", "load_anyuser",   "autosave",
@@ -253,7 +256,10 @@ OUString SvxSaveTabPage::GetAllStrings()
             "relative_fsys", "relative_inet",   "warnalienformat" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 779856fa29b5..e6bc8bdfa224 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -197,17 +197,26 @@ OUString SvxOnlineUpdateTabPage::GetAllStrings()
                           "destpathlabel", "labelagent",  "useragent_label", 
"useragent_changed" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "autocheck", "autodownload", "extrabits" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "everyday", "everyweek", "everymonth" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     // some buttons are not included
     sAllStrings += m_xPrivacyPolicyButton->get_label() + " ";
diff --git a/cui/source/options/personalization.cxx 
b/cui/source/options/personalization.cxx
index 5fe9a7db4c53..49974a90eef2 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -61,9 +61,13 @@ OUString SvxPersonalizationTabPage::GetAllStrings()
     OUString radioButton[] = { "no_persona", "default_persona" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
-    sAllStrings += m_xBuilder->weld_label("personas_label")->get_label() + " ";
+    if (const auto& pString = m_xBuilder->weld_label("personas_label"))
+        sAllStrings += pString->get_label() + " ";
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/cui/source/tabpages/tparea.cxx b/cui/source/tabpages/tparea.cxx
index 9107bace195c..fa6db41d2517 100644
--- a/cui/source/tabpages/tparea.cxx
+++ b/cui/source/tabpages/tparea.cxx
@@ -285,7 +285,10 @@ OUString SvxAreaTabPage::GetAllStrings()
                                 "btnpattern", "btnhatch", "btnusebackground" };
 
     for (const auto& toggle : toggleButton)
-        sAllStrings += m_xBuilder->weld_toggle_button(toggle)->get_label() + " 
";
+    {
+        if (const auto& pString = m_xBuilder->weld_toggle_button(toggle))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sc/source/ui/optdlg/opredlin.cxx b/sc/source/ui/optdlg/opredlin.cxx
index 4bce858b72c4..5aa904536433 100644
--- a/sc/source/ui/optdlg/opredlin.cxx
+++ b/sc/source/ui/optdlg/opredlin.cxx
@@ -64,7 +64,10 @@ OUString ScRedlineOptionsTabPage::GetAllStrings()
     OUString labels[] = { "label1", "label2", "label3", "label4", "label5" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 1188f250e0a3..356fcd9bd1fb 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -166,19 +166,28 @@ OUString ScTpCalcOptions::GetAllStrings()
         = { "label5", "label1", "precft", "label2", "stepsft", "minchangeft", 
"label4", "label3" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "case", "calc", "match", "lookup", "generalprec", "iterate", 
"threadingenabled" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "formulawildcards", "formularegex", 
"formulaliteral",
                                "datestd",          "datesc10",     "date1904" 
};
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sc/source/ui/optdlg/tpcompatibility.cxx 
b/sc/source/ui/optdlg/tpcompatibility.cxx
index d7f6269e101e..cc54635f3300 100644
--- a/sc/source/ui/optdlg/tpcompatibility.cxx
+++ b/sc/source/ui/optdlg/tpcompatibility.cxx
@@ -38,7 +38,10 @@ OUString ScTpCompatOptions::GetAllStrings()
     OUString labels[] = { "label1", "label2" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     // id "keybindings" GtkComboBoxText is not included
 
diff --git a/sc/source/ui/optdlg/tpdefaults.cxx 
b/sc/source/ui/optdlg/tpdefaults.cxx
index 275da4e3aeb2..760c029fe9af 100644
--- a/sc/source/ui/optdlg/tpdefaults.cxx
+++ b/sc/source/ui/optdlg/tpdefaults.cxx
@@ -46,7 +46,10 @@ OUString ScTpDefaultsOptions::GetAllStrings()
     OUString labels[] = { "label1", "textsheetsnumber", "textsheetprefix" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     sAllStrings += m_xEdJumboSheets->get_label() + " ";
 
diff --git a/sc/source/ui/optdlg/tpformula.cxx 
b/sc/source/ui/optdlg/tpformula.cxx
index 6313060133c7..ab8cc38c122e 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -268,17 +268,26 @@ OUString ScTpFormulaOptions::GetAllStrings()
                           "label9", "label10" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "calcdefault", "calccustom" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString buttons[] = { "reset", "details" };
 
     for (const auto& btn : buttons)
-        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_button(btn))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     // check button
     sAllStrings += mxCbEnglishFuncName->get_label() + " ";
diff --git a/sc/source/ui/optdlg/tpprint.cxx b/sc/source/ui/optdlg/tpprint.cxx
index 429928b4056a..44324ffc2aa6 100644
--- a/sc/source/ui/optdlg/tpprint.cxx
+++ b/sc/source/ui/optdlg/tpprint.cxx
@@ -87,12 +87,18 @@ OUString ScTpPrintOptions::GetAllStrings()
     OUString labels[] = { "label1", "label2" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "suppressCB", "forceBreaksCB", "printCB" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sc/source/ui/optdlg/tpusrlst.cxx b/sc/source/ui/optdlg/tpusrlst.cxx
index bce3b70b308e..128b8ea936aa 100644
--- a/sc/source/ui/optdlg/tpusrlst.cxx
+++ b/sc/source/ui/optdlg/tpusrlst.cxx
@@ -191,12 +191,18 @@ OUString ScTpUserLists::GetAllStrings()
     OUString labels[] = { "listslabel", "entrieslabel", "copyfromlabel" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString buttons[] = { "new", "discard", "add", "modify", "delete", "copy" 
};
 
     for (const auto& btn : buttons)
-        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_button(btn))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sc/source/ui/optdlg/tpview.cxx b/sc/source/ui/optdlg/tpview.cxx
index 5bb4fc54c011..a31bc5d417fc 100644
--- a/sc/source/ui/optdlg/tpview.cxx
+++ b/sc/source/ui/optdlg/tpview.cxx
@@ -101,7 +101,10 @@ OUString ScTpContentOptions::GetAllStrings()
                           "lbCursor", "label2", "objgrf_label", 
"diagram_label", "draw_label" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "formula",   "nil",          "annot",   "formulamark", "value",  
"anchor",
@@ -109,7 +112,10 @@ OUString ScTpContentOptions::GetAllStrings()
             "cbSummary", "synczoom",     "break",   "guideline" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -366,19 +372,28 @@ OUString ScTpLayoutOptions::GetAllStrings()
     OUString labels[] = { "label1", "label4", "label5", "label6", "label3" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "aligncb",   "editmodecb", 
"enter_paste_mode_cb",
                                "formatcb",  "exprefcb",   "sortrefupdatecb",
                                "markhdrcb", "replwarncb", 
"legacy_cell_selection_cb" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "alwaysrb", "requestrb", "neverrb" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sd/source/ui/dlg/prntopts.cxx b/sd/source/ui/dlg/prntopts.cxx
index 4c56e703815f..8b17ae6d59ab 100644
--- a/sd/source/ui/dlg/prntopts.cxx
+++ b/sd/source/ui/dlg/prntopts.cxx
@@ -75,20 +75,29 @@ OUString SdPrintOptions::GetAllStrings()
     OUString labels[] = { "label3", "label2", "printlbl", "contentlbl" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "frontcb", "backcb",    "papertryfrmprntrcb", 
"pagenmcb",
                                "datecb",  "timecb",    "hiddenpgcb",         
"drawingcb",
                                "notecb",  "handoutcb", "outlinecb" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "pagedefaultrb", "fittopgrb",   "tilepgrb",    
"brouchrb",
                                "defaultrb",     "grayscalerb", "blackwhiterb" 
};
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sd/source/ui/dlg/tpoption.cxx b/sd/source/ui/dlg/tpoption.cxx
index 0715a41eca8b..b1fc4bd18d55 100644
--- a/sd/source/ui/dlg/tpoption.cxx
+++ b/sd/source/ui/dlg/tpoption.cxx
@@ -125,12 +125,18 @@ OUString SdTpOptionsContents::GetAllStrings()
     OUString labels[] = { "label1" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "ruler", "dragstripes", "handlesbezier", 
"moveoutline" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -350,7 +356,10 @@ OUString SdTpOptionsMisc::GetAllStrings()
             "label5",    "label8", "widthlbl", "info1",        "heightlbl", 
"info2" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "startwithwizard", "copywhenmove", 
"backgroundback",
                                "objalwymov",      "distortcb",    
"cbCompatibility",
@@ -358,7 +367,10 @@ OUString SdTpOptionsMisc::GetAllStrings()
                                "qickedit",        "textselected" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sfx2/source/dialog/printopt.cxx b/sfx2/source/dialog/printopt.cxx
index bb8c67a7ae85..1638f4e2f08e 100644
--- a/sfx2/source/dialog/printopt.cxx
+++ b/sfx2/source/dialog/printopt.cxx
@@ -85,13 +85,19 @@ OUString SfxCommonPrintOptionsTabPage::GetAllStrings()
     OUString labels[] = { "label4", "label6", "label2", "label3", "label1", 
"label5" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "converttogray", "reducebitmaptrans", 
"reducebitmap", "reducetrans",
                                "papersize",     "paperorient",       "trans",  
      "reducegrad" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "printer",
                                "file",
@@ -104,7 +110,10 @@ OUString SfxCommonPrintOptionsTabPage::GetAllStrings()
                                "reducegradcolor" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index f06cb60bc929..c87b987660e4 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -193,18 +193,27 @@ OUString SmPrintOptionsTabPage::GetAllStrings()
     OUString labels[] = { "label4", "label5", "label1", "label6" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "title", "text", "frame", "norightspaces", "saveonlyusedsymbols", 
"autoclosebrackets" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "sizenormal", "sizescaled", "sizezoomed" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/svx/source/dialog/optgrid.cxx b/svx/source/dialog/optgrid.cxx
index ccbfe836fcb8..736c9c798827 100644
--- a/svx/source/dialog/optgrid.cxx
+++ b/svx/source/dialog/optgrid.cxx
@@ -157,14 +157,20 @@ OUString SvxGridTabPage::GetAllStrings()
             "divisionx", "label4", "divisiony", "label5",   "label8", "label9" 
};
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "usegridsnap", "gridvisible", "synchronize", "snaphelplines", 
"snapborder",
             "snapframe",   "snappoints",  "ortho",       "bigortho",      
"rotate" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sw/source/ui/config/mailconfigpage.cxx 
b/sw/source/ui/config/mailconfigpage.cxx
index 3b8a5ec45568..468d9f761d8a 100644
--- a/sw/source/ui/config/mailconfigpage.cxx
+++ b/sw/source/ui/config/mailconfigpage.cxx
@@ -137,17 +137,26 @@ OUString SwMailConfigPage::GetAllStrings()
                           "label2", "server_label",      "port_label" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "replytocb", "secure" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString buttons[] = { "serverauthentication", "test" };
 
     for (const auto& btn : buttons)
-        sAllStrings += m_xBuilder->weld_button(btn)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_button(btn))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index f28ae6af6b43..5a66f839a027 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -337,7 +337,10 @@ std::unique_ptr<SfxTabPage> 
SwCompatibilityOptPage::Create(weld::Container* pPag
 
 OUString SwCompatibilityOptPage::GetAllStrings()
 {
-    OUString sAllStrings = m_xBuilder->weld_label(u"label11")->get_label() + " 
";
+    OUString sAllStrings;
+
+    if (const auto& pString = m_xBuilder->weld_label(u"label11"))
+        sAllStrings += pString->get_label() + " ";
 
     sAllStrings += m_xDefaultPB->get_label() + " ";
 
diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx
index 558ea5dc5796..92e754113aff 100644
--- a/sw/source/ui/config/optload.cxx
+++ b/sw/source/ui/config/optload.cxx
@@ -154,18 +154,27 @@ OUString SwLoadOptPage::GetAllStrings()
                           "tablabel", "label4", "label7", "labelstandardpages" 
};
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "updatefields", "updatecharts", "usecharunit", "squaremode", 
"standardizedpageshow" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "always", "onrequest", "never" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -572,9 +581,13 @@ OUString SwCaptionOptPage::GetAllStrings()
                           "label6",         "label10",     "label3" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
-    sAllStrings += m_xBuilder->weld_check_button("applyborder")->get_label() + 
" ";
+    if (const auto& pString = m_xBuilder->weld_check_button("applyborder"))
+        sAllStrings += pString->get_label() + " ";
 
     return sAllStrings.replaceAll("_", "");
 }
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index d9b5f77bf29e..53218978286b 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -220,7 +220,10 @@ OUString SwContentOptPage::GetAllStrings()
             "hruler",      "settingslabel", "measureunitlabel", "outlinelabel" 
};
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "helplines",
                                "graphics",
@@ -239,7 +242,10 @@ OUString SwContentOptPage::GetAllStrings()
                                "suboutlinelevelsascontent" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -390,19 +396,28 @@ OUString SwAddPrinterTabPage::GetAllStrings()
     OUString labels[] = { "label2", "label10", "label1", "label5", "4" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "graphics",  "formcontrols", "background", "inblack", 
"hiddentext", "textplaceholder",
             "leftpages", "rightpages",   "brochure",   "rtl",     
"blankpages", "papertray" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "none", "only", "end", "endpage", "inmargins" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -636,7 +651,10 @@ OUString SwStdFontTabPage::GetAllStrings()
                           "heading_label", "list_label", "caption_label", 
"index_label" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     sAllStrings += m_xStandardPB->get_label() + " ";
 
@@ -1088,18 +1106,27 @@ OUString SwTableOptionsTabPage::GetAllStrings()
             "label14", "label15", "label16", "label11", "label12", "label13" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "header",        "repeatheader",     
"dontsplit",   "border",
                                "numformatting", "numfmtformatting", 
"numalignment" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "fix", "fixprop", "var" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -1342,14 +1369,20 @@ OUString SwShdwCursorOptionsTabPage::GetAllStrings()
                           "fillmode",  "lbImage",   "lbDefaultAnchor" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[]
         = { "mathbaseline", "paragraph",  "hyphens",   "spaces",       
"nonbreak",   "tabs",
             "break",        "hiddentext", "bookmarks", "cursorinprot", 
"cursoronoff" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -1727,7 +1760,10 @@ OUString SwRedlineOptionsTabPage::GetAllStrings()
                           "label5", "markpos_label", "markcolor_label" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -2124,17 +2160,26 @@ OUString SwCompareOptionsTabPage::GetAllStrings()
     OUString labels[] = { "label1", "setting" };
 
     for (const auto& label : labels)
-        sAllStrings += m_xBuilder->weld_label(label)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_label(label))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString checkButton[] = { "useRSID", "ignore", "storeRSID" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     OUString radioButton[] = { "auto", "byword", "bycharacter" };
 
     for (const auto& radio : radioButton)
-        sAllStrings += m_xBuilder->weld_radio_button(radio)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_radio_button(radio))
+            sAllStrings += pString->get_label() + " ";
+    }
 
     return sAllStrings.replaceAll("_", "");
 }
@@ -2284,9 +2329,13 @@ OUString SwTestTabPage::GetAllStrings()
                                "AutoFormatByInput" };
 
     for (const auto& check : checkButton)
-        sAllStrings += m_xBuilder->weld_check_button(check)->get_label() + " ";
+    {
+        if (const auto& pString = m_xBuilder->weld_check_button(check))
+            sAllStrings += pString->get_label() + " ";
+    }
 
-    sAllStrings += m_xBuilder->weld_label("label1")->get_label() + " ";
+    if (const auto& pString = m_xBuilder->weld_label("label1"))
+        sAllStrings += pString->get_label() + " ";
 
     return sAllStrings.replaceAll("_", "");
 }

Reply via email to