From 01f620676d6cd35b5d9c89bae7438303d1238849 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Wed, 4 Jan 2017 10:24:36 +0000 Subject: split SV_RESID_BITMAP_MSGBOX up Change-Id: I4ebf48e5def5fb31aa7e34b5b6f89b220a27d1a6 --- vcl/inc/svdata.hxx | 2 +- vcl/inc/svids.hrc | 5 ++++- vcl/source/app/svmain.cxx | 6 +----- vcl/source/src/images.src | 19 +++++++++++++++++-- vcl/source/window/msgbox.cxx | 20 ++++++++++---------- 5 files changed, 33 insertions(+), 19 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/svdata.hxx b/vcl/inc/svdata.hxx index fb5d25d26e49..813565165361 100644 --- a/vcl/inc/svdata.hxx +++ b/vcl/inc/svdata.hxx @@ -194,7 +194,7 @@ struct ImplSVWinData VclPtr mpExtTextInputWin; // Window, which is in ExtTextInput VclPtr mpTrackWin; // window, that is in tracking mode AutoTimer* mpTrackTimer = nullptr; // tracking timer - ImageList* mpMsgBoxImgList = nullptr; // ImageList for MessageBox + std::vector maMsgBoxImgList; // ImageList for MessageBox VclPtr mpAutoScrollWin; // window, that is in AutoScrollMode mode VclPtr mpLastWheelWindow; // window, that last received a mouse wheel event SalWheelMouseEvent maLastWheelEvent; // the last received mouse whell event diff --git a/vcl/inc/svids.hrc b/vcl/inc/svids.hrc index a8c1a0f142c3..af3dce70fd29 100644 --- a/vcl/inc/svids.hrc +++ b/vcl/inc/svids.hrc @@ -29,7 +29,10 @@ #define SV_RESID_BITMAP_CHECK 1000 #define SV_RESID_BITMAP_RADIO 1010 -#define SV_RESID_BITMAP_MSGBOX 1020 +#define SV_RESID_BITMAP_ERRORBOX 1020 +#define SV_RESID_BITMAP_QUERYBOX 1021 +#define SV_RESID_BITMAP_WARNINGBOX 1022 +#define SV_RESID_BITMAP_INFOBOX 1023 #define SV_RESID_BITMAP_SPLITHPIN 1040 #define SV_RESID_BITMAP_SPLITVPIN 1041 diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx index 26631ec32833..cf9704f3796b 100644 --- a/vcl/source/app/svmain.cxx +++ b/vcl/source/app/svmain.cxx @@ -419,11 +419,7 @@ void DeInitVCL() Scheduler::ImplDeInitScheduler(); - if ( pSVData->maWinData.mpMsgBoxImgList ) - { - delete pSVData->maWinData.mpMsgBoxImgList; - pSVData->maWinData.mpMsgBoxImgList = nullptr; - } + pSVData->maWinData.maMsgBoxImgList.clear(); if ( pSVData->maCtrlData.mpCheckImgList ) { delete pSVData->maCtrlData.mpCheckImgList; diff --git a/vcl/source/src/images.src b/vcl/source/src/images.src index f1011e5bd34f..bc96efbd8343 100644 --- a/vcl/source/src/images.src +++ b/vcl/source/src/images.src @@ -74,9 +74,24 @@ Bitmap (SV_RESID_BITMAP_RADIO + SV_RESID_MONOOFFSET) File = "radiomono.bmp"; }; -Bitmap SV_RESID_BITMAP_MSGBOX +Bitmap SV_RESID_BITMAP_ERRORBOX { - File = "msgbox.png"; + File = "errorbox.png"; +}; + +Bitmap SV_RESID_BITMAP_WARNINGBOX +{ + File = "warningbox.png"; +}; + +Bitmap SV_RESID_BITMAP_QUERYBOX +{ + File = "querybox.png"; +}; + +Bitmap SV_RESID_BITMAP_INFOBOX +{ + File = "infobox.png"; }; Bitmap SV_RESID_BITMAP_CLOSEDOC diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index ad1031d7ae60..240fb2698330 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -38,15 +38,15 @@ static void ImplInitMsgBoxImageList() { ImplSVData* pSVData = ImplGetSVData(); - if ( !pSVData->maWinData.mpMsgBoxImgList ) + if (pSVData->maWinData.maMsgBoxImgList.empty()) { ResMgr* pResMgr = ImplGetResMgr(); - pSVData->maWinData.mpMsgBoxImgList = new ImageList(); - if( pResMgr ) + if (pResMgr) { - Color aNonAlphaMask( 0xC0, 0xC0, 0xC0 ); - pSVData->maWinData.mpMsgBoxImgList->InsertFromHorizontalBitmap - ( ResId( SV_RESID_BITMAP_MSGBOX, *pResMgr ), 4, &aNonAlphaMask ); + pSVData->maWinData.maMsgBoxImgList.push_back(Image(BitmapEx(ResId(SV_RESID_BITMAP_ERRORBOX, *pResMgr)))); + pSVData->maWinData.maMsgBoxImgList.push_back(Image(BitmapEx(ResId(SV_RESID_BITMAP_QUERYBOX, *pResMgr)))); + pSVData->maWinData.maMsgBoxImgList.push_back(Image(BitmapEx(ResId(SV_RESID_BITMAP_WARNINGBOX, *pResMgr)))); + pSVData->maWinData.maMsgBoxImgList.push_back(Image(BitmapEx(ResId(SV_RESID_BITMAP_INFOBOX, *pResMgr)))); } } } @@ -394,7 +394,7 @@ InfoBox::InfoBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage Image InfoBox::GetStandardImage() { ImplInitMsgBoxImageList(); - return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 4 ); + return ImplGetSVData()->maWinData.maMsgBoxImgList[3]; } WarningBox::WarningBox( vcl::Window* pParent, WinBits nStyle, @@ -418,7 +418,7 @@ void WarningBox::SetDefaultCheckBoxText() Image WarningBox::GetStandardImage() { ImplInitMsgBoxImageList(); - return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 3 ); + return ImplGetSVData()->maWinData.maMsgBoxImgList[2]; } ErrorBox::ErrorBox( vcl::Window* pParent, WinBits nStyle, @@ -444,7 +444,7 @@ Image ErrorBox::GetStandardImage() // ucb and hence no ability to get this image, so nop. return Image(); } - return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 1 ); + return ImplGetSVData()->maWinData.maMsgBoxImgList[0]; } QueryBox::QueryBox( vcl::Window* pParent, WinBits nStyle, const OUString& rMessage ) : @@ -467,7 +467,7 @@ void QueryBox::SetDefaultCheckBoxText() Image QueryBox::GetStandardImage() { ImplInitMsgBoxImageList(); - return ImplGetSVData()->maWinData.mpMsgBoxImgList->GetImage( 2 ); + return ImplGetSVData()->maWinData.maMsgBoxImgList[1]; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit