summaryrefslogtreecommitdiff
path: root/sw/source/ui/config/mailconfigpage.cxx
diff options
context:
space:
mode:
authorBayram Çiçek <bayramcicek2125@gmail.com>2023-09-20 14:37:08 +0300
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2023-09-25 11:05:25 +0200
commit0eb05b47a6d89fdfc533515483584fc739962b65 (patch)
treea2a3d0e2708999e1865eb0ba56ecfb3836aa4f28 /sw/source/ui/config/mailconfigpage.cxx
parenta499a3f2486b44c8b1918e69490f9d26bdb0e1f5 (diff)
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.heinisch@yahoo.de> Tested-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'sw/source/ui/config/mailconfigpage.cxx')
-rw-r--r--sw/source/ui/config/mailconfigpage.cxx15
1 files changed, 12 insertions, 3 deletions
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("_", "");
}