From 19556f9d8b2eeed2c740964efab5a130d19ef8fc Mon Sep 17 00:00:00 2001 From: Thomas Arnhold Date: Tue, 26 Jul 2011 11:07:50 +0200 Subject: callcatcher: clean up SplitWindow --- vcl/inc/vcl/splitwin.hxx | 21 --- vcl/source/window/splitwin.cxx | 325 ----------------------------------------- 2 files changed, 346 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/vcl/splitwin.hxx b/vcl/inc/vcl/splitwin.hxx index ce1e74958f48..c8845ce6962c 100644 --- a/vcl/inc/vcl/splitwin.hxx +++ b/vcl/inc/vcl/splitwin.hxx @@ -153,7 +153,6 @@ private: SAL_DLLPRIVATE SplitWindow & operator= (const SplitWindow &); public: SplitWindow( Window* pParent, WinBits nStyle = 0 ); - SplitWindow( Window* pParent, const ResId& rResId ); ~SplitWindow(); virtual void StartSplit(); @@ -180,22 +179,10 @@ public: void InsertItem( sal_uInt16 nId, long nSize, sal_uInt16 nPos = SPLITWINDOW_APPEND, sal_uInt16 nSetId = 0, SplitWindowItemBits nBits = 0 ); - void MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewSetId = 0 ); void RemoveItem( sal_uInt16 nId, sal_Bool bHide = sal_True ); void Clear(); - void SetBaseSet( sal_uInt16 nSetId = 0 ); - sal_uInt16 GetBaseSet() const; - - void SetSplitSize( sal_uInt16 nSetId, long nSplitSize, - sal_Bool bWithChilds = sal_False ); - long GetSplitSize( sal_uInt16 nSetId ) const; - void SetItemBackground( sal_uInt16 nSetId ); void SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpaper ); - Wallpaper GetItemBackground( sal_uInt16 nSetId ) const; - sal_Bool IsItemBackground( sal_uInt16 nSetId ) const; - void SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap ); - Bitmap GetItemBitmap( sal_uInt16 nSetId ) const; void SplitItem( sal_uInt16 nId, long nNewSize, sal_Bool bPropSmall = sal_False, @@ -213,13 +200,8 @@ public: void SetItemSizeRange (sal_uInt16 nId, const Range aRange); /** Return the current size limits for the specified item. */ - Range GetItemSizeRange (sal_uInt16 nId) const; long GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const; - void SetItemBits( sal_uInt16 nId, SplitWindowItemBits nNewBits ); - SplitWindowItemBits GetItemBits( sal_uInt16 nId ) const; - Window* GetItemWindow( sal_uInt16 nId ) const; sal_uInt16 GetSet( sal_uInt16 nId ) const; - sal_Bool GetSet( sal_uInt16 nId, sal_uInt16& rSetId, sal_uInt16& rPos ) const; sal_uInt16 GetItemId( Window* pWindow ) const; sal_uInt16 GetItemId( const Point& rPos ) const; sal_uInt16 GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId = 0 ) const; @@ -227,7 +209,6 @@ public: sal_uInt16 GetItemCount( sal_uInt16 nSetId = 0 ) const; sal_Bool IsItemValid( sal_uInt16 nId ) const; - void SetNoAlign( sal_Bool bNoAlign ); sal_Bool IsNoAlign() const { return mbNoAlign; } void SetAlign( WindowAlign eNewAlign = WINDOWALIGN_TOP ); WindowAlign GetAlign() const { return meAlign; } @@ -261,8 +242,6 @@ public: sal_Bool GetAutoHideState() const { return mbAutoHideIn; } Rectangle GetAutoHideRect() const; - Rectangle GetFadeInRect() const; - Rectangle GetFadeOutRect() const; void SetStartSplitHdl( const Link& rLink ) { maStartSplitHdl = rLink; } const Link& GetStartSplitHdl() const { return maStartSplitHdl; } diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 9c0f4699baa8..884e18d67df8 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -1430,20 +1430,6 @@ SplitWindow::SplitWindow( Window* pParent, WinBits nStyle ) : // ----------------------------------------------------------------------- -SplitWindow::SplitWindow( Window* pParent, const ResId& rResId ) : - DockingWindow( WINDOW_SPLITWINDOW ) -{ - rResId.SetRT( RSC_SPLITWINDOW ); - WinBits nStyle = ImplInitRes( rResId ); - ImplInit( pParent, nStyle ); - ImplLoadRes( rResId ); - - if ( !(nStyle & WB_HIDE) ) - Show(); -} - -// ----------------------------------------------------------------------- - SplitWindow::~SplitWindow() { // Sets loeschen @@ -2905,77 +2891,6 @@ void SplitWindow::InsertItem( sal_uInt16 nId, long nSize, // ----------------------------------------------------------------------- -void SplitWindow::MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewSetId ) -{ -#ifdef DBG_UTIL - sal_uInt16 nDbgDummy; - DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::MoveItem() - Id not found" ); - DBG_ASSERT( ImplFindSet( mpMainSet, nNewSetId ), "SplitWindow::MoveItem() - Set not exists" ); -#endif - - sal_uInt16 nPos; - ImplSplitSet* pNewSet = ImplFindSet( mpMainSet, nNewSetId ); - ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos ); - ImplSplitItem aTempItem; - - if ( pNewSet == pSet ) - { - if ( nNewPos >= pNewSet->mnItems ) - nNewPos = pNewSet->mnItems-1; - if ( nPos != nNewPos ) - { - memcpy( &aTempItem, &(pSet->mpItems[nPos]), sizeof( aTempItem ) ); - if ( nPos < nNewPos ) - { - memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1, - (nNewPos-nPos)*sizeof( ImplSplitItem ) ); - } - else - { - memmove( pSet->mpItems+nNewPos+1, pSet->mpItems+nNewPos, - (nPos-nNewPos)*sizeof( ImplSplitItem ) ); - } - memcpy( &(pSet->mpItems[nNewPos]), &aTempItem, sizeof( aTempItem ) ); - - ImplUpdate(); - } - } - else - { - if ( nNewPos >= pNewSet->mnItems ) - nNewPos = pNewSet->mnItems; - memcpy( &aTempItem, &(pSet->mpItems[nPos]), sizeof( aTempItem ) ); - pSet->mnItems--; - pSet->mbCalcPix = sal_True; - if ( pSet->mnItems ) - { - memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1, - (pSet->mnItems-nPos)*sizeof( ImplSplitItem ) ); - } - else - { - delete[] pSet->mpItems; - pSet->mpItems = NULL; - } - ImplSplitItem* pNewItems = new ImplSplitItem[pNewSet->mnItems+1]; - if ( nNewPos ) - memcpy( pNewItems, pNewSet->mpItems, sizeof( ImplSplitItem )*nNewPos ); - if ( nNewPos < pNewSet->mnItems ) - { - memcpy( pNewItems+nNewPos+1, pNewSet->mpItems+nNewPos, - sizeof( ImplSplitItem )*(pNewSet->mnItems-nNewPos) ); - } - delete[] pNewSet->mpItems; - pNewSet->mpItems = pNewItems; - pNewSet->mnItems++; - pNewSet->mbCalcPix = sal_True; - memcpy( &(pNewSet->mpItems[nNewPos]), &aTempItem, sizeof( aTempItem ) ); - ImplUpdate(); - } -} - -// ----------------------------------------------------------------------- - void SplitWindow::RemoveItem( sal_uInt16 nId, sal_Bool bHide ) { #ifdef DBG_UTIL @@ -3049,55 +2964,6 @@ void SplitWindow::Clear() // ----------------------------------------------------------------------- -void SplitWindow::SetBaseSet( sal_uInt16 nSetId ) -{ - mpBaseSet = ImplFindSet( mpMainSet, nSetId ); -} - -// ----------------------------------------------------------------------- - -sal_uInt16 SplitWindow::GetBaseSet() const -{ - return mpBaseSet->mnId; -} - -// ----------------------------------------------------------------------- - -void SplitWindow::SetSplitSize( sal_uInt16 nSetId, long nSplitSize, - sal_Bool bWithChilds ) -{ - ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); - if ( pSet ) - { - if ( bWithChilds ) - ImplSetSplitSize( pSet, nSplitSize ); - else - pSet->mnSplitSize = nSplitSize; - } - ImplUpdate(); -} - -// ----------------------------------------------------------------------- - -long SplitWindow::GetSplitSize( sal_uInt16 nSetId ) const -{ - ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); - if ( pSet ) - return pSet->mnSplitSize; - else - return 0; -} - -// ----------------------------------------------------------------------- - -void SplitWindow::SetItemBackground( sal_uInt16 nSetId ) -{ - Wallpaper aWall; - SetItemBackground( nSetId, aWall ); -} - -// ----------------------------------------------------------------------- - void SplitWindow::SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpaper ) { ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); @@ -3138,88 +3004,6 @@ void SplitWindow::SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpa // ----------------------------------------------------------------------- -Wallpaper SplitWindow::GetItemBackground( sal_uInt16 nSetId ) const -{ - ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); - - if ( pSet && pSet->mpWallpaper ) - return *(pSet->mpWallpaper); - else - { - Wallpaper aWall; - return aWall; - } -} - -// ----------------------------------------------------------------------- - -sal_Bool SplitWindow::IsItemBackground( sal_uInt16 nSetId ) const -{ - ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); - - if ( pSet && pSet->mpWallpaper ) - return sal_True; - else - return sal_False; -} - -// ----------------------------------------------------------------------- - -void SplitWindow::SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap ) -{ - ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); - - if ( pSet ) - { - sal_Bool bUpdate = sal_True; - - if ( !rBitmap ) - { - if ( pSet->mpBitmap ) - { - delete pSet->mpBitmap; - pSet->mpBitmap = NULL; - } - else - bUpdate = sal_False; - } - else - { - // Ab jetzt muss immer invalidiert werden - mbInvalidate = sal_True; - - if ( !pSet->mpBitmap ) - pSet->mpBitmap = new Bitmap( rBitmap ); - else - *(pSet->mpBitmap) = rBitmap; - } - - // Beim MainSet koennen wir den Background umsetzen - if ( pSet == mpMainSet ) - ImplInitSettings(); - - if ( bUpdate ) - ImplUpdateSet( pSet ); - } -} - -// ----------------------------------------------------------------------- - -Bitmap SplitWindow::GetItemBitmap( sal_uInt16 nSetId ) const -{ - ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); - - if ( pSet && pSet->mpBitmap ) - return *(pSet->mpBitmap); - else - { - Bitmap aBitmap; - return aBitmap; - } -} - -// ----------------------------------------------------------------------- - void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, sal_Bool bPropSmall, sal_Bool bPropGreat ) { @@ -3560,71 +3344,6 @@ void SplitWindow::SetItemSizeRange (sal_uInt16 nId, const Range aRange) } } - - - -Range SplitWindow::GetItemSizeRange (sal_uInt16 nId) const -{ - sal_uInt16 nPos; - ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos); - - if (pSet != NULL) - return Range (pSet->mpItems[nPos].mnMinSize, pSet->mpItems[nPos].mnMaxSize); - else - return Range(-1,-1); -} - - -// ----------------------------------------------------------------------- - -void SplitWindow::SetItemBits( sal_uInt16 nId, SplitWindowItemBits nNewBits ) -{ - sal_uInt16 nPos; - ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); - ImplSplitItem* pItem; - - if ( !pSet ) - return; - - pItem = &(pSet->mpItems[nPos]); - if ( pItem->mpWindow ) - nNewBits &= ~SWIB_COLSET; - - if ( pItem->mnBits != nNewBits ) - { - // Neue Bits setzen und neu durchrechnen - pItem->mnBits = nNewBits; - pSet->mbCalcPix = sal_True; - ImplUpdate(); - } -} - -// ----------------------------------------------------------------------- - -SplitWindowItemBits SplitWindow::GetItemBits( sal_uInt16 nId ) const -{ - sal_uInt16 nPos; - ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); - - if ( pSet ) - return pSet->mpItems[nPos].mnBits; - else - return 0; -} - -// ----------------------------------------------------------------------- - -Window* SplitWindow::GetItemWindow( sal_uInt16 nId ) const -{ - sal_uInt16 nPos; - ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); - - if ( pSet ) - return pSet->mpItems[nPos].mpWindow; - else - return NULL; -} - // ----------------------------------------------------------------------- sal_uInt16 SplitWindow::GetSet( sal_uInt16 nId ) const @@ -3640,20 +3359,6 @@ sal_uInt16 SplitWindow::GetSet( sal_uInt16 nId ) const // ----------------------------------------------------------------------- -sal_Bool SplitWindow::GetSet( sal_uInt16 nId, sal_uInt16& rSetId, sal_uInt16& rPos ) const -{ - ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, rPos ); - if ( pSet ) - { - rSetId = pSet->mnId; - return sal_True; - } - else - return sal_False; -} - -// ----------------------------------------------------------------------- - sal_Bool SplitWindow::IsItemValid( sal_uInt16 nId ) const { sal_uInt16 nPos; @@ -3766,18 +3471,6 @@ void SplitWindow::ImplNewAlign() // ----------------------------------------------------------------------- -void SplitWindow::SetNoAlign( sal_Bool bNoAlign ) -{ - bNoAlign = bNoAlign != 0; - if ( mbNoAlign != bNoAlign ) - { - mbNoAlign = bNoAlign; - ImplNewAlign(); - } -} - -// ----------------------------------------------------------------------- - void SplitWindow::SetAlign( WindowAlign eNewAlign ) { if ( meAlign != eNewAlign ) @@ -3881,22 +3574,4 @@ Rectangle SplitWindow::GetAutoHideRect() const return aRect; } -// ----------------------------------------------------------------------- - -Rectangle SplitWindow::GetFadeInRect() const -{ - Rectangle aRect; - ImplGetFadeInRect( aRect, sal_True ); - return aRect; -} - -// ----------------------------------------------------------------------- - -Rectangle SplitWindow::GetFadeOutRect() const -{ - Rectangle aRect; - ImplGetFadeOutRect( aRect, sal_True ); - return aRect; -} - /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit v1.2.3