vcl/Library_vcl.mk | 1 vcl/source/window/window.cxx | 131 ------------------------------------------- 2 files changed, 1 insertion(+), 131 deletions(-)
New commits: commit 87ea3aa1cf2a73a3aa9f7a7d40aac5545579d854 Author: Chris Sherlock <chris.sherloc...@gmail.com> Date: Tue May 20 08:04:21 2014 +1000 vcl: move resource functions from window.cxx to resource.cxx Change-Id: I050cb975dfa6ba20a6a840f24d30745fbafbfaef diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk index 5325505..4e53256 100644 --- a/vcl/Library_vcl.mk +++ b/vcl/Library_vcl.mk @@ -101,6 +101,7 @@ $(eval $(call gb_Library_use_externals,vcl,\ )) $(eval $(call gb_Library_add_exception_objects,vcl,\ + vcl/source/window/resource \ vcl/source/window/abstdlg \ vcl/source/window/accel \ vcl/source/window/accmgr \ diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b3dc24e..b77447c 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -1170,137 +1170,6 @@ void Window::ImplCallMove() ImplCallEventListeners( VCLEVENT_WINDOW_MOVE ); } -static OString ImplAutoHelpID( ResMgr* pResMgr ) -{ - OString aRet; - - if( pResMgr && Application::IsAutoHelpIdEnabled() ) - aRet = pResMgr->GetAutoHelpId(); - - return aRet; -} - -WinBits Window::ImplInitRes( const ResId& rResId ) -{ - GetRes( rResId ); - - char* pRes = (char*)GetClassRes(); - pRes += 8; - sal_uInt32 nStyle = (sal_uInt32)GetLongRes( (void*)pRes ); - rResId.SetWinBits( nStyle ); - return nStyle; -} - -WindowResHeader Window::ImplLoadResHeader( const ResId& rResId ) -{ - WindowResHeader aHeader; - - aHeader.nObjMask = 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 - // so we always create an auto help id that might be overwritten later - // HelpId - aHeader.aHelpId = ImplAutoHelpID( rResId.GetResMgr() ); - - // ResourceStyle - aHeader.nRSStyle = ReadLongRes(); - // WinBits - ReadLongRes(); - - if( aHeader.nObjMask & WINDOW_HELPID ) - aHeader.aHelpId = ReadByteStringRes(); - - return aHeader; -} - -void Window::ImplLoadRes( const ResId& rResId ) -{ - WindowResHeader aHeader = ImplLoadResHeader( rResId ); - - SetHelpId( aHeader.aHelpId ); - - sal_uLong nObjMask = aHeader.nObjMask; - - bool bPos = false; - bool bSize = false; - Point aPos; - Size aSize; - - if ( nObjMask & (WINDOW_XYMAPMODE | WINDOW_X | WINDOW_Y) ) - { - // use size as per resource - MapUnit ePosMap = MAP_PIXEL; - - bPos = true; - - if ( nObjMask & WINDOW_XYMAPMODE ) - ePosMap = (MapUnit)ReadLongRes(); - if ( nObjMask & WINDOW_X ) - aPos.X() = ImplLogicUnitToPixelX( ReadLongRes(), ePosMap ); - if ( nObjMask & WINDOW_Y ) - aPos.Y() = ImplLogicUnitToPixelY( ReadLongRes(), ePosMap ); - } - - if ( nObjMask & (WINDOW_WHMAPMODE | WINDOW_WIDTH | WINDOW_HEIGHT) ) - { - // use size as per resource - MapUnit eSizeMap = MAP_PIXEL; - - bSize = true; - - if ( nObjMask & WINDOW_WHMAPMODE ) - eSizeMap = (MapUnit)ReadLongRes(); - if ( nObjMask & WINDOW_WIDTH ) - aSize.Width() = ImplLogicUnitToPixelX( ReadLongRes(), eSizeMap ); - if ( nObjMask & WINDOW_HEIGHT ) - aSize.Height() = ImplLogicUnitToPixelY( ReadLongRes(), eSizeMap ); - } - - sal_uLong nRSStyle = aHeader.nRSStyle; - - // looks bad due to optimization - if ( nRSStyle & RSWND_CLIENTSIZE ) - { - if ( bPos ) - SetPosPixel( aPos ); - if ( bSize ) - SetOutputSizePixel( aSize ); - } - else if ( bPos && bSize ) - SetPosSizePixel( aPos, aSize ); - else if ( bPos ) - SetPosPixel( aPos ); - else if ( bSize ) - SetSizePixel( aSize ); - - if ( nRSStyle & RSWND_DISABLED ) - Enable( false ); - - if ( nObjMask & WINDOW_TEXT ) - SetText( ReadStringRes() ); - if ( nObjMask & WINDOW_HELPTEXT ) - { - SetHelpText( ReadStringRes() ); - mpWindowImpl->mbHelpTextDynamic = true; - } - if ( nObjMask & WINDOW_QUICKTEXT ) - SetQuickHelpText( ReadStringRes() ); - if ( nObjMask & WINDOW_EXTRALONG ) - { - sal_uIntPtr nRes = ReadLongRes(); - SetData( (void*)nRes ); - } - if ( nObjMask & WINDOW_UNIQUEID ) - SetUniqueId( ReadByteStringRes() ); - - if ( nObjMask & WINDOW_BORDER_STYLE ) - { - sal_uInt16 nBorderStyle = (sal_uInt16)ReadLongRes(); - SetBorderStyle( nBorderStyle ); - } -} - ImplWinData* Window::ImplGetWinData() const { if ( !mpWindowImpl->mpWinData ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits