summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@gmail.com>2016-06-12 15:42:19 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-06-12 18:29:05 +0000
commit4ccc83fb257faabf8b36d585629a0b08e6404059 (patch)
treec1c1c9e6b4a1b09a8b32d9c5212ba86e764f64fd
parent272a8afa60fe9a6b497c69a58b0054ad5b880690 (diff)
VCL: Simplify MessBox and its children initialisation.
Change-Id: Icf24af615e6020b40f92f565194b2328e99f47ad Reviewed-on: https://gerrit.libreoffice.org/26199 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--include/vcl/msgbox.hxx10
-rw-r--r--vcl/source/window/msgbox.cxx63
2 files changed, 17 insertions, 56 deletions
diff --git a/include/vcl/msgbox.hxx b/include/vcl/msgbox.hxx
index 5ac566f435d9..802da7da9706 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 7fb7f28dd12b..d7b3bf035430 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();