[Libreoffice-commits] core.git: Branch 'libreoffice-6-4' - basic/source include/vcl vcl/source vcl/unx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Wed Sep 9 09:14:40 UTC 2020


 basic/source/runtime/methods.cxx |    3 +--
 include/vcl/vclenum.hxx          |    3 ++-
 vcl/source/window/layout.cxx     |    9 ++++++++-
 vcl/unx/gtk3/gtk3gtkinst.cxx     |    3 +++
 4 files changed, 14 insertions(+), 4 deletions(-)

New commits:
commit 03843109282186b036c6525fae513233983708fc
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Tue Sep 8 11:17:45 2020 +0100
Commit:     Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Wed Sep 9 11:14:05 2020 +0200

    tdf#134477 add VclMessageType::Other to indicate image-less generic InfoBox
    
    Change-Id: I76e86bf4d82b33771ea2900517712be57ae7f03d
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102130
    Tested-by: Jenkins
    Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>

diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index e2ed754122c6..30ad9dc10188 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -4402,7 +4402,7 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool)
     vcl::Window* pParentWin = Application::GetDefDialogParent();
     weld::Widget* pParent = pParentWin ? pParentWin->GetFrameWeld() : nullptr;
 
-    VclMessageType eType = VclMessageType::Info;
+    VclMessageType eType = VclMessageType::Other;
 
     switch (nDialogType)
     {
@@ -4416,7 +4416,6 @@ void SbRtl_MsgBox(StarBASIC *, SbxArray & rPar, bool)
             eType = VclMessageType::Warning;
             break;
         case 64:
-        default:
             eType = VclMessageType::Info;
             break;
     }
diff --git a/include/vcl/vclenum.hxx b/include/vcl/vclenum.hxx
index 3ae12c0373f7..9d4091be23c9 100644
--- a/include/vcl/vclenum.hxx
+++ b/include/vcl/vclenum.hxx
@@ -258,7 +258,8 @@ enum class VclMessageType
     Info,
     Warning,
     Question,
-    Error
+    Error,
+    Other
 };
 
 enum class VclSizeGroupMode
diff --git a/vcl/source/window/layout.cxx b/vcl/source/window/layout.cxx
index 9c5a36304a21..a9f23d661caa 100644
--- a/vcl/source/window/layout.cxx
+++ b/vcl/source/window/layout.cxx
@@ -2071,11 +2071,13 @@ void MessageDialog::create_message_area()
             case VclMessageType::Error:
                 m_pImage->SetImage(GetStandardErrorBoxImage());
                 break;
+            case VclMessageType::Other:
+                break;
         }
         m_pImage->set_grid_left_attach(0);
         m_pImage->set_grid_top_attach(0);
         m_pImage->set_valign(VclAlign::Start);
-        m_pImage->Show();
+        m_pImage->Show(m_eMessageType != VclMessageType::Other);
 
         WinBits nWinStyle = WB_CLIPCHILDREN | WB_LEFT | WB_VCENTER | WB_NOLABEL | WB_NOTABSTOP;
 
@@ -2227,6 +2229,9 @@ MessageDialog::MessageDialog(vcl::Window* pParent,
         case VclMessageType::Error:
             SetText(GetStandardErrorBoxText());
             break;
+        case VclMessageType::Other:
+            SetText(Application::GetDisplayName());
+            break;
     }
 }
 
@@ -2296,6 +2301,8 @@ bool MessageDialog::set_property(const OString &rKey, const OUString &rValue)
             eMode = VclMessageType::Question;
         else if (rValue == "error")
             eMode = VclMessageType::Error;
+        else if (rValue == "other")
+            eMode = VclMessageType::Other;
         else
         {
             SAL_WARN("vcl.layout", "unknown message type mode" << rValue);
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 6faad1ddf9c3..c9d66e1ac7f7 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -5007,6 +5007,9 @@ static GtkMessageType VclToGtk(VclMessageType eType)
         case VclMessageType::Error:
             eRet = GTK_MESSAGE_ERROR;
             break;
+        case VclMessageType::Other:
+            eRet = GTK_MESSAGE_OTHER;
+            break;
     }
     return eRet;
 }


More information about the Libreoffice-commits mailing list