vcl/source/window/dialog.cxx |   13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 762f76d721b9828222df327a3a5b45182d75f310
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sat Jul 26 07:43:22 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Jul 29 05:57:57 2025 +0200

    vcl: Drop unnecessary OUString -> OString conversion
    
    Change-Id: I3b1f33c5293890b202a957664ef37aa9d33efdb2
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188384
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 3a494b40a884..f5d52cd8e9f6 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -70,7 +70,7 @@
 #include <utility>
 #include <vector>
 
-static OString ImplGetDialogText( Dialog* pDialog )
+static OUString ImplGetDialogText(Dialog* pDialog)
 {
     OUString aErrorStr(pDialog->GetText());
 
@@ -81,7 +81,7 @@ static OString ImplGetDialogText( Dialog* pDialog )
             aErrorStr += ", " + sMessage;
     }
 
-    return OUStringToOString(aErrorStr, RTL_TEXTENCODING_UTF8);
+    return aErrorStr;
 }
 
 static bool ImplIsMnemonicCtrl( vcl::Window* pWindow )
commit b5ac3b4482940d4e3baa91bb7e3a5a5614e364a6
Author:     Michael Weghorn <m.wegh...@posteo.de>
AuthorDate: Sat Jul 26 07:40:18 2025 +0200
Commit:     Michael Weghorn <m.wegh...@posteo.de>
CommitDate: Tue Jul 29 05:57:49 2025 +0200

    vcl: Move conditional logic into relevant if block
    
    `sMessage` can only be non-empty in the MessageDialog
    case, so move the logic into the corresponding if block.
    
    Change-Id: I0aee4b072c19209182f4111678d0cb8393f75081
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188383
    Tested-by: Jenkins
    Reviewed-by: Michael Weghorn <m.wegh...@posteo.de>

diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index 8c980ddd36b2..3a494b40a884 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -74,16 +74,13 @@ static OString ImplGetDialogText( Dialog* pDialog )
 {
     OUString aErrorStr(pDialog->GetText());
 
-    OUString sMessage;
     if (MessageDialog* pMessDialog = dynamic_cast<MessageDialog*>(pDialog))
     {
-        sMessage = pMessDialog->get_primary_text();
+        const OUString sMessage = pMessDialog->get_primary_text();
+        if (!sMessage.isEmpty())
+            aErrorStr += ", " + sMessage;
     }
 
-    if (!sMessage.isEmpty())
-    {
-        aErrorStr += ", " + sMessage;
-    }
     return OUStringToOString(aErrorStr, RTL_TEXTENCODING_UTF8);
 }
 

Reply via email to