[Libreoffice-commits] core.git: include/vcl vcl/source

Arnaud Versini arnaud.versini at gmail.com
Sun Jun 12 18:29:30 UTC 2016


 include/vcl/msgbox.hxx       |   10 ------
 vcl/source/window/msgbox.cxx |   63 +++++++++++--------------------------------
 2 files changed, 17 insertions(+), 56 deletions(-)

New commits:
commit 4ccc83fb257faabf8b36d585629a0b08e6404059
Author: Arnaud Versini <arnaud.versini at gmail.com>
Date:   Sun Jun 12 15:42:19 2016 +0200

    VCL: Simplify MessBox and its children initialisation.
    
    Change-Id: Icf24af615e6020b40f92f565194b2328e99f47ad
    Reviewed-on: https://gerrit.libreoffice.org/26199
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
index 5ac566f..802da7d 100644
--- a/include/vcl/msgbox.hxx
+++ b/include/vcl/msgbox.hxx
@@ -41,7 +41,6 @@ protected:
     OUString                   maCheckBoxText;
     bool                       mbCheck;
 
-    SAL_DLLPRIVATE void ImplInitMessBoxData();
     SAL_DLLPRIVATE void ImplInitButtons();
     SAL_DLLPRIVATE void ImplPosControls();
 
@@ -67,9 +66,6 @@ public:
 
 class VCL_DLLPUBLIC InfoBox : public MessBox
 {
-private:
-    SAL_DLLPRIVATE void ImplInitInfoBoxData();
-
 public:
                         InfoBox( vcl::Window* pParent, const OUString& rMessage );
                         InfoBox( vcl::Window* pParent, WinBits nStyle,
@@ -80,9 +76,6 @@ public:
 
 class VCL_DLLPUBLIC WarningBox : public MessBox
 {
-private:
-    SAL_DLLPRIVATE void ImplInitWarningBoxData();
-
 public:
                         WarningBox( vcl::Window* pParent, WinBits nStyle,
                                     const OUString& rMessage );
@@ -94,9 +87,6 @@ public:
 
 class VCL_DLLPUBLIC ErrorBox : public MessBox
 {
-private:
-    SAL_DLLPRIVATE void ImplInitErrorBoxData();
-
 public:
                         ErrorBox( vcl::Window* pParent, WinBits nStyle,
                                   const OUString& rMessage );
diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx
index 7fb7f28..d7b3bf0 100644
--- a/vcl/source/window/msgbox.cxx
+++ b/vcl/source/window/msgbox.cxx
@@ -51,15 +51,6 @@ static void ImplInitMsgBoxImageList()
     }
 }
 
-void MessBox::ImplInitMessBoxData()
-{
-    mpVCLMultiLineEdit  = nullptr;
-    mpFixedImage        = nullptr;
-    mbHelpBtn           = false;
-    mpCheckBox          = nullptr;
-    mbCheck             = false;
-}
-
 void MessBox::ImplInitButtons()
 {
     WinBits nStyle = GetStyle();
@@ -140,9 +131,10 @@ void MessBox::ImplInitButtons()
 MessBox::MessBox( vcl::Window* pParent, WinBits nStyle,
                   const OUString& rTitle, const OUString& rMessage ) :
     ButtonDialog( WINDOW_MESSBOX ),
-    maMessText( rMessage )
+    maMessText( rMessage ),
+    mbHelpBtn( false ),
+    mbCheck( false )
 {
-    ImplInitMessBoxData();
     ImplInit( pParent, nStyle | WB_MOVEABLE | WB_HORZ | WB_CENTER );
     ImplInitButtons();
 
@@ -379,25 +371,19 @@ Size MessBox::GetOptimalSize() const
     return Size( 250, 100 );
 }
 
-void InfoBox::ImplInitInfoBoxData()
-{
-    // Default Text is the display title from the application
-    if ( GetText().isEmpty() )
-        SetText( Application::GetDisplayName() );
-
-    SetImage( InfoBox::GetStandardImage() );
-}
-
 InfoBox::InfoBox( vcl::Window* pParent, const OUString& rMessage ) :
-    MessBox( pParent, WB_OK | WB_DEF_OK, OUString(), rMessage )
+    InfoBox( pParent, WB_OK | WB_DEF_OK, rMessage )
 {
-    ImplInitInfoBoxData();
 }
 
 InfoBox::InfoBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) :
     MessBox( pParent, nStyle, OUString(), rMessage )
 {
-    ImplInitInfoBoxData();
+    // Default Text is the display title from the application
+    if ( GetText().isEmpty() )
+        SetText( Application::GetDisplayName() );
+
+    SetImage( InfoBox::GetStandardImage() );
 }
 
 Image InfoBox::GetStandardImage()
@@ -406,7 +392,9 @@ Image InfoBox::GetStandardImage()
     return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 4 );
 }
 
-void WarningBox::ImplInitWarningBoxData()
+WarningBox::WarningBox( vcl::Window* pParent, WinBits nStyle,
+                        const OUString& rMessage ) :
+    MessBox( pParent, nStyle, OUString(), rMessage )
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
@@ -415,13 +403,6 @@ void WarningBox::ImplInitWarningBoxData()
     SetImage( WarningBox::GetStandardImage() );
 }
 
-WarningBox::WarningBox( vcl::Window* pParent, WinBits nStyle,
-                        const OUString& rMessage ) :
-    MessBox( pParent, nStyle, OUString(), rMessage )
-{
-    ImplInitWarningBoxData();
-}
-
 void WarningBox::SetDefaultCheckBoxText()
 {
     ResMgr* pResMgr = ImplGetResMgr();
@@ -435,7 +416,9 @@ Image WarningBox::GetStandardImage()
     return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 3 );
 }
 
-void ErrorBox::ImplInitErrorBoxData()
+ErrorBox::ErrorBox( vcl::Window* pParent, WinBits nStyle,
+                    const OUString& rMessage ) :
+    MessBox( pParent, nStyle, OUString(), rMessage )
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
@@ -444,13 +427,6 @@ void ErrorBox::ImplInitErrorBoxData()
     SetImage( ErrorBox::GetStandardImage() );
 }
 
-ErrorBox::ErrorBox( vcl::Window* pParent, WinBits nStyle,
-                    const OUString& rMessage ) :
-    MessBox( pParent, nStyle, OUString(), rMessage )
-{
-    ImplInitErrorBoxData();
-}
-
 Image ErrorBox::GetStandardImage()
 {
     try
@@ -466,7 +442,8 @@ Image ErrorBox::GetStandardImage()
     return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 1 );
 }
 
-void QueryBox::ImplInitQueryBoxData()
+QueryBox::QueryBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) :
+    MessBox( pParent, nStyle, OUString(), rMessage )
 {
     // Default Text is the display title from the application
     if ( GetText().isEmpty() )
@@ -475,12 +452,6 @@ void QueryBox::ImplInitQueryBoxData()
     SetImage( QueryBox::GetStandardImage() );
 }
 
-QueryBox::QueryBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) :
-    MessBox( pParent, nStyle, OUString(), rMessage )
-{
-    ImplInitQueryBoxData();
-}
-
 void QueryBox::SetDefaultCheckBoxText()
 {
     ResMgr* pResMgr = ImplGetResMgr();


More information about the Libreoffice-commits mailing list