diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2016-05-28 14:56:29 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-05-30 08:32:06 +0000 |
commit | a499d1b980be1eb2bd6ccfa07b1d87c02fcb1343 (patch) | |
tree | 9c81b8f52ee76c9c756209ed1c549eb7a811b9f1 /vcl | |
parent | 4405180546bce4b4237f1a23c0bc5bcc5d7bb3a7 (diff) |
Convert WINDOW flags to scoped enum
Change-Id: I952fcc940cfe4daca5a810a406a2b8ecd3bd6f47
Reviewed-on: https://gerrit.libreoffice.org/25582
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/window/resource.cxx | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/vcl/source/window/resource.cxx b/vcl/source/window/resource.cxx index 5f627e8f29d5..12536be7b543 100644 --- a/vcl/source/window/resource.cxx +++ b/vcl/source/window/resource.cxx @@ -50,7 +50,7 @@ WindowResHeader Window::ImplLoadResHeader( const ResId& rResId ) { WindowResHeader aHeader; - aHeader.nObjMask = ReadLongRes(); + aHeader.nObjMask = (RscWindowFlags)ReadLongRes(); // we need to calculate auto helpids before the resource gets closed // if the resource only contains flags, it will be closed before we try to read a help id @@ -63,7 +63,7 @@ WindowResHeader Window::ImplLoadResHeader( const ResId& rResId ) // WinBits ReadLongRes(); - if( aHeader.nObjMask & WINDOW_HELPID ) + if( aHeader.nObjMask & RscWindowFlags::HelpId ) aHeader.aHelpId = ReadByteStringRes(); return aHeader; @@ -75,40 +75,40 @@ void Window::ImplLoadRes( const ResId& rResId ) SetHelpId( aHeader.aHelpId ); - sal_uLong nObjMask = aHeader.nObjMask; + RscWindowFlags nObjMask = aHeader.nObjMask; bool bPos = false; bool bSize = false; Point aPos; Size aSize; - if ( nObjMask & (WINDOW_XYMAPMODE | WINDOW_X | WINDOW_Y) ) + if ( nObjMask & (RscWindowFlags::XYMapMode | RscWindowFlags::X | RscWindowFlags::Y) ) { // use size as per resource MapUnit ePosMap = MAP_PIXEL; bPos = true; - if ( nObjMask & WINDOW_XYMAPMODE ) + if ( nObjMask & RscWindowFlags::XYMapMode ) ePosMap = (MapUnit)ReadLongRes(); - if ( nObjMask & WINDOW_X ) + if ( nObjMask & RscWindowFlags::X ) aPos.X() = ImplLogicUnitToPixelX( ReadLongRes(), ePosMap ); - if ( nObjMask & WINDOW_Y ) + if ( nObjMask & RscWindowFlags::Y ) aPos.Y() = ImplLogicUnitToPixelY( ReadLongRes(), ePosMap ); } - if ( nObjMask & (WINDOW_WHMAPMODE | WINDOW_WIDTH | WINDOW_HEIGHT) ) + if ( nObjMask & (RscWindowFlags::WHMapMode | RscWindowFlags::Width | RscWindowFlags::Height) ) { // use size as per resource MapUnit eSizeMap = MAP_PIXEL; bSize = true; - if ( nObjMask & WINDOW_WHMAPMODE ) + if ( nObjMask & RscWindowFlags::WHMapMode ) eSizeMap = (MapUnit)ReadLongRes(); - if ( nObjMask & WINDOW_WIDTH ) + if ( nObjMask & RscWindowFlags::Width ) aSize.Width() = ImplLogicUnitToPixelX( ReadLongRes(), eSizeMap ); - if ( nObjMask & WINDOW_HEIGHT ) + if ( nObjMask & RscWindowFlags::Height ) aSize.Height() = ImplLogicUnitToPixelY( ReadLongRes(), eSizeMap ); } @@ -132,14 +132,9 @@ void Window::ImplLoadRes( const ResId& rResId ) if ( nRSStyle & RSWND::DISABLED ) Enable( false ); - if ( nObjMask & WINDOW_TEXT ) + if ( nObjMask & RscWindowFlags::Text ) SetText( ReadStringRes() ); - if ( nObjMask & WINDOW_HELPTEXT ) - { - SetHelpText( ReadStringRes() ); - mpWindowImpl->mbHelpTextDynamic = true; - } - if ( nObjMask & WINDOW_QUICKTEXT ) + if ( nObjMask & RscWindowFlags::QuickText ) SetQuickHelpText( ReadStringRes() ); } |