diff options
Diffstat (limited to 'vcl/source/window')
43 files changed, 5324 insertions, 4519 deletions
diff --git a/vcl/source/window/accel.cxx b/vcl/source/window/accel.cxx index 22287a42ffca..50d288b71686 100644 --- a/vcl/source/window/accel.cxx +++ b/vcl/source/window/accel.cxx @@ -42,7 +42,7 @@ DECLARE_TABLE( ImplAccelTable, ImplAccelEntry* ) typedef ::std::vector< ImplAccelEntry* > ImplAccelList; -#define ACCELENTRY_NOTFOUND ((USHORT)0xFFFF) +#define ACCELENTRY_NOTFOUND ((sal_uInt16)0xFFFF) // ======================================================================= @@ -59,14 +59,14 @@ DBG_NAME( Accelerator ) // ======================================================================= -USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId, - USHORT* pIndex = NULL ) +sal_uInt16 ImplAccelEntryGetIndex( ImplAccelList* pList, sal_uInt16 nId, + sal_uInt16* pIndex = NULL ) { size_t nLow; size_t nHigh; size_t nMid; size_t nCount = pList->size(); - USHORT nCompareId; + sal_uInt16 nCompareId; // Abpruefen, ob der erste Key groesser als der Vergleichskey ist if ( !nCount || (nId < (*pList)[ 0 ]->mnId) ) @@ -90,7 +90,7 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId, if ( nId > nCompareId ) nLow = nMid + 1; else - return (USHORT)nMid; + return (sal_uInt16)nMid; } } while ( nLow <= nHigh ); @@ -98,9 +98,9 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId, if ( pIndex ) { if ( nId > nCompareId ) - *pIndex = (USHORT)(nMid+1); + *pIndex = (sal_uInt16)(nMid+1); else - *pIndex = (USHORT)nMid; + *pIndex = (sal_uInt16)nMid; } return ACCELENTRY_NOTFOUND; @@ -110,8 +110,8 @@ USHORT ImplAccelEntryGetIndex( ImplAccelList* pList, USHORT nId, static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry ) { - USHORT nInsIndex; - USHORT nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex ); + sal_uInt16 nInsIndex; + sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, pEntry->mnId, &nInsIndex ); if ( nIndex != ACCELENTRY_NOTFOUND ) { @@ -145,9 +145,9 @@ static void ImplAccelEntryInsert( ImplAccelList* pList, ImplAccelEntry* pEntry ) // ----------------------------------------------------------------------- -static USHORT ImplAccelEntryGetFirstPos( ImplAccelList* pList, USHORT nId ) +static sal_uInt16 ImplAccelEntryGetFirstPos( ImplAccelList* pList, sal_uInt16 nId ) { - USHORT nIndex = ImplAccelEntryGetIndex( pList, nId ); + sal_uInt16 nIndex = ImplAccelEntryGetIndex( pList, nId ); if ( nIndex != ACCELENTRY_NOTFOUND ) { while ( nIndex ) @@ -170,7 +170,7 @@ void Accelerator::ImplInit() { mnCurId = 0; mnCurRepeat = 0; - mbIsCancel = FALSE; + mbIsCancel = sal_False; mpDel = NULL; } @@ -199,7 +199,7 @@ void Accelerator::ImplCopyData( ImplAccelData& rAccelData ) else pEntry->mpAutoAccel = NULL; - mpData->maKeyTable.Insert( (ULONG)pEntry->maKeyCode.GetFullKeyCode(), pEntry ); + mpData->maKeyTable.Insert( (sal_uLong)pEntry->maKeyCode.GetFullKeyCode(), pEntry ); mpData->maIdList.push_back( pEntry ); } } @@ -221,18 +221,18 @@ void Accelerator::ImplDeleteData() // ----------------------------------------------------------------------- -void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode, - BOOL bEnable, Accelerator* pAutoAccel ) +void Accelerator::ImplInsertAccel( sal_uInt16 nItemId, const KeyCode& rKeyCode, + sal_Bool bEnable, Accelerator* pAutoAccel ) { DBG_CHKTHIS( Accelerator, NULL ); DBG_ASSERT( nItemId, "Accelerator::InsertItem(): ItemId == 0" ); if ( rKeyCode.IsFunction() ) { - USHORT nCode1; - USHORT nCode2; - USHORT nCode3; - USHORT nCode4; + sal_uInt16 nCode1; + sal_uInt16 nCode2; + sal_uInt16 nCode3; + sal_uInt16 nCode4; ImplGetKeyCode( rKeyCode.GetFunction(), nCode1, nCode2, nCode3, nCode4 ); if ( nCode1 ) ImplInsertAccel( nItemId, KeyCode( nCode1, nCode1 ), bEnable, pAutoAccel ); @@ -260,7 +260,7 @@ void Accelerator::ImplInsertAccel( USHORT nItemId, const KeyCode& rKeyCode, pEntry->mbEnabled = bEnable; // Ab in die Tabellen - ULONG nCode = rKeyCode.GetFullKeyCode(); + sal_uLong nCode = rKeyCode.GetFullKeyCode(); if ( !nCode ) { OSL_FAIL( "Accelerator::InsertItem(): KeyCode with KeyCode 0 not allowed" ); @@ -319,9 +319,9 @@ void Accelerator::ImplLoadRes( const ResId& rResId ) GetRes( rResId ); maHelpStr = ReadStringRes(); - ULONG nObjFollows = ReadLongRes(); + sal_uLong nObjFollows = ReadLongRes(); - for( ULONG i = 0; i < nObjFollows; i++ ) + for( sal_uLong i = 0; i < nObjFollows; i++ ) { InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) ); IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) ); @@ -336,7 +336,7 @@ Accelerator::~Accelerator() // AccelManager benachrichtigen, das Accelrator geloescht wurde if ( mpDel ) - *mpDel = TRUE; + *mpDel = sal_True; ImplDeleteData(); delete mpData; @@ -365,9 +365,9 @@ void Accelerator::Select() // ----------------------------------------------------------------------- -void Accelerator::InsertItem( USHORT nItemId, const KeyCode& rKeyCode ) +void Accelerator::InsertItem( sal_uInt16 nItemId, const KeyCode& rKeyCode ) { - ImplInsertAccel( nItemId, rKeyCode, TRUE, NULL ); + ImplInsertAccel( nItemId, rKeyCode, sal_True, NULL ); } // ----------------------------------------------------------------------- @@ -376,15 +376,15 @@ void Accelerator::InsertItem( const ResId& rResId ) { DBG_CHKTHIS( Accelerator, NULL ); - ULONG nObjMask; - USHORT nAccelKeyId; - USHORT bDisable; + sal_uLong nObjMask; + sal_uInt16 nAccelKeyId; + sal_uInt16 bDisable; KeyCode aKeyCode; Accelerator* pAutoAccel = NULL; GetRes( rResId.SetRT( RSC_ACCELITEM ) ); nObjMask = ReadLongRes(); - nAccelKeyId = sal::static_int_cast<USHORT>(ReadLongRes()); + nAccelKeyId = sal::static_int_cast<sal_uInt16>(ReadLongRes()); bDisable = ReadShortRes(); if ( nObjMask & ACCELITEM_KEY ) @@ -407,15 +407,15 @@ void Accelerator::InsertItem( const ResId& rResId ) // ----------------------------------------------------------------------- -void Accelerator::RemoveItem( USHORT nItemId ) +void Accelerator::RemoveItem( sal_uInt16 nItemId ) { DBG_CHKTHIS( Accelerator, NULL ); // Aus der Id-Liste entfernen - USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); + sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); if ( nIndex != ACCELENTRY_NOTFOUND ) { - USHORT nItemCount = GetItemCount(); + sal_uInt16 nItemCount = GetItemCount(); do { ImplAccelEntry* pEntry = ( nIndex < mpData->maIdList.size() ) ? mpData->maIdList[ nIndex ] : NULL; @@ -450,8 +450,8 @@ void Accelerator::RemoveItem( const KeyCode rKeyCode ) if ( pEntry ) { // Aus der Id-Liste entfernen - USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId ); - USHORT nItemCount = GetItemCount(); + sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), pEntry->mnId ); + sal_uInt16 nItemCount = GetItemCount(); do { if ( mpData->maIdList[ nIndex ] == pEntry ) @@ -486,16 +486,16 @@ void Accelerator::Clear() // ----------------------------------------------------------------------- -USHORT Accelerator::GetItemCount() const +sal_uInt16 Accelerator::GetItemCount() const { DBG_CHKTHIS( Accelerator, NULL ); - return (USHORT)mpData->maIdList.size(); + return (sal_uInt16)mpData->maIdList.size(); } // ----------------------------------------------------------------------- -USHORT Accelerator::GetItemId( USHORT nPos ) const +sal_uInt16 Accelerator::GetItemId( sal_uInt16 nPos ) const { DBG_CHKTHIS( Accelerator, NULL ); @@ -508,7 +508,7 @@ USHORT Accelerator::GetItemId( USHORT nPos ) const // ----------------------------------------------------------------------- -KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const +KeyCode Accelerator::GetItemKeyCode( sal_uInt16 nPos ) const { DBG_CHKTHIS( Accelerator, NULL ); @@ -521,7 +521,7 @@ KeyCode Accelerator::GetItemKeyCode( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const +sal_uInt16 Accelerator::GetItemId( const KeyCode& rKeyCode ) const { DBG_CHKTHIS( Accelerator, NULL ); @@ -534,11 +534,11 @@ USHORT Accelerator::GetItemId( const KeyCode& rKeyCode ) const // ----------------------------------------------------------------------- -KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const +KeyCode Accelerator::GetKeyCode( sal_uInt16 nItemId ) const { DBG_CHKTHIS( Accelerator, NULL ); - USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); + sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); if ( nIndex != ACCELENTRY_NOTFOUND ) return mpData->maIdList[ nIndex ]->maKeyCode; else @@ -547,17 +547,17 @@ KeyCode Accelerator::GetKeyCode( USHORT nItemId ) const // ----------------------------------------------------------------------- -BOOL Accelerator::IsIdValid( USHORT nItemId ) const +sal_Bool Accelerator::IsIdValid( sal_uInt16 nItemId ) const { DBG_CHKTHIS( Accelerator, NULL ); - USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); + sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); return (nIndex != ACCELENTRY_NOTFOUND); } // ----------------------------------------------------------------------- -BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const +sal_Bool Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const { DBG_CHKTHIS( Accelerator, NULL ); @@ -567,7 +567,7 @@ BOOL Accelerator::IsKeyCodeValid( const KeyCode rKeyCode ) const // ----------------------------------------------------------------------- -BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat ) +sal_Bool Accelerator::Call( const KeyCode& rKeyCode, sal_uInt16 nRepeat ) { DBG_CHKTHIS( Accelerator, NULL ); @@ -576,7 +576,7 @@ BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat ) { if ( pEntry->mbEnabled ) { - BOOL bDel = FALSE; + sal_Bool bDel = sal_False; mnCurId = pEntry->mnId; maCurKeyCode = rKeyCode; mnCurRepeat = nRepeat; @@ -589,23 +589,23 @@ BOOL Accelerator::Call( const KeyCode& rKeyCode, USHORT nRepeat ) mnCurRepeat = 0; } - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel ) +void Accelerator::SetAccel( sal_uInt16 nItemId, Accelerator* pAccel ) { DBG_CHKTHIS( Accelerator, NULL ); - USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); + sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); if ( nIndex != ACCELENTRY_NOTFOUND ) { - USHORT nItemCount = GetItemCount(); + sal_uInt16 nItemCount = GetItemCount(); do { ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ]; @@ -621,11 +621,11 @@ void Accelerator::SetAccel( USHORT nItemId, Accelerator* pAccel ) // ----------------------------------------------------------------------- -Accelerator* Accelerator::GetAccel( USHORT nItemId ) const +Accelerator* Accelerator::GetAccel( sal_uInt16 nItemId ) const { DBG_CHKTHIS( Accelerator, NULL ); - USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); + sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); if ( nIndex != ACCELENTRY_NOTFOUND ) return mpData->maIdList[ nIndex ]->mpAccel; else @@ -653,19 +653,19 @@ Accelerator* Accelerator::GetAccel( const KeyCode rKeyCode ) const if ( pEntry ) return pEntry->mpAccel; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable ) +void Accelerator::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable ) { DBG_CHKTHIS( Accelerator, NULL ); - USHORT nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); + sal_uInt16 nIndex = ImplAccelEntryGetFirstPos( &(mpData->maIdList), nItemId ); if ( nIndex != ACCELENTRY_NOTFOUND ) { - USHORT nItemCount = GetItemCount(); + sal_uInt16 nItemCount = GetItemCount(); do { ImplAccelEntry* pEntry = mpData->maIdList[ nIndex ]; @@ -681,20 +681,20 @@ void Accelerator::EnableItem( USHORT nItemId, BOOL bEnable ) // ----------------------------------------------------------------------- -BOOL Accelerator::IsItemEnabled( USHORT nItemId ) const +sal_Bool Accelerator::IsItemEnabled( sal_uInt16 nItemId ) const { DBG_CHKTHIS( Accelerator, NULL ); - USHORT nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); + sal_uInt16 nIndex = ImplAccelEntryGetIndex( &(mpData->maIdList), nItemId ); if ( nIndex != ACCELENTRY_NOTFOUND ) return mpData->maIdList[ nIndex ]->mbEnabled; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable ) +void Accelerator::EnableItem( const KeyCode rKeyCode, sal_Bool bEnable ) { DBG_CHKTHIS( Accelerator, NULL ); @@ -705,7 +705,7 @@ void Accelerator::EnableItem( const KeyCode rKeyCode, BOOL bEnable ) // ----------------------------------------------------------------------- -BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const +sal_Bool Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const { DBG_CHKTHIS( Accelerator, NULL ); @@ -713,7 +713,7 @@ BOOL Accelerator::IsItemEnabled( const KeyCode rKeyCode ) const if ( pEntry ) return pEntry->mbEnabled; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -728,7 +728,7 @@ Accelerator& Accelerator::operator=( const Accelerator& rAccel ) maCurKeyCode = KeyCode(); mnCurId = 0; mnCurRepeat = 0; - mbIsCancel = FALSE; + mbIsCancel = sal_False; // Tabellen loeschen und kopieren ImplDeleteData(); diff --git a/vcl/source/window/accmgr.cxx b/vcl/source/window/accmgr.cxx index b45020460c08..c8b1e42c5ed1 100644 --- a/vcl/source/window/accmgr.cxx +++ b/vcl/source/window/accmgr.cxx @@ -50,20 +50,20 @@ ImplAccelManager::~ImplAccelManager() // ----------------------------------------------------------------------- -BOOL ImplAccelManager::InsertAccel( Accelerator* pAccel ) +sal_Bool ImplAccelManager::InsertAccel( Accelerator* pAccel ) { if ( !mpAccelList ) { mpAccelList = new ImplAccelList; } else { for ( size_t i = 0, n = mpAccelList->size(); i < n; ++i ) { if ( (*mpAccelList)[ i ] == pAccel ) { - return FALSE; + return sal_False; } } } mpAccelList->insert( mpAccelList->begin(), pAccel ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -79,7 +79,7 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel ) //we're removing an accelerator that a sub-accelerator which is in the //sequence list, throw away the entire sequence if ( mpSequenceList ) { - for (USHORT i = 0; i < pAccel->GetItemCount(); ++i) { + for (sal_uInt16 i = 0; i < pAccel->GetItemCount(); ++i) { Accelerator* pSubAccel = pAccel->GetAccel( pAccel->GetItemId(i) ); for ( size_t j = 0, n = mpSequenceList->size(); j < n; ++j ) { if ( (*mpSequenceList)[ j ] == pSubAccel ) { @@ -105,7 +105,7 @@ void ImplAccelManager::RemoveAccel( Accelerator* pAccel ) // ----------------------------------------------------------------------- -void ImplAccelManager::EndSequence( BOOL bCancel ) +void ImplAccelManager::EndSequence( sal_Bool bCancel ) { // Sind wir ueberhaupt in einer Sequenz ? if ( !mpSequenceList ) @@ -115,13 +115,13 @@ void ImplAccelManager::EndSequence( BOOL bCancel ) for ( size_t i = 0, n = mpSequenceList->size(); i < n; ++i ) { Accelerator* pTempAccel = (*mpSequenceList)[ i ]; - BOOL bDel = FALSE; + sal_Bool bDel = sal_False; pTempAccel->mbIsCancel = bCancel; pTempAccel->mpDel = &bDel; pTempAccel->Deactivate(); if ( !bDel ) { - pTempAccel->mbIsCancel = FALSE; + pTempAccel->mbIsCancel = sal_False; pTempAccel->mpDel = NULL; } } @@ -133,15 +133,15 @@ void ImplAccelManager::EndSequence( BOOL bCancel ) // ----------------------------------------------------------------------- -BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) +sal_Bool ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, sal_uInt16 nRepeat ) { Accelerator* pAccel; // Haben wir ueberhaupt Acceleratoren ?? if ( !mpAccelList ) - return FALSE; + return sal_False; if ( mpAccelList->empty() ) - return FALSE; + return sal_False; // Sind wir in einer Sequenz ? if ( mpSequenceList ) @@ -154,7 +154,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) { // Sequenz abbrechen FlushAccel(); - return FALSE; + return sal_False; } // Ist der Eintrag da drin ? @@ -172,7 +172,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) // Activate-Handler vom Neuen rufen pNextAccel->Activate(); - return TRUE; + return sal_True; } else { @@ -184,7 +184,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) // Dem Accelerator das aktuelle Item setzen // und Handler rufen - BOOL bDel = FALSE; + sal_Bool bDel = sal_False; pAccel->maCurKeyCode = rKeyCode; pAccel->mnCurId = pEntry->mnId; pAccel->mnCurRepeat = nRepeat; @@ -201,14 +201,14 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) pAccel->mpDel = NULL; } - return TRUE; + return sal_True; } else { // Sequenz abbrechen, weil Acceleraor disabled // Taste wird weitergeleitet (ans System) FlushAccel(); - return FALSE; + return sal_False; } } } @@ -216,7 +216,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) { // Sequenz abbrechen wegen falscher Taste FlushAccel(); - return FALSE; + return sal_False; } } @@ -245,7 +245,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) // Activate-Handler vom Neuen rufen pNextAccel->Activate(); - return TRUE; + return sal_True; } else { @@ -258,7 +258,7 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) // Dem Accelerator das aktuelle Item setzen // und Handler rufen - BOOL bDel = FALSE; + sal_Bool bDel = sal_False; pAccel->maCurKeyCode = rKeyCode; pAccel->mnCurId = pEntry->mnId; pAccel->mnCurRepeat = nRepeat; @@ -275,15 +275,15 @@ BOOL ImplAccelManager::IsAccelKey( const KeyCode& rKeyCode, USHORT nRepeat ) pAccel->mpDel = NULL; } - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } } } - return FALSE; + return sal_False; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/arrange.cxx b/vcl/source/window/arrange.cxx index 88e9af2b9f1c..28e0d8ae65fe 100644 --- a/vcl/source/window/arrange.cxx +++ b/vcl/source/window/arrange.cxx @@ -30,15 +30,37 @@ #include "vcl/arrange.hxx" #include "vcl/edit.hxx" +#include "vcl/svdata.hxx" +#include "vcl/svapp.hxx" + +#include "com/sun/star/beans/PropertyValue.hpp" +#include "com/sun/star/awt/Rectangle.hpp" #include "osl/diagnose.h" using namespace vcl; +using namespace com::sun::star; // ---------------------------------------- // vcl::WindowArranger //----------------------------------------- +long WindowArranger::getDefaultBorder() +{ + ImplSVData* pSVData = ImplGetSVData(); + long nResult = pSVData->maAppData.mnDefaultLayoutBorder; + if( nResult < 0 ) + { + OutputDevice* pDefDev = Application::GetDefaultDevice(); + if( pDefDev ) + { + Size aBorder( pDefDev->LogicToPixel( Size( 3, 3 ), MapMode( MAP_APPFONT ) ) ); + nResult = pSVData->maAppData.mnDefaultLayoutBorder = aBorder.Height(); + } + } + return nResult > 0 ? nResult : 0; +} + WindowArranger::~WindowArranger() {} @@ -157,16 +179,26 @@ Size WindowArranger::Element::getOptimalSize( WindowSizeType i_eType ) const Size aResult; if( ! m_bHidden ) { + bool bVisible = false; if( m_pElement && m_pElement->IsVisible() ) + { aResult = m_pElement->GetOptimalSize( i_eType ); - else if( m_pChild ) + bVisible = true; + } + else if( m_pChild && m_pChild->isVisible() ) + { aResult = m_pChild->getOptimalSize( i_eType ); - if( aResult.Width() < m_aMinSize.Width() ) - aResult.Width() = m_aMinSize.Width(); - if( aResult.Height() < m_aMinSize.Height() ) - aResult.Height() = m_aMinSize.Height(); - aResult.Width() += m_nLeftBorder + m_nRightBorder; - aResult.Height() += m_nTopBorder + m_nBottomBorder; + bVisible = true; + } + if( bVisible ) + { + if( aResult.Width() < m_aMinSize.Width() ) + aResult.Width() = m_aMinSize.Width(); + if( aResult.Height() < m_aMinSize.Height() ) + aResult.Height() = m_aMinSize.Height(); + aResult.Width() += getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder ); + aResult.Height() += getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder ); + } } return aResult; @@ -176,16 +208,74 @@ void WindowArranger::Element::setPosSize( const Point& i_rPos, const Size& i_rSi { Point aPoint( i_rPos ); Size aSize( i_rSize ); - aPoint.X() += m_nLeftBorder; - aPoint.Y() += m_nTopBorder; - aSize.Width() -= m_nLeftBorder + m_nRightBorder; - aSize.Height() -= m_nTopBorder + m_nBottomBorder; + aPoint.X() += getBorderValue( m_nLeftBorder ); + aPoint.Y() += getBorderValue( m_nTopBorder ); + aSize.Width() -= getBorderValue( m_nLeftBorder ) + getBorderValue( m_nRightBorder ); + aSize.Height() -= getBorderValue( m_nTopBorder ) + getBorderValue( m_nBottomBorder ); if( m_pElement ) m_pElement->SetPosSizePixel( aPoint, aSize ); else if( m_pChild ) m_pChild->setManagedArea( Rectangle( aPoint, aSize ) ); } +uno::Sequence< beans::PropertyValue > WindowArranger::getProperties() const +{ + uno::Sequence< beans::PropertyValue > aRet( 3 ); + aRet[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "OuterBorder" ) ); + aRet[0].Value = uno::makeAny( sal_Int32( getBorderValue( m_nOuterBorder ) ) ); + aRet[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ManagedArea" ) ); + awt::Rectangle aArea( m_aManagedArea.getX(), m_aManagedArea.getY(), m_aManagedArea.getWidth(), m_aManagedArea.getHeight() ); + aRet[1].Value = uno::makeAny( aArea ); + aRet[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ); + aRet[2].Value = uno::makeAny( sal_Bool( isVisible() ) ); + return aRet; +} + +void WindowArranger::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps ) +{ + const beans::PropertyValue* pProps = i_rProps.getConstArray(); + bool bResize = false; + for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ ) + { + if( pProps[i].Name.equalsAscii( "OuterBorder" ) ) + { + sal_Int32 nVal = 0; + if( pProps[i].Value >>= nVal ) + { + if( getBorderValue( m_nOuterBorder ) != nVal ) + { + m_nOuterBorder = nVal; + bResize = true; + } + } + } + else if( pProps[i].Name.equalsAscii( "ManagedArea" ) ) + { + awt::Rectangle aArea( 0, 0, 0, 0 ); + if( pProps[i].Value >>= aArea ) + { + m_aManagedArea.setX( aArea.X ); + m_aManagedArea.setY( aArea.Y ); + m_aManagedArea.setWidth( aArea.Width ); + m_aManagedArea.setHeight( aArea.Height ); + bResize = true; + } + } + else if( pProps[i].Name.equalsAscii( "Visible" ) ) + { + sal_Bool bVal = sal_False; + if( pProps[i].Value >>= bVal ) + { + show( bVal, false ); + bResize = true; + } + } + } + if( bResize ) + resize(); +} + + // ---------------------------------------- // vcl::RowOrColumn //----------------------------------------- @@ -202,6 +292,7 @@ RowOrColumn::~RowOrColumn() Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const { Size aRet( 0, 0 ); + long nDistance = getBorderValue( m_nBorderWidth ); for( std::vector< WindowArranger::Element >::const_iterator it = m_aElements.begin(); it != m_aElements.end(); ++it ) { @@ -212,7 +303,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const if( m_bColumn ) { // add the distance between elements - aRet.Height() += m_nBorderWidth; + aRet.Height() += nDistance; // check if the width needs adjustment if( aRet.Width() < aElementSize.Width() ) aRet.Width() = aElementSize.Width(); @@ -221,7 +312,7 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const else { // add the distance between elements - aRet.Width() += m_nBorderWidth; + aRet.Width() += nDistance; // check if the height needs adjustment if( aRet.Height() < aElementSize.Height() ) aRet.Height() = aElementSize.Height(); @@ -234,13 +325,14 @@ Size RowOrColumn::getOptimalSize( WindowSizeType i_eType ) const { // subtract the border for the first element if( m_bColumn ) - aRet.Height() -= m_nBorderWidth; + aRet.Height() -= nDistance; else - aRet.Width() -= m_nBorderWidth; + aRet.Width() -= nDistance; // add the outer border - aRet.Width() += 2*m_nOuterBorder; - aRet.Height() += 2*m_nOuterBorder; + long nOuterBorder = getBorderValue( m_nOuterBorder ); + aRet.Width() += 2*nOuterBorder; + aRet.Height() += 2*nOuterBorder; } return aRet; @@ -345,7 +437,9 @@ void RowOrColumn::resize() size_t nElements = m_aElements.size(); // get all element sizes for sizing std::vector<Size> aElementSizes( nElements ); - long nUsedWidth = 2*m_nOuterBorder - (nElements ? m_nBorderWidth : 0); + long nDistance = getBorderValue( m_nBorderWidth ); + long nOuterBorder = getBorderValue( m_nOuterBorder ); + long nUsedWidth = 2*nOuterBorder - (nElements ? nDistance : 0); for( size_t i = 0; i < nElements; i++ ) { if( m_aElements[i].isVisible() ) @@ -353,13 +447,13 @@ void RowOrColumn::resize() aElementSizes[i] = m_aElements[i].getOptimalSize( eType ); if( m_bColumn ) { - aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2* m_nOuterBorder; - nUsedWidth += aElementSizes[i].Height() + m_nBorderWidth; + aElementSizes[i].Width() = m_aManagedArea.GetWidth() - 2 * nOuterBorder; + nUsedWidth += aElementSizes[i].Height() + nDistance; } else { - aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2* m_nOuterBorder; - nUsedWidth += aElementSizes[i].Width() + m_nBorderWidth; + aElementSizes[i].Height() = m_aManagedArea.GetHeight() - 2 * nOuterBorder; + nUsedWidth += aElementSizes[i].Width() + nDistance; } } } @@ -376,8 +470,8 @@ void RowOrColumn::resize() // get starting position Point aElementPos( m_aManagedArea.TopLeft() ); // outer border - aElementPos.X() += m_nOuterBorder; - aElementPos.Y() += m_nOuterBorder; + aElementPos.X() += nOuterBorder; + aElementPos.Y() += nOuterBorder; // position managed windows for( size_t i = 0; i < nElements; i++ ) @@ -387,27 +481,27 @@ void RowOrColumn::resize() { m_aElements[i].setPosSize( aElementPos, aElementSizes[i] ); if( m_bColumn ) - aElementPos.Y() += m_nBorderWidth + aElementSizes[i].Height(); + aElementPos.Y() += nDistance + aElementSizes[i].Height(); else - aElementPos.X() += m_nBorderWidth + aElementSizes[i].Width(); + aElementPos.X() += nDistance + aElementSizes[i].Width(); } } } -size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, size_t i_nIndex ) +size_t RowOrColumn::addWindow( Window* i_pWindow, sal_Int32 i_nExpandPrio, const Size& i_rMinSize, size_t i_nIndex ) { size_t nIndex = i_nIndex; if( i_nIndex >= m_aElements.size() ) { nIndex = m_aElements.size(); - m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) ); + m_aElements.push_back( WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) ); } else { std::vector< WindowArranger::Element >::iterator it = m_aElements.begin(); while( i_nIndex-- ) ++it; - m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) ); + m_aElements.insert( it, WindowArranger::Element( i_pWindow, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) ); } return nIndex; } @@ -480,14 +574,14 @@ Size LabeledElement::getOptimalSize( WindowSizeType i_eType ) const if( m_nLabelColumnWidth != 0 ) aRet.Width() = m_nLabelColumnWidth; else - aRet.Width() += m_nDistance; + aRet.Width() += getBorderValue( m_nDistance ); } Size aElementSize( m_aElement.getOptimalSize( i_eType ) ); aRet.Width() += aElementSize.Width(); if( aElementSize.Height() > aRet.Height() ) aRet.Height() = aElementSize.Height(); if( aRet.Height() != 0 ) - aRet.Height() += 2*m_nOuterBorder; + aRet.Height() += 2 * getBorderValue( m_nOuterBorder ); return aRet; } @@ -496,23 +590,25 @@ void LabeledElement::resize() { Size aLabelSize( m_aLabel.getOptimalSize( WINDOWSIZE_MINIMUM ) ); Size aElementSize( m_aElement.getOptimalSize( WINDOWSIZE_PREFERRED ) ); - if( m_nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() ) + long nDistance = getBorderValue( m_nDistance ); + long nOuterBorder = getBorderValue( m_nOuterBorder ); + if( nDistance + aLabelSize.Width() + aElementSize.Width() > m_aManagedArea.GetWidth() ) aElementSize = m_aElement.getOptimalSize( WINDOWSIZE_MINIMUM ); // align label and element vertically in LabeledElement - long nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aLabelSize.Height()) / 2; + long nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aLabelSize.Height()) / 2; Point aPos( m_aManagedArea.Left(), - m_aManagedArea.Top() + m_nOuterBorder + nYOff ); + m_aManagedArea.Top() + nOuterBorder + nYOff ); Size aSize( aLabelSize ); if( m_nLabelColumnWidth != 0 ) aSize.Width() = m_nLabelColumnWidth; m_aLabel.setPosSize( aPos, aSize ); - aPos.X() += aSize.Width() + m_nDistance; - nYOff = (m_aManagedArea.GetHeight() - 2*m_nOuterBorder - aElementSize.Height()) / 2; - aPos.Y() = m_aManagedArea.Top() + m_nOuterBorder + nYOff; + aPos.X() += aSize.Width() + nDistance; + nYOff = (m_aManagedArea.GetHeight() - 2*nOuterBorder - aElementSize.Height()) / 2; + aPos.Y() = m_aManagedArea.Top() + nOuterBorder + nYOff; aSize.Width() = aElementSize.Width(); - aSize.Height() = m_aManagedArea.GetHeight() - 2*m_nOuterBorder; + aSize.Height() = m_aManagedArea.GetHeight() - 2*nOuterBorder; // label style // 0: position left and right @@ -579,18 +675,22 @@ long LabelColumn::getLabelWidth() const if( pLW ) { Size aLabSize( pLW->GetOptimalSize( WINDOWSIZE_MINIMUM ) ); + long nLB = 0; + pLabel->getBorders(0, &nLB); + aLabSize.Width() += getBorderValue( nLB ); if( aLabSize.Width() > nWidth ) nWidth = aLabSize.Width(); } } } } - return nWidth + getBorderWidth(); + return nWidth + getBorderValue( getBorderWidth() ); } Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const { long nWidth = getLabelWidth(); + long nOuterBorder = getBorderValue( m_nOuterBorder ); Size aColumnSize; // every child is a LabeledElement @@ -623,19 +723,19 @@ Size LabelColumn::getOptimalSize( WindowSizeType i_eType ) const } if( aElementSize.Width() ) { - aElementSize.Width() += 2*m_nOuterBorder; + aElementSize.Width() += 2*nOuterBorder; if( aElementSize.Width() > aColumnSize.Width() ) aColumnSize.Width() = aElementSize.Width(); } if( aElementSize.Height() ) { - aColumnSize.Height() += getBorderWidth() + aElementSize.Height(); + aColumnSize.Height() += getBorderValue( getBorderWidth() ) + aElementSize.Height(); } } if( nEle > 0 && aColumnSize.Height() ) { - aColumnSize.Height() -= getBorderWidth(); // for the first element - aColumnSize.Height() += 2*m_nOuterBorder; + aColumnSize.Height() -= getBorderValue( getBorderWidth() ); // for the first element + aColumnSize.Height() += 2*nOuterBorder; } return aColumnSize; } @@ -668,12 +768,13 @@ size_t LabelColumn::addRow( Window* i_pLabel, boost::shared_ptr<WindowArranger> return nIndex; } -size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent ) +size_t LabelColumn::addRow( Window* i_pLabel, Window* i_pElement, long i_nIndent, const Size& i_rElementMinSize ) { boost::shared_ptr< LabeledElement > xLabel( new LabeledElement( this, 1 ) ); xLabel->setLabel( i_pLabel ); xLabel->setBorders( 0, i_nIndent, 0, 0, 0 ); xLabel->setElement( i_pElement ); + xLabel->setMinimumSize( 1, i_rElementMinSize ); size_t nIndex = addChild( xLabel ); resize(); return nIndex; @@ -691,19 +792,23 @@ Indenter::~Indenter() Size Indenter::getOptimalSize( WindowSizeType i_eType ) const { Size aSize( m_aElement.getOptimalSize( i_eType ) ); - aSize.Width() += 2*m_nOuterBorder + m_nIndent; - aSize.Height() += 2*m_nOuterBorder; + long nOuterBorder = getBorderValue( m_nOuterBorder ); + long nIndent = getBorderValue( m_nIndent ); + aSize.Width() += 2*nOuterBorder + nIndent; + aSize.Height() += 2*nOuterBorder; return aSize; } void Indenter::resize() { + long nOuterBorder = getBorderValue( m_nOuterBorder ); + long nIndent = getBorderValue( m_nIndent ); Point aPt( m_aManagedArea.TopLeft() ); - aPt.X() += m_nOuterBorder + m_nIndent; - aPt.Y() += m_nOuterBorder; + aPt.X() += nOuterBorder + nIndent; + aPt.Y() += nOuterBorder; Size aSz( m_aManagedArea.GetSize() ); - aSz.Width() -= 2*m_nOuterBorder + m_nIndent; - aSz.Height() -= 2*m_nOuterBorder; + aSz.Width() -= 2*nOuterBorder + nIndent; + aSz.Height() -= 2*nOuterBorder; m_aElement.setPosSize( aPt, aSz ); } @@ -729,9 +834,13 @@ MatrixArranger::~MatrixArranger() { } -Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights ) const +Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, + std::vector<long>& o_rColumnWidths, std::vector<long>& o_rRowHeights, + std::vector<sal_Int32>& o_rColumnPrio, std::vector<sal_Int32>& o_rRowPrio + ) const { - Size aMatrixSize( 2*m_nOuterBorder, 2*m_nOuterBorder ); + long nOuterBorder = getBorderValue( m_nOuterBorder ); + Size aMatrixSize( 2*nOuterBorder, 2*nOuterBorder ); // first find out the current number of rows and columns sal_uInt32 nRows = 0, nColumns = 0; @@ -747,6 +856,8 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& // now allocate row and column depth vectors o_rColumnWidths = std::vector< long >( nColumns, 0 ); o_rRowHeights = std::vector< long >( nRows, 0 ); + o_rColumnPrio = std::vector< sal_Int32 >( nColumns, 0 ); + o_rRowPrio = std::vector< sal_Int32 >( nRows, 0 ); // get sizes an allocate them into rows/columns for( std::vector< MatrixElement >::const_iterator it = m_aElements.begin(); @@ -757,18 +868,24 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& o_rColumnWidths[ it->m_nX ] = aSize.Width(); if( aSize.Height() > o_rRowHeights[ it->m_nY ] ) o_rRowHeights[ it->m_nY ] = aSize.Height(); + if( it->m_nExpandPriority > o_rColumnPrio[ it->m_nX ] ) + o_rColumnPrio[ it->m_nX ] = it->m_nExpandPriority; + if( it->m_nExpandPriority > o_rRowPrio[ it->m_nY ] ) + o_rRowPrio[ it->m_nY ] = it->m_nExpandPriority; } // add up sizes + long nDistanceX = getBorderValue( m_nBorderX ); + long nDistanceY = getBorderValue( m_nBorderY ); for( sal_uInt32 i = 0; i < nColumns; i++ ) - aMatrixSize.Width() += o_rColumnWidths[i] + m_nBorderX; + aMatrixSize.Width() += o_rColumnWidths[i] + nDistanceX; if( nColumns > 0 ) - aMatrixSize.Width() -= m_nBorderX; + aMatrixSize.Width() -= nDistanceX; for( sal_uInt32 i = 0; i < nRows; i++ ) - aMatrixSize.Height() += o_rRowHeights[i] + m_nBorderY; + aMatrixSize.Height() += o_rRowHeights[i] + nDistanceY; if( nRows > 0 ) - aMatrixSize.Height() -= m_nBorderY; + aMatrixSize.Height() -= nDistanceY; return aMatrixSize; } @@ -776,9 +893,48 @@ Size MatrixArranger::getOptimalSize( WindowSizeType i_eType, std::vector<long>& Size MatrixArranger::getOptimalSize( WindowSizeType i_eType ) const { std::vector<long> aColumnWidths, aRowHeights; - return getOptimalSize( i_eType, aColumnWidths, aRowHeights ); + std::vector<sal_Int32> aColumnPrio, aRowPrio; + return getOptimalSize( i_eType, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio ); } +void MatrixArranger::distributeExtraSize( std::vector<long>& io_rSizes, const std::vector<sal_Int32>& i_rPrios, long i_nExtraWidth ) +{ + if( ! io_rSizes.empty() && io_rSizes.size() == i_rPrios.size() ) // sanity check + { + // find all elements with the highest expand priority + size_t nElements = io_rSizes.size(); + std::vector< size_t > aIndices; + sal_Int32 nHighPrio = 0; + for( size_t i = 0; i < nElements; i++ ) + { + sal_Int32 nCurPrio = i_rPrios[ i ]; + if( nCurPrio > nHighPrio ) + { + aIndices.clear(); + nHighPrio = nCurPrio; + } + if( nCurPrio == nHighPrio ) + aIndices.push_back( i ); + } + + // distribute extra space evenly among collected elements + nElements = aIndices.size(); + if( nElements > 0 ) + { + long nDelta = i_nExtraWidth / nElements; + for( size_t i = 0; i < nElements; i++ ) + { + io_rSizes[ aIndices[i] ] += nDelta; + i_nExtraWidth -= nDelta; + } + // add the last pixels to the last row element + if( i_nExtraWidth > 0 && nElements > 0 ) + io_rSizes[aIndices.back()] += i_nExtraWidth; + } + } +} + + void MatrixArranger::resize() { // assure that we have at least one row and column @@ -787,30 +943,44 @@ void MatrixArranger::resize() // check if we can get optimal size, else fallback to minimal size std::vector<long> aColumnWidths, aRowHeights; - Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights ) ); + std::vector<sal_Int32> aColumnPrio, aRowPrio; + Size aOptSize( getOptimalSize( WINDOWSIZE_PREFERRED, aColumnWidths, aRowHeights, aColumnPrio, aRowPrio ) ); if( aOptSize.Height() > m_aManagedArea.GetHeight() || aOptSize.Width() > m_aManagedArea.GetWidth() ) { std::vector<long> aMinColumnWidths, aMinRowHeights; - getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights ); + getOptimalSize( WINDOWSIZE_MINIMUM, aMinColumnWidths, aMinRowHeights, aColumnPrio, aRowPrio ); if( aOptSize.Height() > m_aManagedArea.GetHeight() ) aRowHeights = aMinRowHeights; if( aOptSize.Width() > m_aManagedArea.GetWidth() ) aColumnWidths = aMinColumnWidths; } - // FIXME: distribute extra space available + // distribute extra space available + long nExtraSize = m_aManagedArea.GetWidth(); + for( size_t i = 0; i < aColumnWidths.size(); ++i ) + nExtraSize -= aColumnWidths[i] + m_nBorderX; + if( nExtraSize > 0 ) + distributeExtraSize( aColumnWidths, aColumnPrio, nExtraSize ); + nExtraSize = m_aManagedArea.GetHeight(); + for( size_t i = 0; i < aRowHeights.size(); ++i ) + nExtraSize -= aRowHeights[i] + m_nBorderY; + if( nExtraSize > 0 ) + distributeExtraSize( aRowHeights, aRowPrio, nExtraSize ); // prepare offsets + long nDistanceX = getBorderValue( m_nBorderX ); + long nDistanceY = getBorderValue( m_nBorderY ); + long nOuterBorder = getBorderValue( m_nOuterBorder ); std::vector<long> aColumnX( aColumnWidths.size() ); - aColumnX[0] = m_aManagedArea.Left() + m_nOuterBorder; + aColumnX[0] = m_aManagedArea.Left() + nOuterBorder; for( size_t i = 1; i < aColumnX.size(); i++ ) - aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + m_nBorderX; + aColumnX[i] = aColumnX[i-1] + aColumnWidths[i-1] + nDistanceX; std::vector<long> aRowY( aRowHeights.size() ); - aRowY[0] = m_aManagedArea.Top() + m_nOuterBorder; + aRowY[0] = m_aManagedArea.Top() + nOuterBorder; for( size_t i = 1; i < aRowY.size(); i++ ) - aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + m_nBorderY; + aRowY[i] = aRowY[i-1] + aRowHeights[i-1] + nDistanceY; // now iterate over the elements and assign their positions for( std::vector< MatrixElement >::iterator it = m_aElements.begin(); @@ -822,7 +992,7 @@ void MatrixArranger::resize() } } -size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio ) +size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 i_nY, sal_Int32 i_nExpandPrio, const Size& i_rMinSize ) { sal_uInt64 nMapValue = getMap( i_nX, i_nY ); std::map< sal_uInt64, size_t >::const_iterator it = m_aMatrixMap.find( nMapValue ); @@ -830,7 +1000,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 if( it == m_aMatrixMap.end() ) { m_aMatrixMap[ nMapValue ] = nIndex = m_aElements.size(); - m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio ) ); + m_aElements.push_back( MatrixElement( i_pWindow, i_nX, i_nY, boost::shared_ptr<WindowArranger>(), i_nExpandPrio, i_rMinSize ) ); } else { @@ -838,6 +1008,7 @@ size_t MatrixArranger::addWindow( Window* i_pWindow, sal_uInt32 i_nX, sal_uInt32 rEle.m_pElement = i_pWindow; rEle.m_pChild.reset(); rEle.m_nExpandPriority = i_nExpandPrio; + rEle.m_aMinSize = i_rMinSize; rEle.m_nX = i_nX; rEle.m_nY = i_nY; nIndex = it->second; diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx index ebb63f07b11b..a71aadc3cdad 100644 --- a/vcl/source/window/brdwin.cxx +++ b/vcl/source/window/brdwin.cxx @@ -53,7 +53,7 @@ using namespace ::com::sun::star::uno; // ======================================================================= -static void ImplGetPinImage( USHORT nStyle, BOOL bPinIn, Image& rImage ) +static void ImplGetPinImage( sal_uInt16 nStyle, sal_Bool bPinIn, Image& rImage ) { // ImageListe laden, wenn noch nicht vorhanden ImplSVData* pSVData = ImplGetSVData(); @@ -71,7 +71,7 @@ static void ImplGetPinImage( USHORT nStyle, BOOL bPinIn, Image& rImage ) } // Image ermitteln und zurueckgeben - USHORT nId; + sal_uInt16 nId; if ( nStyle & BUTTON_DRAW_PRESSED ) { if ( bPinIn ) @@ -126,9 +126,9 @@ static void ImplDrawBrdWinSymbol( OutputDevice* pDev, static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev, const Rectangle& rRect, - SymbolType eSymbol, USHORT nState ) + SymbolType eSymbol, sal_uInt16 nState ) { - BOOL bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0; + sal_Bool bMouseOver = (nState & BUTTON_DRAW_HIGHLIGHT) != 0; nState &= ~BUTTON_DRAW_HIGHLIGHT; Rectangle aTempRect; @@ -141,8 +141,8 @@ static void ImplDrawBrdWinSymbolButton( OutputDevice* pDev, pWin->SetFillColor( pDev->GetSettings().GetStyleSettings().GetWindowColor() ); pWin->SetLineColor(); pWin->DrawRect( rRect ); - pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) ? TRUE : FALSE, - TRUE, FALSE ); + pWin->DrawSelectionBackground( rRect, 2, (nState & BUTTON_DRAW_PRESSED) ? sal_True : sal_False, + sal_True, sal_False ); } aTempRect = rRect; aTempRect.nLeft+=3; @@ -171,23 +171,23 @@ ImplBorderWindowView::~ImplBorderWindowView() // ----------------------------------------------------------------------- -BOOL ImplBorderWindowView::MouseMove( const MouseEvent& ) +sal_Bool ImplBorderWindowView::MouseMove( const MouseEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ImplBorderWindowView::MouseButtonDown( const MouseEvent& ) +sal_Bool ImplBorderWindowView::MouseButtonDown( const MouseEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ImplBorderWindowView::Tracking( const TrackingEvent& ) +sal_Bool ImplBorderWindowView::Tracking( const TrackingEvent& ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -242,7 +242,7 @@ void ImplBorderWindowView::ImplInitTitle( ImplBorderFrameData* pData ) // ----------------------------------------------------------------------- -USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Point& rPos ) +sal_uInt16 ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Point& rPos ) { ImplBorderWindow* pBorderWindow = pData->mpBorderWindow; @@ -321,15 +321,15 @@ USHORT ImplBorderWindowView::ImplHitTest( ImplBorderFrameData* pData, const Poin // ----------------------------------------------------------------------- -BOOL ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt ) +sal_Bool ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const MouseEvent& rMEvt ) { - USHORT oldCloseState = pData->mnCloseState; - USHORT oldMenuState = pData->mnMenuState; + sal_uInt16 oldCloseState = pData->mnCloseState; + sal_uInt16 oldMenuState = pData->mnMenuState; pData->mnCloseState &= ~BUTTON_DRAW_HIGHLIGHT; pData->mnMenuState &= ~BUTTON_DRAW_HIGHLIGHT; Point aMousePos = rMEvt.GetPosPixel(); - USHORT nHitTest = ImplHitTest( pData, aMousePos ); + sal_uInt16 nHitTest = ImplHitTest( pData, aMousePos ); PointerStyle ePtrStyle = POINTER_ARROW; if ( nHitTest & BORDERWINDOW_HITTEST_LEFT ) ePtrStyle = POINTER_WINDOW_WSIZE; @@ -358,12 +358,12 @@ BOOL ImplBorderWindowView::ImplMouseMove( ImplBorderFrameData* pData, const Mous if( pData->mnMenuState != oldMenuState ) pData->mpBorderWindow->Invalidate( pData->maMenuRect ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt ) +sal_Bool ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, const MouseEvent& rMEvt ) { ImplBorderWindow* pBorderWindow = pData->mpBorderWindow; @@ -371,11 +371,11 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons { pData->maMouseOff = rMEvt.GetPosPixel(); pData->mnHitTest = ImplHitTest( pData, pData->maMouseOff ); - USHORT nDragFullTest = 0; + sal_uInt16 nDragFullTest = 0; if ( pData->mnHitTest ) { - BOOL bTracking = TRUE; - BOOL bHitTest = TRUE; + sal_Bool bTracking = sal_True; + sal_Bool bHitTest = sal_True; if ( pData->mnHitTest & BORDERWINDOW_HITTEST_CLOSE ) { @@ -440,18 +440,18 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons } else { - bTracking = FALSE; + bTracking = sal_False; if ( (pData->mnHitTest & BORDERWINDOW_DRAW_TITLE) && ((rMEvt.GetClicks() % 2) == 0) ) { pData->mnHitTest = 0; - bHitTest = FALSE; + bHitTest = sal_False; if ( pBorderWindow->ImplGetClientWindow()->IsSystemWindow() ) { SystemWindow* pClientWindow = (SystemWindow*)(pBorderWindow->ImplGetClientWindow()); - if ( TRUE /*pBorderWindow->mbDockBtn*/ ) // always perform docking on double click, no button required + if ( sal_True /*pBorderWindow->mbDockBtn*/ ) // always perform docking on double click, no button required pClientWindow->TitleButtonClick( TITLE_BUTTON_DOCKING ); else if ( pBorderWindow->GetStyle() & WB_ROLLABLE ) { @@ -468,9 +468,9 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons if ( bTracking ) { - pData->mbDragFull = FALSE; + pData->mbDragFull = sal_False; if ( nDragFullTest ) - pData->mbDragFull = TRUE; // always fulldrag for proper docking, ignore system settings + pData->mbDragFull = sal_True; // always fulldrag for proper docking, ignore system settings pBorderWindow->StartTracking(); } else if ( bHitTest ) @@ -478,18 +478,18 @@ BOOL ImplBorderWindowView::ImplMouseButtonDown( ImplBorderFrameData* pData, cons } } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt ) +sal_Bool ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const TrackingEvent& rTEvt ) { ImplBorderWindow* pBorderWindow = pData->mpBorderWindow; if ( rTEvt.IsTrackingEnded() ) { - USHORT nHitTest = pData->mnHitTest; + sal_uInt16 nHitTest = pData->mnHitTest; pData->mnHitTest = 0; if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE ) @@ -931,7 +931,7 @@ BOOL ImplBorderWindowView::ImplTracking( ImplBorderFrameData* pData, const Track } } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -940,9 +940,9 @@ String ImplBorderWindowView::ImplRequestHelp( ImplBorderFrameData* pData, const Point& rPos, Rectangle& rHelpRect ) { - USHORT nHelpId = 0; + sal_uInt16 nHelpId = 0; String aHelpStr; - USHORT nHitTest = ImplHitTest( pData, rPos ); + sal_uInt16 nHitTest = ImplHitTest( pData, rPos ); if ( nHitTest ) { if ( nHitTest & BORDERWINDOW_HITTEST_CLOSE ) @@ -1062,7 +1062,7 @@ long ImplNoBorderWindowView::CalcTitleWidth() const // ----------------------------------------------------------------------- -void ImplNoBorderWindowView::DrawWindow( USHORT, OutputDevice*, const Point* ) +void ImplNoBorderWindowView::DrawWindow( sal_uInt16, OutputDevice*, const Point* ) { } @@ -1088,7 +1088,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei mnHeight = nHeight; mbNWFBorder = false; - USHORT nBorderStyle = mpBorderWindow->GetBorderStyle(); + sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle(); if ( nBorderStyle & WINDOW_BORDER_NOBORDER ) { mnLeftBorder = 0; @@ -1164,16 +1164,16 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei if( mnWidth && mnHeight ) { - mpBorderWindow->SetPaintTransparent( TRUE ); + mpBorderWindow->SetPaintTransparent( sal_True ); mpBorderWindow->SetBackground(); - pCtrl->SetPaintTransparent( TRUE ); + pCtrl->SetPaintTransparent( sal_True ); Window* pCompoundParent = NULL; if( pWin->GetParent() && pWin->GetParent()->IsCompoundControl() ) pCompoundParent = pWin->GetParent(); if( pCompoundParent ) - pCompoundParent->SetPaintTransparent( TRUE ); + pCompoundParent->SetPaintTransparent( sal_True ); if( mnWidth < aBounds.GetWidth() || mnHeight < aBounds.GetHeight() ) { @@ -1196,7 +1196,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei if( ! mbNWFBorder ) { - USHORT nStyle = FRAME_DRAW_NODRAW; + sal_uInt16 nStyle = FRAME_DRAW_NODRAW; // Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster // ist, dann Border nach aussen if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder ) @@ -1237,13 +1237,13 @@ long ImplSmallBorderWindowView::CalcTitleWidth() const // ----------------------------------------------------------------------- -void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, const Point* ) +void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*, const Point* ) { - USHORT nBorderStyle = mpBorderWindow->GetBorderStyle(); + sal_uInt16 nBorderStyle = mpBorderWindow->GetBorderStyle(); if ( nBorderStyle & WINDOW_BORDER_NOBORDER ) return; - BOOL bNativeOK = FALSE; + sal_Bool bNativeOK = sal_False; // for native widget drawing we must find out what // control this border belongs to Window *pWin = NULL, *pCtrl = NULL; @@ -1334,9 +1334,9 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co nState |= CTRL_STATE_FOCUSED; } - BOOL bMouseOver = FALSE; + sal_Bool bMouseOver = sal_False; Window *pCtrlChild = pCtrl->GetWindow( WINDOW_FIRSTCHILD ); - while( pCtrlChild && (bMouseOver = pCtrlChild->IsMouseOver()) == FALSE ) + while( pCtrlChild && (bMouseOver = pCtrlChild->IsMouseOver()) == sal_False ) pCtrlChild = pCtrlChild->GetWindow( WINDOW_NEXT ); if( bMouseOver ) @@ -1385,7 +1385,7 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co } else { - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; // Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster // ist, dann Border nach aussen if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder ) @@ -1417,7 +1417,7 @@ void ImplSmallBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice*, co ImplStdBorderWindowView::ImplStdBorderWindowView( ImplBorderWindow* pBorderWindow ) { maFrameData.mpBorderWindow = pBorderWindow; - maFrameData.mbDragFull = FALSE; + maFrameData.mbDragFull = sal_False; maFrameData.mnHitTest = 0; maFrameData.mnPinState = 0; maFrameData.mnCloseState = 0; @@ -1444,21 +1444,21 @@ ImplStdBorderWindowView::~ImplStdBorderWindowView() // ----------------------------------------------------------------------- -BOOL ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt ) +sal_Bool ImplStdBorderWindowView::MouseMove( const MouseEvent& rMEvt ) { return ImplMouseMove( &maFrameData, rMEvt ); } // ----------------------------------------------------------------------- -BOOL ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt ) +sal_Bool ImplStdBorderWindowView::MouseButtonDown( const MouseEvent& rMEvt ) { return ImplMouseButtonDown( &maFrameData, rMEvt ); } // ----------------------------------------------------------------------- -BOOL ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) +sal_Bool ImplStdBorderWindowView::Tracking( const TrackingEvent& rTEvt ) { return ImplTracking( &maFrameData, rTEvt ); } @@ -1654,7 +1654,7 @@ long ImplStdBorderWindowView::CalcTitleWidth() const // ----------------------------------------------------------------------- -void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutDev, const Point* pOffset ) +void ImplStdBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice* pOutDev, const Point* pOffset ) { ImplBorderFrameData* pData = &maFrameData; OutputDevice* pDev = pOutDev ? pOutDev : pData->mpOutDev; @@ -1666,7 +1666,7 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD Color aFaceColor( rStyleSettings.GetFaceColor() ); Color aFrameColor( aFaceColor ); - aFrameColor.DecreaseContrast( (UINT8) (0.50 * 255)); + aFrameColor.DecreaseContrast( (sal_uInt8) (0.50 * 255)); // Draw Frame if ( nDrawFlags & BORDERWINDOW_DRAW_FRAME ) @@ -1762,7 +1762,7 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD if ( pOffset ) aInRect.Move( pOffset->X(), pOffset->Y() ); - USHORT nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP; + sal_uInt16 nTextStyle = TEXT_DRAW_LEFT | TEXT_DRAW_VCENTER | TEXT_DRAW_ENDELLIPSIS | TEXT_DRAW_CLIP; // must show tooltip ? TextRectInfo aInfo; @@ -1852,14 +1852,14 @@ void ImplStdBorderWindowView::DrawWindow( USHORT nDrawFlags, OutputDevice* pOutD // ======================================================================= void ImplBorderWindow::ImplInit( Window* pParent, - WinBits nStyle, USHORT nTypeStyle, + WinBits nStyle, sal_uInt16 nTypeStyle, const ::com::sun::star::uno::Any& ) { ImplInit( pParent, nStyle, nTypeStyle, NULL ); } void ImplBorderWindow::ImplInit( Window* pParent, - WinBits nStyle, USHORT nTypeStyle, + WinBits nStyle, sal_uInt16 nTypeStyle, SystemParentData* pSystemParentData ) { @@ -1870,44 +1870,44 @@ void ImplBorderWindow::ImplInit( Window* pParent, nTestStyle |= WB_APP; nStyle &= nTestStyle; - mpWindowImpl->mbBorderWin = TRUE; - mbSmallOutBorder = FALSE; + mpWindowImpl->mbBorderWin = sal_True; + mbSmallOutBorder = sal_False; if ( nTypeStyle & BORDERWINDOW_STYLE_FRAME ) { if( (nStyle & WB_SYSTEMCHILDWINDOW) ) { - mpWindowImpl->mbOverlapWin = TRUE; - mpWindowImpl->mbFrame = TRUE; - mbFrameBorder = FALSE; + mpWindowImpl->mbOverlapWin = sal_True; + mpWindowImpl->mbFrame = sal_True; + mbFrameBorder = sal_False; } else if( (nStyle & (WB_OWNERDRAWDECORATION | WB_POPUP)) ) { - mpWindowImpl->mbOverlapWin = TRUE; - mpWindowImpl->mbFrame = TRUE; - mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? FALSE : TRUE; + mpWindowImpl->mbOverlapWin = sal_True; + mpWindowImpl->mbFrame = sal_True; + mbFrameBorder = (nOrgStyle & WB_NOBORDER) ? sal_False : sal_True; } else { - mpWindowImpl->mbOverlapWin = TRUE; - mpWindowImpl->mbFrame = TRUE; - mbFrameBorder = FALSE; + mpWindowImpl->mbOverlapWin = sal_True; + mpWindowImpl->mbFrame = sal_True; + mbFrameBorder = sal_False; // closeable windows may have a border as well, eg. system floating windows without caption if ( (nOrgStyle & (WB_BORDER | WB_NOBORDER | WB_MOVEABLE | WB_SIZEABLE/* | WB_CLOSEABLE*/)) == WB_BORDER ) - mbSmallOutBorder = TRUE; + mbSmallOutBorder = sal_True; } } else if ( nTypeStyle & BORDERWINDOW_STYLE_OVERLAP ) { - mpWindowImpl->mbOverlapWin = TRUE; - mbFrameBorder = TRUE; + mpWindowImpl->mbOverlapWin = sal_True; + mbFrameBorder = sal_True; } else - mbFrameBorder = FALSE; + mbFrameBorder = sal_False; if ( nTypeStyle & BORDERWINDOW_STYLE_FLOAT ) - mbFloatWindow = TRUE; + mbFloatWindow = sal_True; else - mbFloatWindow = FALSE; + mbFloatWindow = sal_False; Window::ImplInit( pParent, nStyle, pSystemParentData ); SetBackground(); @@ -1920,13 +1920,13 @@ void ImplBorderWindow::ImplInit( Window* pParent, mnMaxHeight = SHRT_MAX; mnRollHeight = 0; mnOrgMenuHeight = 0; - mbPined = FALSE; - mbRollUp = FALSE; - mbMenuHide = FALSE; - mbDockBtn = FALSE; - mbMenuBtn = FALSE; - mbHideBtn = FALSE; - mbHelpBtn = FALSE; + mbPined = sal_False; + mbRollUp = sal_False; + mbMenuHide = sal_False; + mbDockBtn = sal_False; + mbMenuBtn = sal_False; + mbHideBtn = sal_False; + mbHelpBtn = sal_False; mbDisplayActive = IsActive(); if ( nTypeStyle & BORDERWINDOW_STYLE_FLOAT ) @@ -1941,7 +1941,7 @@ void ImplBorderWindow::ImplInit( Window* pParent, ImplBorderWindow::ImplBorderWindow( Window* pParent, SystemParentData* pSystemParentData, - WinBits nStyle, USHORT nTypeStyle + WinBits nStyle, sal_uInt16 nTypeStyle ) : Window( WINDOW_BORDERWINDOW ) { ImplInit( pParent, nStyle, nTypeStyle, pSystemParentData ); @@ -1950,14 +1950,14 @@ ImplBorderWindow::ImplBorderWindow( Window* pParent, // ----------------------------------------------------------------------- ImplBorderWindow::ImplBorderWindow( Window* pParent, WinBits nStyle , - USHORT nTypeStyle ) : + sal_uInt16 nTypeStyle ) : Window( WINDOW_BORDERWINDOW ) { ImplInit( pParent, nStyle, nTypeStyle, ::com::sun::star::uno::Any() ); } ImplBorderWindow::ImplBorderWindow( Window* pParent, - WinBits nStyle, USHORT nTypeStyle, + WinBits nStyle, sal_uInt16 nTypeStyle, const ::com::sun::star::uno::Any& aSystemToken ) : Window( WINDOW_BORDERWINDOW ) { @@ -2008,7 +2008,7 @@ void ImplBorderWindow::Draw( const Rectangle&, OutputDevice* pOutDev, const Poin void ImplBorderWindow::Activate() { - SetDisplayActive( TRUE ); + SetDisplayActive( sal_True ); Window::Activate(); } @@ -2019,7 +2019,7 @@ void ImplBorderWindow::Deactivate() // Fenster die immer Active sind, nehmen wir von dieser Regel aus, // genauso, wenn ein Menu aktiv wird, ignorieren wir das Deactivate if ( GetActivateMode() && !ImplGetSVData()->maWinData.mbNoDeactivate ) - SetDisplayActive( FALSE ); + SetDisplayActive( sal_False ); Window::Deactivate(); } @@ -2133,7 +2133,7 @@ void ImplBorderWindow::DataChanged( const DataChangedEvent& rDCEvt ) (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { if ( !mpWindowImpl->mbFrame || (GetStyle() & (WB_OWNERDRAWDECORATION | WB_POPUP)) ) - UpdateView( TRUE, ImplGetWindow()->GetOutputSizePixel() ); + UpdateView( sal_True, ImplGetWindow()->GetOutputSizePixel() ); } Window::DataChanged( rDCEvt ); @@ -2162,7 +2162,7 @@ void ImplBorderWindow::InitView() // ----------------------------------------------------------------------- -void ImplBorderWindow::UpdateView( BOOL bNewView, const Size& rNewOutSize ) +void ImplBorderWindow::UpdateView( sal_Bool bNewView, const Size& rNewOutSize ) { sal_Int32 nLeftBorder; sal_Int32 nTopBorder; @@ -2238,7 +2238,7 @@ void ImplBorderWindow::InvalidateBorder() // ----------------------------------------------------------------------- -void ImplBorderWindow::SetDisplayActive( BOOL bActive ) +void ImplBorderWindow::SetDisplayActive( sal_Bool bActive ) { if ( mbDisplayActive != bActive ) { @@ -2250,26 +2250,26 @@ void ImplBorderWindow::SetDisplayActive( BOOL bActive ) // ----------------------------------------------------------------------- -void ImplBorderWindow::SetTitleType( USHORT nTitleType, const Size& rSize ) +void ImplBorderWindow::SetTitleType( sal_uInt16 nTitleType, const Size& rSize ) { mnTitleType = nTitleType; - UpdateView( FALSE, rSize ); + UpdateView( sal_False, rSize ); } // ----------------------------------------------------------------------- -void ImplBorderWindow::SetBorderStyle( USHORT nStyle ) +void ImplBorderWindow::SetBorderStyle( sal_uInt16 nStyle ) { if ( !mbFrameBorder && (mnBorderStyle != nStyle) ) { mnBorderStyle = nStyle; - UpdateView( FALSE, ImplGetWindow()->GetOutputSizePixel() ); + UpdateView( sal_False, ImplGetWindow()->GetOutputSizePixel() ); } } // ----------------------------------------------------------------------- -void ImplBorderWindow::SetPin( BOOL bPin ) +void ImplBorderWindow::SetPin( sal_Bool bPin ) { mbPined = bPin; InvalidateBorder(); @@ -2277,11 +2277,11 @@ void ImplBorderWindow::SetPin( BOOL bPin ) // ----------------------------------------------------------------------- -void ImplBorderWindow::SetRollUp( BOOL bRollUp, const Size& rSize ) +void ImplBorderWindow::SetRollUp( sal_Bool bRollUp, const Size& rSize ) { mbRollUp = bRollUp; mnRollHeight = rSize.Height(); - UpdateView( FALSE, rSize ); + UpdateView( sal_False, rSize ); } // ----------------------------------------------------------------------- @@ -2296,7 +2296,7 @@ void ImplBorderWindow::SetCloser() // ----------------------------------------------------------------------- -void ImplBorderWindow::SetDockButton( BOOL bDockButton ) +void ImplBorderWindow::SetDockButton( sal_Bool bDockButton ) { mbDockBtn = bDockButton; Size aSize = GetOutputSizePixel(); @@ -2306,7 +2306,7 @@ void ImplBorderWindow::SetDockButton( BOOL bDockButton ) // ----------------------------------------------------------------------- -void ImplBorderWindow::SetHideButton( BOOL bHideButton ) +void ImplBorderWindow::SetHideButton( sal_Bool bHideButton ) { mbHideBtn = bHideButton; Size aSize = GetOutputSizePixel(); @@ -2316,7 +2316,7 @@ void ImplBorderWindow::SetHideButton( BOOL bHideButton ) // ----------------------------------------------------------------------- -void ImplBorderWindow::SetHelpButton( BOOL bHelpButton ) +void ImplBorderWindow::SetHelpButton( sal_Bool bHelpButton ) { mbHelpBtn = bHelpButton; Size aSize = GetOutputSizePixel(); @@ -2326,7 +2326,7 @@ void ImplBorderWindow::SetHelpButton( BOOL bHelpButton ) // ----------------------------------------------------------------------- -void ImplBorderWindow::SetMenuButton( BOOL bMenuButton ) +void ImplBorderWindow::SetMenuButton( sal_Bool bMenuButton ) { mbMenuBtn = bMenuButton; Size aSize = GetOutputSizePixel(); @@ -2353,7 +2353,7 @@ void ImplBorderWindow::SetMenuBarWindow( Window* pWindow ) // ----------------------------------------------------------------------- -void ImplBorderWindow::SetMenuBarMode( BOOL bHide ) +void ImplBorderWindow::SetMenuBarMode( sal_Bool bHide ) { mbMenuHide = bHide; UpdateMenuHeight(); diff --git a/vcl/source/window/btndlg.cxx b/vcl/source/window/btndlg.cxx index c5f329f11c38..cf9697b4f602 100644 --- a/vcl/source/window/btndlg.cxx +++ b/vcl/source/window/btndlg.cxx @@ -40,7 +40,7 @@ typedef boost::ptr_vector<ImplBtnDlgItem>::const_iterator btn_const_iterator; struct ImplBtnDlgItem { - USHORT mnId; + sal_uInt16 mnId; bool mbOwnButton; bool mbDummyAlign; long mnSepSize; @@ -52,7 +52,7 @@ void ButtonDialog::ImplInitButtonDialogData() mnButtonSize = 0; mnCurButtonId = 0; mnFocusButtonId = BUTTONDIALOG_BUTTON_NOTFOUND; - mbFormat = TRUE; + mbFormat = sal_True; } ButtonDialog::ButtonDialog( WindowType nType ) : @@ -86,7 +86,7 @@ ButtonDialog::~ButtonDialog() } } -PushButton* ButtonDialog::ImplCreatePushButton( USHORT nBtnFlags ) +PushButton* ButtonDialog::ImplCreatePushButton( sal_uInt16 nBtnFlags ) { PushButton* pBtn; WinBits nStyle = 0; @@ -108,7 +108,7 @@ PushButton* ButtonDialog::ImplCreatePushButton( USHORT nBtnFlags ) return pBtn; } -ImplBtnDlgItem* ButtonDialog::ImplGetItem( USHORT nId ) const +ImplBtnDlgItem* ButtonDialog::ImplGetItem( sal_uInt16 nId ) const { for ( btn_const_iterator it = maItemList.begin(); it != maItemList.end(); ++it) { @@ -223,7 +223,7 @@ void ButtonDialog::ImplPosControls() SetOutputSizePixel( aDlgSize ); - mbFormat = FALSE; + mbFormat = sal_False; } IMPL_LINK( ButtonDialog, ImplClickHdl, PushButton*, pBtn ) @@ -281,13 +281,13 @@ void ButtonDialog::Click() maClickHdl.Call( this ); } -void ButtonDialog::AddButton( const XubString& rText, USHORT nId, - USHORT nBtnFlags, long nSepPixel ) +void ButtonDialog::AddButton( const XubString& rText, sal_uInt16 nId, + sal_uInt16 nBtnFlags, long nSepPixel ) { // PageItem anlegen ImplBtnDlgItem* pItem = new ImplBtnDlgItem; pItem->mnId = nId; - pItem->mbOwnButton = TRUE; + pItem->mbOwnButton = sal_True; pItem->mnSepSize = nSepPixel; pItem->mpPushButton = ImplCreatePushButton( nBtnFlags ); @@ -299,16 +299,16 @@ void ButtonDialog::AddButton( const XubString& rText, USHORT nId, if ( nBtnFlags & BUTTONDIALOG_FOCUSBUTTON ) mnFocusButtonId = nId; - mbFormat = TRUE; + mbFormat = sal_True; } -void ButtonDialog::AddButton( StandardButtonType eType, USHORT nId, - USHORT nBtnFlags, long nSepPixel ) +void ButtonDialog::AddButton( StandardButtonType eType, sal_uInt16 nId, + sal_uInt16 nBtnFlags, long nSepPixel ) { // PageItem anlegen ImplBtnDlgItem* pItem = new ImplBtnDlgItem; pItem->mnId = nId; - pItem->mbOwnButton = TRUE; + pItem->mbOwnButton = sal_True; pItem->mnSepSize = nSepPixel; if ( eType == BUTTON_OK ) @@ -333,16 +333,16 @@ void ButtonDialog::AddButton( StandardButtonType eType, USHORT nId, maItemList.push_back(pItem); - mbFormat = TRUE; + mbFormat = sal_True; } -void ButtonDialog::AddButton( PushButton* pBtn, USHORT nId, - USHORT nBtnFlags, long nSepPixel ) +void ButtonDialog::AddButton( PushButton* pBtn, sal_uInt16 nId, + sal_uInt16 nBtnFlags, long nSepPixel ) { // PageItem anlegen ImplBtnDlgItem* pItem = new ImplBtnDlgItem; pItem->mnId = nId; - pItem->mbOwnButton = FALSE; + pItem->mbOwnButton = sal_False; pItem->mnSepSize = nSepPixel; pItem->mpPushButton = pBtn; @@ -351,10 +351,10 @@ void ButtonDialog::AddButton( PushButton* pBtn, USHORT nId, maItemList.push_back(pItem); - mbFormat = TRUE; + mbFormat = sal_True; } -void ButtonDialog::RemoveButton( USHORT nId ) +void ButtonDialog::RemoveButton( sal_uInt16 nId ) { btn_iterator it; for (it = maItemList.begin(); it != maItemList.end(); ++it) @@ -367,7 +367,6 @@ void ButtonDialog::RemoveButton( USHORT nId ) delete it->mpPushButton; maItemList.erase(it); - mbFormat = TRUE; break; } } @@ -387,15 +386,15 @@ void ButtonDialog::Clear() } maItemList.clear(); - mbFormat = TRUE; + mbFormat = sal_True; } -USHORT ButtonDialog::GetButtonCount() const +sal_uInt16 ButtonDialog::GetButtonCount() const { - return (USHORT)maItemList.size(); + return (sal_uInt16)maItemList.size(); } -USHORT ButtonDialog::GetButtonId( USHORT nButton ) const +sal_uInt16 ButtonDialog::GetButtonId( sal_uInt16 nButton ) const { if ( nButton < maItemList.size() ) return maItemList[nButton].mnId; @@ -403,7 +402,7 @@ USHORT ButtonDialog::GetButtonId( USHORT nButton ) const return BUTTONDIALOG_BUTTON_NOTFOUND; } -PushButton* ButtonDialog::GetPushButton( USHORT nId ) const +PushButton* ButtonDialog::GetPushButton( sal_uInt16 nId ) const { ImplBtnDlgItem* pItem = ImplGetItem( nId ); @@ -413,18 +412,18 @@ PushButton* ButtonDialog::GetPushButton( USHORT nId ) const return NULL; } -void ButtonDialog::SetButtonText( USHORT nId, const XubString& rText ) +void ButtonDialog::SetButtonText( sal_uInt16 nId, const XubString& rText ) { ImplBtnDlgItem* pItem = ImplGetItem( nId ); if ( pItem ) { pItem->mpPushButton->SetText( rText ); - mbFormat = TRUE; + mbFormat = sal_True; } } -XubString ButtonDialog::GetButtonText( USHORT nId ) const +XubString ButtonDialog::GetButtonText( sal_uInt16 nId ) const { ImplBtnDlgItem* pItem = ImplGetItem( nId ); @@ -434,7 +433,7 @@ XubString ButtonDialog::GetButtonText( USHORT nId ) const return ImplGetSVEmptyStr(); } -void ButtonDialog::SetButtonHelpText( USHORT nId, const XubString& rText ) +void ButtonDialog::SetButtonHelpText( sal_uInt16 nId, const XubString& rText ) { ImplBtnDlgItem* pItem = ImplGetItem( nId ); @@ -442,7 +441,7 @@ void ButtonDialog::SetButtonHelpText( USHORT nId, const XubString& rText ) pItem->mpPushButton->SetHelpText( rText ); } -XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const +XubString ButtonDialog::GetButtonHelpText( sal_uInt16 nId ) const { ImplBtnDlgItem* pItem = ImplGetItem( nId ); @@ -452,22 +451,19 @@ XubString ButtonDialog::GetButtonHelpText( USHORT nId ) const return ImplGetSVEmptyStr(); } -void ButtonDialog::SetButtonHelpId( USHORT nId, ULONG nHelpId ) +void ButtonDialog::SetButtonHelpId( sal_uInt16 nId, const rtl::OString& rHelpId ) { ImplBtnDlgItem* pItem = ImplGetItem( nId ); if ( pItem ) - pItem->mpPushButton->SetHelpId( nHelpId ); + pItem->mpPushButton->SetHelpId( rHelpId ); } -ULONG ButtonDialog::GetButtonHelpId( USHORT nId ) const +rtl::OString ButtonDialog::GetButtonHelpId( sal_uInt16 nId ) const { ImplBtnDlgItem* pItem = ImplGetItem( nId ); - if ( pItem ) - return pItem->mpPushButton->GetHelpId(); - else - return 0; + return pItem ? rtl::OString( pItem->mpPushButton->GetHelpId() ) : rtl::OString(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/cmdevt.cxx b/vcl/source/window/cmdevt.cxx index ae5b765909ba..1fa77a3621cd 100644 --- a/vcl/source/window/cmdevt.cxx +++ b/vcl/source/window/cmdevt.cxx @@ -42,24 +42,24 @@ CommandExtTextInputData::CommandExtTextInputData() mnDeltaStart = 0; mnOldTextLen = 0; mnCursorFlags = 0; - mbOnlyCursor = FALSE; + mbOnlyCursor = sal_False; } // ----------------------------------------------------------------------- CommandExtTextInputData::CommandExtTextInputData( const XubString& rText, - const USHORT* pTextAttr, + const sal_uInt16* pTextAttr, xub_StrLen nCursorPos, - USHORT nCursorFlags, + sal_uInt16 nCursorFlags, xub_StrLen nDeltaStart, xub_StrLen nOldTextLen, - BOOL bOnlyCursor ) : + sal_Bool bOnlyCursor ) : maText( rText ) { if ( pTextAttr && maText.Len() ) { - mpTextAttr = new USHORT[maText.Len()]; - memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(USHORT) ); + mpTextAttr = new sal_uInt16[maText.Len()]; + memcpy( mpTextAttr, pTextAttr, maText.Len()*sizeof(sal_uInt16) ); } else mpTextAttr = NULL; @@ -77,8 +77,8 @@ CommandExtTextInputData::CommandExtTextInputData( const CommandExtTextInputData& { if ( rData.mpTextAttr && maText.Len() ) { - mpTextAttr = new USHORT[maText.Len()]; - memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(USHORT) ); + mpTextAttr = new sal_uInt16[maText.Len()]; + memcpy( mpTextAttr, rData.mpTextAttr, maText.Len()*sizeof(sal_uInt16) ); } else mpTextAttr = NULL; diff --git a/vcl/source/window/cursor.cxx b/vcl/source/window/cursor.cxx index 21ef136ad663..318529dcc7d9 100644 --- a/vcl/source/window/cursor.cxx +++ b/vcl/source/window/cursor.cxx @@ -48,8 +48,8 @@ struct ImplCursorData long mnPixSlant; // Pixel-Slant short mnOrientation; // Pixel-Orientation unsigned char mnDirection; // indicates writing direction - USHORT mnStyle; // Cursor-Style - BOOL mbCurVisible; // Ist Cursor aktuell sichtbar + sal_uInt16 mnStyle; // Cursor-Style + sal_Bool mbCurVisible; // Ist Cursor aktuell sichtbar Window* mpWindow; // Zugeordnetes Windows }; @@ -58,9 +58,9 @@ struct ImplCursorData static void ImplCursorInvert( ImplCursorData* pData ) { Window* pWindow = pData->mpWindow; - BOOL bMapMode = pWindow->IsMapModeEnabled(); - pWindow->EnableMapMode( FALSE ); - USHORT nInvertStyle; + sal_Bool bMapMode = pWindow->IsMapModeEnabled(); + pWindow->EnableMapMode( sal_False ); + sal_uInt16 nInvertStyle; if ( pData->mnStyle & CURSOR_SHADOW ) nInvertStyle = INVERT_50; else @@ -155,7 +155,7 @@ void Cursor::ImplDraw() // Ausgabeflaeche berechnen und ausgeben ImplCursorInvert( mpData ); - mpData->mbCurVisible = TRUE; + mpData->mbCurVisible = sal_True; } } @@ -166,13 +166,13 @@ void Cursor::ImplRestore() if ( mpData && mpData->mbCurVisible ) { ImplCursorInvert( mpData ); - mpData->mbCurVisible = FALSE; + mpData->mbCurVisible = sal_False; } } // ----------------------------------------------------------------------- -void Cursor::ImplShow( BOOL bDrawDirect ) +void Cursor::ImplShow( sal_Bool bDrawDirect ) { if ( mbVisible ) { @@ -194,7 +194,7 @@ void Cursor::ImplShow( BOOL bDrawDirect ) if ( !mpData ) { mpData = new ImplCursorData; - mpData->mbCurVisible = FALSE; + mpData->mbCurVisible = sal_False; mpData->maTimer.SetTimeoutHdl( LINK( this, Cursor, ImplTimerHdl ) ); } @@ -269,7 +269,7 @@ Cursor::Cursor() mnOrientation = 0; mnDirection = 0; mnStyle = 0; - mbVisible = FALSE; + mbVisible = sal_False; } // ----------------------------------------------------------------------- @@ -302,7 +302,7 @@ Cursor::~Cursor() // ----------------------------------------------------------------------- -void Cursor::SetStyle( USHORT nStyle ) +void Cursor::SetStyle( sal_uInt16 nStyle ) { if ( mnStyle != nStyle ) { @@ -317,7 +317,7 @@ void Cursor::Show() { if ( !mbVisible ) { - mbVisible = TRUE; + mbVisible = sal_True; ImplShow(); } } @@ -328,7 +328,7 @@ void Cursor::Hide() { if ( mbVisible ) { - mbVisible = FALSE; + mbVisible = sal_False; ImplHide(); } } @@ -449,7 +449,7 @@ Cursor& Cursor::operator=( const Cursor& rCursor ) // ----------------------------------------------------------------------- -BOOL Cursor::operator==( const Cursor& rCursor ) const +sal_Bool Cursor::operator==( const Cursor& rCursor ) const { if ( (maPos == rCursor.maPos) && (maSize == rCursor.maSize) && @@ -457,9 +457,9 @@ BOOL Cursor::operator==( const Cursor& rCursor ) const (mnOrientation == rCursor.mnOrientation) && (mnDirection == rCursor.mnDirection) && (mbVisible == rCursor.mbVisible) ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/decoview.cxx b/vcl/source/window/decoview.cxx index 0cb89a025f5d..125c927bf673 100644 --- a/vcl/source/window/decoview.cxx +++ b/vcl/source/window/decoview.cxx @@ -45,71 +45,6 @@ // ======================================================================= -void ImplDrawOS2Symbol( OutputDevice* pDev, const Rectangle& rRect, - USHORT nStyle, BOOL bClose ) -{ - DecorationView aView( pDev ); - const StyleSettings& rStyleSettings = pDev->GetSettings().GetStyleSettings(); - Rectangle aRect = rRect; - Color aColor1; - Color aColor2; - - pDev->SetFillColor(); - - if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) ) - { - aColor1 = rStyleSettings.GetShadowColor(); - aColor2 = rStyleSettings.GetLightColor(); - } - else - { - aColor1 = rStyleSettings.GetLightColor(); - aColor2 = rStyleSettings.GetShadowColor(); - } - aView.DrawFrame( aRect, aColor1, aColor2 ); - - aRect.Left() += 2; - aRect.Top() += 2; - aRect.Right() -= 2; - aRect.Bottom() -= 2; - - if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) ) - pDev->SetLineColor( rStyleSettings.GetLightColor() ); - else - pDev->SetLineColor( rStyleSettings.GetShadowColor() ); - if ( bClose ) - { - pDev->DrawLine( aRect.TopLeft(), Point( aRect.Left(), aRect.Bottom()-2 ) ); - pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-2, aRect.Top() ) ); - pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom()-1 ), - Point( aRect.Right()-1, aRect.Top()+2 ) ); - } - else - { - pDev->DrawLine( aRect.TopLeft(), aRect.BottomLeft() ); - pDev->DrawLine( aRect.TopLeft(), Point( aRect.Right()-1, aRect.Top() ) ); - } - - if ( nStyle & (BUTTON_DRAW_PRESSED | BUTTON_DRAW_CHECKED) ) - pDev->SetLineColor( rStyleSettings.GetShadowColor() ); - else - pDev->SetLineColor( rStyleSettings.GetLightColor() ); - if ( bClose ) - { - pDev->DrawLine( Point( aRect.Right(), aRect.Top()+2 ), aRect.BottomRight() ); - pDev->DrawLine( Point( aRect.Left()+2, aRect.Bottom() ), aRect.BottomRight() ); - pDev->DrawLine( Point( aRect.Right()-2, aRect.Top()+1 ), - Point( aRect.Left()+1, aRect.Bottom()-2 ) ); - } - else - { - pDev->DrawLine( aRect.TopRight(), aRect.BottomRight() ); - pDev->DrawLine( Point( aRect.Left()+1, aRect.Bottom() ), aRect.BottomRight() ); - } -} - -// ======================================================================= - static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect, SymbolType eType ) { @@ -509,7 +444,7 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect, case SYMBOL_CHECKMARK: { // #106953# never mirror checkmarks - BOOL bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled(); + sal_Bool bRTL = pDev->ImplHasMirroredGraphics() && pDev->IsRTLEnabled(); Point aPos1( bRTL ? rRect.Right() : rRect.Left(), rRect.Bottom() - rRect.GetHeight() / 3 ); Point aPos2( bRTL ? rRect.Right() - rRect.GetWidth()/3 : rRect.Left() + rRect.GetWidth()/3, @@ -631,57 +566,22 @@ static void ImplDrawSymbol( OutputDevice* pDev, const Rectangle& rRect, pDev->DrawRect( aRect ); } break; - - case SYMBOL_OS2CLOSE: - { - Rectangle aRect( nCenterX-n2, nCenterY-n2, - nCenterX+n2, nCenterY+n2 ); - ImplDrawOS2Symbol( pDev, aRect, 0, TRUE ); - } - break; - - case SYMBOL_OS2FLOAT: - { - Rectangle aRect( nCenterX-n2+4, nCenterY-n2+4, - nCenterX+n2-4, nCenterY+n2-3 ); - ImplDrawOS2Symbol( pDev, aRect, 0, FALSE ); - DecorationView aDecoView( pDev ); - Rectangle aRect2( nCenterX-n2, nCenterY-n2, - nCenterX-n2+2, nCenterY+n2 ); - aDecoView.DrawFrame( aRect2, - pDev->GetSettings().GetStyleSettings().GetLightColor(), - pDev->GetSettings().GetStyleSettings().GetShadowColor() ); - Rectangle aRect3( nCenterX+n2-2, nCenterY-n2, - nCenterX+n2, nCenterY+n2 ); - aDecoView.DrawFrame( aRect3, - pDev->GetSettings().GetStyleSettings().GetLightColor(), - pDev->GetSettings().GetStyleSettings().GetShadowColor() ); - } - break; - - case SYMBOL_OS2HIDE: - { - Rectangle aRect( nCenterX-n2+3, nCenterY-n2+3, - nCenterX+n2-3, nCenterY+n2-3 ); - ImplDrawOS2Symbol( pDev, aRect, 0, FALSE ); - } - break; } } // ----------------------------------------------------------------------- void DecorationView::DrawSymbol( const Rectangle& rRect, SymbolType eType, - const Color& rColor, USHORT nStyle ) + const Color& rColor, sal_uInt16 nStyle ) { const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings(); Rectangle aRect = mpOutDev->LogicToPixel( rRect ); Color aOldLineColor = mpOutDev->GetLineColor(); Color aOldFillColor = mpOutDev->GetFillColor(); - BOOL bOldMapMode = mpOutDev->IsMapModeEnabled(); + sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled(); mpOutDev->SetLineColor(); mpOutDev->SetFillColor( rColor ); - mpOutDev->EnableMapMode( FALSE ); + mpOutDev->EnableMapMode( sal_False ); if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) || (mpOutDev->GetOutDevType() == OUTDEV_PRINTER) ) @@ -725,8 +625,8 @@ void DecorationView::DrawFrame( const Rectangle& rRect, Rectangle aRect = mpOutDev->LogicToPixel( rRect ); Color aOldLineColor = mpOutDev->GetLineColor(); Color aOldFillColor = mpOutDev->GetFillColor(); - BOOL bOldMapMode = mpOutDev->IsMapModeEnabled(); - mpOutDev->EnableMapMode( FALSE ); + sal_Bool bOldMapMode = mpOutDev->IsMapModeEnabled(); + mpOutDev->EnableMapMode( sal_False ); mpOutDev->SetLineColor(); mpOutDev->ImplDraw2ColorFrame( aRect, rLeftTopColor, rRightBottomColor ); mpOutDev->SetLineColor( aOldLineColor ); @@ -737,7 +637,7 @@ void DecorationView::DrawFrame( const Rectangle& rRect, // ======================================================================= void DecorationView::DrawHighlightFrame( const Rectangle& rRect, - USHORT nStyle ) + sal_uInt16 nStyle ) { const StyleSettings& rStyleSettings = mpOutDev->GetSettings().GetStyleSettings(); Color aLightColor = rStyleSettings.GetLightColor(); @@ -787,7 +687,7 @@ void DecorationView::DrawHighlightFrame( const Rectangle& rRect, // ======================================================================= static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect, - const Color* pColor, BOOL bRound = FALSE ) + const Color* pColor, sal_Bool bRound = sal_False ) { long nLineWidth = pDev->ImplGetDPIX()/300; long nLineHeight = pDev->ImplGetDPIY()/300; @@ -836,10 +736,10 @@ static void ImplDrawDPILineRect( OutputDevice* pDev, Rectangle& rRect, // ======================================================================= static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, - const StyleSettings& rStyleSettings, USHORT nStyle ) + const StyleSettings& rStyleSettings, sal_uInt16 nStyle ) { // mask menu style - BOOL bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? TRUE : FALSE; + sal_Bool bMenuStyle = (nStyle & FRAME_DRAW_MENU) ? sal_True : sal_False; nStyle &= ~FRAME_DRAW_MENU; Window *pWin = NULL; @@ -850,7 +750,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, // menus may use different border colors (eg on XP) // normal frames will be drawn using the shadow color // whereas window frame borders will use black - BOOL bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() ); + sal_Bool bFlatBorders = ( !bMenuStyle && rStyleSettings.GetUseFlatBorders() ); // no flat borders for standard VCL controls (ie formcontrols that keep their classic look) // will not affect frame windows (like dropdowns) @@ -859,13 +759,13 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, // check for formcontrol, i.e., a control without NWF enabled Control *pControl = dynamic_cast< Control* >( pWin->GetWindow( WINDOW_CLIENT ) ); if( pControl && pControl->IsNativeWidgetEnabled() ) - bFlatBorders = TRUE; + bFlatBorders = sal_True; else - bFlatBorders = FALSE; + bFlatBorders = sal_False; } // no round corners for window frame borders - BOOL bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER)); + sal_Bool bRound = (bFlatBorders && !(nStyle & FRAME_DRAW_WINDOWBORDER)); if ( (rStyleSettings.GetOptions() & STYLE_OPTION_MONO) || (pDev->GetOutDevType() == OUTDEV_PRINTER) || @@ -874,7 +774,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, if ( nStyle & FRAME_DRAW_NODRAW ) { - USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle; + sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle; if( pWin->GetType() == WINDOW_BORDERWINDOW ) nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER; ImplControlValue aControlValue( nValueStyle ); @@ -889,7 +789,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, ImplDrawDPILineRect( pDev, rRect, NULL, bRound ); else { - USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE; + sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE; if ( nFrameStyle == FRAME_DRAW_GROUP ) { @@ -919,7 +819,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, { if( pWin && pWin->IsNativeControlSupported(CTRL_FRAME, PART_BORDER) ) { - USHORT nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle; + sal_uInt16 nValueStyle = bMenuStyle ? nStyle | FRAME_DRAW_MENU : nStyle; if( pWin->GetType() == WINDOW_BORDERWINDOW ) nValueStyle |= FRAME_DRAW_BORDERWINDOWBORDER; ImplControlValue aControlValue( nValueStyle ); @@ -956,7 +856,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, } else { - USHORT nFrameStyle = nStyle & FRAME_DRAW_STYLE; + sal_uInt16 nFrameStyle = nStyle & FRAME_DRAW_STYLE; if ( nFrameStyle == FRAME_DRAW_GROUP ) { pDev->SetFillColor(); @@ -1031,7 +931,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, rRect.Right()--; rRect.Bottom()--; - BOOL bDrawn = TRUE; + sal_Bool bDrawn = sal_True; if ( nFrameStyle == FRAME_DRAW_DOUBLEIN ) { if( bFlatBorders ) // no 3d effect @@ -1051,7 +951,7 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, rStyleSettings.GetLightColor(), rStyleSettings.GetShadowColor() ); else - bDrawn = FALSE; + bDrawn = sal_False; } if( bDrawn ) { @@ -1068,14 +968,14 @@ static void ImplDrawFrame( OutputDevice* pDev, Rectangle& rRect, // ----------------------------------------------------------------------- -Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle ) +Rectangle DecorationView::DrawFrame( const Rectangle& rRect, sal_uInt16 nStyle ) { Rectangle aRect = rRect; - BOOL bOldMap = mpOutDev->IsMapModeEnabled(); + sal_Bool bOldMap = mpOutDev->IsMapModeEnabled(); if ( bOldMap ) { aRect = mpOutDev->LogicToPixel( aRect ); - mpOutDev->EnableMapMode( FALSE ); + mpOutDev->EnableMapMode( sal_False ); } if ( !rRect.IsEmpty() ) @@ -1104,7 +1004,7 @@ Rectangle DecorationView::DrawFrame( const Rectangle& rRect, USHORT nStyle ) // ======================================================================= static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect, - const StyleSettings& rStyleSettings, USHORT nStyle ) + const StyleSettings& rStyleSettings, sal_uInt16 nStyle ) { Rectangle aFillRect = rRect; @@ -1317,14 +1217,14 @@ static void ImplDrawButton( OutputDevice* pDev, Rectangle& rRect, // ----------------------------------------------------------------------- -Rectangle DecorationView::DrawButton( const Rectangle& rRect, USHORT nStyle ) +Rectangle DecorationView::DrawButton( const Rectangle& rRect, sal_uInt16 nStyle ) { Rectangle aRect = rRect; - BOOL bOldMap = mpOutDev->IsMapModeEnabled(); + sal_Bool bOldMap = mpOutDev->IsMapModeEnabled(); if ( bOldMap ) { aRect = mpOutDev->LogicToPixel( aRect ); - mpOutDev->EnableMapMode( FALSE ); + mpOutDev->EnableMapMode( sal_False ); } if ( !rRect.IsEmpty() ) diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx index 63da028e82d2..7e2725e07023 100644 --- a/vcl/source/window/dialog.cxx +++ b/vcl/source/window/dialog.cxx @@ -73,24 +73,24 @@ static ByteString ImplGetDialogText( Dialog* pDialog ) // ======================================================================= -static BOOL ImplIsMnemonicCtrl( Window* pWindow ) +static sal_Bool ImplIsMnemonicCtrl( Window* pWindow ) { if( ! pWindow->GetSettings().GetStyleSettings().GetAutoMnemonic() ) - return FALSE; + return sal_False; if ( (pWindow->GetType() == WINDOW_RADIOBUTTON) || (pWindow->GetType() == WINDOW_CHECKBOX) || (pWindow->GetType() == WINDOW_TRISTATEBOX) || (pWindow->GetType() == WINDOW_PUSHBUTTON) ) - return TRUE; + return sal_True; if ( pWindow->GetType() == WINDOW_FIXEDTEXT ) { if ( pWindow->GetStyle() & (WB_INFO | WB_NOLABEL) ) - return FALSE; + return sal_False; Window* pNextWindow = pWindow->GetWindow( WINDOW_NEXT ); if ( !pNextWindow ) - return FALSE; + return sal_False; pNextWindow = pNextWindow->GetWindow( WINDOW_CLIENT ); if ( !(pNextWindow->GetStyle() & WB_TABSTOP) || (pNextWindow->GetType() == WINDOW_FIXEDTEXT) || @@ -99,12 +99,12 @@ static BOOL ImplIsMnemonicCtrl( Window* pWindow ) (pNextWindow->GetType() == WINDOW_CHECKBOX) || (pNextWindow->GetType() == WINDOW_TRISTATEBOX) || (pNextWindow->GetType() == WINDOW_PUSHBUTTON) ) - return FALSE; + return sal_False; - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -215,7 +215,7 @@ static PushButton* ImplGetCancelButton( Dialog* pDialog ) static void ImplMouseAutoPos( Dialog* pDialog ) { - ULONG nMouseOptions = pDialog->GetSettings().GetMouseSettings().GetOptions(); + sal_uLong nMouseOptions = pDialog->GetSettings().GetMouseSettings().GetOptions(); if ( nMouseOptions & MOUSE_OPTION_AUTOCENTERPOS ) { Size aSize = pDialog->GetOutputSizePixel(); @@ -250,13 +250,13 @@ struct DialogImpl void Dialog::ImplInitDialogData() { - mpWindowImpl->mbDialog = TRUE; + mpWindowImpl->mbDialog = sal_True; mpDialogParent = NULL; mpPrevExecuteDlg = NULL; - mbInExecute = FALSE; - mbOldSaveBack = FALSE; - mbInClose = FALSE; - mbModalMode = FALSE; + mbInExecute = sal_False; + mbOldSaveBack = sal_False; + mbInClose = sal_False; + mbModalMode = sal_False; mnMousePositioned = 0; mpDialogImpl = new DialogImpl; } @@ -265,7 +265,7 @@ void Dialog::ImplInitDialogData() void Dialog::ImplInit( Window* pParent, WinBits nStyle ) { - USHORT nSysWinMode = Application::GetSystemWindowMode(); + sal_uInt16 nSysWinMode = Application::GetSystemWindowMode(); if ( !(nStyle & WB_NODIALOGCONTROL) ) nStyle |= WB_DIALOGCONTROL; @@ -291,7 +291,7 @@ void Dialog::ImplInit( Window* pParent, WinBits nStyle ) while ( pExeDlg ) { // Nur wenn er sichtbar und enabled ist - if ( pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild( pExeDlg, TRUE ) && + if ( pParent->ImplGetFirstOverlapWindow()->IsWindowOrChild( pExeDlg, sal_True ) && pExeDlg->IsReallyVisible() && pExeDlg->IsEnabled() && pExeDlg->IsInputEnabled() && !pExeDlg->IsInModalMode() ) { @@ -341,8 +341,8 @@ void Dialog::ImplInit( Window* pParent, WinBits nStyle ) } else { - mpWindowImpl->mbFrame = TRUE; - mpWindowImpl->mbOverlapWin = TRUE; + mpWindowImpl->mbFrame = sal_True; + mpWindowImpl->mbOverlapWin = sal_True; SystemWindow::ImplInit( pParent, (nStyle & (WB_MOVEABLE | WB_SIZEABLE | WB_ROLLABLE | WB_CLOSEABLE | WB_STANDALONE)) | WB_CLOSEABLE, NULL ); // Now set all style bits mpWindowImpl->mnStyle = nStyle; @@ -374,7 +374,7 @@ void Dialog::ImplInitSettings() else if( IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_DIALOG ) ) { mpWindowImpl->mnNativeBackground = PART_BACKGROUND_DIALOG; - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); } // fallback to settings color else @@ -467,7 +467,7 @@ long Dialog::Notify( NotifyEvent& rNEvt ) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); KeyCode aKeyCode = pKEvt->GetKeyCode(); - USHORT nKeyCode = aKeyCode.GetCode(); + sal_uInt16 nKeyCode = aKeyCode.GetCode(); if ( (nKeyCode == KEY_ESCAPE) && ((GetStyle() & WB_CLOSEABLE) || ImplGetCancelButton( this ) || ImplGetOKButton( this )) ) @@ -477,7 +477,7 @@ long Dialog::Notify( NotifyEvent& rNEvt ) // post this Close asynchronous so we can leave our key handler before // we get destroyed PostUserEvent( LINK( this, Dialog, ImplAsyncCloseHdl ), this ); - return TRUE; + return sal_True; } } else if ( rNEvt.GetType() == EVENT_GETFOCUS ) @@ -488,8 +488,8 @@ long Dialog::Notify( NotifyEvent& rNEvt ) if( mbInExecute && mbModalMode ) { // do not change modal counter (pSVData->maAppData.mnModalDialog) - SetModalInputMode( FALSE ); - SetModalInputMode( TRUE ); + SetModalInputMode( sal_False ); + SetModalInputMode( sal_True ); // #93022# def-button might have changed after show if( !mnMousePositioned ) @@ -554,7 +554,7 @@ void Dialog::DataChanged( const DataChangedEvent& rDCEvt ) // ----------------------------------------------------------------------- -BOOL Dialog::Close() +sal_Bool Dialog::Close() { ImplDelData aDelData; ImplAddDel( &aDelData ); @@ -567,21 +567,21 @@ BOOL Dialog::Close() // ( Note: ) this used to work ( something changes somewhere ) if (mnCancelClose != 0) { - return FALSE; + return sal_False; } //liuchen 2009-7-22 if ( aDelData.IsDelete() ) - return FALSE; + return sal_False; ImplRemoveDel( &aDelData ); if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() && !IsInExecute() ) - return FALSE; + return sal_False; - mbInClose = TRUE; + mbInClose = sal_True; if ( !(GetStyle() & WB_CLOSEABLE) ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; ImplAddDel( &aDelData ); PushButton* pButton = ImplGetCancelButton( this ); if ( pButton ) @@ -592,30 +592,30 @@ BOOL Dialog::Close() if ( pButton ) pButton->Click(); else - bRet = FALSE; + bRet = sal_False; } if ( aDelData.IsDelete() ) - return TRUE; + return sal_True; ImplRemoveDel( &aDelData ); return bRet; } if ( IsInExecute() ) { - EndDialog( FALSE ); - mbInClose = FALSE; - return TRUE; + EndDialog( sal_False ); + mbInClose = sal_False; + return sal_True; } else { - mbInClose = FALSE; + mbInClose = sal_False; return SystemWindow::Close(); } } // ----------------------------------------------------------------------- -BOOL Dialog::ImplStartExecuteModal() +sal_Bool Dialog::ImplStartExecuteModal() { if ( mbInExecute ) { @@ -624,7 +624,7 @@ BOOL Dialog::ImplStartExecuteModal() aErrorStr += ImplGetDialogText( this ); OSL_FAIL( aErrorStr.GetBuffer() ); #endif - return FALSE; + return sal_False; } if ( Application::IsDialogCancelEnabled() ) @@ -634,7 +634,7 @@ BOOL Dialog::ImplStartExecuteModal() aErrorStr += ImplGetDialogText( this ); OSL_FAIL( aErrorStr.GetBuffer() ); #endif - return FALSE; + return sal_False; } #ifdef DBG_UTIL @@ -663,15 +663,15 @@ BOOL Dialog::ImplStartExecuteModal() pSVData->maWinData.mpTrackWin->EndTracking( ENDTRACK_CANCEL ); if ( pSVData->maWinData.mpCaptureWin ) pSVData->maWinData.mpCaptureWin->ReleaseMouse(); - EnableInput( TRUE, TRUE ); + EnableInput( sal_True, sal_True ); if ( GetParent() ) { NotifyEvent aNEvt( EVENT_EXECUTEDIALOG, this ); GetParent()->Notify( aNEvt ); } - mbInExecute = TRUE; - SetModalInputMode( TRUE ); + mbInExecute = sal_True; + SetModalInputMode( sal_True ); mbOldSaveBack = IsSaveBackgroundEnabled(); EnableSaveBackground(); @@ -681,7 +681,7 @@ BOOL Dialog::ImplStartExecuteModal() Show(); pSVData->maAppData.mnModalMode++; - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -753,7 +753,7 @@ void Dialog::StartExecuteModal( const Link& rEndDialogHdl ) // ----------------------------------------------------------------------- -BOOL Dialog::IsStartedModal() const +sal_Bool Dialog::IsStartedModal() const { return mpDialogImpl->mbStartedModal; } @@ -764,7 +764,7 @@ void Dialog::EndDialog( long nResult ) { if ( mbInExecute ) { - SetModalInputMode( FALSE ); + SetModalInputMode( sal_False ); // Dialog aus der Kette der Dialoge die in Execute stehen entfernen ImplSVData* pSVData = ImplGetSVData(); @@ -812,7 +812,7 @@ void Dialog::EndDialog( long nResult ) mpDialogImpl->mbStartedModal = false; mpDialogImpl->mnResult = -1; } - mbInExecute = FALSE; + mbInExecute = sal_False; } } @@ -833,9 +833,9 @@ void Dialog::EndAllDialogs( Window* pParent ) while ( pModDialog ) { pTempModDialog = pModDialog->mpPrevExecuteDlg; - if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, TRUE ) ) ) + if( !pParent || ( pParent && pParent->IsWindowOrChild( pModDialog, sal_True ) ) ) { - pModDialog->EndDialog( FALSE ); + pModDialog->EndDialog( sal_False ); pModDialog->PostUserEvent( Link() ); } pModDialog = pTempModDialog; @@ -844,7 +844,7 @@ void Dialog::EndAllDialogs( Window* pParent ) // ----------------------------------------------------------------------- -void Dialog::SetModalInputMode( BOOL bModal ) +void Dialog::SetModalInputMode( sal_Bool bModal ) { if ( bModal == mbModalMode ) return; @@ -858,8 +858,8 @@ void Dialog::SetModalInputMode( BOOL bModal ) // Diable the prev Modal Dialog, because our dialog must close at first, // before the other dialog can be closed (because the other dialog // is on stack since our dialog returns) - if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, TRUE ) ) - mpPrevExecuteDlg->EnableInput( FALSE, TRUE, TRUE, this ); + if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, sal_True ) ) + mpPrevExecuteDlg->EnableInput( sal_False, sal_True, sal_True, this ); // determine next overlap dialog parent Window* pParent = GetParent(); @@ -886,20 +886,20 @@ void Dialog::SetModalInputMode( BOOL bModal ) } // Enable the prev Modal Dialog - if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, TRUE ) ) + if ( mpPrevExecuteDlg && !mpPrevExecuteDlg->IsWindowOrChild( this, sal_True ) ) { - mpPrevExecuteDlg->EnableInput( TRUE, TRUE, TRUE, this ); + mpPrevExecuteDlg->EnableInput( sal_True, sal_True, sal_True, this ); // ensure continued modality of prev dialog // do not change modality counter - mpPrevExecuteDlg->SetModalInputMode( FALSE ); - mpPrevExecuteDlg->SetModalInputMode( TRUE ); + mpPrevExecuteDlg->SetModalInputMode( sal_False ); + mpPrevExecuteDlg->SetModalInputMode( sal_True ); } } } // ----------------------------------------------------------------------- -void Dialog::SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs ) +void Dialog::SetModalInputMode( sal_Bool bModal, sal_Bool bSubModalDialogs ) { if ( bSubModalDialogs ) { @@ -908,7 +908,7 @@ void Dialog::SetModalInputMode( BOOL bModal, BOOL bSubModalDialogs ) while ( pOverlap ) { if ( pOverlap->IsDialog() ) - ((Dialog*)pOverlap)->SetModalInputMode( bModal, TRUE ); + ((Dialog*)pOverlap)->SetModalInputMode( bModal, sal_True ); pOverlap = pOverlap->mpWindowImpl->mpNext; } } @@ -943,7 +943,7 @@ void Dialog::GrabFocusToFirstControl() !pFocusControl->IsVisible() || !pFocusControl->IsEnabled() || !pFocusControl->IsInputEnabled() ) { - USHORT n = 0; + sal_uInt16 n = 0; pFocusControl = ImplGetDlgWindow( n, DLGWINDOW_FIRST ); } if ( pFocusControl ) @@ -955,13 +955,13 @@ void Dialog::GetDrawWindowBorder( sal_Int32& rLeftBorder, sal_Int32& rTopBorder, ImplBorderWindow aImplWin( (Window*)this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP ); // aImplWin.SetText( GetText() ); // aImplWin.SetPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() ); -// aImplWin.SetDisplayActive( TRUE ); +// aImplWin.SetDisplayActive( sal_True ); // aImplWin.InitView(); aImplWin.GetBorder( rLeftBorder, rTopBorder, rRightBorder, rBottomBorder ); } -void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG ) +void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong ) { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); @@ -987,7 +987,7 @@ void Dialog::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULO ImplBorderWindow aImplWin( this, WB_BORDER|WB_STDWORK, BORDERWINDOW_STYLE_OVERLAP ); aImplWin.SetText( GetText() ); aImplWin.SetPosSizePixel( aPos.X(), aPos.Y(), aSize.Width(), aSize.Height() ); - aImplWin.SetDisplayActive( TRUE ); + aImplWin.SetDisplayActive( sal_True ); aImplWin.InitView(); aImplWin.Draw( Rectangle( aPos, aSize ), pDev, aPos ); diff --git a/vcl/source/window/dlgctrl.cxx b/vcl/source/window/dlgctrl.cxx index a1e8d3219d33..ce7b6dca8119 100644 --- a/vcl/source/window/dlgctrl.cxx +++ b/vcl/source/window/dlgctrl.cxx @@ -45,7 +45,7 @@ using namespace ::com::sun::star; // ======================================================================= -static BOOL ImplHasIndirectTabParent( Window* pWindow ) +static sal_Bool ImplHasIndirectTabParent( Window* pWindow ) { // The window has inderect tab parent if it is included in tab hierarchy // of the indirect parent window @@ -75,7 +75,7 @@ static Window* ImplGetTopParentOfTabHierarchy( Window* pParent ) // ----------------------------------------------------------------------- -static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex ) +static Window* ImplGetSubChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex ) { Window* pTabPage = NULL; Window* pFoundWindow = NULL; @@ -151,7 +151,7 @@ static Window* ImplGetSubChildWindow( Window* pParent, USHORT n, USHORT& nIndex // ----------------------------------------------------------------------- -static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable ) +static Window* ImplGetChildWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, sal_Bool bTestEnable ) { pParent = ImplGetTopParentOfTabHierarchy( pParent ); @@ -159,7 +159,7 @@ static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BO Window* pWindow = ImplGetSubChildWindow( pParent, n, nIndex ); if ( bTestEnable ) { - USHORT n2 = nIndex; + sal_uInt16 n2 = nIndex; while ( pWindow && (!pWindow->IsEnabled() || !pWindow->IsInputEnabled()) ) { n2 = nIndex+1; @@ -185,7 +185,7 @@ static Window* ImplGetChildWindow( Window* pParent, USHORT n, USHORT& nIndex, BO // ----------------------------------------------------------------------- -static Window* ImplGetNextWindow( Window* pParent, USHORT n, USHORT& nIndex, BOOL bTestEnable ) +static Window* ImplGetNextWindow( Window* pParent, sal_uInt16 n, sal_uInt16& nIndex, sal_Bool bTestEnable ) { Window* pWindow = ImplGetChildWindow( pParent, n+1, nIndex, bTestEnable ); if ( n == nIndex ) @@ -198,17 +198,17 @@ static Window* ImplGetNextWindow( Window* pParent, USHORT n, USHORT& nIndex, BOO // ----------------------------------------------------------------------- -Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType, - USHORT nFormStart, USHORT nFormEnd, - USHORT* pIndex ) +Window* Window::ImplGetDlgWindow( sal_uInt16 nIndex, sal_uInt16 nType, + sal_uInt16 nFormStart, sal_uInt16 nFormEnd, + sal_uInt16* pIndex ) { DBG_ASSERT( (nIndex >= nFormStart) && (nIndex <= nFormEnd), "Window::ImplGetDlgWindow() - nIndex not in Form" ); Window* pWindow = NULL; - USHORT i; - USHORT nTemp; - USHORT nStartIndex; + sal_uInt16 i; + sal_uInt16 nTemp; + sal_uInt16 nStartIndex; if ( nType == DLGWINDOW_PREV ) { @@ -219,7 +219,7 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType, i--; else i = nFormEnd; - pWindow = ImplGetChildWindow( this, i, nTemp, TRUE ); + pWindow = ImplGetChildWindow( this, i, nTemp, sal_True ); if ( !pWindow ) break; if ( (i == nTemp) && (pWindow->GetStyle() & WB_TABSTOP) ) @@ -239,19 +239,19 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType, { if ( i < nFormEnd ) { - pWindow = ImplGetNextWindow( this, i, i, TRUE ); + pWindow = ImplGetNextWindow( this, i, i, sal_True ); if ( (i > nFormEnd) || (i < nFormStart) ) - pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE ); + pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True ); } else - pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE ); + pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True ); } if ( i <= nFormEnd ) { // 2ten Index mitfuehren, falls alle Controls disablte - USHORT nStartIndex2 = i; - USHORT nOldIndex = i+1; + sal_uInt16 nStartIndex2 = i; + sal_uInt16 nOldIndex = i+1; do { @@ -264,9 +264,9 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType, } nOldIndex = i; if ( (i > nFormEnd) || (i < nFormStart) ) - pWindow = ImplGetChildWindow( this, nFormStart, i, TRUE ); + pWindow = ImplGetChildWindow( this, nFormStart, i, sal_True ); else - pWindow = ImplGetNextWindow( this, i, i, TRUE ); + pWindow = ImplGetNextWindow( this, i, i, sal_True ); } while ( (i != nStartIndex) && (i != nStartIndex2) ); @@ -304,20 +304,20 @@ Window* Window::ImplGetDlgWindow( USHORT nIndex, USHORT nType, // ----------------------------------------------------------------------- -static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& rIndex, - USHORT& rFormStart, USHORT& rFormEnd ) +static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, sal_uInt16& rIndex, + sal_uInt16& rFormStart, sal_uInt16& rFormEnd ) { Window* pSWindow; Window* pSecondWindow = NULL; Window* pTempWindow = NULL; - USHORT i; - USHORT nSecond_i = 0; - USHORT nFormStart = 0; - USHORT nSecondFormStart = 0; - USHORT nFormEnd; + sal_uInt16 i; + sal_uInt16 nSecond_i = 0; + sal_uInt16 nFormStart = 0; + sal_uInt16 nSecondFormStart = 0; + sal_uInt16 nFormEnd; // Focus-Fenster in der Child-Liste suchen - Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, FALSE ); + Window* pFirstChildWindow = pSWindow = ImplGetChildWindow( pParent, 0, i, sal_False ); if( pWindow == NULL ) pWindow = pSWindow; @@ -340,7 +340,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& break; } - pSWindow = ImplGetNextWindow( pParent, i, i, FALSE ); + pSWindow = ImplGetNextWindow( pParent, i, i, sal_False ); if ( !i ) pSWindow = NULL; } @@ -370,7 +370,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& do { nFormEnd = i; - pTempWindow = ImplGetNextWindow( pParent, i, i, FALSE ); + pTempWindow = ImplGetNextWindow( pParent, i, i, sal_False ); // the DialogControlStart mark is only accepted for the direct children if ( !i @@ -388,7 +388,7 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& if ( nIteration >= 2 ) { // this is an unexpected scenario - DBG_ASSERT( FALSE, "It seems to be an endless loop!" ); + DBG_ASSERT( sal_False, "It seems to be an endless loop!" ); rFormStart = 0; break; } @@ -402,16 +402,16 @@ static Window* ImplFindDlgCtrlWindow( Window* pParent, Window* pWindow, USHORT& // ----------------------------------------------------------------------- -static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode, - USHORT nFormStart, USHORT nFormEnd, BOOL bCheckEnable = TRUE ) +static Window* ImplFindAccelWindow( Window* pParent, sal_uInt16& rIndex, xub_Unicode cCharCode, + sal_uInt16 nFormStart, sal_uInt16 nFormEnd, sal_Bool bCheckEnable = sal_True ) { DBG_ASSERT( (rIndex >= nFormStart) && (rIndex <= nFormEnd), "Window::ImplFindAccelWindow() - rIndex not in Form" ); xub_Unicode cCompareChar; - USHORT nStart = rIndex; - USHORT i = rIndex; - int bSearch = TRUE; + sal_uInt16 nStart = rIndex; + sal_uInt16 i = rIndex; + int bSearch = sal_True; Window* pWindow; // MT: Where can we keep the CharClass?! @@ -423,13 +423,13 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode cCharCode = xCharClass->toUpper( String(cCharCode), 0, 1, rLocale )[0]; if ( i < nFormEnd ) - pWindow = ImplGetNextWindow( pParent, i, i, TRUE ); + pWindow = ImplGetNextWindow( pParent, i, i, sal_True ); else - pWindow = ImplGetChildWindow( pParent, nFormStart, i, TRUE ); + pWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_True ); while( bSearch && pWindow ) { const XubString aStr = pWindow->GetText(); - USHORT nPos = aStr.Search( '~' ); + sal_uInt16 nPos = aStr.Search( '~' ); while ( nPos != STRING_NOTFOUND ) { cCompareChar = aStr.GetChar( nPos+1 ); @@ -453,9 +453,9 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode // children checked for accelerators if( (pWindow->GetStyle() & WB_CHILDDLGCTRL) != 0 ) { - USHORT nChildIndex; - USHORT nChildFormStart; - USHORT nChildFormEnd; + sal_uInt16 nChildIndex; + sal_uInt16 nChildFormStart; + sal_uInt16 nChildFormEnd; // get form start and end ::ImplFindDlgCtrlWindow( pWindow, NULL, @@ -485,14 +485,14 @@ static Window* ImplFindAccelWindow( Window* pParent, USHORT& rIndex, xub_Unicode // ----------------------------------------------------------------------- -void Window::ImplControlFocus( USHORT nFlags ) +void Window::ImplControlFocus( sal_uInt16 nFlags ) { if ( nFlags & GETFOCUS_MNEMONIC ) { if ( GetType() == WINDOW_RADIOBUTTON ) { if ( !((RadioButton*)this)->IsChecked() ) - ((RadioButton*)this)->ImplCallClick( TRUE, nFlags ); + ((RadioButton*)this)->ImplCallClick( sal_True, nFlags ); else ImplGrabFocus( nFlags ); } @@ -505,8 +505,8 @@ void Window::ImplControlFocus( USHORT nFlags ) ((CheckBox*)this)->ImplCheck(); else if ( mpWindowImpl->mbPushButton ) { - ((PushButton*)this)->SetPressed( TRUE ); - ((PushButton*)this)->SetPressed( FALSE ); + ((PushButton*)this)->SetPressed( sal_True ); + ((PushButton*)this)->SetPressed( sal_False ); ((PushButton*)this)->Click(); } } @@ -517,7 +517,7 @@ void Window::ImplControlFocus( USHORT nFlags ) if ( GetType() == WINDOW_RADIOBUTTON ) { if ( !((RadioButton*)this)->IsChecked() ) - ((RadioButton*)this)->ImplCallClick( TRUE, nFlags ); + ((RadioButton*)this)->ImplCallClick( sal_True, nFlags ); else ImplGrabFocus( nFlags ); } @@ -528,32 +528,32 @@ void Window::ImplControlFocus( USHORT nFlags ) // ----------------------------------------------------------------------- -BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) +sal_Bool Window::ImplDlgCtrl( const KeyEvent& rKEvt, sal_Bool bKeyInput ) { KeyCode aKeyCode = rKEvt.GetKeyCode(); - USHORT nKeyCode = aKeyCode.GetCode(); + sal_uInt16 nKeyCode = aKeyCode.GetCode(); Window* pSWindow; Window* pTempWindow; Window* pButtonWindow; - USHORT i; - USHORT iButton; - USHORT iButtonStart; - USHORT iTemp; - USHORT nIndex; - USHORT nFormStart; - USHORT nFormEnd; - USHORT nDlgCtrlFlags; + sal_uInt16 i; + sal_uInt16 iButton; + sal_uInt16 iButtonStart; + sal_uInt16 iTemp; + sal_uInt16 nIndex; + sal_uInt16 nFormStart; + sal_uInt16 nFormEnd; + sal_uInt16 nDlgCtrlFlags; // Ohne Focus-Window koennen wir auch keine Steuerung uebernehmen Window* pFocusWindow = Application::GetFocusWindow(); if ( !pFocusWindow || !ImplIsWindowOrChild( pFocusWindow ) ) - return FALSE; + return sal_False; // Focus-Fenster in der Child-Liste suchen pSWindow = ::ImplFindDlgCtrlWindow( this, pFocusWindow, nIndex, nFormStart, nFormEnd ); if ( !pSWindow ) - return FALSE; + return sal_False; i = nIndex; nDlgCtrlFlags = 0; @@ -572,7 +572,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) if ( nKeyCode == KEY_RETURN ) { // Wir suchen zuerst nach einem DefPushButton/CancelButton - pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, TRUE ); + pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, sal_True ); iButtonStart = iButton; while ( pButtonWindow ) { @@ -580,17 +580,17 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) pButtonWindow->mpWindowImpl->mbPushButton ) break; - pButtonWindow = ImplGetNextWindow( this, iButton, iButton, TRUE ); + pButtonWindow = ImplGetNextWindow( this, iButton, iButton, sal_True ); if ( (iButton <= iButtonStart) || (iButton > nFormEnd) ) pButtonWindow = NULL; } if ( bKeyInput && !pButtonWindow && (nDlgCtrlFlags & WINDOW_DLGCTRL_RETURN) ) { - USHORT nType; - USHORT nGetFocusFlags = GETFOCUS_TAB; - USHORT nNewIndex; - USHORT iStart; + sal_uInt16 nType; + sal_uInt16 nGetFocusFlags = GETFOCUS_TAB; + sal_uInt16 nNewIndex; + sal_uInt16 iStart; if ( aKeyCode.IsShift() ) { nType = DLGWINDOW_PREV; @@ -619,7 +619,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) nGetFocusFlags |= GETFOCUS_AROUND; } pTempWindow->ImplControlFocus( nGetFocusFlags ); - return TRUE; + return sal_True; } else { @@ -641,21 +641,21 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) if ( !ImplCallPreNotify( aNEvt2 ) ) pSWindow->GetFocus(); pSWindow->mpWindowImpl->mnGetFocusFlags = 0; - return TRUE; + return sal_True; } } } else if ( nKeyCode == KEY_ESCAPE ) { // Wir suchen zuerst nach einem DefPushButton/CancelButton - pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, TRUE ); + pButtonWindow = ImplGetChildWindow( this, nFormStart, iButton, sal_True ); iButtonStart = iButton; while ( pButtonWindow ) { if ( pButtonWindow->GetType() == WINDOW_CANCELBUTTON ) break; - pButtonWindow = ImplGetNextWindow( this, iButton, iButton, TRUE ); + pButtonWindow = ImplGetNextWindow( this, iButton, iButton, sal_True ); if ( (iButton <= iButtonStart) || (iButton > nFormEnd) ) pButtonWindow = NULL; } @@ -664,9 +664,9 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) { if ( mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow ) { - ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE ); + ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False ); mpWindowImpl->mpDlgCtrlDownWindow = NULL; - return TRUE; + return sal_True; } } } @@ -677,10 +677,10 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) // keine Alt-Taste abfangen, wegen Windows if ( !aKeyCode.IsMod2() ) { - USHORT nType; - USHORT nGetFocusFlags = GETFOCUS_TAB; - USHORT nNewIndex; - BOOL bFormular = FALSE; + sal_uInt16 nType; + sal_uInt16 nGetFocusFlags = GETFOCUS_TAB; + sal_uInt16 nNewIndex; + sal_Bool bFormular = sal_False; // Bei Ctrl-Tab erstmal testen, ob zwischen Formularen // gesprungen werden soll @@ -689,7 +689,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) // Gruppe suchen Window* pFormularFirstWindow = NULL; Window* pLastFormularFirstWindow = NULL; - pTempWindow = ImplGetChildWindow( this, 0, iTemp, FALSE ); + pTempWindow = ImplGetChildWindow( this, 0, iTemp, sal_False ); Window* pPrevFirstFormularFirstWindow = NULL; Window* pFirstFormularFirstWindow = pTempWindow; while ( pTempWindow ) @@ -697,7 +697,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) if ( pTempWindow->ImplGetWindow()->IsDialogControlStart() ) { if ( iTemp != 0 ) - bFormular = TRUE; + bFormular = sal_True; if ( aKeyCode.IsShift() ) { if ( iTemp <= nIndex ) @@ -712,7 +712,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) pLastFormularFirstWindow = pTempWindow; } - pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, FALSE ); + pTempWindow = ImplGetNextWindow( this, iTemp, iTemp, sal_False ); if ( !iTemp ) pTempWindow = NULL; } @@ -727,9 +727,9 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) pFormularFirstWindow = pFirstFormularFirstWindow; } - USHORT nFoundFormStart = 0; - USHORT nFoundFormEnd = 0; - USHORT nTempIndex = 0; + sal_uInt16 nFoundFormStart = 0; + sal_uInt16 nFoundFormEnd = 0; + sal_uInt16 nTempIndex = 0; if ( ::ImplFindDlgCtrlWindow( this, pFormularFirstWindow, nTempIndex, nFoundFormStart, nFoundFormEnd ) ) { @@ -738,7 +738,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) if ( pFormularFirstWindow ) { pFormularFirstWindow->ImplControlFocus(); - return TRUE; + return sal_True; } } } @@ -774,7 +774,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) if ( !ImplCallPreNotify( aNEvt2 ) ) pSWindow->GetFocus(); pSWindow->mpWindowImpl->mnGetFocusFlags = 0; - return TRUE; + return sal_True; } else if ( pWindow ) { @@ -790,7 +790,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) nGetFocusFlags |= GETFOCUS_AROUND; } pWindow->ImplControlFocus( nGetFocusFlags ); - return TRUE; + return sal_True; } } } @@ -813,7 +813,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) { if ( pWindow != pSWindow ) pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD ); - return TRUE; + return sal_True; } if ( nStyle & WB_GROUP ) @@ -840,7 +840,7 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) if ( pWindow->IsVisible() && pWindow->IsEnabled() && pWindow->IsInputEnabled() ) { pWindow->ImplControlFocus( GETFOCUS_CURSOR | GETFOCUS_BACKWARD ); - return TRUE; + return sal_True; } pWindow = pWindow->GetWindow( WINDOW_NEXT ); @@ -854,11 +854,11 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) pSWindow = ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd ); if ( pSWindow ) { - USHORT nGetFocusFlags = GETFOCUS_MNEMONIC; + sal_uInt16 nGetFocusFlags = GETFOCUS_MNEMONIC; if ( pSWindow == ::ImplFindAccelWindow( this, i, c, nFormStart, nFormEnd ) ) nGetFocusFlags |= GETFOCUS_UNIQUEMNEMONIC; pSWindow->ImplControlFocus( nGetFocusFlags ); - return TRUE; + return sal_True; } } } @@ -870,30 +870,30 @@ BOOL Window::ImplDlgCtrl( const KeyEvent& rKEvt, BOOL bKeyInput ) { if ( mpWindowImpl->mpDlgCtrlDownWindow && (mpWindowImpl->mpDlgCtrlDownWindow != pButtonWindow) ) { - ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE ); + ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False ); mpWindowImpl->mpDlgCtrlDownWindow = NULL; } - ((PushButton*)pButtonWindow)->SetPressed( TRUE ); + ((PushButton*)pButtonWindow)->SetPressed( sal_True ); mpWindowImpl->mpDlgCtrlDownWindow = pButtonWindow; } else if ( mpWindowImpl->mpDlgCtrlDownWindow == pButtonWindow ) { mpWindowImpl->mpDlgCtrlDownWindow = NULL; - ((PushButton*)pButtonWindow)->SetPressed( FALSE ); + ((PushButton*)pButtonWindow)->SetPressed( sal_False ); ((PushButton*)pButtonWindow)->Click(); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- // checks if this window has dialog control -BOOL Window::ImplHasDlgCtrl() +sal_Bool Window::ImplHasDlgCtrl() { Window* pDlgCtrlParent; @@ -905,9 +905,9 @@ BOOL Window::ImplHasDlgCtrl() pDlgCtrlParent = pDlgCtrlParent->ImplGetParent(); if ( !pDlgCtrlParent || ((pDlgCtrlParent->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL)) != WB_DIALOGCONTROL) ) - return FALSE; + return sal_False; else - return TRUE; + return sal_True; } void Window::ImplDlgCtrlNextWindow() @@ -915,9 +915,9 @@ void Window::ImplDlgCtrlNextWindow() Window* pDlgCtrlParent; Window* pDlgCtrl; Window* pSWindow; - USHORT nIndex; - USHORT nFormStart; - USHORT nFormEnd; + sal_uInt16 nIndex; + sal_uInt16 nFormStart; + sal_uInt16 nFormEnd; // lookup window for dialog control pDlgCtrl = this; @@ -944,14 +944,14 @@ if ( !pDlgCtrlParent || (GetStyle() & WB_NODIALOGCONTROL) || ((pDlgCtrlParent->G // ----------------------------------------------------------------------- static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow, - BOOL bGetFocus ) + sal_Bool bGetFocus ) { PushButton* pOldDefButton = NULL; PushButton* pNewDefButton = NULL; Window* pSWindow; - USHORT i; - USHORT nFormStart; - USHORT nFormEnd; + sal_uInt16 i; + sal_uInt16 nFormStart; + sal_uInt16 nFormEnd; // Formular suchen pSWindow = ::ImplFindDlgCtrlWindow( pParent, pFocusWindow, i, nFormStart, nFormEnd ); @@ -961,7 +961,7 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow, nFormEnd = 0xFFFF; } - pSWindow = ImplGetChildWindow( pParent, nFormStart, i, FALSE ); + pSWindow = ImplGetChildWindow( pParent, nFormStart, i, sal_False ); while ( pSWindow ) { if ( pSWindow->ImplIsPushButton() ) @@ -975,14 +975,14 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow, pNewDefButton = pPushButton; } - pSWindow = ImplGetNextWindow( pParent, i, i, FALSE ); + pSWindow = ImplGetNextWindow( pParent, i, i, sal_False ); if ( !i || (i > nFormEnd) ) pSWindow = NULL; } if ( !bGetFocus ) { - USHORT nDummy; + sal_uInt16 nDummy; Window* pNewFocusWindow = Application::GetFocusWindow(); if ( !pNewFocusWindow || !pParent->ImplIsWindowOrChild( pNewFocusWindow ) ) pNewDefButton = NULL; @@ -994,19 +994,19 @@ static void ImplDlgCtrlUpdateDefButton( Window* pParent, Window* pFocusWindow, if ( pOldDefButton != pNewDefButton ) { if ( pOldDefButton ) - pOldDefButton->ImplSetDefButton( FALSE ); + pOldDefButton->ImplSetDefButton( sal_False ); if ( pNewDefButton ) - pNewDefButton->ImplSetDefButton( TRUE ); + pNewDefButton->ImplSetDefButton( sal_True ); } } // ----------------------------------------------------------------------- -void Window::ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus ) +void Window::ImplDlgCtrlFocusChanged( Window* pWindow, sal_Bool bGetFocus ) { if ( mpWindowImpl->mpDlgCtrlDownWindow && !bGetFocus ) { - ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( FALSE ); + ((PushButton*)mpWindowImpl->mpDlgCtrlDownWindow)->SetPressed( sal_False ); mpWindowImpl->mpDlgCtrlDownWindow = NULL; } @@ -1017,9 +1017,9 @@ void Window::ImplDlgCtrlFocusChanged( Window* pWindow, BOOL bGetFocus ) Window* Window::ImplFindDlgCtrlWindow( Window* pWindow ) { - USHORT nIndex; - USHORT nFormStart; - USHORT nFormEnd; + sal_uInt16 nIndex; + sal_uInt16 nFormStart; + sal_uInt16 nFormEnd; // Focus-Fenster in der Child-Liste suchen und zurueckgeben return ::ImplFindDlgCtrlWindow( this, pWindow, nIndex, nFormStart, nFormEnd ); @@ -1045,7 +1045,7 @@ Window* Window::GetParentLabeledBy( const Window* ) const static sal_Unicode getAccel( const String& rStr ) { sal_Unicode nChar = 0; - USHORT nPos = 0; + sal_uInt16 nPos = 0; do { nPos = rStr.Search( '~', nPos ); @@ -1067,10 +1067,10 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window { // #i100833# MT 2010/02: Group box and fixed lines can also lable a fixed text. // See tools/options/print for example. - BOOL bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE); + sal_Bool bThisIsAGroupControl = (nMyType == WINDOW_GROUPBOX) || (nMyType == WINDOW_FIXEDLINE); Window* pSWindow = NULL; // get index, form start and form end - USHORT nIndex=0, nFormStart=0, nFormEnd=0; + sal_uInt16 nIndex=0, nFormStart=0, nFormEnd=0; pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow, pLabel, nIndex, @@ -1084,7 +1084,7 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window nAccel, nFormStart, nFormEnd, - FALSE ); + sal_False ); } else { @@ -1096,7 +1096,7 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window pSWindow = ::ImplGetChildWindow( pFrameWindow, nIndex, nIndex, - FALSE ); + sal_False ); if( pSWindow && pSWindow->IsVisible() && ! (pSWindow->GetStyle() & WB_NOLABEL) ) { WindowType nType = pSWindow->GetType(); @@ -1119,11 +1119,15 @@ static Window* ImplGetLabelFor( Window* pFrameWindow, WindowType nMyType, Window return pWindow; } -Window* Window::GetLabelFor() const +Window* Window::GetAccessibleRelationLabelFor() const { if ( mpWindowImpl->mbDisableAccessibleLabelForRelation ) return NULL; + if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabelForWindow ) + return mpWindowImpl->mpAccessibleInfos->pLabelForWindow; + + Window* pWindow = NULL; Window* pFrameWindow = ImplGetFrameWindow(); @@ -1161,7 +1165,7 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo // is directly before the control // get form start and form end and index of this control - USHORT nIndex, nFormStart, nFormEnd; + sal_uInt16 nIndex, nFormStart, nFormEnd; Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow, pLabeled, nIndex, @@ -1176,13 +1180,13 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo { nFormStart = nIndex-1; } - for( USHORT nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- ) + for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- ) { - USHORT nFoundIndex = 0; + sal_uInt16 nFoundIndex = 0; pSWindow = ::ImplGetChildWindow( pFrameWindow, nSearchIndex, nFoundIndex, - FALSE ); + sal_False ); if( pSWindow && pSWindow->IsVisible() && !(pSWindow->GetStyle() & WB_NOLABEL) ) { WindowType nType = pSWindow->GetType(); @@ -1204,11 +1208,14 @@ static Window* ImplGetLabeledBy( Window* pFrameWindow, WindowType nMyType, Windo return pWindow; } -Window* Window::GetLabeledBy() const +Window* Window::GetAccessibleRelationLabeledBy() const { if ( mpWindowImpl->mbDisableAccessibleLabeledByRelation ) return NULL; + if ( mpWindowImpl->mpAccessibleInfos && mpWindowImpl->mpAccessibleInfos->pLabeledByWindow ) + return mpWindowImpl->mpAccessibleInfos->pLabeledByWindow; + Window* pWindow = NULL; Window* pFrameWindow = ImplGetFrameWindow(); @@ -1237,6 +1244,62 @@ Window* Window::GetLabeledBy() const return pWindow; } +Window* Window::GetAccessibleRelationMemberOf() const +{ + Window* pWindow = NULL; + Window* pFrameWindow = GetParent(); + if ( !pFrameWindow ) + { + pFrameWindow = ImplGetFrameWindow(); + } + // if( ! ( GetType() == WINDOW_FIXEDTEXT || + if( !( GetType() == WINDOW_FIXEDLINE || + GetType() == WINDOW_GROUPBOX ) ) + { + // search for a control that makes member of this window + // it is considered the last fixed line or group box + // that comes before this control; with the exception of push buttons + // which are labeled only if the fixed line or group box + // is directly before the control + // get form start and form end and index of this control + sal_uInt16 nIndex, nFormStart, nFormEnd; + Window* pSWindow = ::ImplFindDlgCtrlWindow( pFrameWindow, + const_cast<Window*>(this), + nIndex, + nFormStart, + nFormEnd ); + if( pSWindow && nIndex != nFormStart ) + { + if( GetType() == WINDOW_PUSHBUTTON || + GetType() == WINDOW_HELPBUTTON || + GetType() == WINDOW_OKBUTTON || + GetType() == WINDOW_CANCELBUTTON ) + { + nFormStart = nIndex-1; + } + for( sal_uInt16 nSearchIndex = nIndex-1; nSearchIndex >= nFormStart; nSearchIndex-- ) + { + sal_uInt16 nFoundIndex = 0; + pSWindow = ::ImplGetChildWindow( pFrameWindow, + nSearchIndex, + nFoundIndex, + sal_False ); + if( pSWindow && pSWindow->IsVisible() && + ( pSWindow->GetType() == WINDOW_FIXEDLINE || + pSWindow->GetType() == WINDOW_GROUPBOX ) ) + { + pWindow = pSWindow; + break; + } + if( nFoundIndex > nSearchIndex || nSearchIndex == 0 ) + break; + } + } + } + return pWindow; +} +//-----IAccessibility2 Implementation 2009 + // ----------------------------------------------------------------------- KeyEvent Window::GetActivationKey() const @@ -1246,20 +1309,24 @@ KeyEvent Window::GetActivationKey() const sal_Unicode nAccel = getAccel( GetText() ); if( ! nAccel ) { - Window* pWindow = GetLabeledBy(); + Window* pWindow = GetAccessibleRelationLabeledBy(); if( pWindow ) nAccel = getAccel( pWindow->GetText() ); } if( nAccel ) { - USHORT nCode = 0; + sal_uInt16 nCode = 0; if( nAccel >= 'a' && nAccel <= 'z' ) nCode = KEY_A + (nAccel-'a'); else if( nAccel >= 'A' && nAccel <= 'Z' ) nCode = KEY_A + (nAccel-'A'); else if( nAccel >= '0' && nAccel <= '9' ) nCode = KEY_0 + (nAccel-'0'); - KeyCode aKeyCode( nCode, FALSE, FALSE, TRUE, FALSE ); + else if( nAccel == '.' ) + nCode = KEY_POINT; + else if( nAccel == '-' ) + nCode = KEY_SUBTRACT; + KeyCode aKeyCode( nCode, sal_False, sal_False, sal_True, sal_False ); aKeyEvent = KeyEvent( nAccel, aKeyCode ); } return aKeyEvent; diff --git a/vcl/source/window/dockingarea.cxx b/vcl/source/window/dockingarea.cxx index 231f17759b86..ded887c59933 100644 --- a/vcl/source/window/dockingarea.cxx +++ b/vcl/source/window/dockingarea.cxx @@ -127,7 +127,7 @@ void DockingAreaWindow::StateChanged( StateChangedType nType ) // ----------------------------------------------------------------------- -BOOL DockingAreaWindow::IsHorizontal() const +sal_Bool DockingAreaWindow::IsHorizontal() const { return ( mpImplData->meAlign == WINDOWALIGN_TOP || mpImplData->meAlign == WINDOWALIGN_BOTTOM ); } @@ -150,7 +150,7 @@ WindowAlign DockingAreaWindow::GetAlign() const void DockingAreaWindow::Paint( const Rectangle& ) { - EnableNativeWidget( TRUE ); // only required because the toolkit curently switches this flag off + EnableNativeWidget( sal_True ); // only required because the toolkit curently switches this flag off if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) ) { ToolbarValue aControlValue; @@ -159,7 +159,7 @@ void DockingAreaWindow::Paint( const Rectangle& ) { // give NWF a hint that this dockingarea is adjacent to the menubar // useful for special gradient effects that should cover both windows - aControlValue.mbIsTopDockingArea = TRUE; + aControlValue.mbIsTopDockingArea = sal_True; } ControlState nState = CTRL_STATE_ENABLED; @@ -173,8 +173,8 @@ void DockingAreaWindow::Paint( const Rectangle& ) aCtrlRegion, nState, aControlValue, rtl::OUString() ); // each toolbar gets a thin border to better recognize its borders on the homogeneous docking area - USHORT nChildren = GetChildCount(); - for( USHORT n = 0; n < nChildren; n++ ) + sal_uInt16 nChildren = GetChildCount(); + for( sal_uInt16 n = 0; n < nChildren; n++ ) { Window* pChild = GetChild( n ); if ( pChild->IsVisible() ) @@ -198,8 +198,8 @@ void DockingAreaWindow::Paint( const Rectangle& ) // create map to find toolbar lines Size aOutSz = GetOutputSizePixel(); std::map< int, int > ranges; - USHORT nChildren = GetChildCount(); - for( USHORT n = 0; n < nChildren; n++ ) + sal_uInt16 nChildren = GetChildCount(); + for( sal_uInt16 n = 0; n < nChildren; n++ ) { Window* pChild = GetChild( n ); Point aPos = pChild->GetPosPixel(); diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx index ee8e584ac234..017fdc5390db 100644 --- a/vcl/source/window/dockmgr.cxx +++ b/vcl/source/window/dockmgr.cxx @@ -59,13 +59,13 @@ class ImplDockFloatWin2 : public FloatingWindow { private: ImplDockingWindowWrapper* mpDockWin; - ULONG mnLastTicks; + sal_uLong mnLastTicks; Timer maDockTimer; Timer maEndDockTimer; Point maDockPos; Rectangle maDockRect; - BOOL mbInMove; - ULONG mnLastUserEvent; + sal_Bool mbInMove; + sal_uLong mnLastUserEvent; DECL_LINK( DockingHdl, ImplDockFloatWin2* ); DECL_LINK( DockTimerHdl, ImplDockFloatWin2* ); @@ -77,18 +77,18 @@ public: virtual void Move(); virtual void Resize(); - virtual void TitleButtonClick( USHORT nButton ); + virtual void TitleButtonClick( sal_uInt16 nButton ); virtual void Pin(); virtual void Roll(); virtual void PopupModeEnd(); virtual void Resizing( Size& rSize ); - virtual BOOL Close(); + virtual sal_Bool Close(); using Window::SetPosSizePixel; virtual void SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, - USHORT nFlags = WINDOW_POSSIZE_ALL ); + sal_uInt16 nFlags = WINDOW_POSSIZE_ALL ); - ULONG GetLastTicks() const { return mnLastTicks; } + sal_uLong GetLastTicks() const { return mnLastTicks; } }; // ======================================================================= @@ -98,16 +98,16 @@ ImplDockFloatWin2::ImplDockFloatWin2( Window* pParent, WinBits nWinBits, FloatingWindow( pParent, nWinBits ), mpDockWin( pDockingWin ), mnLastTicks( Time::GetSystemTicks() ), - mbInMove( FALSE ), + mbInMove( sal_False ), mnLastUserEvent( 0 ) { // Daten vom DockingWindow uebernehmen if ( pDockingWin ) { SetSettings( pDockingWin->GetWindow()->GetSettings() ); - Enable( pDockingWin->GetWindow()->IsEnabled(), FALSE ); - EnableInput( pDockingWin->GetWindow()->IsInputEnabled(), FALSE ); - AlwaysEnableInput( pDockingWin->GetWindow()->IsAlwaysEnableInput(), FALSE ); + Enable( pDockingWin->GetWindow()->IsEnabled(), sal_False ); + EnableInput( pDockingWin->GetWindow()->IsInputEnabled(), sal_False ); + AlwaysEnableInput( pDockingWin->GetWindow()->IsAlwaysEnableInput(), sal_False ); EnableAlwaysOnTop( pDockingWin->GetWindow()->IsAlwaysOnTopEnabled() ); SetActivateMode( pDockingWin->GetWindow()->GetActivateMode() ); } @@ -147,7 +147,7 @@ IMPL_LINK( ImplDockFloatWin2, DockTimerHdl, ImplDockFloatWin2*, EMPTYARG ) else if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) ) { mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking(); - mpDockWin->EndDocking( maDockRect, FALSE ); + mpDockWin->EndDocking( maDockRect, sal_False ); } else { @@ -167,7 +167,7 @@ IMPL_LINK( ImplDockFloatWin2, EndDockTimerHdl, ImplDockFloatWin2*, EMPTYARG ) if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) ) { mpDockWin->GetWindow()->GetParent()->ImplGetFrameWindow()->HideTracking(); - mpDockWin->EndDocking( maDockRect, TRUE ); + mpDockWin->EndDocking( maDockRect, sal_True ); } else { @@ -186,7 +186,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG ) Window *pDockingArea = mpDockWin->GetWindow()->GetParent(); PointerState aState = pDockingArea->GetPointerState(); - BOOL bRealMove = TRUE; + sal_Bool bRealMove = sal_True; if( GetStyle() & WB_OWNERDRAWDECORATION ) { // for windows with ownerdraw decoration @@ -207,9 +207,9 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG ) PointerState aBorderState = pBorder->GetPointerState(); if( aBorderRect.IsInside( aBorderState.maPos ) ) - bRealMove = TRUE; + bRealMove = sal_True; else - bRealMove = FALSE; + bRealMove = sal_False; } } @@ -229,7 +229,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG ) if( ! mpDockWin->IsDocking() ) mpDockWin->StartDocking( aMousePos, maDockRect ); - BOOL bFloatMode = mpDockWin->Docking( aMousePos, maDockRect ); + sal_Bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect ); if( ! bFloatMode ) { @@ -247,7 +247,7 @@ IMPL_LINK( ImplDockFloatWin2, DockingHdl, ImplDockFloatWin2*, EMPTYARG ) EndDockTimerHdl( this ); } } - mbInMove = FALSE; + mbInMove = sal_False; return 0; } // ----------------------------------------------------------------------- @@ -257,7 +257,7 @@ void ImplDockFloatWin2::Move() if( mbInMove ) return; - mbInMove = TRUE; + mbInMove = sal_True; FloatingWindow::Move(); mpDockWin->GetWindow()->Move(); @@ -289,7 +289,7 @@ void ImplDockFloatWin2::Resize() void ImplDockFloatWin2::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, - USHORT nFlags ) + sal_uInt16 nFlags ) { FloatingWindow::SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags ); } @@ -297,7 +297,7 @@ void ImplDockFloatWin2::SetPosSizePixel( long nX, long nY, // ----------------------------------------------------------------------- -void ImplDockFloatWin2::TitleButtonClick( USHORT nButton ) +void ImplDockFloatWin2::TitleButtonClick( sal_uInt16 nButton ) { FloatingWindow::TitleButtonClick( nButton ); mpDockWin->TitleButtonClick( nButton ); @@ -337,7 +337,7 @@ void ImplDockFloatWin2::Resizing( Size& rSize ) // ----------------------------------------------------------------------- -BOOL ImplDockFloatWin2::Close() +sal_Bool ImplDockFloatWin2::Close() { return mpDockWin->Close(); } @@ -373,33 +373,33 @@ ImplDockingWindowWrapper* DockingManager::GetDockingWindowWrapper( const Window return NULL; } -BOOL DockingManager::IsDockable( const Window *pWindow ) +sal_Bool DockingManager::IsDockable( const Window *pWindow ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); /* if( pWindow->HasDockingHandler() ) - return TRUE; + return sal_True; */ return (pWrapper != NULL); } -BOOL DockingManager::IsFloating( const Window *pWindow ) +sal_Bool DockingManager::IsFloating( const Window *pWindow ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); if( pWrapper ) return pWrapper->IsFloatingMode(); else - return FALSE; + return sal_False; } -BOOL DockingManager::IsLocked( const Window *pWindow ) +sal_Bool DockingManager::IsLocked( const Window *pWindow ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); if( pWrapper && pWrapper->IsLocked() ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } void DockingManager::Lock( const Window *pWindow ) @@ -416,14 +416,14 @@ void DockingManager::Unlock( const Window *pWindow ) pWrapper->Unlock(); } -void DockingManager::SetFloatingMode( const Window *pWindow, BOOL bFloating ) +void DockingManager::SetFloatingMode( const Window *pWindow, sal_Bool bFloating ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); if( pWrapper ) pWrapper->SetFloatingMode( bFloating ); } -void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, ULONG nFlags ) +void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWindow, sal_uLong nFlags ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); if( pWrapper ) @@ -438,13 +438,13 @@ void DockingManager::StartPopupMode( ToolBox *pParentToolBox, const Window *pWin FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE ); } -BOOL DockingManager::IsInPopupMode( const Window *pWindow ) +sal_Bool DockingManager::IsInPopupMode( const Window *pWindow ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); if( pWrapper && pWrapper->IsInPopupMode() ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -488,7 +488,7 @@ void DockingManager::RemoveWindow( const Window *pWindow ) void DockingManager::SetPosSizePixel( Window *pWindow, long nX, long nY, long nWidth, long nHeight, - USHORT nFlags ) + sal_uInt16 nFlags ) { ImplDockingWindowWrapper* pWrapper = GetDockingWindowWrapper( pWindow ); if( pWrapper ) @@ -529,8 +529,8 @@ class ImplPopupFloatWin : public FloatingWindow { private: ImplDockingWindowWrapper* mpDockingWin; - BOOL mbHighlight; - BOOL mbMoving; + sal_Bool mbHighlight; + sal_Bool mbMoving; bool mbTrackingEnabled; Point maDelta; Point maTearOffPosition; @@ -563,13 +563,13 @@ public: ImplPopupFloatWin::ImplPopupFloatWin( Window* pParent, ImplDockingWindowWrapper* pDockingWin, bool bHasGrip ) : FloatingWindow( pParent, WB_NOBORDER | WB_SYSTEMWINDOW | WB_NOSHADOW) { - mpWindowImpl->mbToolbarFloatingWindow = TRUE; // indicate window type, required for accessibility + mpWindowImpl->mbToolbarFloatingWindow = sal_True; // indicate window type, required for accessibility // which should not see this window as a toplevel window mpDockingWin = pDockingWin; - mbHighlight = FALSE; - mbMoving = FALSE; - mbTrackingEnabled = FALSE; - mbGripAtBottom = TRUE; + mbHighlight = sal_False; + mbMoving = sal_False; + mbTrackingEnabled = sal_False; + mbGripAtBottom = sal_True; mbHasGrip = bHasGrip; ImplSetBorder(); @@ -679,9 +679,9 @@ void ImplPopupFloatWin::DrawBorder() void ImplPopupFloatWin::DrawGrip() { - BOOL bLinecolor = IsLineColor(); + sal_Bool bLinecolor = IsLineColor(); Color aLinecolor = GetLineColor(); - BOOL bFillcolor = IsFillColor(); + sal_Bool bFillcolor = IsFillColor(); Color aFillcolor = GetFillColor(); // draw background @@ -694,7 +694,7 @@ void ImplPopupFloatWin::DrawGrip() if( mbHighlight ) { Erase( aRect ); - DrawSelectionBackground( aRect, 2, FALSE, TRUE, FALSE ); + DrawSelectionBackground( aRect, 2, sal_False, sal_True, sal_False ); } else { @@ -781,18 +781,18 @@ void ImplPopupFloatWin::MouseMove( const MouseEvent& rMEvt ) if( mbTrackingEnabled && rMEvt.IsLeft() && GetDragRect().IsInside( aMousePos ) ) { // start window move - mbMoving = TRUE; + mbMoving = sal_True; StartTracking( STARTTRACK_NOKEYCANCEL ); return; } if( !mbHighlight && GetDragRect().IsInside( aMousePos ) ) { - mbHighlight = TRUE; + mbHighlight = sal_True; DrawGrip(); } if( mbHighlight && ( rMEvt.IsLeaveWindow() || !GetDragRect().IsInside( aMousePos ) ) ) { - mbHighlight = FALSE; + mbHighlight = sal_False; DrawGrip(); } } @@ -829,7 +829,7 @@ void ImplPopupFloatWin::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingEnded() ) { - mbMoving = FALSE; + mbMoving = sal_False; EndPopupMode( FLOATWIN_POPUPMODEEND_TEAROFF ); } else if ( !rTEvt.GetMouseEvent().IsSynthetic() ) @@ -853,39 +853,39 @@ ImplDockingWindowWrapper::ImplDockingWindowWrapper( const Window *pWindow ) mpDockingWindow = (Window*) pWindow; mpParent = pWindow->GetParent(); - mbDockable = TRUE; - mbLocked = FALSE; + mbDockable = sal_True; + mbLocked = sal_False; mnFloatBits = WB_BORDER | WB_CLOSEABLE | WB_SIZEABLE | (pWindow->GetStyle() & DOCKWIN_FLOATSTYLES); DockingWindow *pDockWin = dynamic_cast< DockingWindow* > ( mpDockingWindow ); if( pDockWin ) mnFloatBits = pDockWin->GetFloatStyle(); // must be enabled in Window::Notify to prevent permanent docking during mouse move - mbStartDockingEnabled = FALSE; + mbStartDockingEnabled = sal_False; } ImplDockingWindowWrapper::~ImplDockingWindowWrapper() { if ( IsFloatingMode() ) { - GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE ); - SetFloatingMode( FALSE ); + GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE ); + SetFloatingMode( sal_False ); } } // ----------------------------------------------------------------------- -BOOL ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos ) +sal_Bool ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos ) { if ( !mbDockable ) - return FALSE; + return sal_False; if( !mbStartDockingEnabled ) - return FALSE; + return sal_False; maMouseOff = rPos; maMouseStart = maMouseOff; - mbDocking = TRUE; + mbDocking = sal_True; mbLastFloatMode = IsFloatingMode(); mbStartFloat = mbLastFloatMode; @@ -929,7 +929,7 @@ BOOL ImplDockingWindowWrapper::ImplStartDocking( const Point& rPos ) GetWindow()->ImplGetFrameWindow()->ImplUpdateAll(); GetWindow()->StartTracking( STARTTRACK_KEYMOD ); - return TRUE; + return sal_True; } // ======================================================================= @@ -938,15 +938,15 @@ void ImplDockingWindowWrapper::ImplInitData() { mpDockingWindow = NULL; - //GetWindow()->mpWindowImpl->mbDockWin = TRUE; // TODO: must be eliminated + //GetWindow()->mpWindowImpl->mbDockWin = sal_True; // TODO: must be eliminated mpFloatWin = NULL; - mbDockCanceled = FALSE; - mbFloatPrevented = FALSE; - mbDocking = FALSE; - mbPined = FALSE; - mbRollUp = FALSE; - mbDockBtn = FALSE; - mbHideBtn = FALSE; + mbDockCanceled = sal_False; + mbFloatPrevented = sal_False; + mbDocking = sal_False; + mbPined = sal_False; + mbRollUp = sal_False; + mbDockBtn = sal_False; + mbHideBtn = sal_False; maMaxOutSize = Size( SHRT_MAX, SHRT_MAX ); } @@ -959,13 +959,13 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingEnded() ) { - mbDocking = FALSE; + mbDocking = sal_False; GetWindow()->HideTracking(); if ( rTEvt.IsTrackingCanceled() ) { - mbDockCanceled = TRUE; + mbDockCanceled = sal_True; EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode ); - mbDockCanceled = FALSE; + mbDockCanceled = sal_False; } else EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode ); @@ -993,9 +993,9 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) aPos.X() += maMouseOff.X(); aPos.Y() += maMouseOff.Y(); - BOOL bFloatMode = Docking( aPos, aTrackRect ); + sal_Bool bFloatMode = Docking( aPos, aTrackRect ); - mbFloatPrevented = FALSE; + mbFloatPrevented = sal_False; if ( mbLastFloatMode != bFloatMode ) { if ( bFloatMode ) @@ -1018,7 +1018,7 @@ void ImplDockingWindowWrapper::Tracking( const TrackingEvent& rTEvt ) mbLastFloatMode = bFloatMode; } - USHORT nTrackStyle; + sal_uInt16 nTrackStyle; if ( bFloatMode ) nTrackStyle = SHOWTRACK_OBJECT; else @@ -1055,12 +1055,12 @@ void ImplDockingWindowWrapper::StartDocking( const Point& rPoint, Rectangle& rRe DockingData data( rPoint, rRect, IsFloatingMode() ); GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_STARTDOCKING, &data ); - mbDocking = TRUE; + mbDocking = sal_True; } // ----------------------------------------------------------------------- -BOOL ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect ) +sal_Bool ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect ) { DockingData data( rPoint, rRect, IsFloatingMode() ); @@ -1071,18 +1071,18 @@ BOOL ImplDockingWindowWrapper::Docking( const Point& rPoint, Rectangle& rRect ) // ----------------------------------------------------------------------- -void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, BOOL bFloatMode ) +void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode ) { Rectangle aRect( rRect ); if ( !IsDockingCanceled() ) { - BOOL bShow = FALSE; + sal_Bool bShow = sal_False; if ( bFloatMode != IsFloatingMode() ) { - GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE ); SetFloatingMode( bFloatMode ); - bShow = TRUE; + bShow = sal_True; if ( bFloatMode ) { // #i44800# always use outputsize - as in all other places @@ -1098,30 +1098,30 @@ void ImplDockingWindowWrapper::EndDocking( const Rectangle& rRect, BOOL bFloatMo } if ( bShow ) - GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + GetWindow()->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } EndDockingData data( aRect, IsFloatingMode(), IsDockingCanceled() ); GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_ENDDOCKING, &data ); - mbDocking = FALSE; + mbDocking = sal_False; // must be enabled in Window::Notify to prevent permanent docking during mouse move - mbStartDockingEnabled = FALSE; + mbStartDockingEnabled = sal_False; } // ----------------------------------------------------------------------- -BOOL ImplDockingWindowWrapper::PrepareToggleFloatingMode() +sal_Bool ImplDockingWindowWrapper::PrepareToggleFloatingMode() { - BOOL bFloating = TRUE; + sal_Bool bFloating = sal_True; GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_PREPARETOGGLEFLOATING, &bFloating ); return bFloating; } // ----------------------------------------------------------------------- -BOOL ImplDockingWindowWrapper::Close() +sal_Bool ImplDockingWindowWrapper::Close() { // TODO: send event /* @@ -1129,15 +1129,15 @@ BOOL ImplDockingWindowWrapper::Close() ImplAddDel( &aDelData ); GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE ); if ( aDelData.IsDelete() ) - return FALSE; + return sal_False; ImplRemoveDel( &aDelData ); if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() ) - return FALSE; + return sal_False; - GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE ); */ - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -1154,12 +1154,12 @@ void ImplDockingWindowWrapper::ToggleFloatingMode() GetWindow()->ImplCallEventListeners( VCLEVENT_WINDOW_TOGGLEFLOATING ); // must be enabled in Window::Notify to prevent permanent docking during mouse move - mbStartDockingEnabled = FALSE; + mbStartDockingEnabled = sal_False; } // ----------------------------------------------------------------------- -void ImplDockingWindowWrapper::TitleButtonClick( USHORT nType ) +void ImplDockingWindowWrapper::TitleButtonClick( sal_uInt16 nType ) { if( nType == TITLE_BUTTON_MENU ) { @@ -1208,7 +1208,7 @@ void ImplDockingWindowWrapper::Resizing( Size& rSize ) // ----------------------------------------------------------------------- -void ImplDockingWindowWrapper::ShowTitleButton( USHORT nButton, BOOL bVisible ) +void ImplDockingWindowWrapper::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible ) { if ( mpFloatWin ) mpFloatWin->ShowTitleButton( nButton, bVisible ); @@ -1223,7 +1223,7 @@ void ImplDockingWindowWrapper::ShowTitleButton( USHORT nButton, BOOL bVisible ) // ----------------------------------------------------------------------- -BOOL ImplDockingWindowWrapper::IsTitleButtonVisible( USHORT nButton ) const +sal_Bool ImplDockingWindowWrapper::IsTitleButtonVisible( sal_uInt16 nButton ) const { if ( mpFloatWin ) return mpFloatWin->IsTitleButtonVisible( nButton ); @@ -1238,13 +1238,13 @@ BOOL ImplDockingWindowWrapper::IsTitleButtonVisible( USHORT nButton ) const // ----------------------------------------------------------------------- -void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, ULONG nFlags ) +void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, sal_uLong nFlags ) { // do nothing if window is floating if( IsFloatingMode() ) return; - GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE ); // prepare reparenting Window* pRealParent = GetWindow()->GetWindow( WINDOW_PARENT ); @@ -1301,7 +1301,7 @@ void ImplDockingWindowWrapper::StartPopupMode( ToolBox *pParentToolBox, ULONG nF IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG ) { - GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE ); // set parameter for handler before destroying floating window ImplPopupFloatWin *pPopupFloatWin = (ImplPopupFloatWin*) mpFloatWin; @@ -1332,17 +1332,17 @@ IMPL_LINK( ImplDockingWindowWrapper, PopupModeEnd, void*, EMPTYARG ) } -BOOL ImplDockingWindowWrapper::IsInPopupMode() const +sal_Bool ImplDockingWindowWrapper::IsInPopupMode() const { if( GetFloatingWindow() ) return GetFloatingWindow()->IsInPopupMode(); else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode ) +void ImplDockingWindowWrapper::SetFloatingMode( sal_Bool bFloatMode ) { // do nothing if window is docked and locked if( !IsFloatingMode() && IsLocked() ) @@ -1352,11 +1352,11 @@ void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode ) { if ( PrepareToggleFloatingMode() ) { - BOOL bVisible = GetWindow()->IsVisible(); + sal_Bool bVisible = GetWindow()->IsVisible(); if ( bFloatMode ) { - GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE ); maDockPos = GetWindow()->GetPosPixel(); @@ -1422,13 +1422,13 @@ void ImplDockingWindowWrapper::SetFloatingMode( BOOL bFloatMode ) mpFloatWin = pWin; if ( bVisible ) - GetWindow()->Show( TRUE, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + GetWindow()->Show( sal_True, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); ToggleFloatingMode(); } else { - GetWindow()->Show( FALSE, SHOW_NOFOCUSCHANGE ); + GetWindow()->Show( sal_False, SHOW_NOFOCUSCHANGE ); // FloatingDaten wird im FloatingWindow speichern maFloatPos = mpFloatWin->GetPosPixel(); @@ -1493,7 +1493,7 @@ void ImplDockingWindowWrapper::SetTabStop() void ImplDockingWindowWrapper::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, - USHORT nFlags ) + sal_uInt16 nFlags ) { if ( mpFloatWin ) mpFloatWin->SetPosSizePixel( nX, nY, nWidth, nHeight, nFlags ); @@ -1561,14 +1561,14 @@ Point ImplDockingWindowWrapper::GetFloatingPos() const // old inlines from DockingWindow // ----------------------------------------------------------------------- -void ImplDockingWindowWrapper::SetPin( BOOL bPin ) +void ImplDockingWindowWrapper::SetPin( sal_Bool bPin ) { if ( mpFloatWin ) mpFloatWin->SetPin( bPin ); mbPined = bPin; } -BOOL ImplDockingWindowWrapper::IsPined() const +sal_Bool ImplDockingWindowWrapper::IsPined() const { if ( mpFloatWin ) return mpFloatWin->IsPined(); @@ -1579,17 +1579,17 @@ void ImplDockingWindowWrapper::RollUp() { if ( mpFloatWin ) mpFloatWin->RollUp(); - mbRollUp = TRUE; + mbRollUp = sal_True; } void ImplDockingWindowWrapper::RollDown() { if ( mpFloatWin ) mpFloatWin->RollDown(); - mbRollUp = FALSE; + mbRollUp = sal_False; } -BOOL ImplDockingWindowWrapper::IsRollUp() const +sal_Bool ImplDockingWindowWrapper::IsRollUp() const { if ( mpFloatWin ) return mpFloatWin->IsRollUp(); @@ -1646,7 +1646,7 @@ void ImplDockingWindowWrapper::SetFloatingPos( const Point& rNewPos ) maFloatPos = rNewPos; } -BOOL ImplDockingWindowWrapper::IsFloatingMode() const +sal_Bool ImplDockingWindowWrapper::IsFloatingMode() const { return (mpFloatWin != NULL); } @@ -1664,7 +1664,7 @@ Rectangle ImplDockingWindowWrapper::GetDragArea() const void ImplDockingWindowWrapper::Lock() { - mbLocked = TRUE; + mbLocked = sal_True; // only toolbars support locking ToolBox *pToolBox = dynamic_cast< ToolBox * >( GetWindow() ); if( pToolBox ) @@ -1673,14 +1673,14 @@ void ImplDockingWindowWrapper::Lock() void ImplDockingWindowWrapper::Unlock() { - mbLocked = FALSE; + mbLocked = sal_False; // only toolbars support locking ToolBox *pToolBox = dynamic_cast< ToolBox * >( GetWindow() ); if( pToolBox ) pToolBox->Lock( mbLocked ); } -BOOL ImplDockingWindowWrapper::IsLocked() const +sal_Bool ImplDockingWindowWrapper::IsLocked() const { return mbLocked; } diff --git a/vcl/source/window/dockwin.cxx b/vcl/source/window/dockwin.cxx index a176f97d88d5..c9b71b01f78e 100644 --- a/vcl/source/window/dockwin.cxx +++ b/vcl/source/window/dockwin.cxx @@ -79,12 +79,12 @@ class ImplDockFloatWin : public FloatingWindow { private: DockingWindow* mpDockWin; - ULONG mnLastTicks; + sal_uLong mnLastTicks; Timer maDockTimer; Point maDockPos; Rectangle maDockRect; - BOOL mbInMove; - ULONG mnLastUserEvent; + sal_Bool mbInMove; + sal_uLong mnLastUserEvent; DECL_LINK( DockingHdl, ImplDockFloatWin* ); DECL_LINK( DockTimerHdl, ImplDockFloatWin* ); @@ -95,14 +95,14 @@ public: virtual void Move(); virtual void Resize(); - virtual void TitleButtonClick( USHORT nButton ); + virtual void TitleButtonClick( sal_uInt16 nButton ); virtual void Pin(); virtual void Roll(); virtual void PopupModeEnd(); virtual void Resizing( Size& rSize ); - virtual BOOL Close(); + virtual sal_Bool Close(); - ULONG GetLastTicks() const { return mnLastTicks; } + sal_uLong GetLastTicks() const { return mnLastTicks; } }; @@ -111,16 +111,16 @@ ImplDockFloatWin::ImplDockFloatWin( Window* pParent, WinBits nWinBits, FloatingWindow( pParent, nWinBits ), mpDockWin( pDockingWin ), mnLastTicks( Time::GetSystemTicks() ), - mbInMove( FALSE ), + mbInMove( sal_False ), mnLastUserEvent( 0 ) { // Daten vom DockingWindow uebernehmen if ( pDockingWin ) { SetSettings( pDockingWin->GetSettings() ); - Enable( pDockingWin->IsEnabled(), FALSE ); - EnableInput( pDockingWin->IsInputEnabled(), FALSE ); - AlwaysEnableInput( pDockingWin->IsAlwaysEnableInput(), FALSE ); + Enable( pDockingWin->IsEnabled(), sal_False ); + EnableInput( pDockingWin->IsInputEnabled(), sal_False ); + AlwaysEnableInput( pDockingWin->IsAlwaysEnableInput(), sal_False ); EnableAlwaysOnTop( pDockingWin->IsAlwaysOnTopEnabled() ); SetActivateMode( pDockingWin->GetActivateMode() ); } @@ -152,14 +152,14 @@ IMPL_LINK( ImplDockFloatWin, DockTimerHdl, ImplDockFloatWin*, EMPTYARG ) { // i43499 CTRL disables docking now mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking(); - mpDockWin->EndDocking( maDockRect, TRUE ); + mpDockWin->EndDocking( maDockRect, sal_True ); if( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) maDockTimer.Start(); } else if( ! ( aState.mnState & ( MOUSE_LEFT | MOUSE_MIDDLE | MOUSE_RIGHT ) ) ) { mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking(); - mpDockWin->EndDocking( maDockRect, FALSE ); + mpDockWin->EndDocking( maDockRect, sal_False ); } else { @@ -190,7 +190,7 @@ IMPL_LINK( ImplDockFloatWin, DockingHdl, ImplDockFloatWin*, EMPTYARG ) // mouse pos also in screen pixels Point aMousePos = mpDockWin->GetParent()->OutputToScreenPixel( aState.maPos ); - BOOL bFloatMode = mpDockWin->Docking( aMousePos, maDockRect ); + sal_Bool bFloatMode = mpDockWin->Docking( aMousePos, maDockRect ); if( ! bFloatMode ) { mpDockWin->GetParent()->ImplGetFrameWindow()->ShowTracking( maDockRect, SHOWTRACK_OBJECT | SHOWTRACK_WINDOW ); @@ -200,10 +200,10 @@ IMPL_LINK( ImplDockFloatWin, DockingHdl, ImplDockFloatWin*, EMPTYARG ) { mpDockWin->GetParent()->ImplGetFrameWindow()->HideTracking(); maDockTimer.Stop(); - mpDockWin->EndDocking( maDockRect, TRUE ); + mpDockWin->EndDocking( maDockRect, sal_True ); } } - mbInMove = FALSE; + mbInMove = sal_False; return 0; } // ----------------------------------------------------------------------- @@ -213,7 +213,7 @@ void ImplDockFloatWin::Move() if( mbInMove ) return; - mbInMove = TRUE; + mbInMove = sal_True; FloatingWindow::Move(); mpDockWin->Move(); @@ -241,7 +241,7 @@ void ImplDockFloatWin::Resize() // ----------------------------------------------------------------------- -void ImplDockFloatWin::TitleButtonClick( USHORT nButton ) +void ImplDockFloatWin::TitleButtonClick( sal_uInt16 nButton ) { FloatingWindow::TitleButtonClick( nButton ); mpDockWin->TitleButtonClick( nButton ); @@ -281,21 +281,21 @@ void ImplDockFloatWin::Resizing( Size& rSize ) // ----------------------------------------------------------------------- -BOOL ImplDockFloatWin::Close() +sal_Bool ImplDockFloatWin::Close() { return mpDockWin->Close(); } // ======================================================================= -BOOL DockingWindow::ImplStartDocking( const Point& rPos ) +sal_Bool DockingWindow::ImplStartDocking( const Point& rPos ) { if ( !mbDockable ) - return FALSE; + return sal_False; maMouseOff = rPos; maMouseStart = maMouseOff; - mbDocking = TRUE; + mbDocking = sal_True; mbLastFloatMode = IsFloatingMode(); mbStartFloat = mbLastFloatMode; @@ -328,17 +328,17 @@ BOOL DockingWindow::ImplStartDocking( const Point& rPos ) if ( GetSettings().GetStyleSettings().GetDragFullOptions() & DRAGFULL_OPTION_DOCKING && !( mnFloatBits & ( WB_MOVEABLE | WB_SIZEABLE | WB_CLOSEABLE ) ) ) // no full drag when migrating to system window - mbDragFull = TRUE; + mbDragFull = sal_True; else { StartDocking(); - mbDragFull = FALSE; + mbDragFull = sal_False; ImplUpdateAll(); ImplGetFrameWindow()->ImplUpdateAll(); } StartTracking( STARTTRACK_KEYMOD ); - return TRUE; + return sal_True; } // ======================================================================= @@ -346,17 +346,17 @@ BOOL DockingWindow::ImplStartDocking( const Point& rPos ) void DockingWindow::ImplInitDockingWindowData() { mpImplData = new ImplData; - mpWindowImpl->mbDockWin = TRUE; + mpWindowImpl->mbDockWin = sal_True; mpFloatWin = NULL; - mbDockCanceled = FALSE; - mbDockPrevented = FALSE; - mbFloatPrevented = FALSE; - mbDocking = FALSE; - mbPined = FALSE; - mbRollUp = FALSE; - mbDockBtn = FALSE; - mbHideBtn = FALSE; + mbDockCanceled = sal_False; + mbDockPrevented = sal_False; + mbFloatPrevented = sal_False; + mbDocking = sal_False; + mbPined = sal_False; + mbRollUp = sal_False; + mbDockBtn = sal_False; + mbHideBtn = sal_False; } // ----------------------------------------------------------------------- @@ -405,7 +405,7 @@ void DockingWindow::ImplLoadRes( const ResId& rResId ) { Window::ImplLoadRes( rResId ); - ULONG nMask = ReadLongRes(); + sal_uLong nMask = ReadLongRes(); if ( (RSC_DOCKINGWINDOW_XYMAPMODE | RSC_DOCKINGWINDOW_X | RSC_DOCKINGWINDOW_Y) & nMask ) @@ -434,8 +434,8 @@ void DockingWindow::ImplLoadRes( const ResId& rResId ) if ( nMask & RSC_DOCKINGWINDOW_FLOATING ) { - if ( (BOOL)ReadShortRes() ) - SetFloatingMode( TRUE ); + if ( (sal_Bool)ReadShortRes() ) + SetFloatingMode( sal_True ); } } @@ -477,8 +477,8 @@ DockingWindow::~DockingWindow() { if ( IsFloatingMode() ) { - Show( FALSE, SHOW_NOFOCUSCHANGE ); - SetFloatingMode( FALSE ); + Show( sal_False, SHOW_NOFOCUSCHANGE ); + SetFloatingMode( sal_False ); } delete mpImplData; } @@ -494,7 +494,7 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingEnded() ) { - mbDocking = FALSE; + mbDocking = sal_False; if ( mbDragFull ) { // Bei Abbruch alten Zustand wieder herstellen @@ -510,9 +510,9 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) HideTracking(); if ( rTEvt.IsTrackingCanceled() ) { - mbDockCanceled = TRUE; + mbDockCanceled = sal_True; EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode ); - mbDockCanceled = FALSE; + mbDockCanceled = sal_False; } else EndDocking( Rectangle( Point( mnTrackX, mnTrackY ), Size( mnTrackWidth, mnTrackHeight ) ), mbLastFloatMode ); @@ -542,9 +542,9 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) aFramePos.Y() += maMouseOff.Y(); if ( mbDragFull ) StartDocking(); - BOOL bFloatMode = Docking( aFramePos, aTrackRect ); - mbDockPrevented = FALSE; - mbFloatPrevented = FALSE; + sal_Bool bFloatMode = Docking( aFramePos, aTrackRect ); + mbDockPrevented = sal_False; + mbFloatPrevented = sal_False; if ( mbLastFloatMode != bFloatMode ) { if ( bFloatMode ) @@ -582,7 +582,7 @@ void DockingWindow::Tracking( const TrackingEvent& rTEvt ) } else { - USHORT nTrackStyle; + sal_uInt16 nTrackStyle; if ( bFloatMode ) nTrackStyle = SHOWTRACK_BIG; else @@ -622,7 +622,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt ) if ( pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) ) { SetFloatingMode( !IsFloatingMode() ); - return TRUE; + return sal_True; } else if ( pMEvt->GetClicks() == 1 ) { @@ -640,7 +640,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt ) } ImplStartDocking( aPos ); } - return TRUE; + return sal_True; } } } @@ -651,7 +651,7 @@ long DockingWindow::Notify( NotifyEvent& rNEvt ) rKey.IsShift() && rKey.IsMod1() ) { SetFloatingMode( !IsFloatingMode() ); - return TRUE; + return sal_True; } } } @@ -663,28 +663,28 @@ long DockingWindow::Notify( NotifyEvent& rNEvt ) void DockingWindow::StartDocking() { - mbDocking = TRUE; + mbDocking = sal_True; } // ----------------------------------------------------------------------- -BOOL DockingWindow::Docking( const Point&, Rectangle& ) +sal_Bool DockingWindow::Docking( const Point&, Rectangle& ) { return IsFloatingMode(); } // ----------------------------------------------------------------------- -void DockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode ) +void DockingWindow::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode ) { if ( !IsDockingCanceled() ) { - BOOL bShow = FALSE; + sal_Bool bShow = sal_False; if ( bFloatMode != IsFloatingMode() ) { - Show( FALSE, SHOW_NOFOCUSCHANGE ); + Show( sal_False, SHOW_NOFOCUSCHANGE ); SetFloatingMode( bFloatMode ); - bShow = TRUE; + bShow = sal_True; if ( bFloatMode && mpFloatWin ) mpFloatWin->SetPosSizePixel( rRect.TopLeft(), rRect.GetSize() ); } @@ -698,32 +698,32 @@ void DockingWindow::EndDocking( const Rectangle& rRect, BOOL bFloatMode ) if ( bShow ) Show(); } - mbDocking = FALSE; + mbDocking = sal_False; } // ----------------------------------------------------------------------- -BOOL DockingWindow::PrepareToggleFloatingMode() +sal_Bool DockingWindow::PrepareToggleFloatingMode() { - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -BOOL DockingWindow::Close() +sal_Bool DockingWindow::Close() { ImplDelData aDelData; ImplAddDel( &aDelData ); ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE ); if ( aDelData.IsDelete() ) - return FALSE; + return sal_False; ImplRemoveDel( &aDelData ); if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() ) - return FALSE; + return sal_False; - Show( FALSE, SHOW_NOFOCUSCHANGE ); - return TRUE; + Show( sal_False, SHOW_NOFOCUSCHANGE ); + return sal_True; } // ----------------------------------------------------------------------- @@ -734,7 +734,7 @@ void DockingWindow::ToggleFloatingMode() // ----------------------------------------------------------------------- -void DockingWindow::TitleButtonClick( USHORT ) +void DockingWindow::TitleButtonClick( sal_uInt16 ) { } @@ -791,7 +791,7 @@ void DockingWindow::DataChanged( const DataChangedEvent& rDCEvt ) // ----------------------------------------------------------------------- -void DockingWindow::ShowTitleButton( USHORT nButton, BOOL bVisible ) +void DockingWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible ) { if ( mpFloatWin ) mpFloatWin->ShowTitleButton( nButton, bVisible ); @@ -806,7 +806,7 @@ void DockingWindow::ShowTitleButton( USHORT nButton, BOOL bVisible ) // ----------------------------------------------------------------------- -BOOL DockingWindow::IsTitleButtonVisible( USHORT nButton ) const +sal_Bool DockingWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const { if ( mpFloatWin ) return mpFloatWin->IsTitleButtonVisible( nButton ); @@ -821,7 +821,7 @@ BOOL DockingWindow::IsTitleButtonVisible( USHORT nButton ) const // ----------------------------------------------------------------------- -void DockingWindow::SetFloatingMode( BOOL bFloatMode ) +void DockingWindow::SetFloatingMode( sal_Bool bFloatMode ) { ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); if( pWrapper ) @@ -833,11 +833,11 @@ void DockingWindow::SetFloatingMode( BOOL bFloatMode ) { if ( PrepareToggleFloatingMode() ) // changes to floating mode can be vetoed { - BOOL bVisible = IsVisible(); + sal_Bool bVisible = IsVisible(); if ( bFloatMode ) { - Show( FALSE, SHOW_NOFOCUSCHANGE ); + Show( sal_False, SHOW_NOFOCUSCHANGE ); maDockPos = Window::GetPosPixel(); @@ -886,7 +886,7 @@ void DockingWindow::SetFloatingMode( BOOL bFloatMode ) } else { - Show( FALSE, SHOW_NOFOCUSCHANGE ); + Show( sal_False, SHOW_NOFOCUSCHANGE ); // FloatingDaten wird im FloatingWindow speichern maFloatPos = mpFloatWin->GetPosPixel(); @@ -967,7 +967,7 @@ void DockingWindow::SetTabStop() void DockingWindow::SetPosSizePixel( long nX, long nY, long nWidth, long nHeight, - USHORT nFlags ) + sal_uInt16 nFlags ) { ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); if( pWrapper ) @@ -1093,7 +1093,7 @@ Point DockingWindow::GetFloatingPos() const return maFloatPos; } -BOOL DockingWindow::IsFloatingMode() const +sal_Bool DockingWindow::IsFloatingMode() const { ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); if( pWrapper ) diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx index 9896333174ce..2c21ec7a83d1 100644 --- a/vcl/source/window/floatwin.cxx +++ b/vcl/source/window/floatwin.cxx @@ -75,9 +75,9 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle ) { mpImplData = new ImplData; - mpWindowImpl->mbFloatWin = TRUE; - mbInCleanUp = FALSE; - mbGrabFocus = FALSE; + mpWindowImpl->mbFloatWin = sal_True; + mbInCleanUp = sal_False; + mbGrabFocus = sal_False; DBG_ASSERT( pParent, "FloatWindow::FloatingWindow(): - pParent == NULL!" ); @@ -89,7 +89,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle ) // no Border, then we dont need a border window if ( !nStyle ) { - mpWindowImpl->mbOverlapWin = TRUE; + mpWindowImpl->mbOverlapWin = sal_True; nStyle |= WB_DIALOGCONTROL; SystemWindow::ImplInit( pParent, nStyle, NULL ); } @@ -104,14 +104,14 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle ) WinBits nFloatWinStyle = nStyle; // #99154# floaters are not closeable by default anymore, eg fullscreen floater // nFloatWinStyle |= WB_CLOSEABLE; - mpWindowImpl->mbFrame = TRUE; - mpWindowImpl->mbOverlapWin = TRUE; + mpWindowImpl->mbFrame = sal_True; + mpWindowImpl->mbOverlapWin = sal_True; SystemWindow::ImplInit( pParent, nFloatWinStyle & ~WB_BORDER, NULL ); } else { ImplBorderWindow* pBorderWin; - USHORT nBorderStyle = BORDERWINDOW_STYLE_BORDER | BORDERWINDOW_STYLE_FLOAT; + sal_uInt16 nBorderStyle = BORDERWINDOW_STYLE_BORDER | BORDERWINDOW_STYLE_FLOAT; if( nStyle & WB_OWNERDRAWDECORATION ) nBorderStyle |= BORDERWINDOW_STYLE_FRAME; else nBorderStyle |= BORDERWINDOW_STYLE_OVERLAP; @@ -125,7 +125,7 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle ) SystemWindow::ImplInit( pBorderWin, nStyle & ~WB_BORDER, NULL ); pBorderWin->mpWindowImpl->mpClientWindow = this; pBorderWin->GetBorder( mpWindowImpl->mnLeftBorder, mpWindowImpl->mnTopBorder, mpWindowImpl->mnRightBorder, mpWindowImpl->mnBottomBorder ); - pBorderWin->SetDisplayActive( TRUE ); + pBorderWin->SetDisplayActive( sal_True ); mpWindowImpl->mpBorderWindow = pBorderWin; mpWindowImpl->mpRealParent = pParent; } @@ -138,11 +138,11 @@ void FloatingWindow::ImplInit( Window* pParent, WinBits nStyle ) mnTitle = (nStyle & (WB_MOVEABLE | WB_POPUP)) ? FLOATWIN_TITLE_NORMAL : FLOATWIN_TITLE_NONE; mnOldTitle = mnTitle; mnPopupModeFlags = 0; - mbInPopupMode = FALSE; - mbPopupMode = FALSE; - mbPopupModeCanceled = FALSE; - mbPopupModeTearOff = FALSE; - mbMouseDown = FALSE; + mbInPopupMode = sal_False; + mbPopupMode = sal_False; + mbPopupModeCanceled = sal_False; + mbPopupModeTearOff = sal_False; + mbMouseDown = sal_False; ImplInitSettings(); } @@ -191,7 +191,7 @@ void FloatingWindow::ImplLoadRes( const ResId& rResId ) { SystemWindow::ImplLoadRes( rResId ); - ULONG nObjMask = ReadLongRes(); + sal_uLong nObjMask = ReadLongRes(); if ( (RSC_FLOATINGWINDOW_WHMAPMODE | RSC_FLOATINGWINDOW_WIDTH | RSC_FLOATINGWINDOW_HEIGHT) & nObjMask ) @@ -237,7 +237,7 @@ FloatingWindow::~FloatingWindow() // ----------------------------------------------------------------------- -Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, ULONG nFlags, USHORT& rArrangeIndex ) +Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rRect, sal_uLong nFlags, sal_uInt16& rArrangeIndex ) { return ImplCalcPos( pWindow, rRect, nFlags, rArrangeIndex ); } @@ -245,8 +245,8 @@ Point FloatingWindow::CalcFloatingPosition( Window* pWindow, const Rectangle& rR // ----------------------------------------------------------------------- Point FloatingWindow::ImplCalcPos( Window* pWindow, - const Rectangle& rRect, ULONG nFlags, - USHORT& rArrangeIndex ) + const Rectangle& rRect, sal_uLong nFlags, + sal_uInt16& rArrangeIndex ) { // Fenster-Position ermitteln Point aPos; @@ -262,7 +262,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, Rectangle normRect( rRect ); // rRect is already relative to top-level window normRect.SetPos( pW->ScreenToOutputPixel( normRect.TopLeft() ) ); - BOOL bRTL = Application::GetSettings().GetLayoutRTL(); + sal_Bool bRTL = Application::GetSettings().GetLayoutRTL(); Rectangle devRect( pW->OutputToAbsoluteScreenPixel( normRect.TopLeft() ), pW->OutputToAbsoluteScreenPixel( normRect.BottomRight() ) ); @@ -276,9 +276,9 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, Application::GetBestScreen( bRTL ? devRectRTL : devRect ) ); - USHORT nArrangeAry[5]; - USHORT nArrangeIndex; - BOOL bBreak; + sal_uInt16 nArrangeAry[5]; + sal_uInt16 nArrangeIndex; + sal_Bool bBreak; Point e1,e2; // the common edge between the item rect and the floating window if ( nFlags & FLOATWIN_POPUPMODE_LEFT ) @@ -320,7 +320,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, for ( ; nArrangeIndex < 5; nArrangeIndex++ ) { - bBreak = TRUE; + bBreak = sal_True; switch ( nArrangeAry[nArrangeIndex] ) { @@ -331,12 +331,12 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, if( bRTL ) // --- RTL --- we're comparing screen coordinates here { if( (devRectRTL.Right()+aSize.Width()) > aScreenRect.Right() ) - bBreak = FALSE; + bBreak = sal_False; } else { if ( aPos.X() < aScreenRect.Left() ) - bBreak = FALSE; + bBreak = sal_False; } if( bBreak ) { @@ -355,12 +355,12 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, if( bRTL ) // --- RTL --- we're comparing screen coordinates here { if( (devRectRTL.Left() - aSize.Width()) < aScreenRect.Left() ) - bBreak = FALSE; + bBreak = sal_False; } else { if ( aPos.X()+aSize.Width() > aScreenRect.Right() ) - bBreak = FALSE; + bBreak = sal_False; } if( bBreak ) { @@ -377,7 +377,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, aPos.X() = devRect.Left(); aPos.Y() = devRect.Top()-aSize.Height()+1; if ( aPos.Y() < aScreenRect.Top() ) - bBreak = FALSE; + bBreak = sal_False; if( bBreak ) { e1 = devRect.TopLeft(); @@ -392,7 +392,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, case FLOATWIN_POPUPMODE_DOWN: aPos = devRect.BottomLeft(); if ( aPos.Y()+aSize.Height() > aScreenRect.Bottom() ) - bBreak = FALSE; + bBreak = sal_False; if( bBreak ) { e1 = devRect.BottomLeft(); @@ -463,7 +463,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow, // ----------------------------------------------------------------------- -FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, USHORT& rHitTest ) +FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest ) { FloatingWindow* pWin = this; @@ -538,20 +538,20 @@ FloatingWindow* FloatingWindow::ImplFindLastLevelFloat() // ----------------------------------------------------------------------- -BOOL FloatingWindow::ImplIsFloatPopupModeWindow( const Window* pWindow ) +sal_Bool FloatingWindow::ImplIsFloatPopupModeWindow( const Window* pWindow ) { FloatingWindow* pWin = this; do { if ( pWin->mpFirstPopupModeWin == pWindow ) - return TRUE; + return sal_True; pWin = pWin->mpNextFloat; } while ( pWin ); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -560,7 +560,7 @@ IMPL_LINK( FloatingWindow, ImplEndPopupModeHdl, void*, EMPTYARG ) { mnPostId = 0; mnPopupModeFlags = 0; - mbPopupMode = FALSE; + mbPopupMode = sal_False; PopupModeEnd(); return 0; } @@ -577,12 +577,12 @@ long FloatingWindow::Notify( NotifyEvent& rNEvt ) { const KeyEvent* pKEvt = rNEvt.GetKeyEvent(); KeyCode aKeyCode = pKEvt->GetKeyCode(); - USHORT nKeyCode = aKeyCode.GetCode(); + sal_uInt16 nKeyCode = aKeyCode.GetCode(); if ( (nKeyCode == KEY_ESCAPE) && (GetStyle() & WB_CLOSEABLE) ) { Close(); - return TRUE; + return sal_True; } } } @@ -622,7 +622,7 @@ void FloatingWindow::DataChanged( const DataChangedEvent& rDCEvt ) void FloatingWindow::ImplCallPopupModeEnd() { // PopupMode wurde beendet - mbInPopupMode = FALSE; + mbInPopupMode = sal_False; // Handler asyncron rufen if ( !mnPostId ) @@ -638,13 +638,13 @@ void FloatingWindow::PopupModeEnd() // ----------------------------------------------------------------------- -void FloatingWindow::SetTitleType( USHORT nTitle ) +void FloatingWindow::SetTitleType( sal_uInt16 nTitle ) { if ( (mnTitle != nTitle) && mpWindowImpl->mpBorderWindow ) { mnTitle = nTitle; Size aOutSize = GetOutputSizePixel(); - USHORT nTitleStyle; + sal_uInt16 nTitleStyle; if ( nTitle == FLOATWIN_TITLE_NORMAL ) nTitleStyle = BORDERWINDOW_TITLE_SMALL; else if ( nTitle == FLOATWIN_TITLE_TEAROFF ) @@ -660,11 +660,11 @@ void FloatingWindow::SetTitleType( USHORT nTitle ) // ----------------------------------------------------------------------- -void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags ) +void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags ) { // avoid flickering if ( IsVisible() ) - Show( FALSE, SHOW_NOFOCUSCHANGE ); + Show( sal_False, SHOW_NOFOCUSCHANGE ); if ( IsRollUp() ) RollDown(); @@ -688,7 +688,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags ) nFlags |= FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE; // compute window position according to flags and arrangement - USHORT nArrangeIndex; + sal_uInt16 nArrangeIndex; SetPosPixel( ImplCalcPos( this, rRect, nFlags, nArrangeIndex ) ); // set data and display window @@ -709,11 +709,11 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags ) maFloatRect.Right() += 2; maFloatRect.Bottom() += 2; mnPopupModeFlags = nFlags; - mbInPopupMode = TRUE; - mbPopupMode = TRUE; - mbPopupModeCanceled = FALSE; - mbPopupModeTearOff = FALSE; - mbMouseDown = FALSE; + mbInPopupMode = sal_True; + mbPopupMode = sal_True; + mbPopupModeCanceled = sal_False; + mbPopupModeTearOff = sal_False; + mbMouseDown = sal_False; mbOldSaveBackMode = IsSaveBackgroundEnabled(); EnableSaveBackground(); @@ -725,22 +725,22 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, ULONG nFlags ) if( nFlags & FLOATWIN_POPUPMODE_GRABFOCUS ) { // force key input even without focus (useful for menues) - mbGrabFocus = TRUE; + mbGrabFocus = sal_True; } - Show( TRUE, SHOW_NOACTIVATE ); + Show( sal_True, SHOW_NOACTIVATE ); } // ----------------------------------------------------------------------- -void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags ) +void FloatingWindow::StartPopupMode( ToolBox* pBox, sal_uLong nFlags ) { // get selected button - USHORT nItemId = pBox->GetDownItemId(); + sal_uInt16 nItemId = pBox->GetDownItemId(); if ( !nItemId ) return; mpImplData->mpBox = pBox; - pBox->ImplFloatControl( TRUE, this ); + pBox->ImplFloatControl( sal_True, this ); // retrieve some data from the ToolBox Rectangle aRect = pBox->GetItemRect( nItemId ); @@ -779,14 +779,14 @@ void FloatingWindow::StartPopupMode( ToolBox* pBox, ULONG nFlags ) // ----------------------------------------------------------------------- -void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId ) +void FloatingWindow::ImplEndPopupMode( sal_uInt16 nFlags, sal_uLong nFocusId ) { if ( !mbInPopupMode ) return; ImplSVData* pSVData = ImplGetSVData(); - mbInCleanUp = TRUE; // prevent killing this window due to focus change while working with it + mbInCleanUp = sal_True; // prevent killing this window due to focus change while working with it // Bei allen nachfolgenden PopupMode-Fenster den Modus auch beenden while ( pSVData->maWinData.mpFirstFloat && pSVData->maWinData.mpFirstFloat != this ) @@ -797,13 +797,13 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId ) pSVData->maWinData.mpFirstFloat = mpNextFloat; mpNextFloat = NULL; - ULONG nPopupModeFlags = mnPopupModeFlags; + sal_uLong nPopupModeFlags = mnPopupModeFlags; // Wenn nicht abgerissen wurde, dann Fenster wieder Hiden if ( !(nFlags & FLOATWIN_POPUPMODEEND_TEAROFF) || !(nPopupModeFlags & FLOATWIN_POPUPMODE_ALLOWTEAROFF) ) { - Show( FALSE, SHOW_NOFOCUSCHANGE ); + Show( sal_False, SHOW_NOFOCUSCHANGE ); // Focus evt. auf ein entsprechendes FloatingWindow weiterschalten if ( nFocusId ) @@ -811,13 +811,13 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId ) else if ( pSVData->maWinData.mpFocusWin && pSVData->maWinData.mpFirstFloat && ImplIsWindowOrChild( pSVData->maWinData.mpFocusWin ) ) pSVData->maWinData.mpFirstFloat->GrabFocus(); - mbPopupModeTearOff = FALSE; + mbPopupModeTearOff = sal_False; } else { - mbPopupModeTearOff = TRUE; + mbPopupModeTearOff = sal_True; if ( nFocusId ) - Window::EndSaveFocus( nFocusId, FALSE ); + Window::EndSaveFocus( nFocusId, sal_False ); } EnableSaveBackground( mbOldSaveBackMode ); @@ -829,7 +829,7 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId ) // ToolBox wieder auf normal schalten if ( mpImplData->mpBox ) { - mpImplData->mpBox->ImplFloatControl( FALSE, this ); + mpImplData->mpBox->ImplFloatControl( sal_False, this ); mpImplData->mpBox = NULL; } @@ -850,12 +850,12 @@ void FloatingWindow::ImplEndPopupMode( USHORT nFlags, ULONG nFocusId ) } } - mbInCleanUp = FALSE; + mbInCleanUp = sal_False; } // ----------------------------------------------------------------------- -void FloatingWindow::EndPopupMode( USHORT nFlags ) +void FloatingWindow::EndPopupMode( sal_uInt16 nFlags ) { ImplEndPopupMode( nFlags ); } diff --git a/vcl/source/window/javachild.cxx b/vcl/source/window/javachild.cxx index 3b26e92829a7..1f15019999e5 100644 --- a/vcl/source/window/javachild.cxx +++ b/vcl/source/window/javachild.cxx @@ -3,10 +3,13 @@ * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * - * Copyright 2000, 2010 Oracle and/or its affiliates. + * Copyright 2008 by Sun Microsystems, Inc. * * OpenOffice.org - a multi-platform office productivity suite * + * $RCSfile: javachild.cxx,v $ + * $Revision: 1.12 $ + * * This file is part of OpenOffice.org. * * OpenOffice.org is free software: you can redistribute it and/or modify @@ -29,30 +32,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_vcl.hxx" - -#ifdef SOLAR_JAVA -#include <jni.h> -#endif -#include <comphelper/processfactory.hxx> - -#include <vcl/unohelp.hxx> -#include <rtl/process.h> -#include <rtl/ref.hxx> -#include <jvmaccess/virtualmachine.hxx> -#include <com/sun/star/java/XJavaVM.hpp> -#include <com/sun/star/java/XJavaThreadRegister_11.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> - -#include <svsys.h> -#include <vcl/salinst.hxx> -#include <vcl/salframe.hxx> -#include <vcl/window.hxx> -#include <vcl/salobj.hxx> #include <vcl/javachild.hxx> -#include <vcl/svdata.hxx> -#include <vcl/sysdata.hxx> - -using namespace ::com::sun::star; // ------------------- // - JavaChildWindow - @@ -78,131 +58,9 @@ JavaChildWindow::~JavaChildWindow() // ----------------------------------------------------------------------- -void JavaChildWindow::implTestJavaException( void* pEnv ) -{ -#ifdef SOLAR_JAVA - JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv ); - jthrowable jtThrowable = pJavaEnv->ExceptionOccurred(); - - if( jtThrowable ) - { // is it a java exception ? -#if OSL_DEBUG_LEVEL > 1 - pJavaEnv->ExceptionDescribe(); -#endif // OSL_DEBUG_LEVEL > 1 - pJavaEnv->ExceptionClear(); - - jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable"); - jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;"); - jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage); - ::rtl::OUString ouMessage; - - if(jsMessage) - { - const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL); - ouMessage = ::rtl::OUString(jcMessage); - pJavaEnv->ReleaseStringChars(jsMessage, jcMessage); - } - - throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>()); - } -#endif // SOLAR_JAVA -} - -// ----------------------------------------------------------------------- - sal_IntPtr JavaChildWindow::getParentWindowHandleForJava() { - sal_IntPtr nRet = 0; - -#if defined WNT - nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd ); -#elif defined QUARTZ - // FIXME: this is wrong - nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); -#elif defined UNX -#ifdef SOLAR_JAVA - uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); - - if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) ) - { - try - { - ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM; - uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY ); - uno::Sequence< sal_Int8 > aProcessID( 17 ); - - rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() ); - aProcessID[ 16 ] = 0; - OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64"); - sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0)); - xJavaVM->getJavaVM(aProcessID) >>= nPointer; - xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer); - - if( xVM.is() ) - { - try - { - ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM ); - JNIEnv* pEnv = aVMAttachGuard.getEnvironment(); - - jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit"); - implTestJavaException(pEnv); - - jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" ); - implTestJavaException(pEnv); - - pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit); - implTestJavaException(pEnv); - - jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer"); - if( pEnv->ExceptionOccurred() ) - { - pEnv->ExceptionClear(); - - jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext"); - implTestJavaException(pEnv); - } - - jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader"); - implTestJavaException(pEnv); - - jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V"); - implTestJavaException(pEnv); - - jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni"); - implTestJavaException(pEnv); - - pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE); - implTestJavaException(pEnv); - - jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" ); - implTestJavaException(pEnv); - - const Size aSize( GetOutputSizePixel() ); - jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget, - GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() ); - implTestJavaException(pEnv); - - nRet = static_cast< sal_IntPtr >( ji_widget ); - } - catch( uno::RuntimeException& ) - { - } - - if( !nRet ) - nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow ); - } - } - catch( ... ) - { - } - } -#endif // SOLAR_JAVA -#else // WNT || QUARTZ || UNX - // TBD -#endif - - return nRet; + return SystemChildWindow::GetParentWindowHandle( sal_True ); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/keycod.cxx b/vcl/source/window/keycod.cxx index 575b8022b739..05370f3a029f 100644 --- a/vcl/source/window/keycod.cxx +++ b/vcl/source/window/keycod.cxx @@ -41,7 +41,7 @@ // ======================================================================= -static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] = +static sal_uInt16 aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] = { 0, 0, 0, 0, // KEYFUNC_DONTKNOW KEY_N | KEY_MOD1, 0, 0, 0, // KEYFUNC_NEW @@ -66,9 +66,9 @@ static USHORT aImplKeyFuncTab[(KEYFUNC_FRONT+1)*4] = // ----------------------------------------------------------------------- -void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& rCode3, USHORT& rCode4 ) +void ImplGetKeyCode( KeyFuncType eFunc, sal_uInt16& rCode1, sal_uInt16& rCode2, sal_uInt16& rCode3, sal_uInt16& rCode4 ) { - USHORT nIndex = (USHORT)eFunc; + sal_uInt16 nIndex = (sal_uInt16)eFunc; nIndex *= 4; rCode1 = aImplKeyFuncTab[nIndex]; rCode2 = aImplKeyFuncTab[nIndex+1]; @@ -80,7 +80,7 @@ void ImplGetKeyCode( KeyFuncType eFunc, USHORT& rCode1, USHORT& rCode2, USHORT& KeyCode::KeyCode( KeyFuncType eFunction ) { - USHORT nDummy; + sal_uInt16 nDummy; ImplGetKeyCode( eFunction, nCode, nDummy, nDummy, nDummy ); eFunc = eFunction; } @@ -96,18 +96,18 @@ KeyCode::KeyCode( const ResId& rResId ) { pResMgr->Increment( sizeof( RSHEADER_TYPE ) ); - ULONG nKeyCode = pResMgr->ReadLong(); - ULONG nModifier = pResMgr->ReadLong(); - ULONG nKeyFunc = pResMgr->ReadLong(); + sal_uLong nKeyCode = pResMgr->ReadLong(); + sal_uLong nModifier = pResMgr->ReadLong(); + sal_uLong nKeyFunc = pResMgr->ReadLong(); eFunc = (KeyFuncType)nKeyFunc; if ( eFunc != KEYFUNC_DONTKNOW ) { - USHORT nDummy; + sal_uInt16 nDummy; ImplGetKeyCode( eFunc, nCode, nDummy, nDummy, nDummy ); } else - nCode = sal::static_int_cast<USHORT>(nKeyCode | nModifier); + nCode = sal::static_int_cast<sal_uInt16>(nKeyCode | nModifier); } } @@ -136,15 +136,15 @@ KeyFuncType KeyCode::GetFunction() const if ( eFunc != KEYFUNC_DONTKNOW ) return eFunc; - USHORT nCompCode = GetModifier() | GetCode(); + sal_uInt16 nCompCode = GetModifier() | GetCode(); if ( nCompCode ) { - for ( USHORT i = (USHORT)KEYFUNC_NEW; i < (USHORT)KEYFUNC_FRONT; i++ ) + for ( sal_uInt16 i = (sal_uInt16)KEYFUNC_NEW; i < (sal_uInt16)KEYFUNC_FRONT; i++ ) { - USHORT nKeyCode1; - USHORT nKeyCode2; - USHORT nKeyCode3; - USHORT nKeyCode4; + sal_uInt16 nKeyCode1; + sal_uInt16 nKeyCode2; + sal_uInt16 nKeyCode3; + sal_uInt16 nKeyCode4; ImplGetKeyCode( (KeyFuncType)i, nKeyCode1, nKeyCode2, nKeyCode3, nKeyCode4 ); if ( (nCompCode == nKeyCode1) || (nCompCode == nKeyCode2) || (nCompCode == nKeyCode3) || (nCompCode == nKeyCode4) ) return (KeyFuncType)i; diff --git a/vcl/source/window/keyevent.cxx b/vcl/source/window/keyevent.cxx index 2677c31cc100..db8144c3d648 100644 --- a/vcl/source/window/keyevent.cxx +++ b/vcl/source/window/keyevent.cxx @@ -75,8 +75,8 @@ KeyEvent KeyEvent::LogicalTextDirectionality (TextDirectionality eMode) const { KeyEvent aClone(*this); - USHORT nCode = maKeyCode.GetCode(); - USHORT nMod = maKeyCode.GetAllModifier(); + sal_uInt16 nCode = maKeyCode.GetCode(); + sal_uInt16 nMod = maKeyCode.GetAllModifier(); switch (eMode) { diff --git a/vcl/source/window/makefile.mk b/vcl/source/window/makefile.mk index 82ce26f8e78e..1c63376dfda5 100644 --- a/vcl/source/window/makefile.mk +++ b/vcl/source/window/makefile.mk @@ -85,6 +85,8 @@ SLOFILES= \ $(SLO)$/winproc.obj \ $(SLO)$/window2.obj \ $(SLO)$/window3.obj \ + $(SLO)$/window4.obj \ + $(SLO)$/wpropset.obj \ $(SLO)$/wrkwin.obj # --- Targets ------------------------------------------------------ diff --git a/vcl/source/window/menu.cxx b/vcl/source/window/menu.cxx index 6d76050623cd..6ab9dda55fc2 100644..100755 --- a/vcl/source/window/menu.cxx +++ b/vcl/source/window/menu.cxx @@ -1,3 +1,4 @@ + /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /************************************************************************* * @@ -80,9 +81,9 @@ namespace vcl struct MenuLayoutData : public ControlLayoutData { - std::vector< USHORT > m_aLineItemIds; - std::vector< USHORT > m_aLineItemPositions; - std::map< USHORT, Rectangle > m_aVisibleItemBoundRects; + std::vector< sal_uInt16 > m_aLineItemIds; + std::vector< sal_uInt16 > m_aLineItemPositions; + std::map< sal_uInt16, Rectangle > m_aVisibleItemBoundRects; }; } @@ -96,6 +97,7 @@ DBG_NAME( Menu ) #define EXTRASPACEY 2 #define EXTRAITEMHEIGHT 4 +#define GUTTERBORDER 8 // document closer #define IID_DOCUMENTCLOSE 1 @@ -104,32 +106,32 @@ DBG_NAME( Menu ) #include <xwphook.h> -// return TRUE if hilite should be executed: left mouse button down +// return sal_True if hilite should be executed: left mouse button down // or xwp mouse hook enabled -static BOOL ImplHilite( const MouseEvent& rMEvt ) +static sal_Bool ImplHilite( const MouseEvent& rMEvt ) { - static BOOL init = FALSE; + static sal_Bool init = sal_False; static HOOKCONFIG hc; // read XWP settings at program startup - if (init == FALSE) { - BOOL rc; - ULONG cb = sizeof(HOOKCONFIG); + if (init == sal_False) { + sal_Bool rc; + sal_uLong cb = sizeof(HOOKCONFIG); memset(&hc, 0, sizeof(HOOKCONFIG)); rc = PrfQueryProfileData( HINI_USER, INIAPP_XWPHOOK, INIKEY_HOOK_CONFIG, &hc, &cb); - init = TRUE; + init = sal_True; } // check mouse left button if (rMEvt.GetButtons() == MOUSE_LEFT) - return TRUE; + return sal_True; // return xwp flag return hc.fSlidingMenus; } #endif -static BOOL ImplAccelDisabled() +static sal_Bool ImplAccelDisabled() { // display of accelerator strings may be suppressed via configuration static int nAccelDisabled = -1; @@ -142,12 +144,12 @@ static BOOL ImplAccelDisabled() rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "SuppressAccelerators" ) ) ); nAccelDisabled = aStr.equalsIgnoreAsciiCaseAscii( "true" ) ? 1 : 0; } - return (nAccelDisabled == 1) ? TRUE : FALSE; + return (nAccelDisabled == 1) ? sal_True : sal_False; } struct MenuItemData { - USHORT nId; // SV Id + sal_uInt16 nId; // SV Id MenuItemType eType; // MenuItem-Type MenuItemBits nBits; // MenuItem-Bits Menu* pSubMenu; // Pointer auf das SubMenu @@ -157,15 +159,15 @@ struct MenuItemData XubString aTipHelpText; // TipHelp-String (eg, expanded filenames) XubString aCommandStr; // CommandString XubString aHelpCommandStr; // Help command string (to reference external help) - ULONG nHelpId; // Help-Id - ULONG nUserValue; // User value + rtl::OString aHelpId; // Help-Id + sal_uLong nUserValue; // User value Image aImage; // Image KeyCode aAccelKey; // Accelerator-Key - BOOL bChecked; // Checked - BOOL bEnabled; // Enabled - BOOL bVisible; // Visible (note: this flag will not override MENU_FLAG_HIDEDISABLEDENTRIES when true) - BOOL bIsTemporary; // Temporary inserted ('No selection possible') - BOOL bMirrorMode; + sal_Bool bChecked; // Checked + sal_Bool bEnabled; // Enabled + sal_Bool bVisible; // Visible (note: this flag will not override MENU_FLAG_HIDEDISABLEDENTRIES when true) + sal_Bool bIsTemporary; // Temporary inserted ('No selection possible') + sal_Bool bMirrorMode; long nItemImageAngle; Size aSz; // nur temporaer gueltig XubString aAccessibleName; // accessible name @@ -210,22 +212,22 @@ public: MenuItemList() : List( 16, 4 ) {} ~MenuItemList(); - MenuItemData* Insert( USHORT nId, MenuItemType eType, MenuItemBits nBits, + MenuItemData* Insert( sal_uInt16 nId, MenuItemType eType, MenuItemBits nBits, const XubString& rStr, const Image& rImage, - Menu* pMenu, USHORT nPos ); - void InsertSeparator( USHORT nPos ); - void Remove( USHORT nPos ); + Menu* pMenu, sal_uInt16 nPos ); + void InsertSeparator( sal_uInt16 nPos ); + void Remove( sal_uInt16 nPos ); - MenuItemData* GetData( USHORT nSVId, USHORT& rPos ) const; - MenuItemData* GetData( USHORT nSVId ) const - { USHORT nTemp; return GetData( nSVId, nTemp ); } - MenuItemData* GetDataFromPos( ULONG nPos ) const + MenuItemData* GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const; + MenuItemData* GetData( sal_uInt16 nSVId ) const + { sal_uInt16 nTemp; return GetData( nSVId, nTemp ); } + MenuItemData* GetDataFromPos( sal_uLong nPos ) const { return (MenuItemData*)List::GetObject( nPos ); } - MenuItemData* SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const; - USHORT GetItemCount( xub_Unicode cSelectChar ) const; - USHORT GetItemCount( KeyCode aKeyCode ) const; + MenuItemData* SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const; + sal_uInt16 GetItemCount( xub_Unicode cSelectChar ) const; + sal_uInt16 GetItemCount( KeyCode aKeyCode ) const; uno::Reference< i18n::XCharacterClassification > GetCharClass() const; }; @@ -234,17 +236,17 @@ public: MenuItemList::~MenuItemList() { - for ( ULONG n = Count(); n; ) + for ( sal_uLong n = Count(); n; ) { MenuItemData* pData = GetDataFromPos( --n ); delete pData; } } -MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType, +MenuItemData* MenuItemList::Insert( sal_uInt16 nId, MenuItemType eType, MenuItemBits nBits, const XubString& rStr, const Image& rImage, - Menu* pMenu, USHORT nPos ) + Menu* pMenu, sal_uInt16 nPos ) { MenuItemData* pData = new MenuItemData( rStr, rImage ); pData->nId = nId; @@ -252,13 +254,12 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType, pData->nBits = nBits; pData->pSubMenu = NULL; pData->pAutoSubMenu = NULL; - pData->nHelpId = 0; pData->nUserValue = 0; - pData->bChecked = FALSE; - pData->bEnabled = TRUE; - pData->bVisible = TRUE; - pData->bIsTemporary = FALSE; - pData->bMirrorMode = FALSE; + pData->bChecked = sal_False; + pData->bEnabled = sal_True; + pData->bVisible = sal_True; + pData->bIsTemporary = sal_False; + pData->bMirrorMode = sal_False; pData->nItemImageAngle = 0; SalItemParams aSalMIData; @@ -276,7 +277,7 @@ MenuItemData* MenuItemList::Insert( USHORT nId, MenuItemType eType, return pData; } -void MenuItemList::InsertSeparator( USHORT nPos ) +void MenuItemList::InsertSeparator( sal_uInt16 nPos ) { MenuItemData* pData = new MenuItemData; pData->nId = 0; @@ -284,13 +285,12 @@ void MenuItemList::InsertSeparator( USHORT nPos ) pData->nBits = 0; pData->pSubMenu = NULL; pData->pAutoSubMenu = NULL; - pData->nHelpId = 0; pData->nUserValue = 0; - pData->bChecked = FALSE; - pData->bEnabled = TRUE; - pData->bVisible = TRUE; - pData->bIsTemporary = FALSE; - pData->bMirrorMode = FALSE; + pData->bChecked = sal_False; + pData->bEnabled = sal_True; + pData->bVisible = sal_True; + pData->bIsTemporary = sal_False; + pData->bMirrorMode = sal_False; pData->nItemImageAngle = 0; SalItemParams aSalMIData; @@ -307,14 +307,14 @@ void MenuItemList::InsertSeparator( USHORT nPos ) List::Insert( (void*)pData, nPos ); } -void MenuItemList::Remove( USHORT nPos ) +void MenuItemList::Remove( sal_uInt16 nPos ) { - MenuItemData* pData = (MenuItemData*)List::Remove( (ULONG)nPos ); + MenuItemData* pData = (MenuItemData*)List::Remove( (sal_uLong)nPos ); if ( pData ) delete pData; } -MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const +MenuItemData* MenuItemList::GetData( sal_uInt16 nSVId, sal_uInt16& rPos ) const { rPos = 0; MenuItemData* pData = (MenuItemData*)GetObject( rPos ); @@ -330,11 +330,11 @@ MenuItemData* MenuItemList::GetData( USHORT nSVId, USHORT& rPos ) const return NULL; } -MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, USHORT& rPos, USHORT& nDuplicates, USHORT nCurrentPos ) const +MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCode, sal_uInt16& rPos, sal_uInt16& nDuplicates, sal_uInt16 nCurrentPos ) const { const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - USHORT nListCount = (USHORT)Count(); + sal_uInt16 nListCount = (sal_uInt16)Count(); // try character code first nDuplicates = GetItemCount( cSelectChar ); // return number of duplicates @@ -367,7 +367,7 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod MenuItemData* pData = GetDataFromPos( rPos ); if ( pData->bEnabled ) { - USHORT n = pData->aText.Search( '~' ); + sal_uInt16 n = pData->aText.Search( '~' ); if ( n != STRING_NOTFOUND ) { KeyCode mnKeyCode; @@ -391,13 +391,13 @@ MenuItemData* MenuItemList::SearchItem( xub_Unicode cSelectChar, KeyCode aKeyCod return NULL; } -USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const +sal_uInt16 MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const { // returns number of entries with same mnemonic const vcl::I18nHelper& rI18nHelper = Application::GetSettings().GetUILocaleI18nHelper(); - USHORT nItems = 0, nPos; - for ( nPos = (USHORT)Count(); nPos; ) + sal_uInt16 nItems = 0, nPos; + for ( nPos = (sal_uInt16)Count(); nPos; ) { MenuItemData* pData = GetDataFromPos( --nPos ); if ( pData->bEnabled && rI18nHelper.MatchMnemonic( pData->aText, cSelectChar ) ) @@ -407,7 +407,7 @@ USHORT MenuItemList::GetItemCount( xub_Unicode cSelectChar ) const return nItems; } -USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const +sal_uInt16 MenuItemList::GetItemCount( KeyCode aKeyCode ) const { // returns number of entries with same mnemonic // uses key codes instead of character codes @@ -416,13 +416,13 @@ USHORT MenuItemList::GetItemCount( KeyCode aKeyCode ) const if( aKeyCode.GetCode() >= KEY_A && aKeyCode.GetCode() <= KEY_Z ) ascii = sal::static_int_cast<char>('A' + (aKeyCode.GetCode() - KEY_A)); - USHORT nItems = 0, nPos; - for ( nPos = (USHORT)Count(); nPos; ) + sal_uInt16 nItems = 0, nPos; + for ( nPos = (sal_uInt16)Count(); nPos; ) { MenuItemData* pData = GetDataFromPos( --nPos ); if ( pData->bEnabled ) { - USHORT n = pData->aText.Search( '~' ); + sal_uInt16 n = pData->aText.Search( '~' ); if ( n != STRING_NOTFOUND ) { KeyCode mnKeyCode; @@ -464,21 +464,21 @@ private: Timer aHighlightChangedTimer; Timer aSubmenuCloseTimer; Timer aScrollTimer; - ULONG nSaveFocusId; + sal_uLong nSaveFocusId; // long nStartY; - USHORT nHighlightedItem; // gehighlightetes/selektiertes Item - USHORT nMBDownPos; - USHORT nScrollerHeight; - USHORT nFirstEntry; - USHORT nBorder; - USHORT nPosInParent; - BOOL bInExecute; - - BOOL bScrollMenu; - BOOL bScrollUp; - BOOL bScrollDown; - BOOL bIgnoreFirstMove; - BOOL bKeyInput; + sal_uInt16 nHighlightedItem; // gehighlightetes/selektiertes Item + sal_uInt16 nMBDownPos; + sal_uInt16 nScrollerHeight; + sal_uInt16 nFirstEntry; + sal_uInt16 nBorder; + sal_uInt16 nPosInParent; + sal_Bool bInExecute; + + sal_Bool bScrollMenu; + sal_Bool bScrollUp; + sal_Bool bScrollDown; + sal_Bool bIgnoreFirstMove; + sal_Bool bKeyInput; DECL_LINK( PopupEnd, FloatingWindow* ); DECL_LINK( HighlightChanged, Timer* ); @@ -489,16 +489,16 @@ private: void StateChanged( StateChangedType nType ); void DataChanged( const DataChangedEvent& rDCEvt ); protected: - Region ImplCalcClipRegion( BOOL bIncludeLogo = TRUE ) const; + Region ImplCalcClipRegion( sal_Bool bIncludeLogo = sal_True ) const; void ImplInitClipRegion(); - void ImplDrawScroller( BOOL bUp ); + void ImplDrawScroller( sal_Bool bUp ); using Window::ImplScroll; void ImplScroll( const Point& rMousePos ); - void ImplScroll( BOOL bUp ); - void ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd = FALSE ); - void ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown ); + void ImplScroll( sal_Bool bUp ); + void ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd = sal_False ); + void ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown ); long ImplGetStartY() const; - Rectangle ImplGetItemRect( USHORT nPos ); + Rectangle ImplGetItemRect( sal_uInt16 nPos ); public: MenuFloatingWindow( Menu* pMenu, Window* pParent, WinBits nStyle ); @@ -515,27 +515,27 @@ public: virtual void RequestHelp( const HelpEvent& rHEvt ); virtual void Resize(); - void SetFocusId( ULONG nId ) { nSaveFocusId = nId; } - ULONG GetFocusId() const { return nSaveFocusId; } + void SetFocusId( sal_uLong nId ) { nSaveFocusId = nId; } + sal_uLong GetFocusId() const { return nSaveFocusId; } - void EnableScrollMenu( BOOL b ); - BOOL IsScrollMenu() const { return bScrollMenu; } - USHORT GetScrollerHeight() const { return nScrollerHeight; } + void EnableScrollMenu( sal_Bool b ); + sal_Bool IsScrollMenu() const { return bScrollMenu; } + sal_uInt16 GetScrollerHeight() const { return nScrollerHeight; } void Execute(); - void StopExecute( ULONG nFocusId = 0 ); + void StopExecute( sal_uLong nFocusId = 0 ); void EndExecute(); - void EndExecute( USHORT nSelectId ); + void EndExecute( sal_uInt16 nSelectId ); PopupMenu* GetActivePopup() const { return pActivePopup; } void KillActivePopup( PopupMenu* pThisOnly = NULL ); - void HighlightItem( USHORT nPos, BOOL bHighlight ); - void ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ); - USHORT GetHighlightedItem() const { return nHighlightedItem; } + void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ); + void ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer ); + sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; } - void SetPosInParent( USHORT nPos ) { nPosInParent = nPos; } - USHORT GetPosInParent() const { return nPosInParent; } + void SetPosInParent( sal_uInt16 nPos ) { nPosInParent = nPos; } + sal_uInt16 GetPosInParent() const { return nPosInParent; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); }; @@ -606,10 +606,10 @@ void DecoToolBox::calcMinSize() } else { - USHORT nItems = GetItemCount(); - for( USHORT i = 0; i < nItems; i++ ) + sal_uInt16 nItems = GetItemCount(); + for( sal_uInt16 i = 0; i < nItems; i++ ) { - USHORT nId = GetItemId( i ); + sal_uInt16 nId = GetItemId( i ); aTbx.InsertItem( nId, GetItemImage( nId ) ); } } @@ -670,7 +670,7 @@ class MenuBarWindow : public Window private: struct AddButtonEntry { - USHORT m_nId; + sal_uInt16 m_nId; Link m_aSelectLink; Link m_aHighlightLink; @@ -679,25 +679,25 @@ private: Menu* pMenu; PopupMenu* pActivePopup; - USHORT nHighlightedItem; - ULONG nSaveFocusId; - BOOL mbAutoPopup; - BOOL bIgnoreFirstMove; - BOOL bStayActive; + sal_uInt16 nHighlightedItem; + sal_uLong nSaveFocusId; + sal_Bool mbAutoPopup; + sal_Bool bIgnoreFirstMove; + sal_Bool bStayActive; DecoToolBox aCloser; PushButton aFloatBtn; PushButton aHideBtn; - std::map< USHORT, AddButtonEntry > m_aAddButtons; + std::map< sal_uInt16, AddButtonEntry > m_aAddButtons; - void HighlightItem( USHORT nPos, BOOL bHighlight ); - void ChangeHighlightItem( USHORT n, BOOL bSelectPopupEntry, BOOL bAllowRestoreFocus = TRUE, BOOL bDefaultToDocument = TRUE ); + void HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ); + void ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectPopupEntry, sal_Bool bAllowRestoreFocus = sal_True, sal_Bool bDefaultToDocument = sal_True ); - USHORT ImplFindEntry( const Point& rMousePos ) const; - void ImplCreatePopup( BOOL bPreSelectFirst ); - BOOL ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu = TRUE ); - Rectangle ImplGetItemRect( USHORT nPos ); + sal_uInt16 ImplFindEntry( const Point& rMousePos ) const; + void ImplCreatePopup( sal_Bool bPreSelectFirst ); + sal_Bool ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu = sal_True ); + Rectangle ImplGetItemRect( sal_uInt16 nPos ); void ImplInitStyleSettings(); @@ -716,7 +716,7 @@ public: MenuBarWindow( Window* pParent ); ~MenuBarWindow(); - void ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide ); + void ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide ); virtual void MouseMove( const MouseEvent& rMEvt ); virtual void MouseButtonDown( const MouseEvent& rMEvt ); @@ -726,26 +726,26 @@ public: virtual void Resize(); virtual void RequestHelp( const HelpEvent& rHEvt ); - void SetFocusId( ULONG nId ) { nSaveFocusId = nId; } - ULONG GetFocusId() const { return nSaveFocusId; } + void SetFocusId( sal_uLong nId ) { nSaveFocusId = nId; } + sal_uLong GetFocusId() const { return nSaveFocusId; } void SetMenu( MenuBar* pMenu ); void KillActivePopup(); PopupMenu* GetActivePopup() const { return pActivePopup; } void PopupClosed( Menu* pMenu ); - USHORT GetHighlightedItem() const { return nHighlightedItem; } + sal_uInt16 GetHighlightedItem() const { return nHighlightedItem; } virtual ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > CreateAccessible(); - void SetAutoPopup( BOOL bAuto ) { mbAutoPopup = bAuto; } + void SetAutoPopup( sal_Bool bAuto ) { mbAutoPopup = bAuto; } void ImplLayoutChanged(); Size MinCloseButtonSize(); // add an arbitrary button to the menubar (will appear next to closer) - USHORT AddMenuBarButton( const Image&, const Link&, const String&, USHORT nPos ); - void SetMenuBarButtonHighlightHdl( USHORT nId, const Link& ); - Rectangle GetMenuBarButtonRectPixel( USHORT nId ); - void RemoveMenuBarButton( USHORT nId ); - bool HandleMenuButtonEvent( USHORT i_nButtonId ); + sal_uInt16 AddMenuBarButton( const Image&, const Link&, const String&, sal_uInt16 nPos ); + void SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& ); + Rectangle GetMenuBarButtonRectPixel( sal_uInt16 nId ); + void RemoveMenuBarButton( sal_uInt16 nId ); + bool HandleMenuButtonEvent( sal_uInt16 i_nButtonId ); }; static void ImplAddNWFSeparator( Window *pThis, const MenubarValue& rMenubarValue ) @@ -775,24 +775,24 @@ static void ImplSetMenuItemData( MenuItemData* pData ) pData->eType = MENUITEM_STRINGIMAGE; } -static ULONG ImplChangeTipTimeout( ULONG nTimeout, Window *pWindow ) +static sal_uLong ImplChangeTipTimeout( sal_uLong nTimeout, Window *pWindow ) { AllSettings aAllSettings( pWindow->GetSettings() ); HelpSettings aHelpSettings( aAllSettings.GetHelpSettings() ); - ULONG nRet = aHelpSettings.GetTipTimeout(); + sal_uLong nRet = aHelpSettings.GetTipTimeout(); aHelpSettings.SetTipTimeout( nTimeout ); aAllSettings.SetHelpSettings( aHelpSettings ); pWindow->SetSettings( aAllSettings ); return nRet; } -static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect ) +static sal_Bool ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, sal_uInt16 nHighlightedItem, const HelpEvent& rHEvt, const Rectangle &rHighlightRect ) { if( ! pMenu ) - return FALSE; + return sal_False; - BOOL bDone = FALSE; - USHORT nId = 0; + sal_Bool bDone = sal_False; + sal_uInt16 nId = 0; if ( nHighlightedItem != ITEMPOS_INVALID ) { @@ -815,23 +815,23 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl else { // give user a chance to read the full filename - ULONG oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow ); + sal_uLong oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow ); // call always, even when strlen==0 to correctly remove tip Help::ShowQuickHelp( pMenuWindow, aRect, pMenu->GetTipHelpText( nId ) ); ImplChangeTipTimeout( oldTimeout, pMenuWindow ); } - bDone = TRUE; + bDone = sal_True; } else if ( ( rHEvt.GetMode() & HELPMODE_QUICK ) && pMenuWindow ) { Point aPos = rHEvt.GetMousePosPixel(); Rectangle aRect( aPos, Size() ); // give user a chance to read the full filename - ULONG oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow ); + sal_uLong oldTimeout=ImplChangeTipTimeout( 60000, pMenuWindow ); // call always, even when strlen==0 to correctly remove tip Help::ShowQuickHelp( pMenuWindow, aRect, pMenu->GetTipHelpText( nId ) ); ImplChangeTipTimeout( oldTimeout, pMenuWindow ); - bDone = TRUE; + bDone = sal_True; } else if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) ) { @@ -842,16 +842,16 @@ static BOOL ImplHandleHelpEvent( Window* pMenuWindow, Menu* pMenu, USHORT nHighl // Ist eine ID vorhanden, dann Hilfe mit der ID aufrufen, sonst // den Hilfe-Index String aCommand = pMenu->GetItemCommand( nId ); - ULONG nHelpId = pMenu->GetHelpId( nId ); + rtl::OString aHelpId( pMenu->GetHelpId( nId ) ); + if( ! aHelpId.getLength() ) + aHelpId = OOO_HELP_INDEX; if ( aCommand.Len() ) pHelp->Start( aCommand, NULL ); - else if ( nHelpId ) - pHelp->Start( nHelpId, NULL ); else - pHelp->Start( OOO_HELP_INDEX, NULL ); + pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), NULL ); } - bDone = TRUE; + bDone = sal_True; } return bDone; } @@ -861,7 +861,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow ) // find docking area that is top aligned and return its height // note: dockingareas are direct children of the SystemWindow int height=0; - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if( pWindow->ImplGetFrameWindow() ) { Window *pWin = pWindow->ImplGetFrameWindow()->GetWindow( WINDOW_FIRSTCHILD); //mpWindowImpl->mpFirstChild; @@ -875,7 +875,7 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow ) DockingAreaWindow *pDockingArea = dynamic_cast< DockingAreaWindow* >( pWin ); if( pDockingArea && pDockingArea->GetAlign() == WINDOWALIGN_TOP ) { - bDone = TRUE; + bDone = sal_True; if( pDockingArea->IsVisible() ) height = pDockingArea->GetOutputSizePixel().Height(); } @@ -894,13 +894,13 @@ static int ImplGetTopDockingAreaHeight( Window *pWindow ) Menu::Menu() { DBG_CTOR( Menu, NULL ); - bIsMenuBar = FALSE; + bIsMenuBar = sal_False; ImplInit(); } // this constructor makes sure we're creating the native menu // with the correct type (ie, MenuBar vs. PopupMenu) -Menu::Menu( BOOL bMenubar ) +Menu::Menu( sal_Bool bMenubar ) { DBG_CTOR( Menu, NULL ); bIsMenuBar = bMenubar; @@ -944,7 +944,7 @@ Menu::~Menu() pDelData = pDelData->mpNext; } - bKilled = TRUE; + bKilled = sal_True; delete pItemList; delete pLogo; @@ -965,20 +965,20 @@ void Menu::ImplInit() mpSalMenu = NULL; nMenuFlags = 0; nDefaultItem = 0; - //bIsMenuBar = FALSE; // this is now set in the ctor, must not be changed here!!! + //bIsMenuBar = sal_False; // this is now set in the ctor, must not be changed here!!! nSelectedId = 0; pItemList = new MenuItemList; pLogo = NULL; pStartedFrom = NULL; pWindow = NULL; nEventId = 0; - bCanceled = FALSE; - bInCallback = FALSE; - bKilled = FALSE; + bCanceled = sal_False; + bInCallback = sal_False; + bKilled = sal_False; mpLayoutData = NULL; mpFirstDel = NULL; // Dtor notification list // Native-support: returns NULL if not supported - mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar ); + mpSalMenu = ImplGetSVData()->mpDefInst->CreateMenu( bIsMenuBar, this ); } Menu* Menu::ImplGetStartedFrom() const @@ -995,13 +995,13 @@ void Menu::ImplLoadRes( const ResId& rResId ) rResId.SetRT( RSC_MENU ); GetRes( rResId ); - ULONG nObjMask = ReadLongRes(); + sal_uLong nObjMask = ReadLongRes(); if( nObjMask & RSC_MENU_ITEMS ) { - ULONG nObjFollows = ReadLongRes(); + sal_uLong nObjFollows = ReadLongRes(); // MenuItems einfuegen - for( ULONG i = 0; i < nObjFollows; i++ ) + for( sal_uLong i = 0; i < nObjFollows; i++ ) { InsertItem( ResId( (RSHEADER_TYPE*)GetClassRes(), *pMgr ) ); IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) ); @@ -1016,13 +1016,13 @@ void Menu::ImplLoadRes( const ResId& rResId ) aTitleText = ReadStringRes(); } if( nObjMask & RSC_MENU_DEFAULTITEMID ) - SetDefaultItem( sal::static_int_cast<USHORT>(ReadLongRes()) ); + SetDefaultItem( sal::static_int_cast<sal_uInt16>(ReadLongRes()) ); } void Menu::CreateAutoMnemonics() { MnemonicGenerator aMnemonicGenerator; - ULONG n; + sal_uLong n; for ( n = 0; n < pItemList->Count(); n++ ) { MenuItemData* pData = pItemList->GetDataFromPos(n); @@ -1039,7 +1039,7 @@ void Menu::CreateAutoMnemonics() void Menu::Activate() { - bInCallback = TRUE; + bInCallback = sal_True; ImplMenuDelData aDelData( this ); @@ -1054,27 +1054,27 @@ void Menu::Activate() Menu* pStartMenu = ImplGetStartMenu(); if ( pStartMenu && ( pStartMenu != this ) ) { - pStartMenu->bInCallback = TRUE; + pStartMenu->bInCallback = sal_True; // MT 11/01: Call EventListener here? I don't know... pStartMenu->aActivateHdl.Call( this ); - pStartMenu->bInCallback = FALSE; + pStartMenu->bInCallback = sal_False; } } } - bInCallback = FALSE; + bInCallback = sal_False; } } void Menu::Deactivate() { - for ( USHORT n = (USHORT)pItemList->Count(); n; ) + for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; ) { MenuItemData* pData = pItemList->GetDataFromPos( --n ); if ( pData->bIsTemporary ) pItemList->Remove( n ); } - bInCallback = TRUE; + bInCallback = sal_True; ImplMenuDelData aDelData( this ); @@ -1089,9 +1089,9 @@ void Menu::Deactivate() { if ( pStartMenu && ( pStartMenu != this ) ) { - pStartMenu->bInCallback = TRUE; + pStartMenu->bInCallback = sal_True; pStartMenu->aDeactivateHdl.Call( this ); - pStartMenu->bInCallback = FALSE; + pStartMenu->bInCallback = sal_False; } } } @@ -1099,7 +1099,7 @@ void Menu::Deactivate() if( !aDelData.isDeleted() ) { - bInCallback = FALSE; + bInCallback = sal_False; } } @@ -1120,11 +1120,11 @@ void Menu::ImplSelect() MenuItemData* pData = GetItemList()->GetData( nSelectedId ); if ( pData && (pData->nBits & MIB_AUTOCHECK) ) { - BOOL bChecked = IsItemChecked( nSelectedId ); + sal_Bool bChecked = IsItemChecked( nSelectedId ); if ( pData->nBits & MIB_RADIOCHECK ) { if ( !bChecked ) - CheckItem( nSelectedId, TRUE ); + CheckItem( nSelectedId, sal_True ); } else CheckItem( nSelectedId, !bChecked ); @@ -1170,7 +1170,7 @@ void Menu::RequestHelp( const HelpEvent& ) { } -void Menu::ImplCallEventListeners( ULONG nEvent, USHORT nPos ) +void Menu::ImplCallEventListeners( sal_uLong nEvent, sal_uInt16 nPos ) { ImplMenuDelData aDelData( this ); @@ -1224,14 +1224,14 @@ void Menu::RemoveEventListener( const Link& rEventListener ) // mpDummy4_WindowChildEventListeners->remove( rEventListener ); //} -void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItemBits, USHORT nPos ) +void Menu::InsertItem( sal_uInt16 nItemId, const XubString& rStr, MenuItemBits nItemBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "Menu::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == MENU_ITEM_NOTFOUND, "Menu::InsertItem(): ItemId already exists" ); // if Position > ItemCount, append - if ( nPos >= (USHORT)pItemList->Count() ) + if ( nPos >= (sal_uInt16)pItemList->Count() ) nPos = MENU_APPEND; // put Item in MenuItemList @@ -1253,39 +1253,39 @@ void Menu::InsertItem( USHORT nItemId, const XubString& rStr, MenuItemBits nItem ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos ); } -void Menu::InsertItem( USHORT nItemId, const Image& rImage, - MenuItemBits nItemBits, USHORT nPos ) +void Menu::InsertItem( sal_uInt16 nItemId, const Image& rImage, + MenuItemBits nItemBits, sal_uInt16 nPos ) { InsertItem( nItemId, ImplGetSVEmptyStr(), nItemBits, nPos ); SetItemImage( nItemId, rImage ); } -void Menu::InsertItem( USHORT nItemId, +void Menu::InsertItem( sal_uInt16 nItemId, const XubString& rStr, const Image& rImage, - MenuItemBits nItemBits, USHORT nPos ) + MenuItemBits nItemBits, sal_uInt16 nPos ) { InsertItem( nItemId, rStr, nItemBits, nPos ); SetItemImage( nItemId, rImage ); } -void Menu::InsertItem( const ResId& rResId, USHORT nPos ) +void Menu::InsertItem( const ResId& rResId, sal_uInt16 nPos ) { ResMgr* pMgr = rResId.GetResMgr(); if( ! pMgr ) return; - ULONG nObjMask; + sal_uLong nObjMask; GetRes( rResId.SetRT( RSC_MENUITEM ) ); nObjMask = ReadLongRes(); - BOOL bSep = FALSE; + sal_Bool bSep = sal_False; if ( nObjMask & RSC_MENUITEM_SEPARATOR ) - bSep = (BOOL)ReadShortRes(); + bSep = (sal_Bool)ReadShortRes(); - USHORT nItemId = 1; + sal_uInt16 nItemId = 1; if ( nObjMask & RSC_MENUITEM_ID ) - nItemId = sal::static_int_cast<USHORT>(ReadLongRes()); + nItemId = sal::static_int_cast<sal_uInt16>(ReadLongRes()); MenuItemBits nStatus = 0; if ( nObjMask & RSC_MENUITEM_STATUS ) @@ -1321,15 +1321,14 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos ) SetHelpText( nItemId, aHelpText ); } - ULONG nHelpId = 0; if ( nObjMask & RSC_MENUITEM_HELPID ) { - nHelpId = ReadLongRes(); + rtl::OString aHelpId( ReadByteStringRes() ); if ( !bSep ) - SetHelpId( nItemId, nHelpId ); + SetHelpId( nItemId, aHelpId ); } - if( !bSep /* && SvHelpSettings::HelpText( aHelpText, nHelpId ) */ ) + if( !bSep ) SetHelpText( nItemId, aHelpText ); if ( nObjMask & RSC_MENUITEM_KEYCODE ) @@ -1341,12 +1340,12 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos ) if( nObjMask & RSC_MENUITEM_CHECKED ) { if ( !bSep ) - CheckItem( nItemId, (BOOL)ReadShortRes() ); + CheckItem( nItemId, (sal_Bool)ReadShortRes() ); } if ( nObjMask & RSC_MENUITEM_DISABLE ) { if ( !bSep ) - EnableItem( nItemId, !(BOOL)ReadShortRes() ); + EnableItem( nItemId, !(sal_Bool)ReadShortRes() ); } if ( nObjMask & RSC_MENUITEM_COMMAND ) { @@ -1373,21 +1372,21 @@ void Menu::InsertItem( const ResId& rResId, USHORT nPos ) delete mpLayoutData, mpLayoutData = NULL; } -void Menu::InsertSeparator( USHORT nPos ) +void Menu::InsertSeparator( sal_uInt16 nPos ) { // do nothing if its a menu bar if ( bIsMenuBar ) return; // if position > ItemCount, append - if ( nPos >= (USHORT)pItemList->Count() ) + if ( nPos >= (sal_uInt16)pItemList->Count() ) nPos = MENU_APPEND; // put separator in item list pItemList->InsertSeparator( nPos ); // update native menu - USHORT itemPos = nPos != MENU_APPEND ? nPos : (USHORT)pItemList->Count() - 1; + sal_uInt16 itemPos = nPos != MENU_APPEND ? nPos : (sal_uInt16)pItemList->Count() - 1; MenuItemData *pData = pItemList->GetDataFromPos( itemPos ); if( ImplGetSalMenu() && pData && pData->pSalMenuItem ) ImplGetSalMenu()->InsertItem( pData->pSalMenuItem, nPos ); @@ -1397,9 +1396,9 @@ void Menu::InsertSeparator( USHORT nPos ) ImplCallEventListeners( VCLEVENT_MENU_INSERTITEM, nPos ); } -void Menu::RemoveItem( USHORT nPos ) +void Menu::RemoveItem( sal_uInt16 nPos ) { - BOOL bRemove = FALSE; + sal_Bool bRemove = sal_False; if ( nPos < GetItemCount() ) { @@ -1408,7 +1407,7 @@ void Menu::RemoveItem( USHORT nPos ) ImplGetSalMenu()->RemoveItem( nPos ); pItemList->Remove( nPos ); - bRemove = TRUE; + bRemove = sal_True; } Window* pWin = ImplGetWindow(); @@ -1424,8 +1423,8 @@ void Menu::RemoveItem( USHORT nPos ) ImplCallEventListeners( VCLEVENT_MENU_REMOVEITEM, nPos ); } -void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos, - USHORT nMode = 0 ) +void ImplCopyItem( Menu* pThis, const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos, + sal_uInt16 nMode = 0 ) { MenuItemType eType = rMenu.GetItemType( nPos ); @@ -1436,7 +1435,7 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos, pThis->InsertSeparator( nNewPos ); else { - USHORT nId = rMenu.GetItemId( nPos ); + sal_uInt16 nId = rMenu.GetItemId( nPos ); DBG_ASSERT( pThis->GetItemPos( nId ) == MENU_ITEM_NOTFOUND, "Menu::CopyItem(): ItemId already exists" ); @@ -1451,10 +1450,10 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos, pThis->InsertItem( nId, pData->aImage, pData->nBits, nNewPos ); if ( rMenu.IsItemChecked( nId ) ) - pThis->CheckItem( nId, TRUE ); + pThis->CheckItem( nId, sal_True ); if ( !rMenu.IsItemEnabled( nId ) ) - pThis->EnableItem( nId, FALSE ); - pThis->SetHelpId( nId, pData->nHelpId ); + pThis->EnableItem( nId, sal_False ); + pThis->SetHelpId( nId, pData->aHelpId ); pThis->SetHelpText( nId, pData->aHelpText ); pThis->SetAccelKey( nId, pData->aAccelKey ); pThis->SetItemCommand( nId, pData->aCommandStr ); @@ -1476,26 +1475,26 @@ void ImplCopyItem( Menu* pThis, const Menu& rMenu, USHORT nPos, USHORT nNewPos, } } -void Menu::CopyItem( const Menu& rMenu, USHORT nPos, USHORT nNewPos ) +void Menu::CopyItem( const Menu& rMenu, sal_uInt16 nPos, sal_uInt16 nNewPos ) { ImplCopyItem( this, rMenu, nPos, nNewPos ); } void Menu::Clear() { - for ( USHORT i = GetItemCount(); i; i-- ) + for ( sal_uInt16 i = GetItemCount(); i; i-- ) RemoveItem( 0 ); } -USHORT Menu::GetItemCount() const +sal_uInt16 Menu::GetItemCount() const { - return (USHORT)pItemList->Count(); + return (sal_uInt16)pItemList->Count(); } -USHORT Menu::ImplGetVisibleItemCount() const +sal_uInt16 Menu::ImplGetVisibleItemCount() const { - USHORT nItems = 0; - for ( USHORT n = (USHORT)pItemList->Count(); n; ) + sal_uInt16 nItems = 0; + for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; ) { if ( ImplIsVisible( --n ) ) nItems++; @@ -1503,9 +1502,9 @@ USHORT Menu::ImplGetVisibleItemCount() const return nItems; } -USHORT Menu::ImplGetFirstVisible() const +sal_uInt16 Menu::ImplGetFirstVisible() const { - for ( USHORT n = 0; n < pItemList->Count(); n++ ) + for ( sal_uInt16 n = 0; n < pItemList->Count(); n++ ) { if ( ImplIsVisible( n ) ) return n; @@ -1513,9 +1512,9 @@ USHORT Menu::ImplGetFirstVisible() const return ITEMPOS_INVALID; } -USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const +sal_uInt16 Menu::ImplGetPrevVisible( sal_uInt16 nPos ) const { - for ( USHORT n = nPos; n; ) + for ( sal_uInt16 n = nPos; n; ) { if ( n && ImplIsVisible( --n ) ) return n; @@ -1523,9 +1522,9 @@ USHORT Menu::ImplGetPrevVisible( USHORT nPos ) const return ITEMPOS_INVALID; } -USHORT Menu::ImplGetNextVisible( USHORT nPos ) const +sal_uInt16 Menu::ImplGetNextVisible( sal_uInt16 nPos ) const { - for ( USHORT n = nPos+1; n < pItemList->Count(); n++ ) + for ( sal_uInt16 n = nPos+1; n < pItemList->Count(); n++ ) { if ( ImplIsVisible( n ) ) return n; @@ -1533,7 +1532,7 @@ USHORT Menu::ImplGetNextVisible( USHORT nPos ) const return ITEMPOS_INVALID; } -USHORT Menu::GetItemId( USHORT nPos ) const +sal_uInt16 Menu::GetItemId( sal_uInt16 nPos ) const { MenuItemData* pData = pItemList->GetDataFromPos( nPos ); @@ -1543,9 +1542,9 @@ USHORT Menu::GetItemId( USHORT nPos ) const return 0; } -USHORT Menu::GetItemPos( USHORT nItemId ) const +sal_uInt16 Menu::GetItemPos( sal_uInt16 nItemId ) const { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData ) @@ -1554,7 +1553,7 @@ USHORT Menu::GetItemPos( USHORT nItemId ) const return MENU_ITEM_NOTFOUND; } -MenuItemType Menu::GetItemType( USHORT nPos ) const +MenuItemType Menu::GetItemType( sal_uInt16 nPos ) const { MenuItemData* pData = pItemList->GetDataFromPos( nPos ); @@ -1564,19 +1563,19 @@ MenuItemType Menu::GetItemType( USHORT nPos ) const return MENUITEM_DONTKNOW; } -USHORT Menu::GetCurItemId() const +sal_uInt16 Menu::GetCurItemId() const { return nSelectedId; } -void Menu::SetItemBits( USHORT nItemId, MenuItemBits nBits ) +void Menu::SetItemBits( sal_uInt16 nItemId, MenuItemBits nBits ) { MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) pData->nBits = nBits; } -MenuItemBits Menu::GetItemBits( USHORT nItemId ) const +MenuItemBits Menu::GetItemBits( sal_uInt16 nItemId ) const { MenuItemBits nBits = 0; MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1585,22 +1584,22 @@ MenuItemBits Menu::GetItemBits( USHORT nItemId ) const return nBits; } -void Menu::SetUserValue( USHORT nItemId, ULONG nValue ) +void Menu::SetUserValue( sal_uInt16 nItemId, sal_uLong nValue ) { MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) pData->nUserValue = nValue; } -ULONG Menu::GetUserValue( USHORT nItemId ) const +sal_uLong Menu::GetUserValue( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); return pData ? pData->nUserValue : 0; } -void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu ) +void Menu::SetPopupMenu( sal_uInt16 nItemId, PopupMenu* pMenu ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); // Item does not exist -> return NULL @@ -1630,7 +1629,7 @@ void Menu::SetPopupMenu( USHORT nItemId, PopupMenu* pMenu ) ImplCallEventListeners( VCLEVENT_MENU_SUBMENUCHANGED, nPos ); } -PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const +PopupMenu* Menu::GetPopupMenu( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1640,9 +1639,9 @@ PopupMenu* Menu::GetPopupMenu( USHORT nItemId ) const return NULL; } -void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode ) +void Menu::SetAccelKey( sal_uInt16 nItemId, const KeyCode& rKeyCode ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) @@ -1658,7 +1657,7 @@ void Menu::SetAccelKey( USHORT nItemId, const KeyCode& rKeyCode ) ImplGetSalMenu()->SetAccelerator( nPos, pData->pSalMenuItem, rKeyCode, rKeyCode.GetName() ); } -KeyCode Menu::GetAccelKey( USHORT nItemId ) const +KeyCode Menu::GetAccelKey( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1668,16 +1667,16 @@ KeyCode Menu::GetAccelKey( USHORT nItemId ) const return KeyCode(); } -KeyEvent Menu::GetActivationKey( USHORT nItemId ) const +KeyEvent Menu::GetActivationKey( sal_uInt16 nItemId ) const { KeyEvent aRet; MenuItemData* pData = pItemList->GetData( nItemId ); if( pData ) { - USHORT nPos = pData->aText.Search( '~' ); + sal_uInt16 nPos = pData->aText.Search( '~' ); if( nPos != STRING_NOTFOUND && nPos < pData->aText.Len()-1 ) { - USHORT nCode = 0; + sal_uInt16 nCode = 0; sal_Unicode cAccel = pData->aText.GetChar( nPos+1 ); if( cAccel >= 'a' && cAccel <= 'z' ) nCode = KEY_A + (cAccel-'a'); @@ -1693,9 +1692,9 @@ KeyEvent Menu::GetActivationKey( USHORT nItemId ) const return aRet; } -void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) +void Menu::CheckItem( sal_uInt16 nItemId, sal_Bool bCheck ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData || pData->bChecked == bCheck ) @@ -1706,9 +1705,9 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) (pData->nBits & MIB_RADIOCHECK) ) { MenuItemData* pGroupData; - USHORT nGroupPos; - USHORT nItemCount = GetItemCount(); - BOOL bFound = FALSE; + sal_uInt16 nGroupPos; + sal_uInt16 nItemCount = GetItemCount(); + sal_Bool bFound = sal_False; nGroupPos = nPos; while ( nGroupPos ) @@ -1718,8 +1717,8 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) { if ( IsItemChecked( pGroupData->nId ) ) { - CheckItem( pGroupData->nId, FALSE ); - bFound = TRUE; + CheckItem( pGroupData->nId, sal_False ); + bFound = sal_True; break; } } @@ -1738,7 +1737,7 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) { if ( IsItemChecked( pGroupData->nId ) ) { - CheckItem( pGroupData->nId, FALSE ); + CheckItem( pGroupData->nId, sal_False ); break; } } @@ -1758,20 +1757,20 @@ void Menu::CheckItem( USHORT nItemId, BOOL bCheck ) ImplCallEventListeners( bCheck ? VCLEVENT_MENU_ITEMCHECKED : VCLEVENT_MENU_ITEMUNCHECKED, nPos ); } -BOOL Menu::IsItemChecked( USHORT nItemId ) const +sal_Bool Menu::IsItemChecked( sal_uInt16 nItemId ) const { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) - return FALSE; + return sal_False; return pData->bChecked; } -void Menu::EnableItem( USHORT nItemId, BOOL bEnable ) +void Menu::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pItemData = pItemList->GetData( nItemId, nPos ); if ( pItemData && ( pItemData->bEnabled != bEnable ) ) @@ -1783,8 +1782,8 @@ void Menu::EnableItem( USHORT nItemId, BOOL bEnable ) { DBG_ASSERT( bIsMenuBar, "Menu::EnableItem - Popup visible!" ); long nX = 0; - ULONG nCount = pItemList->Count(); - for ( ULONG n = 0; n < nCount; n++ ) + sal_uLong nCount = pItemList->Count(); + for ( sal_uLong n = 0; n < nCount; n++ ) { MenuItemData* pData = pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -1803,20 +1802,20 @@ void Menu::EnableItem( USHORT nItemId, BOOL bEnable ) } } -BOOL Menu::IsItemEnabled( USHORT nItemId ) const +sal_Bool Menu::IsItemEnabled( sal_uInt16 nItemId ) const { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) - return FALSE; + return sal_False; return pData->bEnabled; } -void Menu::ShowItem( USHORT nItemId, BOOL bVisible ) +void Menu::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); DBG_ASSERT( !bIsMenuBar, "Menu::ShowItem - ignored for menu bar entries!" ); @@ -1838,9 +1837,9 @@ void Menu::ShowItem( USHORT nItemId, BOOL bVisible ) } } -void Menu::SetItemText( USHORT nItemId, const XubString& rStr ) +void Menu::SetItemText( sal_uInt16 nItemId, const XubString& rStr ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) @@ -1867,9 +1866,9 @@ void Menu::SetItemText( USHORT nItemId, const XubString& rStr ) } } -XubString Menu::GetItemText( USHORT nItemId ) const +XubString Menu::GetItemText( sal_uInt16 nItemId ) const { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData ) @@ -1878,9 +1877,9 @@ XubString Menu::GetItemText( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetItemImage( USHORT nItemId, const Image& rImage ) +void Menu::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( !pData ) @@ -1904,9 +1903,9 @@ static inline Image ImplRotImage( const Image& rImage, long nAngle10 ) return Image( aBmpEx ); } -void Menu::SetItemImageAngle( USHORT nItemId, long nAngle10 ) +void Menu::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData ) @@ -1931,9 +1930,9 @@ static inline Image ImplMirrorImage( const Image& rImage ) return Image( aBmpEx ); } -void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror ) +void Menu::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData ) @@ -1949,7 +1948,7 @@ void Menu::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror ) } } -Image Menu::GetItemImage( USHORT nItemId ) const +Image Menu::GetItemImage( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1959,7 +1958,7 @@ Image Menu::GetItemImage( USHORT nItemId ) const return Image(); } -long Menu::GetItemImageAngle( USHORT nItemId ) const +long Menu::GetItemImageAngle( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1969,17 +1968,17 @@ long Menu::GetItemImageAngle( USHORT nItemId ) const return 0; } -BOOL Menu::GetItemImageMirrorMode( USHORT nItemId ) const +sal_Bool Menu::GetItemImageMirrorMode( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) return pData->bMirrorMode; else - return FALSE; + return sal_False; } -void Menu::SetItemCommand( USHORT nItemId, const String& rCommand ) +void Menu::SetItemCommand( sal_uInt16 nItemId, const String& rCommand ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1987,7 +1986,7 @@ void Menu::SetItemCommand( USHORT nItemId, const String& rCommand ) pData->aCommandStr = rCommand; } -const XubString& Menu::GetItemCommand( USHORT nItemId ) const +const XubString& Menu::GetItemCommand( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -1997,7 +1996,7 @@ const XubString& Menu::GetItemCommand( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr ) +void Menu::SetHelpCommand( sal_uInt16 nItemId, const XubString& rStr ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2005,7 +2004,7 @@ void Menu::SetHelpCommand( USHORT nItemId, const XubString& rStr ) pData->aHelpCommandStr = rStr; } -const XubString& Menu::GetHelpCommand( USHORT nItemId ) const +const XubString& Menu::GetHelpCommand( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2015,7 +2014,7 @@ const XubString& Menu::GetHelpCommand( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetHelpText( USHORT nItemId, const XubString& rStr ) +void Menu::SetHelpText( sal_uInt16 nItemId, const XubString& rStr ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2023,14 +2022,14 @@ void Menu::SetHelpText( USHORT nItemId, const XubString& rStr ) pData->aHelpText = rStr; } -const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const +const XubString& Menu::ImplGetHelpText( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) { if ( !pData->aHelpText.Len() && - (( pData->nHelpId ) || ( pData->aCommandStr.Len() ))) + (( pData->aHelpId.getLength() ) || ( pData->aCommandStr.Len() ))) { Help* pHelp = Application::GetHelp(); if ( pHelp ) @@ -2038,8 +2037,8 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const if ( pData->aCommandStr.Len() ) pData->aHelpText = pHelp->GetHelpText( pData->aCommandStr, NULL ); - if( !pData->aHelpText.Len() && pData->nHelpId ) - pData->aHelpText = pHelp->GetHelpText( pData->nHelpId, NULL ); + if( !pData->aHelpText.Len() && pData->aHelpId.getLength() ) + pData->aHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pData->aHelpId, RTL_TEXTENCODING_UTF8 ), NULL ); } } @@ -2049,12 +2048,12 @@ const XubString& Menu::ImplGetHelpText( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -const XubString& Menu::GetHelpText( USHORT nItemId ) const +const XubString& Menu::GetHelpText( sal_uInt16 nItemId ) const { return ImplGetHelpText( nItemId ); } -void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr ) +void Menu::SetTipHelpText( sal_uInt16 nItemId, const XubString& rStr ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2062,7 +2061,7 @@ void Menu::SetTipHelpText( USHORT nItemId, const XubString& rStr ) pData->aTipHelpText = rStr; } -const XubString& Menu::GetTipHelpText( USHORT nItemId ) const +const XubString& Menu::GetTipHelpText( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -2072,22 +2071,29 @@ const XubString& Menu::GetTipHelpText( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetHelpId( USHORT nItemId, ULONG nHelpId ) +void Menu::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId ) { MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) - pData->nHelpId = nHelpId; + pData->aHelpId = rHelpId; } -ULONG Menu::GetHelpId( USHORT nItemId ) const +rtl::OString Menu::GetHelpId( sal_uInt16 nItemId ) const { + rtl::OString aRet; + MenuItemData* pData = pItemList->GetData( nItemId ); if ( pData ) - return pData->nHelpId; - else - return 0; + { + if ( pData->aHelpId.getLength() ) + aRet = pData->aHelpId; + else + aRet = ::rtl::OUStringToOString( pData->aCommandStr, RTL_TEXTENCODING_UTF8 ); + } + + return aRet; } Menu& Menu::operator=( const Menu& rMenu ) @@ -2096,8 +2102,8 @@ Menu& Menu::operator=( const Menu& rMenu ) Clear(); // Items kopieren - USHORT nCount = rMenu.GetItemCount(); - for ( USHORT i = 0; i < nCount; i++ ) + sal_uInt16 nCount = rMenu.GetItemCount(); + for ( sal_uInt16 i = 0; i < nCount; i++ ) ImplCopyItem( this, rMenu, i, MENU_APPEND, 1 ); nDefaultItem = rMenu.nDefaultItem; @@ -2111,24 +2117,24 @@ Menu& Menu::operator=( const Menu& rMenu ) return *this; } -BOOL Menu::ImplIsVisible( USHORT nPos ) const +sal_Bool Menu::ImplIsVisible( sal_uInt16 nPos ) const { - BOOL bVisible = TRUE; + sal_Bool bVisible = sal_True; MenuItemData* pData = pItemList->GetDataFromPos( nPos ); // check general visibility first if( pData && !pData->bVisible ) - bVisible = FALSE; + bVisible = sal_False; if ( bVisible && pData && pData->eType == MENUITEM_SEPARATOR ) { if( nPos == 0 ) // no separator should be shown at the very beginning - bVisible = FALSE; + bVisible = sal_False; else { // always avoid adjacent separators - USHORT nCount = (USHORT) pItemList->Count(); - USHORT n; + sal_uInt16 nCount = (sal_uInt16) pItemList->Count(); + sal_uInt16 n; MenuItemData* pNextData = NULL; // search next visible item for( n = nPos + 1; n < nCount; n++ ) @@ -2141,10 +2147,10 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const } } if( n == nCount ) // no next visible item - bVisible = FALSE; + bVisible = sal_False; // check for separator if( pNextData && pNextData->bVisible && pNextData->eType == MENUITEM_SEPARATOR ) - bVisible = FALSE; + bVisible = sal_False; if( bVisible ) { @@ -2158,7 +2164,7 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const } } if( n == 0 ) // no previous visible item - bVisible = FALSE; + bVisible = sal_False; } } } @@ -2169,10 +2175,10 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const !( nMenuFlags & MENU_FLAG_ALWAYSSHOWDISABLEDENTRIES ) ) { if( !pData ) // e.g. nPos == ITEMPOS_INVALID - bVisible = FALSE; + bVisible = sal_False; else if ( pData->eType != MENUITEM_SEPARATOR ) // separators handled above { - // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( TRUE ) ); + // bVisible = pData->bEnabled && ( !pData->pSubMenu || pData->pSubMenu->HasValidEntries( sal_True ) ); bVisible = pData->bEnabled; // SubMenus nicht pruefen, weil sie ggf. erst im Activate() gefuellt werden. } } @@ -2180,34 +2186,34 @@ BOOL Menu::ImplIsVisible( USHORT nPos ) const return bVisible; } -BOOL Menu::IsItemVisible( USHORT nItemId ) const +sal_Bool Menu::IsItemVisible( sal_uInt16 nItemId ) const { return IsMenuVisible() && ImplIsVisible( GetItemPos( nItemId ) ); } -BOOL Menu::IsItemPosVisible( USHORT nItemPos ) const +sal_Bool Menu::IsItemPosVisible( sal_uInt16 nItemPos ) const { return IsMenuVisible() && ImplIsVisible( nItemPos ); } -BOOL Menu::IsMenuVisible() const +sal_Bool Menu::IsMenuVisible() const { return pWindow && pWindow->IsReallyVisible(); } -BOOL Menu::ImplIsSelectable( USHORT nPos ) const +sal_Bool Menu::ImplIsSelectable( sal_uInt16 nPos ) const { - BOOL bSelectable = TRUE; + sal_Bool bSelectable = sal_True; MenuItemData* pData = pItemList->GetDataFromPos( nPos ); // check general visibility first if ( pData && ( pData->nBits & MIB_NOSELECT ) ) - bSelectable = FALSE; + bSelectable = sal_False; return bSelectable; } -void Menu::SelectItem( USHORT nItemId ) +void Menu::SelectItem( sal_uInt16 nItemId ) { if( bIsMenuBar ) static_cast<MenuBar*>(this)->SelectEntry( nItemId ); @@ -2362,7 +2368,7 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( rSettings.GetUseImagesInMenus() ) { nMinMenuItemHeight = 16; - for ( USHORT i = (USHORT)pItemList->Count(); i; ) + for ( sal_uInt16 i = (sal_uInt16)pItemList->Count(); i; ) { MenuItemData* pData = pItemList->GetDataFromPos( --i ); if ( ImplIsVisible( i ) && (( pData->eType == MENUITEM_IMAGE ) || ( pData->eType == MENUITEM_STRINGIMAGE ))) @@ -2380,7 +2386,7 @@ Size Menu::ImplCalcSize( Window* pWin ) } } - for ( USHORT n = (USHORT)pItemList->Count(); n; ) + for ( sal_uInt16 n = (sal_uInt16)pItemList->Count(); n; ) { MenuItemData* pData = pItemList->GetDataFromPos( --n ); @@ -2478,8 +2484,18 @@ Size Menu::ImplCalcSize( Window* pWin ) if ( !bIsMenuBar ) { - USHORT gfxExtra = (USHORT) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text - nCheckPos = (USHORT)nExtra; + // popup menus should not be wider than half the screen + // except on rather small screens + // TODO: move GetScreenNumber from SystemWindow to Window ? + // currently we rely on internal privileges + unsigned int nScreenNumber = pWin->ImplGetWindowImpl()->mpFrame->maGeometry.nScreenNumber; + Rectangle aDispRect( Application::GetScreenPosSizePixel( nScreenNumber ) ); + long nScreenWidth = aDispRect.GetWidth() >= 800 ? aDispRect.GetWidth() : 800; + if( nMaxWidth > nScreenWidth/2 ) + nMaxWidth = nScreenWidth/2; + + sal_uInt16 gfxExtra = (sal_uInt16) Max( nExtra, 7L ); // #107710# increase space between checkmarks/images/text + nCheckPos = (sal_uInt16)nExtra; if ( ( nMenuFlags & MENU_FLAG_SHOWCHECKIMAGES ) || bSpaceForCheckbox ) { long nImgOrChkWidth = 0; @@ -2489,12 +2505,12 @@ Size Menu::ImplCalcSize( Window* pWin ) else // non NWF case nImgOrChkWidth = nFontHeight/2 + gfxExtra; nImgOrChkWidth = Max( nImgOrChkWidth, aMaxImgSz.Width() + gfxExtra ); - nTextPos = (USHORT)(nImagePos + nImgOrChkWidth); + nTextPos = (sal_uInt16)(nImagePos + nImgOrChkWidth); } else { nImagePos = nCheckPos; - nTextPos = (USHORT)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth )); + nTextPos = (sal_uInt16)(nImagePos + Max( aMaxImgSz.Width(), nCheckWidth )); } nTextPos = nTextPos + gfxExtra; @@ -2507,7 +2523,7 @@ Size Menu::ImplCalcSize( Window* pWin ) } else { - nTextPos = (USHORT)(2*nExtra); + nTextPos = (sal_uInt16)(2*nExtra); aSz.Height() = nFontHeight+6; // get menubar height from native methods if supported @@ -2549,7 +2565,7 @@ Size Menu::ImplCalcSize( Window* pWin ) static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRect, bool i_bHighlight ) { - BOOL bNativeOk = FALSE; + sal_Bool bNativeOk = sal_False; if( i_pWindow->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; @@ -2567,11 +2583,31 @@ static void ImplPaintCheckBackground( Window* i_pWindow, const Rectangle& i_rRec { const StyleSettings& rSettings = i_pWindow->GetSettings().GetStyleSettings(); Color aColor( i_bHighlight ? rSettings.GetMenuHighlightTextColor() : rSettings.GetHighlightColor() ); - i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, TRUE, FALSE, 2, NULL, &aColor ); + i_pWindow->DrawSelectionBackground( i_rRect, 0, i_bHighlight, sal_True, sal_False, 2, NULL, &aColor ); + } +} + +static String getShortenedString( const String& i_rLong, Window* i_pWin, long i_nMaxWidth ) +{ + xub_StrLen nPos = STRING_NOTFOUND; + String aNonMnem( OutputDevice::GetNonMnemonicString( i_rLong, nPos ) ); + aNonMnem = i_pWin->GetEllipsisString( aNonMnem, i_nMaxWidth, TEXT_DRAW_CENTERELLIPSIS ); + // re-insert mnemonic + if( nPos != STRING_NOTFOUND ) + { + if( nPos < aNonMnem.Len() && i_rLong.GetChar(nPos+1) == aNonMnem.GetChar(nPos) ) + { + rtl::OUStringBuffer aBuf( i_rLong.Len() ); + aBuf.append( aNonMnem.GetBuffer(), nPos ); + aBuf.append( sal_Unicode('~') ); + aBuf.append( aNonMnem.GetBuffer()+nPos ); + aNonMnem = aBuf.makeStringAndClear(); + } } + return aNonMnem; } -void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pThisItemOnly, BOOL bHighlighted, bool bLayout ) const +void Menu::ImplPaint( Window* pWin, sal_uInt16 nBorder, long nStartY, MenuItemData* pThisItemOnly, sal_Bool bHighlighted, bool bLayout ) const { // Fuer Symbole: nFontHeight x nFontHeight long nFontHeight = pWin->GetTextHeight(); @@ -2597,10 +2633,10 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* } Size aOutSz = pWin->GetOutputSizePixel(); - USHORT nCount = (USHORT)pItemList->Count(); + sal_uInt16 nCount = (sal_uInt16)pItemList->Count(); if( bLayout ) mpLayoutData->m_aVisibleItemBoundRects.clear(); - for ( USHORT n = 0; n < nCount; n++ ) + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pItemList->GetDataFromPos( n ); if ( ImplIsVisible( n ) && ( !pThisItemOnly || ( pData == pThisItemOnly ) ) ) @@ -2617,9 +2653,9 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* long nTextOffsetY = ((pData->aSz.Height()-nFontHeight)/2); if( bIsMenuBar ) nTextOffsetY += (aOutSz.Height()-pData->aSz.Height()) / 2; - USHORT nTextStyle = 0; - USHORT nSymbolStyle = 0; - USHORT nImageStyle = 0; + sal_uInt16 nTextStyle = 0; + sal_uInt16 nSymbolStyle = 0; + sal_uInt16 nImageStyle = 0; // SubMenus ohne Items werden nicht mehr disablte dargestellt, // wenn keine Items enthalten sind, da die Anwendung selber // darauf achten muss. Ansonsten gibt es Faelle, wo beim @@ -2634,14 +2670,36 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* // Separator if ( !bLayout && !bIsMenuBar && ( pData->eType == MENUITEM_SEPARATOR ) ) { - aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2); - aTmpPos.X() = aPos.X() + 2 + nOuterSpace; - pWin->SetLineColor( rSettings.GetShadowColor() ); - pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) ); - aTmpPos.Y()++; - pWin->SetLineColor( rSettings.GetLightColor() ); - pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) ); - pWin->SetLineColor(); + bool bNativeOk = false; + if( pWin->IsNativeControlSupported( CTRL_MENU_POPUP, + PART_MENU_SEPARATOR ) ) + { + ControlState nState = 0; + if ( pData->bEnabled ) + nState |= CTRL_STATE_ENABLED; + if ( bHighlighted ) + nState |= CTRL_STATE_SELECTED; + Size aSz( pData->aSz ); + aSz.Width() = aOutSz.Width() - 2*nOuterSpace; + Rectangle aItemRect( aPos, aSz ); + MenupopupValue aVal( nTextPos-GUTTERBORDER, aItemRect ); + bNativeOk = pWin->DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_SEPARATOR, + aItemRect, + nState, + aVal, + OUString() ); + } + if( ! bNativeOk ) + { + aTmpPos.Y() = aPos.Y() + ((pData->aSz.Height()-2)/2); + aTmpPos.X() = aPos.X() + 2 + nOuterSpace; + pWin->SetLineColor( rSettings.GetShadowColor() ); + pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) ); + aTmpPos.Y()++; + pWin->SetLineColor( rSettings.GetLightColor() ); + pWin->DrawLine( aTmpPos, Point( aOutSz.Width() - 3 - 2*nOuterSpace, aTmpPos.Y() ) ); + pWin->SetLineColor(); + } } Rectangle aOuterCheckRect( Point( aPos.X()+nCheckPos, aPos.Y() ), Size( pData->aSz.Height(), pData->aSz.Height() ) ); @@ -2686,10 +2744,11 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* aTmpPos.Y() = aOuterCheckRect.Top() + (aOuterCheckRect.GetHeight() - nCtrlHeight)/2; Rectangle aCheckRect( aTmpPos, Size( nCtrlHeight, nCtrlHeight ) ); + MenupopupValue aVal( nTextPos-GUTTERBORDER, Rectangle( aPos, pData->aSz ) ); pWin->DrawNativeControl( CTRL_MENU_POPUP, nPart, aCheckRect, nState, - ImplControlValue(), + aVal, OUString() ); } else if ( pData->bChecked ) // by default do nothing for unchecked items @@ -2737,7 +2796,7 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* aTmpPos.X() = aPos.X() + nTextPos; aTmpPos.Y() = aPos.Y(); aTmpPos.Y() += nTextOffsetY; - USHORT nStyle = nTextStyle|TEXT_DRAW_MNEMONIC; + sal_uInt16 nStyle = nTextStyle|TEXT_DRAW_MNEMONIC; if ( pData->bIsTemporary ) nStyle |= TEXT_DRAW_DISABLE; MetricVector* pVector = bLayout ? &mpLayoutData->m_aUnicodeBoundRects : NULL; @@ -2761,7 +2820,19 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* pWin->GetSettings().GetStyleSettings().GetMenuColor(); pWin->SetBackground( Wallpaper( aBg ) ); } - pWin->DrawCtrlText( aTmpPos, pData->aText, 0, pData->aText.Len(), nStyle, pVector, pDisplayText ); + // how much space is there for the text ? + long nMaxItemTextWidth = aOutSz.Width() - aTmpPos.X() - nExtra - nOuterSpace; + if( !bIsMenuBar && pData->aAccelKey.GetCode() && !ImplAccelDisabled() ) + { + XubString aAccText = pData->aAccelKey.GetName(); + nMaxItemTextWidth -= pWin->GetTextWidth( aAccText ) + 3*nExtra; + } + if( !bIsMenuBar && pData->pSubMenu ) + { + nMaxItemTextWidth -= nFontHeight - nExtra; + } + String aItemText( getShortenedString( pData->aText, pWin, nMaxItemTextWidth ) ); + pWin->DrawCtrlText( aTmpPos, aItemText, 0, aItemText.Len(), nStyle, pVector, pDisplayText ); if( bSetTmpBackground ) pWin->SetBackground(); } @@ -2797,16 +2868,6 @@ void Menu::ImplPaint( Window* pWin, USHORT nBorder, long nStartY, MenuItemData* aDecoView.DrawSymbol( Rectangle( aTmpPos, Size( nFontHeight/2, nFontHeight/2 ) ), SYMBOL_SPIN_RIGHT, pWin->GetTextColor(), nSymbolStyle ); -// if ( pData->nBits & MIB_POPUPSELECT ) -// { -// aTmpPos.Y() += nFontHeight/2 ; -// pWin->SetLineColor( rSettings.GetShadowColor() ); -// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) ); -// pWin->SetLineColor( rSettings.GetLightColor() ); -// aTmpPos.Y()++; -// pWin->DrawLine( aTmpPos, Point( aTmpPos.X() + nFontHeight/3, aTmpPos.Y() ) ); -// pWin->SetLineColor(); -// } } if ( pThisItemOnly && bHighlighted ) @@ -2869,7 +2930,7 @@ Menu* Menu::ImplGetStartMenu() return pStart; } -void Menu::ImplCallHighlight( USHORT nHighlightedItem ) +void Menu::ImplCallHighlight( sal_uInt16 nHighlightedItem ) { ImplMenuDelData aDelData( this ); @@ -2897,7 +2958,7 @@ Menu* Menu::ImplFindSelectMenu() { Menu* pSelMenu = nEventId ? this : NULL; - for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; ) + for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; ) { MenuItemData* pData = GetItemList()->GetDataFromPos( --n ); @@ -2908,11 +2969,11 @@ Menu* Menu::ImplFindSelectMenu() return pSelMenu; } -Menu* Menu::ImplFindMenu( USHORT nItemId ) +Menu* Menu::ImplFindMenu( sal_uInt16 nItemId ) { Menu* pSelMenu = NULL; - for ( ULONG n = GetItemList()->Count(); n && !pSelMenu; ) + for ( sal_uLong n = GetItemList()->Count(); n && !pSelMenu; ) { MenuItemData* pData = GetItemList()->GetDataFromPos( --n ); @@ -2925,25 +2986,25 @@ Menu* Menu::ImplFindMenu( USHORT nItemId ) return pSelMenu; } -void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups ) +void Menu::RemoveDisabledEntries( sal_Bool bCheckPopups, sal_Bool bRemoveEmptyPopups ) { - for ( USHORT n = 0; n < GetItemCount(); n++ ) + for ( sal_uInt16 n = 0; n < GetItemCount(); n++ ) { - BOOL bRemove = FALSE; + sal_Bool bRemove = sal_False; MenuItemData* pItem = pItemList->GetDataFromPos( n ); if ( pItem->eType == MENUITEM_SEPARATOR ) { if ( !n || ( GetItemType( n-1 ) == MENUITEM_SEPARATOR ) ) - bRemove = TRUE; + bRemove = sal_True; } else bRemove = !pItem->bEnabled; if ( bCheckPopups && pItem->pSubMenu ) { - pItem->pSubMenu->RemoveDisabledEntries( TRUE ); + pItem->pSubMenu->RemoveDisabledEntries( sal_True ); if ( bRemoveEmptyPopups && !pItem->pSubMenu->GetItemCount() ) - bRemove = TRUE; + bRemove = sal_True; } if ( bRemove ) @@ -2952,7 +3013,7 @@ void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups ) if ( GetItemCount() ) { - USHORT nLast = GetItemCount() - 1; + sal_uInt16 nLast = GetItemCount() - 1; MenuItemData* pItem = pItemList->GetDataFromPos( nLast ); if ( pItem->eType == MENUITEM_SEPARATOR ) RemoveItem( nLast ); @@ -2960,19 +3021,19 @@ void Menu::RemoveDisabledEntries( BOOL bCheckPopups, BOOL bRemoveEmptyPopups ) delete mpLayoutData, mpLayoutData = NULL; } -BOOL Menu::HasValidEntries( BOOL bCheckPopups ) +sal_Bool Menu::HasValidEntries( sal_Bool bCheckPopups ) { - BOOL bValidEntries = FALSE; - USHORT nCount = GetItemCount(); - for ( USHORT n = 0; !bValidEntries && ( n < nCount ); n++ ) + sal_Bool bValidEntries = sal_False; + sal_uInt16 nCount = GetItemCount(); + for ( sal_uInt16 n = 0; !bValidEntries && ( n < nCount ); n++ ) { MenuItemData* pItem = pItemList->GetDataFromPos( n ); if ( pItem->bEnabled && ( pItem->eType != MENUITEM_SEPARATOR ) ) { if ( bCheckPopups && pItem->pSubMenu ) - bValidEntries = pItem->pSubMenu->HasValidEntries( TRUE ); + bValidEntries = pItem->pSubMenu->HasValidEntries( sal_True ); else - bValidEntries = TRUE; + bValidEntries = sal_True; } } return bValidEntries; @@ -3010,12 +3071,12 @@ void Menu::ImplFillLayoutData() const mpLayoutData = new MenuLayoutData(); if( bIsMenuBar ) { - ImplPaint( pWindow, 0, 0, 0, FALSE, true ); + ImplPaint( pWindow, 0, 0, 0, sal_False, true ); } else { MenuFloatingWindow* pFloat = (MenuFloatingWindow*)pWindow; - ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, FALSE, true ); + ImplPaint( pWindow, pFloat->nScrollerHeight, pFloat->ImplGetStartY(), 0, sal_False, true ); } } } @@ -3027,7 +3088,7 @@ String Menu::GetDisplayText() const return mpLayoutData ? mpLayoutData->m_aDisplayText : String(); } -Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const +Rectangle Menu::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const { long nItemIndex = -1; if( ! mpLayoutData ) @@ -3047,7 +3108,7 @@ Rectangle Menu::GetCharacterBounds( USHORT nItemID, long nIndex ) const } -long Menu::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const +long Menu::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const { long nIndex = -1; rItemID = 0; @@ -3085,7 +3146,7 @@ Pair Menu::GetLineStartEnd( long nLine ) const return mpLayoutData ? mpLayoutData->GetLineStartEnd( nLine ) : Pair( -1, -1 ); } -Pair Menu::GetItemStartEnd( USHORT nItem ) const +Pair Menu::GetItemStartEnd( sal_uInt16 nItem ) const { if( ! mpLayoutData ) ImplFillLayoutData(); @@ -3097,9 +3158,9 @@ Pair Menu::GetItemStartEnd( USHORT nItem ) const return Pair( -1, -1 ); } -USHORT Menu::GetDisplayItemId( long nLine ) const +sal_uInt16 Menu::GetDisplayItemId( long nLine ) const { - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if( ! mpLayoutData ) ImplFillLayoutData(); if( mpLayoutData && ( nLine >= 0 ) && ( nLine < (long)mpLayoutData->m_aLineItemIds.size() ) ) @@ -3107,19 +3168,19 @@ USHORT Menu::GetDisplayItemId( long nLine ) const return nItemId; } -BOOL Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const +sal_Bool Menu::ConvertPoint( Point& rPoint, Window* pReferenceWindow ) const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( pWindow && pReferenceWindow ) { rPoint = pReferenceWindow->OutputToAbsoluteScreenPixel( rPoint ); rPoint = pWindow->AbsoluteScreenToOutputPixel( rPoint ); - bRet = TRUE; + bRet = sal_True; } return bRet; } -Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const +Rectangle Menu::GetBoundingRectangle( sal_uInt16 nPos ) const { Rectangle aRet; @@ -3127,16 +3188,16 @@ Rectangle Menu::GetBoundingRectangle( USHORT nPos ) const ImplFillLayoutData(); if( mpLayoutData ) { - std::map< USHORT, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos ); + std::map< sal_uInt16, Rectangle >::const_iterator it = mpLayoutData->m_aVisibleItemBoundRects.find( nPos ); if( it != mpLayoutData->m_aVisibleItemBoundRects.end() ) aRet = it->second; } return aRet; } -void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr ) +void Menu::SetAccessibleName( sal_uInt16 nItemId, const XubString& rStr ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = pItemList->GetData( nItemId, nPos ); if ( pData && !rStr.Equals( pData->aAccessibleName ) ) @@ -3146,7 +3207,7 @@ void Menu::SetAccessibleName( USHORT nItemId, const XubString& rStr ) } } -XubString Menu::GetAccessibleName( USHORT nItemId ) const +XubString Menu::GetAccessibleName( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -3156,7 +3217,7 @@ XubString Menu::GetAccessibleName( USHORT nItemId ) const return ImplGetSVEmptyStr(); } -void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr ) +void Menu::SetAccessibleDescription( sal_uInt16 nItemId, const XubString& rStr ) { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -3164,7 +3225,7 @@ void Menu::SetAccessibleDescription( USHORT nItemId, const XubString& rStr ) pData->aAccessibleDescription = rStr; } -XubString Menu::GetAccessibleDescription( USHORT nItemId ) const +XubString Menu::GetAccessibleDescription( sal_uInt16 nItemId ) const { MenuItemData* pData = pItemList->GetData( nItemId ); @@ -3181,19 +3242,19 @@ void Menu::ImplSetSalMenu( SalMenu *pSalMenu ) mpSalMenu = pSalMenu; } -BOOL Menu::GetSystemMenuData( SystemMenuData* pData ) const +sal_Bool Menu::GetSystemMenuData( SystemMenuData* pData ) const { Menu* pMenu = (Menu*)this; if( pData && pMenu->ImplGetSalMenu() ) { pMenu->ImplGetSalMenu()->GetSystemMenuData( pData ); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } -bool Menu::IsHighlighted( USHORT nItemPos ) const +bool Menu::IsHighlighted( sal_uInt16 nItemPos ) const { bool bRet = false; @@ -3208,19 +3269,19 @@ bool Menu::IsHighlighted( USHORT nItemPos ) const return bRet; } -void Menu::HighlightItem( USHORT nItemPos ) +void Menu::HighlightItem( sal_uInt16 nItemPos ) { if ( pWindow ) { if ( bIsMenuBar ) { MenuBarWindow* pMenuWin = static_cast< MenuBarWindow* >( pWindow ); - pMenuWin->SetAutoPopup( FALSE ); - pMenuWin->ChangeHighlightItem( nItemPos, FALSE ); + pMenuWin->SetAutoPopup( sal_False ); + pMenuWin->ChangeHighlightItem( nItemPos, sal_False ); } else { - static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, FALSE ); + static_cast< MenuFloatingWindow* >( pWindow )->ChangeHighlightItem( nItemPos, sal_False ); } } } @@ -3229,54 +3290,54 @@ void Menu::HighlightItem( USHORT nItemPos ) // - MenuBar - // ----------- -MenuBar::MenuBar() : Menu( TRUE ) +MenuBar::MenuBar() : Menu( sal_True ) { - mbDisplayable = TRUE; - mbCloserVisible = FALSE; - mbFloatBtnVisible = FALSE; - mbHideBtnVisible = FALSE; + mbDisplayable = sal_True; + mbCloserVisible = sal_False; + mbFloatBtnVisible = sal_False; + mbHideBtnVisible = sal_False; } -MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( TRUE ) +MenuBar::MenuBar( const MenuBar& rMenu ) : Menu( sal_True ) { - mbDisplayable = TRUE; - mbCloserVisible = FALSE; - mbFloatBtnVisible = FALSE; - mbHideBtnVisible = FALSE; + mbDisplayable = sal_True; + mbCloserVisible = sal_False; + mbFloatBtnVisible = sal_False; + mbHideBtnVisible = sal_False; *this = rMenu; - bIsMenuBar = TRUE; + bIsMenuBar = sal_True; } -MenuBar::MenuBar( const ResId& rResId ) : Menu ( TRUE ) +MenuBar::MenuBar( const ResId& rResId ) : Menu ( sal_True ) { - mbDisplayable = TRUE; - mbCloserVisible = FALSE; - mbFloatBtnVisible = FALSE; - mbHideBtnVisible = FALSE; + mbDisplayable = sal_True; + mbCloserVisible = sal_False; + mbFloatBtnVisible = sal_False; + mbHideBtnVisible = sal_False; ImplLoadRes( rResId ); } MenuBar::~MenuBar() { - ImplDestroy( this, TRUE ); + ImplDestroy( this, sal_True ); } -void MenuBar::ShowCloser( BOOL bShow ) +void MenuBar::ShowCloser( sal_Bool bShow ) { ShowButtons( bShow, mbFloatBtnVisible, mbHideBtnVisible ); } -void MenuBar::ShowFloatButton( BOOL bShow ) +void MenuBar::ShowFloatButton( sal_Bool bShow ) { ShowButtons( mbCloserVisible, bShow, mbHideBtnVisible ); } -void MenuBar::ShowHideButton( BOOL bShow ) +void MenuBar::ShowHideButton( sal_Bool bShow ) { ShowButtons( mbCloserVisible, mbFloatBtnVisible, bShow ); } -void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide ) +void MenuBar::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide ) { if ( (bClose != mbCloserVisible) || (bFloat != mbFloatBtnVisible) || @@ -3290,7 +3351,7 @@ void MenuBar::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide ) } } -void MenuBar::SetDisplayable( BOOL bDisplayable ) +void MenuBar::SetDisplayable( sal_Bool bDisplayable ) { if( bDisplayable != mbDisplayable ) { @@ -3321,7 +3382,7 @@ Window* MenuBar::ImplCreate( Window* pParent, Window* pWindow, MenuBar* pMenu ) return pWindow; } -void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete ) +void MenuBar::ImplDestroy( MenuBar* pMenu, sal_Bool bDelete ) { MenuBarWindow* pWindow = (MenuBarWindow*) pMenu->ImplGetWindow(); if ( pWindow && bDelete ) @@ -3332,9 +3393,9 @@ void MenuBar::ImplDestroy( MenuBar* pMenu, BOOL bDelete ) pMenu->pWindow = NULL; } -BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu ) +sal_Bool MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // No keyboard processing when system handles the menu or our menubar is invisible if( !IsDisplayable() || @@ -3350,7 +3411,7 @@ BOOL MenuBar::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu ) // ----------------------------------------------------------------------- -void MenuBar::SelectEntry( USHORT nId ) +void MenuBar::SelectEntry( sal_uInt16 nId ) { MenuBarWindow* pMenuWin = (MenuBarWindow*) ImplGetWindow(); @@ -3360,14 +3421,14 @@ void MenuBar::SelectEntry( USHORT nId ) nId = GetItemPos( nId ); // #99705# popup the selected menu - pMenuWin->SetAutoPopup( TRUE ); + pMenuWin->SetAutoPopup( sal_True ); if( ITEMPOS_INVALID != pMenuWin->nHighlightedItem ) { pMenuWin->KillActivePopup(); - pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + pMenuWin->ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); } if( nId != ITEMPOS_INVALID ) - pMenuWin->ChangeHighlightItem( nId, FALSE ); + pMenuWin->ChangeHighlightItem( nId, sal_False ); } } @@ -3375,38 +3436,38 @@ void MenuBar::SelectEntry( USHORT nId ) // handler for native menu selection and command events -BOOL MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const +sal_Bool MenuBar::HandleMenuActivateEvent( Menu *pMenu ) const { if( pMenu ) { ImplMenuDelData aDelData( this ); pMenu->pStartedFrom = (Menu*)this; - pMenu->bInCallback = TRUE; + pMenu->bInCallback = sal_True; pMenu->Activate(); if( !aDelData.isDeleted() ) - pMenu->bInCallback = FALSE; + pMenu->bInCallback = sal_False; } - return TRUE; + return sal_True; } -BOOL MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const +sal_Bool MenuBar::HandleMenuDeActivateEvent( Menu *pMenu ) const { if( pMenu ) { ImplMenuDelData aDelData( this ); pMenu->pStartedFrom = (Menu*)this; - pMenu->bInCallback = TRUE; + pMenu->bInCallback = sal_True; pMenu->Deactivate(); if( !aDelData.isDeleted() ) - pMenu->bInCallback = FALSE; + pMenu->bInCallback = sal_False; } - return TRUE; + return sal_True; } -BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) const +sal_Bool MenuBar::HandleMenuHighlightEvent( Menu *pMenu, sal_uInt16 nHighlightEventId ) const { if( !pMenu ) pMenu = ((Menu*) this)->ImplFindMenu( nHighlightEventId ); @@ -3424,13 +3485,13 @@ BOOL MenuBar::HandleMenuHighlightEvent( Menu *pMenu, USHORT nHighlightEventId ) pMenu->pStartedFrom = (Menu*)this; pMenu->ImplCallHighlight( pMenu->mnHighlightedItemPos ); } - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } -BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) const +sal_Bool MenuBar::HandleMenuCommandEvent( Menu *pMenu, sal_uInt16 nCommandEventId ) const { if( !pMenu ) pMenu = ((Menu*) this)->ImplFindMenu( nCommandEventId ); @@ -3439,47 +3500,47 @@ BOOL MenuBar::HandleMenuCommandEvent( Menu *pMenu, USHORT nCommandEventId ) cons pMenu->nSelectedId = nCommandEventId; pMenu->pStartedFrom = (Menu*)this; pMenu->ImplSelect(); - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } -USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, USHORT i_nPos ) +sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, sal_uInt16 i_nPos ) { return AddMenuBarButton( i_rImage, i_rLink, String(), i_nPos ); } -USHORT MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos ) +sal_uInt16 MenuBar::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos ) { return pWindow ? static_cast<MenuBarWindow*>(pWindow)->AddMenuBarButton( i_rImage, i_rLink, i_rToolTip, i_nPos ) : 0; } -void MenuBar::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink ) +void MenuBar::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink ) { if( pWindow ) static_cast<MenuBarWindow*>(pWindow)->SetMenuBarButtonHighlightHdl( nId, rLink ); } -Rectangle MenuBar::GetMenuBarButtonRectPixel( USHORT nId ) +Rectangle MenuBar::GetMenuBarButtonRectPixel( sal_uInt16 nId ) { return pWindow ? static_cast<MenuBarWindow*>(pWindow)->GetMenuBarButtonRectPixel( nId ) : Rectangle(); } -void MenuBar::RemoveMenuBarButton( USHORT nId ) +void MenuBar::RemoveMenuBarButton( sal_uInt16 nId ) { if( pWindow ) static_cast<MenuBarWindow*>(pWindow)->RemoveMenuBarButton( nId ); } -BOOL MenuBar::HandleMenuButtonEvent( Menu *, USHORT i_nButtonId ) const +sal_Bool MenuBar::HandleMenuButtonEvent( Menu *, sal_uInt16 i_nButtonId ) const { return static_cast<MenuBarWindow*>(pWindow)->HandleMenuButtonEvent( i_nButtonId ); } // ----------------------------------------------------------------------- -// BOOL PopupMenu::bAnyPopupInExecute = FALSE; +// sal_Bool PopupMenu::bAnyPopupInExecute = sal_False; PopupMenu::PopupMenu() { @@ -3504,9 +3565,9 @@ PopupMenu::~PopupMenu() *pRefAutoSubMenu = NULL; // #111060# avoid second delete in ~MenuItemData } -BOOL PopupMenu::IsInExecute() +sal_Bool PopupMenu::IsInExecute() { - return GetActivePopupMenu() ? TRUE : FALSE; + return GetActivePopupMenu() ? sal_True : sal_False; } PopupMenu* PopupMenu::GetActivePopupMenu() @@ -3515,22 +3576,22 @@ PopupMenu* PopupMenu::GetActivePopupMenu() return pSVData->maAppData.mpActivePopupMenu; } -void PopupMenu::EndExecute( USHORT nSelectId ) +void PopupMenu::EndExecute( sal_uInt16 nSelectId ) { if ( ImplGetWindow() ) ImplGetFloatingWindow()->EndExecute( nSelectId ); } -void PopupMenu::SelectEntry( USHORT nId ) +void PopupMenu::SelectEntry( sal_uInt16 nId ) { if ( ImplGetWindow() ) { if( nId != ITEMPOS_INVALID ) { - USHORT nPos; + sal_uInt16 nPos; MenuItemData* pData = GetItemList()->GetData( nId, nPos ); if ( pData->pSubMenu ) - ImplGetFloatingWindow()->ChangeHighlightItem( nPos, TRUE ); + ImplGetFloatingWindow()->ChangeHighlightItem( nPos, sal_True ); else ImplGetFloatingWindow()->EndExecute( nId ); } @@ -3538,7 +3599,7 @@ void PopupMenu::SelectEntry( USHORT nId ) { MenuFloatingWindow* pFloat = ImplGetFloatingWindow(); pFloat->GrabFocus(); - USHORT nPos; + sal_uInt16 nPos; for( nPos = 0; nPos < GetItemList()->Count(); nPos++ ) { MenuItemData* pData = (MenuItemData*)GetItemList()->GetObject( nPos ); @@ -3547,27 +3608,27 @@ void PopupMenu::SelectEntry( USHORT nId ) pFloat->KillActivePopup(); } } - pFloat->ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + pFloat->ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); } } } -void PopupMenu::SetSelectedEntry( USHORT nId ) +void PopupMenu::SetSelectedEntry( sal_uInt16 nId ) { nSelectedId = nId; } -USHORT PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos ) +sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Point& rPopupPos ) { return Execute( pExecWindow, Rectangle( rPopupPos, rPopupPos ), POPUPMENU_EXECUTE_DOWN ); } -USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT nFlags ) +sal_uInt16 PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, sal_uInt16 nFlags ) { ENSURE_OR_RETURN( pExecWindow, "PopupMenu::Execute: need a non-NULL window!", 0 ); - ULONG nPopupModeFlags = 0; + sal_uLong nPopupModeFlags = 0; if ( nFlags & POPUPMENU_EXECUTE_DOWN ) nPopupModeFlags = FLOATWIN_POPUPMODE_DOWN; else if ( nFlags & POPUPMENU_EXECUTE_UP ) @@ -3582,10 +3643,10 @@ USHORT PopupMenu::Execute( Window* pExecWindow, const Rectangle& rRect, USHORT n if (nFlags & POPUPMENU_NOMOUSEUPCLOSE ) // allow popup menus to stay open on mouse button up nPopupModeFlags |= FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE; // useful if the menu was opened on mousebutton down (eg toolbox configuration) - return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, FALSE ); + return ImplExecute( pExecWindow, rRect, nPopupModeFlags, 0, sal_False ); } -USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupModeFlags, Menu* pSFrom, BOOL bPreSelectFirst ) +sal_uInt16 PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, sal_uLong nPopupModeFlags, Menu* pSFrom, sal_Bool bPreSelectFirst ) { if ( !pSFrom && ( PopupMenu::IsInExecute() || !GetItemCount() ) ) return 0; @@ -3596,15 +3657,15 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM pStartedFrom = pSFrom; nSelectedId = 0; - bCanceled = FALSE; + bCanceled = sal_False; - ULONG nFocusId = 0; - BOOL bRealExecute = FALSE; + sal_uLong nFocusId = 0; + sal_Bool bRealExecute = sal_False; if ( !pStartedFrom ) { - pSVData->maWinData.mbNoDeactivate = TRUE; + pSVData->maWinData.mbNoDeactivate = sal_True; nFocusId = Window::SaveFocus(); - bRealExecute = TRUE; + bRealExecute = sal_True; } else { @@ -3631,9 +3692,9 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM ImplDelData aDelData; pW->ImplAddDel( &aDelData ); - bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen + bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen Activate(); - bInCallback = FALSE; + bInCallback = sal_False; if ( aDelData.IsDelete() ) return 0; // Error @@ -3659,7 +3720,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM nMenuFlags |= MENU_FLAG_HIDEDISABLEDENTRIES; - USHORT nVisibleEntries = ImplGetVisibleItemCount(); + sal_uInt16 nVisibleEntries = ImplGetVisibleItemCount(); if ( !nVisibleEntries ) { ResMgr* pResMgr = ImplGetResMgr(); @@ -3668,7 +3729,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM String aTmpEntryText( ResId( SV_RESID_STRING_NOSELECTIONPOSSIBLE, *pResMgr ) ); MenuItemData* pData = pItemList->Insert( 0xFFFF, MENUITEM_STRING, 0, aTmpEntryText, Image(), NULL, 0xFFFF ); - pData->bIsTemporary = TRUE; + pData->bIsTemporary = sal_True; } } else if ( Application::GetSettings().GetStyleSettings().GetAutoMnemonic() && !( nMenuFlags & MENU_FLAG_NOAUTOMNEMONICS ) ) @@ -3703,9 +3764,9 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM nMaxHeight -= nTop+nBottom; if ( aSz.Height() > nMaxHeight ) { - pWin->EnableScrollMenu( TRUE ); - USHORT nStart = ImplGetFirstVisible(); - USHORT nEntries = ImplCalcVisEntries( nMaxHeight, nStart ); + pWin->EnableScrollMenu( sal_True ); + sal_uInt16 nStart = ImplGetFirstVisible(); + sal_uInt16 nEntries = ImplCalcVisEntries( nMaxHeight, nStart ); aSz.Height() = ImplCalcHeight( nEntries ); } @@ -3720,7 +3781,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM if ( GetItemCount() ) { SalMenu* pMenu = ImplGetSalMenu(); - if( pMenu && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) ) + if( pMenu && bRealExecute && pMenu->ShowNativePopupMenu( pWin, aRect, nPopupModeFlags | FLOATWIN_POPUPMODE_GRABFOCUS ) ) { pWin->StopExecute(0); pWin->doShutdown(); @@ -3734,7 +3795,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM } if( pSFrom ) { - USHORT aPos; + sal_uInt16 aPos; if( pSFrom->bIsMenuBar ) aPos = ((MenuBarWindow *) pSFrom->pWindow)->GetHighlightedItem(); else @@ -3746,14 +3807,14 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM } if ( bPreSelectFirst ) { - USHORT nCount = (USHORT)pItemList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16)pItemList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pItemList->GetDataFromPos( n ); if ( ( pData->bEnabled || !Application::GetSettings().GetStyleSettings().GetSkipDisabledInMenus() ) && ( pData->eType != MENUITEM_SEPARATOR ) && ImplIsVisible( n ) && ImplIsSelectable( n ) ) { - pWin->ChangeHighlightItem( n, FALSE ); + pWin->ChangeHighlightItem( n, sal_False ); break; } } @@ -3783,7 +3844,7 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM if ( nFocusId ) { pWin->SetFocusId( 0 ); - pSVData->maWinData.mbNoDeactivate = FALSE; + pSVData->maWinData.mbNoDeactivate = sal_False; } pWin->ImplEndPopupMode( 0, nFocusId ); @@ -3814,18 +3875,18 @@ USHORT PopupMenu::ImplExecute( Window* pW, const Rectangle& rRect, ULONG nPopupM return bRealExecute ? nSelectedId : 0; } -USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHORT* pLastVisible ) const +sal_uInt16 PopupMenu::ImplCalcVisEntries( long nMaxHeight, sal_uInt16 nStartEntry, sal_uInt16* pLastVisible ) const { nMaxHeight -= 2 * ImplGetFloatingWindow()->GetScrollerHeight(); long nHeight = 0; - USHORT nEntries = (USHORT) pItemList->Count(); - USHORT nVisEntries = 0; + sal_uInt16 nEntries = (sal_uInt16) pItemList->Count(); + sal_uInt16 nVisEntries = 0; if ( pLastVisible ) *pLastVisible = 0; - for ( USHORT n = nStartEntry; n < nEntries; n++ ) + for ( sal_uInt16 n = nStartEntry; n < nEntries; n++ ) { if ( ImplIsVisible( n ) ) { @@ -3842,14 +3903,14 @@ USHORT PopupMenu::ImplCalcVisEntries( long nMaxHeight, USHORT nStartEntry, USHOR return nVisEntries; } -long PopupMenu::ImplCalcHeight( USHORT nEntries ) const +long PopupMenu::ImplCalcHeight( sal_uInt16 nEntries ) const { long nHeight = 0; - USHORT nFound = 0; - for ( USHORT n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ ) + sal_uInt16 nFound = 0; + for ( sal_uInt16 n = 0; ( nFound < nEntries ) && ( n < pItemList->Count() ); n++ ) { - if ( ImplIsVisible( (USHORT) n ) ) + if ( ImplIsVisible( (sal_uInt16) n ) ) { MenuItemData* pData = pItemList->GetDataFromPos( n ); nHeight += pData->aSz.Height(); @@ -3863,7 +3924,7 @@ long PopupMenu::ImplCalcHeight( USHORT nEntries ) const } -static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar ) +static void ImplInitMenuWindow( Window* pWin, sal_Bool bFont, sal_Bool bMenuBar ) { const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings(); @@ -3880,7 +3941,7 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar ) Wallpaper aWallpaper; aWallpaper.SetStyle( WALLPAPER_APPLICATIONGRADIENT ); pWin->SetBackground( aWallpaper ); - pWin->SetPaintTransparent( FALSE ); + pWin->SetPaintTransparent( sal_False ); pWin->SetParentClipMode( 0 ); } } @@ -3905,12 +3966,12 @@ static void ImplInitMenuWindow( Window* pWin, BOOL bFont, BOOL bMenuBar ) MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nStyle ) : FloatingWindow( pParent, nStyle ) { - mpWindowImpl->mbMenuFloatingWindow= TRUE; + mpWindowImpl->mbMenuFloatingWindow= sal_True; pMenu = pMen; pActivePopup = 0; nSaveFocusId = 0; - bInExecute = FALSE; - bScrollMenu = FALSE; + bInExecute = sal_False; + bScrollMenu = sal_False; nHighlightedItem = ITEMPOS_INVALID; nMBDownPos = ITEMPOS_INVALID; nPosInParent = ITEMPOS_INVALID; @@ -3918,13 +3979,13 @@ MenuFloatingWindow::MenuFloatingWindow( Menu* pMen, Window* pParent, WinBits nSt // nStartY = 0; nBorder = EXTRASPACEY; nFirstEntry = 0; - bScrollUp = FALSE; - bScrollDown = FALSE; - bIgnoreFirstMove = TRUE; - bKeyInput = FALSE; + bScrollUp = sal_False; + bScrollDown = sal_False; + bIgnoreFirstMove = sal_True; + bKeyInput = sal_False; EnableSaveBackground(); - ImplInitMenuWindow( this, TRUE, FALSE ); + ImplInitMenuWindow( this, sal_True, sal_False ); SetPopupModeEndHdl( LINK( this, MenuFloatingWindow, PopupEnd ) ); @@ -3950,7 +4011,7 @@ void MenuFloatingWindow::doShutdown() { // #102461# remove highlight in parent MenuItemData* pData; - USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count(); + sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count(); for(i = 0; i < nCount; i++) { pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i ); @@ -3961,7 +4022,7 @@ void MenuFloatingWindow::doShutdown() { MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow(); if( pPWin ) - pPWin->HighlightItem( i, FALSE ); + pPWin->HighlightItem( i, sal_False ); } } @@ -3997,13 +4058,13 @@ long MenuFloatingWindow::ImplGetStartY() const long nY = 0; if( pMenu ) { - for ( USHORT n = 0; n < nFirstEntry; n++ ) + for ( sal_uInt16 n = 0; n < nFirstEntry; n++ ) nY += pMenu->GetItemList()->GetDataFromPos( n )->aSz.Height(); } return -nY; } -Region MenuFloatingWindow::ImplCalcClipRegion( BOOL bIncludeLogo ) const +Region MenuFloatingWindow::ImplCalcClipRegion( sal_Bool bIncludeLogo ) const { Size aOutSz = GetOutputSizePixel(); Point aPos; @@ -4033,7 +4094,7 @@ void MenuFloatingWindow::ImplInitClipRegion() } } -void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDown ) +void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, sal_Bool bMBDown ) { if( ! pMenu ) return; @@ -4043,10 +4104,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow Size aOutSz = GetOutputSizePixel(); if ( ( nMouseY >= nY ) && ( nMouseY < ( aOutSz.Height() - nY ) ) ) { - BOOL bHighlighted = FALSE; - USHORT nCount = (USHORT)pMenu->pItemList->Count(); + sal_Bool bHighlighted = sal_False; + sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count(); nY += ImplGetStartY(); // ggf. gescrollt. - for ( USHORT n = 0; !bHighlighted && ( n < nCount ); n++ ) + for ( sal_uInt16 n = 0; !bHighlighted && ( n < nCount ); n++ ) { if ( pMenu->ImplIsVisible( n ) ) { @@ -4055,7 +4116,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow nY += pItemData->aSz.Height(); if ( ( nOldY <= nMouseY ) && ( nY > nMouseY ) && pMenu->ImplIsSelectable( n ) ) { - BOOL bPopupArea = TRUE; + sal_Bool bPopupArea = sal_True; if ( pItemData->nBits & MIB_POPUPSELECT ) { // Nur wenn ueber dem Pfeil geklickt wurde... @@ -4068,10 +4129,10 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow { if ( n != nHighlightedItem ) { - ChangeHighlightItem( (USHORT)n, FALSE ); + ChangeHighlightItem( (sal_uInt16)n, sal_False ); } - BOOL bAllowNewPopup = TRUE; + sal_Bool bAllowNewPopup = sal_True; if ( pActivePopup ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); @@ -4089,7 +4150,7 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow { if ( n != nHighlightedItem ) { - ChangeHighlightItem( (USHORT)n, TRUE ); + ChangeHighlightItem( (sal_uInt16)n, sal_True ); } else if ( pItemData->nBits & MIB_POPUPSELECT ) { @@ -4097,17 +4158,17 @@ void MenuFloatingWindow::ImplHighlightItem( const MouseEvent& rMEvt, BOOL bMBDow HighlightChanged( NULL ); } } - bHighlighted = TRUE; + bHighlighted = sal_True; } } } if ( !bHighlighted ) - ChangeHighlightItem( ITEMPOS_INVALID, TRUE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_True ); } else { ImplScroll( rMEvt.GetPosPixel() ); - ChangeHighlightItem( ITEMPOS_INVALID, TRUE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_True ); } } @@ -4121,12 +4182,12 @@ IMPL_LINK( MenuFloatingWindow, PopupEnd, FloatingWindow*, EMPTYARG ) { //DBG_ASSERT( !pActivePopup->ImplGetWindow(), "PopupEnd, obwohl pActivePopup MIT Window!" ); KillActivePopup(); // should be ok to just remove it - //pActivePopup->bCanceled = TRUE; + //pActivePopup->bCanceled = sal_True; } - bInExecute = FALSE; - pMenu->bInCallback = TRUE; + bInExecute = sal_False; + pMenu->bInCallback = sal_True; pMenu->Deactivate(); - pMenu->bInCallback = FALSE; + pMenu->bInCallback = sal_False; } else { @@ -4176,7 +4237,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer ) { if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) ) { - ULONG nOldFlags = GetPopupModeFlags(); + sal_uLong nOldFlags = GetPopupModeFlags(); SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); KillActivePopup(); SetPopupModeFlags( nOldFlags ); @@ -4186,7 +4247,7 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer ) pActivePopup = (PopupMenu*)pItemData->pSubMenu; long nY = nScrollerHeight+ImplGetStartY(); MenuItemData* pData = 0; - for ( ULONG n = 0; n < nHighlightedItem; n++ ) + for ( sal_uLong n = 0; n < nHighlightedItem; n++ ) { pData = pMenu->pItemList->GetDataFromPos( n ); nY += pData->aSz.Height(); @@ -4217,9 +4278,9 @@ IMPL_LINK( MenuFloatingWindow, HighlightChanged, Timer*, pTimer ) // die lange im Activate Rescheduled haben und jetzt schon nicht mehr // angezeigt werden sollen. Menu* pTest = pActivePopup; - ULONG nOldFlags = GetPopupModeFlags(); + sal_uLong nOldFlags = GetPopupModeFlags(); SetPopupModeFlags( GetPopupModeFlags() | FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE ); - USHORT nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? FALSE : TRUE ); + sal_uInt16 nRet = pActivePopup->ImplExecute( this, Rectangle( aItemTopLeft, aItemBottomRight ), FLOATWIN_POPUPMODE_RIGHT, pMenu, pTimer ? sal_False : sal_True ); SetPopupModeFlags( nOldFlags ); // nRet != 0, wenn es waerend Activate() abgeschossen wurde... @@ -4254,11 +4315,11 @@ IMPL_LINK( MenuFloatingWindow, ShowHideListener, VclWindowEvent*, pEvent ) return 0; } -void MenuFloatingWindow::EnableScrollMenu( BOOL b ) +void MenuFloatingWindow::EnableScrollMenu( sal_Bool b ) { bScrollMenu = b; - nScrollerHeight = b ? (USHORT) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0; - bScrollDown = TRUE; + nScrollerHeight = b ? (sal_uInt16) GetSettings().GetStyleSettings().GetScrollBarSize() /2 : 0; + bScrollDown = sal_True; ImplInitClipRegion(); } @@ -4268,8 +4329,8 @@ void MenuFloatingWindow::Execute() pSVData->maAppData.mpActivePopupMenu = (PopupMenu*)pMenu; - bInExecute = TRUE; -// bCallingSelect = FALSE; + bInExecute = sal_True; +// bCallingSelect = sal_False; while ( bInExecute ) Application::Yield(); @@ -4280,24 +4341,24 @@ void MenuFloatingWindow::Execute() // Application::Yield(); } -void MenuFloatingWindow::StopExecute( ULONG nFocusId ) +void MenuFloatingWindow::StopExecute( sal_uLong nFocusId ) { // Focus wieder herstellen // (kann schon im Select wieder hergestellt wurden sein) if ( nSaveFocusId ) { - Window::EndSaveFocus( nFocusId, FALSE ); + Window::EndSaveFocus( nFocusId, sal_False ); nFocusId = nSaveFocusId; if ( nFocusId ) { nSaveFocusId = 0; - ImplGetSVData()->maWinData.mbNoDeactivate = FALSE; + ImplGetSVData()->maWinData.mbNoDeactivate = sal_False; } } ImplEndPopupMode( 0, nFocusId ); aHighlightChangedTimer.Stop(); - bInExecute = FALSE; + bInExecute = sal_False; if ( pActivePopup ) { KillActivePopup(); @@ -4315,15 +4376,15 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) if( ((FloatingWindow *) pActivePopup->pWindow)->IsInCleanUp() ) return; // kill it later if ( pActivePopup->bInCallback ) - pActivePopup->bCanceled = TRUE; + pActivePopup->bCanceled = sal_True; // Vor allen Aktionen schon pActivePopup = 0, falls z.B. // PopupModeEndHdl des zu zerstoerenden Popups mal synchron gerufen wird. PopupMenu* pPopup = pActivePopup; pActivePopup = NULL; - pPopup->bInCallback = TRUE; + pPopup->bInCallback = sal_True; pPopup->Deactivate(); - pPopup->bInCallback = FALSE; + pPopup->bInCallback = sal_False; if ( pPopup->ImplGetWindow() ) { pPopup->ImplGetFloatingWindow()->StopExecute(); @@ -4339,14 +4400,14 @@ void MenuFloatingWindow::KillActivePopup( PopupMenu* pThisOnly ) void MenuFloatingWindow::EndExecute() { Menu* pStart = pMenu ? pMenu->ImplGetStartMenu() : NULL; - ULONG nFocusId = 0; + sal_uLong nFocusId = 0; if ( pStart && pStart->bIsMenuBar ) { nFocusId = ((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->GetFocusId(); if ( nFocusId ) { ((MenuBarWindow*)((MenuBar*)pStart)->ImplGetWindow())->SetFocusId( 0 ); - ImplGetSVData()->maWinData.mbNoDeactivate = FALSE; + ImplGetSVData()->maWinData.mbNoDeactivate = sal_False; } } @@ -4363,7 +4424,7 @@ void MenuFloatingWindow::EndExecute() // Dies Fenster wird gleich zerstoert => Daten lokal merken... Menu* pM = pMenu; - USHORT nItem = nHighlightedItem; + sal_uInt16 nItem = nHighlightedItem; pCleanUpFrom->StopExecute( nFocusId ); @@ -4381,9 +4442,9 @@ void MenuFloatingWindow::EndExecute() } } -void MenuFloatingWindow::EndExecute( USHORT nId ) +void MenuFloatingWindow::EndExecute( sal_uInt16 nId ) { - USHORT nPos; + sal_uInt16 nPos; if ( pMenu && pMenu->GetItemList()->GetData( nId, nPos ) ) nHighlightedItem = nPos; else @@ -4400,7 +4461,7 @@ void MenuFloatingWindow::MouseButtonDown( const MouseEvent& rMEvt ) //if ( pActivePopup && pActivePopup->ImplGetWindow() && !pActivePopup->ImplGetFloatingWindow()->pActivePopup ) // pActivePopup->ImplGetFloatingWindow()->ToTop( TOTOP_NOGRABFOCUS ); - ImplHighlightItem( rMEvt, TRUE ); + ImplHighlightItem( rMEvt, sal_True ); nMBDownPos = nHighlightedItem; } @@ -4410,7 +4471,7 @@ void MenuFloatingWindow::MouseButtonUp( const MouseEvent& rMEvt ) MenuItemData* pData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL; // nMBDownPos in lokaler Variable merken und gleich zuruecksetzen, // weil nach EndExecute zu spaet - USHORT _nMBDownPos = nMBDownPos; + sal_uInt16 _nMBDownPos = nMBDownPos; nMBDownPos = ITEMPOS_INVALID; if ( pData && pData->bEnabled && ( pData->eType != MENUITEM_SEPARATOR ) ) { @@ -4448,7 +4509,7 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) pActivePopup->ImplGetFloatingWindow()->aSubmenuCloseTimer.Start(); if( !pActivePopup || (pData && pData->pSubMenu != pActivePopup ) ) - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); #ifdef OS2 } #endif @@ -4463,13 +4524,13 @@ void MenuFloatingWindow::MouseMove( const MouseEvent& rMEvt ) { aSubmenuCloseTimer.Stop(); if( bIgnoreFirstMove ) - bIgnoreFirstMove = FALSE; + bIgnoreFirstMove = sal_False; else - ImplHighlightItem( rMEvt, FALSE ); + ImplHighlightItem( rMEvt, sal_False ); } } -void MenuFloatingWindow::ImplScroll( BOOL bUp ) +void MenuFloatingWindow::ImplScroll( sal_Bool bUp ) { KillActivePopup(); Update(); @@ -4477,7 +4538,7 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp ) if( ! pMenu ) return; - HighlightItem( nHighlightedItem, FALSE ); + HighlightItem( nHighlightedItem, sal_False ); pMenu->ImplKillLayoutData(); @@ -4492,17 +4553,17 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp ) if ( !bScrollDown ) { - bScrollDown = TRUE; - ImplDrawScroller( FALSE ); + bScrollDown = sal_True; + ImplDrawScroller( sal_False ); } if ( pMenu->ImplGetPrevVisible( nFirstEntry ) == ITEMPOS_INVALID ) { - bScrollUp = FALSE; - ImplDrawScroller( TRUE ); + bScrollUp = sal_False; + ImplDrawScroller( sal_True ); } - Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP ); + Scroll( 0, nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP ); } else if ( bScrollDown && !bUp ) { @@ -4514,24 +4575,24 @@ void MenuFloatingWindow::ImplScroll( BOOL bUp ) if ( !bScrollUp ) { - bScrollUp = TRUE; - ImplDrawScroller( TRUE ); + bScrollUp = sal_True; + ImplDrawScroller( sal_True ); } long nHeight = GetOutputSizePixel().Height(); - USHORT nLastVisible; + sal_uInt16 nLastVisible; ((PopupMenu*)pMenu)->ImplCalcVisEntries( nHeight, nFirstEntry, &nLastVisible ); if ( pMenu->ImplGetNextVisible( nLastVisible ) == ITEMPOS_INVALID ) { - bScrollDown = FALSE; - ImplDrawScroller( FALSE ); + bScrollDown = sal_False; + ImplDrawScroller( sal_False ); } // nStartY -= nEntryHeight; - Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( FALSE ).GetBoundRect(), SCROLL_CLIP ); + Scroll( 0, -nScrollEntryHeight, ImplCalcClipRegion( sal_False ).GetBoundRect(), SCROLL_CLIP ); } - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); } void MenuFloatingWindow::ImplScroll( const Point& rMousePos ) @@ -4544,12 +4605,12 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos ) if ( bScrollUp && ( nMouseY < nY ) ) { - ImplScroll( TRUE ); + ImplScroll( sal_True ); nDelta = nY - nMouseY; } else if ( bScrollDown && ( nMouseY > ( aOutSz.Height() - nY ) ) ) { - ImplScroll( FALSE ); + ImplScroll( sal_False ); nDelta = nMouseY - ( aOutSz.Height() - nY ); } @@ -4571,7 +4632,7 @@ void MenuFloatingWindow::ImplScroll( const Point& rMousePos ) aScrollTimer.Start(); } } -void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) +void MenuFloatingWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bStartPopupTimer ) { // #57934# ggf. das aktive Popup sofort schliessen, damit TH's Hintergrundsicherung funktioniert. // #65750# Dann verzichten wir lieber auf den schmalen Streifen Hintergrundsicherung. @@ -4586,11 +4647,11 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) if ( nHighlightedItem != ITEMPOS_INVALID ) { - HighlightItem( nHighlightedItem, FALSE ); + HighlightItem( nHighlightedItem, sal_False ); pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem ); } - nHighlightedItem = (USHORT)n; + nHighlightedItem = (sal_uInt16)n; DBG_ASSERT( pMenu->ImplIsVisible( nHighlightedItem ) || nHighlightedItem == ITEMPOS_INVALID, "ChangeHighlightItem: Not visible!" ); if( nHighlightedItem != ITEMPOS_INVALID ) { @@ -4598,7 +4659,7 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) { // #102461# make sure parent entry is highlighted as well MenuItemData* pData; - USHORT i, nCount = (USHORT)pMenu->pStartedFrom->pItemList->Count(); + sal_uInt16 i, nCount = (sal_uInt16)pMenu->pStartedFrom->pItemList->Count(); for(i = 0; i < nCount; i++) { pData = pMenu->pStartedFrom->pItemList->GetDataFromPos( i ); @@ -4610,12 +4671,12 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) MenuFloatingWindow* pPWin = (MenuFloatingWindow*)pMenu->pStartedFrom->ImplGetWindow(); if( pPWin && pPWin->nHighlightedItem != i ) { - pPWin->HighlightItem( i, TRUE ); + pPWin->HighlightItem( i, sal_True ); pPWin->nHighlightedItem = i; } } } - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); pMenu->ImplCallHighlight( nHighlightedItem ); } else @@ -4634,7 +4695,7 @@ void MenuFloatingWindow::ChangeHighlightItem( USHORT n, BOOL bStartPopupTimer ) } } -void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) +void MenuFloatingWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ) { if( ! pMenu ) return; @@ -4650,8 +4711,8 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) int nOuterSpace = ImplGetSVData()->maNWFData.mnMenuFormatExtraBorder; nY += nOuterSpace; - USHORT nCount = (USHORT)pMenu->pItemList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -4659,7 +4720,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) DBG_ASSERT( pMenu->ImplIsVisible( n ), "Highlight: Item not visible!" ); if ( pData->eType != MENUITEM_SEPARATOR ) { - BOOL bRestoreLineColor = FALSE; + sal_Bool bRestoreLineColor = sal_False; Color oldLineColor; bool bDrawItemRect = true; @@ -4676,19 +4737,20 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) Push( PUSH_CLIPREGION ); IntersectClipRegion( Rectangle( Point( nX, nY ), Size( aSz.Width(), pData->aSz.Height() ) ) ); Rectangle aCtrlRect( Point( nX, 0 ), Size( aPxSize.Width()-nX, aPxSize.Height() ) ); + MenupopupValue aVal( pMenu->nTextPos-GUTTERBORDER, aItemRect ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, aCtrlRect, CTRL_STATE_ENABLED, - ImplControlValue(), + aVal, OUString() ); if( bHighlight && IsNativeControlSupported( CTRL_MENU_POPUP, PART_MENU_ITEM ) ) { bDrawItemRect = false; - if( FALSE == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, + if( sal_False == DrawNativeControl( CTRL_MENU_POPUP, PART_MENU_ITEM, aItemRect, CTRL_STATE_SELECTED | ( pData->bEnabled? CTRL_STATE_ENABLED: 0 ), - ImplControlValue(), + aVal, OUString() ) ) { bDrawItemRect = bHighlight; @@ -4709,7 +4771,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) SetFillColor(); oldLineColor = GetLineColor(); SetLineColor( GetSettings().GetStyleSettings().GetMenuHighlightColor() ); - bRestoreLineColor = TRUE; + bRestoreLineColor = sal_True; } } else @@ -4728,7 +4790,7 @@ void MenuFloatingWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) } } -Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos ) +Rectangle MenuFloatingWindow::ImplGetItemRect( sal_uInt16 nPos ) { if( ! pMenu ) return Rectangle(); @@ -4742,8 +4804,8 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos ) if ( pMenu->pLogo ) nX = pMenu->pLogo->aBitmap.GetSizePixel().Width(); - USHORT nCount = (USHORT)pMenu->pItemList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -4766,14 +4828,14 @@ Rectangle MenuFloatingWindow::ImplGetItemRect( USHORT nPos ) } -void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) +void MenuFloatingWindow::ImplCursorUpDown( sal_Bool bUp, sal_Bool bHomeEnd ) { if( ! pMenu ) return; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); - USHORT n = nHighlightedItem; + sal_uInt16 n = nHighlightedItem; if ( n == ITEMPOS_INVALID ) { if ( bUp ) @@ -4782,7 +4844,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) n = pMenu->GetItemCount()-1; } - USHORT nLoop = n; + sal_uInt16 nLoop = n; if( bHomeEnd ) { @@ -4794,7 +4856,7 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) } else { - n = (USHORT)-1; + n = (sal_uInt16)-1; nLoop = n+1; } } @@ -4830,21 +4892,21 @@ void MenuFloatingWindow::ImplCursorUpDown( BOOL bUp, BOOL bHomeEnd ) // Selektion noch im sichtbaren Bereich? if ( IsScrollMenu() ) { - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); while ( n < nFirstEntry ) - ImplScroll( TRUE ); + ImplScroll( sal_True ); Size aOutSz = GetOutputSizePixel(); - USHORT nLastVisible; + sal_uInt16 nLastVisible; ((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); while ( n > nLastVisible ) { - ImplScroll( FALSE ); + ImplScroll( sal_False ); ((PopupMenu*)pMenu)->ImplCalcVisEntries( aOutSz.Height(), nFirstEntry, &nLastVisible ); } } - ChangeHighlightItem( n, FALSE ); + ChangeHighlightItem( n, sal_False ); break; } } while ( n != nLoop ); @@ -4855,8 +4917,8 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) ImplDelData aDelData; ImplAddDel( &aDelData ); - USHORT nCode = rKEvent.GetKeyCode().GetCode(); - bKeyInput = TRUE; + sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode(); + bKeyInput = sal_True; switch ( nCode ) { case KEY_UP: @@ -4868,7 +4930,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) case KEY_END: case KEY_HOME: { - ImplCursorUpDown( nCode == KEY_END, TRUE ); + ImplCursorUpDown( nCode == KEY_END, sal_True ); } break; case KEY_F6: @@ -4924,14 +4986,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) { if( pMenu ) { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; if ( nHighlightedItem != ITEMPOS_INVALID ) { MenuItemData* pData = pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ); if ( pData && pData->pSubMenu ) { HighlightChanged( 0 ); - bDone = TRUE; + bDone = sal_True; } } if ( !bDone ) @@ -4979,14 +5041,14 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) default: { xub_Unicode nCharCode = rKEvent.GetCharCode(); - USHORT nPos = 0; - USHORT nDuplicates = 0; + sal_uInt16 nPos = 0; + sal_uInt16 nDuplicates = 0; MenuItemData* pData = (nCharCode && pMenu) ? pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nPos, nDuplicates, nHighlightedItem ) : NULL; if ( pData ) { if ( pData->pSubMenu || nDuplicates > 1 ) { - ChangeHighlightItem( nPos, FALSE ); + ChangeHighlightItem( nPos, sal_False ); HighlightChanged( 0 ); } else @@ -5008,7 +5070,7 @@ void MenuFloatingWindow::KeyInput( const KeyEvent& rKEvent ) if ( !aDelData.IsDelete() ) { ImplRemoveDel( &aDelData ); - bKeyInput = FALSE; + bKeyInput = sal_False; } } @@ -5023,25 +5085,26 @@ void MenuFloatingWindow::Paint( const Rectangle& ) long nX = pMenu->pLogo ? pMenu->pLogo->aBitmap.GetSizePixel().Width() : 0; Size aPxSize( GetOutputSizePixel() ); aPxSize.Width() -= nX; + ImplControlValue aVal( pMenu->nTextPos-GUTTERBORDER ); DrawNativeControl( CTRL_MENU_POPUP, PART_ENTIRE_CONTROL, Rectangle( Point( nX, 0 ), aPxSize ), CTRL_STATE_ENABLED, - ImplControlValue(), + aVal, OUString() ); ImplInitClipRegion(); } if ( IsScrollMenu() ) { - ImplDrawScroller( TRUE ); - ImplDrawScroller( FALSE ); + ImplDrawScroller( sal_True ); + ImplDrawScroller( sal_False ); } SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() ); pMenu->ImplPaint( this, nScrollerHeight, ImplGetStartY() ); if ( nHighlightedItem != ITEMPOS_INVALID ) - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); } -void MenuFloatingWindow::ImplDrawScroller( BOOL bUp ) +void MenuFloatingWindow::ImplDrawScroller( sal_Bool bUp ) { if( ! pMenu ) return; @@ -5056,7 +5119,7 @@ void MenuFloatingWindow::ImplDrawScroller( BOOL bUp ) DecorationView aDecoView( this ); SymbolType eSymbol = bUp ? SYMBOL_SPIN_UP : SYMBOL_SPIN_DOWN; - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; if ( ( bUp && !bScrollUp ) || ( !bUp && !bScrollDown ) ) nStyle |= SYMBOL_DRAW_DISABLE; @@ -5067,7 +5130,7 @@ void MenuFloatingWindow::ImplDrawScroller( BOOL bUp ) void MenuFloatingWindow::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nId = nHighlightedItem; + sal_uInt16 nId = nHighlightedItem; Menu* pM = pMenu; Window* pW = this; @@ -5091,7 +5154,7 @@ void MenuFloatingWindow::StateChanged( StateChangedType nType ) if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) ) { - ImplInitMenuWindow( this, FALSE, FALSE ); + ImplInitMenuWindow( this, sal_False, sal_False ); Invalidate(); } } @@ -5105,7 +5168,7 @@ void MenuFloatingWindow::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - ImplInitMenuWindow( this, FALSE, FALSE ); + ImplInitMenuWindow( this, sal_False, sal_False ); Invalidate(); } } @@ -5145,10 +5208,10 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : pActivePopup = NULL; nSaveFocusId = 0; nHighlightedItem = ITEMPOS_INVALID; - mbAutoPopup = TRUE; + mbAutoPopup = sal_True; nSaveFocusId = 0; - bIgnoreFirstMove = TRUE; - bStayActive = FALSE; + bIgnoreFirstMove = sal_True; + bStayActive = sal_False; ResMgr* pResMgr = ImplGetResMgr(); @@ -5159,7 +5222,7 @@ MenuBarWindow::MenuBarWindow( Window* pParent ) : aCloser.SetOutStyle( TOOLBOX_STYLE_FLAT ); aCloser.SetBackground(); - aCloser.SetPaintTransparent( TRUE ); + aCloser.SetPaintTransparent( sal_True ); aCloser.SetParentClipMode( PARENTCLIPMODE_NOCLIP ); aCloser.InsertItem( IID_DOCUMENTCLOSE, aCloser.maImage, 0 ); @@ -5192,7 +5255,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen ) pMenu = pMen; KillActivePopup(); nHighlightedItem = ITEMPOS_INVALID; - ImplInitMenuWindow( this, TRUE, TRUE ); + ImplInitMenuWindow( this, sal_True, sal_True ); if ( pMen ) { aCloser.ShowItem( IID_DOCUMENTCLOSE, pMen->HasCloser() ); @@ -5212,7 +5275,7 @@ void MenuBarWindow::SetMenu( MenuBar* pMen ) } } -void MenuBarWindow::ShowButtons( BOOL bClose, BOOL bFloat, BOOL bHide ) +void MenuBarWindow::ShowButtons( sal_Bool bClose, sal_Bool bFloat, sal_Bool bHide ) { aCloser.ShowItem( IID_DOCUMENTCLOSE, bClose ); aCloser.Show( bClose || ! m_aAddButtons.empty() ); @@ -5240,7 +5303,7 @@ IMPL_LINK( MenuBarWindow, CloserHdl, PushButton*, EMPTYARG ) } else { - std::map<USHORT,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() ); + std::map<sal_uInt16,AddButtonEntry>::iterator it = m_aAddButtons.find( aCloser.GetCurItemId() ); if( it != m_aAddButtons.end() ) { MenuBar::MenuBarButtonCallbackArg aArg; @@ -5266,10 +5329,10 @@ IMPL_LINK( MenuBarWindow, ToolboxEventHdl, VclWindowEvent*, pEvent ) aArg.nId = aCloser.GetHighlightItemId(); else if( pEvent->GetId() == VCLEVENT_TOOLBOX_HIGHLIGHTOFF ) { - USHORT nPos = static_cast< USHORT >(reinterpret_cast<sal_IntPtr>(pEvent->GetData())); + sal_uInt16 nPos = static_cast< sal_uInt16 >(reinterpret_cast<sal_IntPtr>(pEvent->GetData())); aArg.nId = aCloser.GetItemId( nPos ); } - std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId ); + std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( aArg.nId ); if( it != m_aAddButtons.end() ) { it->second.m_aHighlightLink.Call( &aArg ); @@ -5299,12 +5362,12 @@ IMPL_LINK( MenuBarWindow, HideHdl, PushButton*, EMPTYARG ) return pMenu ? ((MenuBar*)pMenu)->GetHideButtonClickHdl().Call( pMenu ) : 0; } -void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst ) +void MenuBarWindow::ImplCreatePopup( sal_Bool bPreSelectFirst ) { MenuItemData* pItemData = pMenu ? pMenu->GetItemList()->GetDataFromPos( nHighlightedItem ) : NULL; if ( pItemData ) { - bIgnoreFirstMove = TRUE; + bIgnoreFirstMove = sal_True; if ( pActivePopup && ( pActivePopup != pItemData->pSubMenu ) ) { KillActivePopup(); @@ -5314,7 +5377,7 @@ void MenuBarWindow::ImplCreatePopup( BOOL bPreSelectFirst ) pActivePopup = (PopupMenu*)pItemData->pSubMenu; long nX = 0; MenuItemData* pData = 0; - for ( ULONG n = 0; n < nHighlightedItem; n++ ) + for ( sal_uLong n = 0; n < nHighlightedItem; n++ ) { pData = pMenu->GetItemList()->GetDataFromPos( n ); nX += pData->aSz.Width(); @@ -5361,11 +5424,11 @@ void MenuBarWindow::KillActivePopup() return; // kill it later if ( pActivePopup->bInCallback ) - pActivePopup->bCanceled = TRUE; + pActivePopup->bCanceled = sal_True; - pActivePopup->bInCallback = TRUE; + pActivePopup->bInCallback = sal_True; pActivePopup->Deactivate(); - pActivePopup->bInCallback = FALSE; + pActivePopup->bInCallback = sal_False; // Abfrage auf pActivePopup, falls im Deactivate abgeschossen... if ( pActivePopup && pActivePopup->ImplGetWindow() ) { @@ -5383,22 +5446,22 @@ void MenuBarWindow::PopupClosed( Menu* pPopup ) if ( pPopup == pActivePopup ) { KillActivePopup(); - ChangeHighlightItem( ITEMPOS_INVALID, FALSE, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False, ImplGetFrameWindow()->ImplGetFrameData()->mbHasFocus, sal_False ); } } void MenuBarWindow::MouseButtonDown( const MouseEvent& rMEvt ) { - mbAutoPopup = TRUE; - USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); + mbAutoPopup = sal_True; + sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); if ( ( nEntry != ITEMPOS_INVALID ) && ( nEntry != nHighlightedItem ) ) { - ChangeHighlightItem( nEntry, FALSE ); + ChangeHighlightItem( nEntry, sal_False ); } else { KillActivePopup(); - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); } } @@ -5414,20 +5477,20 @@ void MenuBarWindow::MouseMove( const MouseEvent& rMEvt ) if( bIgnoreFirstMove ) { - bIgnoreFirstMove = FALSE; + bIgnoreFirstMove = sal_False; return; } - USHORT nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); + sal_uInt16 nEntry = ImplFindEntry( rMEvt.GetPosPixel() ); if ( ( nEntry != ITEMPOS_INVALID ) #ifdef OS2 && ( ImplHilite(rMEvt) ) #endif && ( nEntry != nHighlightedItem ) ) - ChangeHighlightItem( nEntry, FALSE ); + ChangeHighlightItem( nEntry, sal_False ); } -void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllowRestoreFocus, BOOL bDefaultToDocument) +void MenuBarWindow::ChangeHighlightItem( sal_uInt16 n, sal_Bool bSelectEntry, sal_Bool bAllowRestoreFocus, sal_Bool bDefaultToDocument) { if( ! pMenu ) return; @@ -5438,21 +5501,21 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo KillActivePopup(); // pActivePopup ggf. ohne pWin, wenn in Activate() Rescheduled wurde // Activate am MenuBar immer nur einmal pro Vorgang... - BOOL bJustActivated = FALSE; + sal_Bool bJustActivated = sal_False; if ( ( nHighlightedItem == ITEMPOS_INVALID ) && ( n != ITEMPOS_INVALID ) ) { - ImplGetSVData()->maWinData.mbNoDeactivate = TRUE; + ImplGetSVData()->maWinData.mbNoDeactivate = sal_True; if( !bStayActive ) { // #105406# avoid saving the focus when we already have the focus - BOOL bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin ); + sal_Bool bNoSaveFocus = (this == ImplGetSVData()->maWinData.mpFocusWin ); if( nSaveFocusId ) { if( !ImplGetSVData()->maWinData.mbNoSaveFocus ) { // we didn't clean up last time - Window::EndSaveFocus( nSaveFocusId, FALSE ); // clean up + Window::EndSaveFocus( nSaveFocusId, sal_False ); // clean up nSaveFocusId = 0; if( !bNoSaveFocus ) nSaveFocusId = Window::SaveFocus(); // only save focus when initially activated @@ -5468,21 +5531,21 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo } } else - bStayActive = FALSE; - pMenu->bInCallback = TRUE; // hier schon setzen, falls Activate ueberladen + bStayActive = sal_False; + pMenu->bInCallback = sal_True; // hier schon setzen, falls Activate ueberladen pMenu->Activate(); - pMenu->bInCallback = FALSE; - bJustActivated = TRUE; + pMenu->bInCallback = sal_False; + bJustActivated = sal_True; } else if ( ( nHighlightedItem != ITEMPOS_INVALID ) && ( n == ITEMPOS_INVALID ) ) { - pMenu->bInCallback = TRUE; + pMenu->bInCallback = sal_True; pMenu->Deactivate(); - pMenu->bInCallback = FALSE; - ImplGetSVData()->maWinData.mbNoDeactivate = FALSE; + pMenu->bInCallback = sal_False; + ImplGetSVData()->maWinData.mbNoDeactivate = sal_False; if( !ImplGetSVData()->maWinData.mbNoSaveFocus ) { - ULONG nTempFocusId = nSaveFocusId; + sal_uLong nTempFocusId = nSaveFocusId; nSaveFocusId = 0; Window::EndSaveFocus( nTempFocusId, bAllowRestoreFocus ); // #105406# restore focus to document if we could not save focus before @@ -5493,13 +5556,13 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo if ( nHighlightedItem != ITEMPOS_INVALID ) { - HighlightItem( nHighlightedItem, FALSE ); + HighlightItem( nHighlightedItem, sal_False ); pMenu->ImplCallEventListeners( VCLEVENT_MENU_DEHIGHLIGHT, nHighlightedItem ); } - nHighlightedItem = (USHORT)n; + nHighlightedItem = (sal_uInt16)n; DBG_ASSERT( ( nHighlightedItem == ITEMPOS_INVALID ) || pMenu->ImplIsVisible( nHighlightedItem ), "ChangeHighlightItem: Not visible!" ); - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); pMenu->ImplCallHighlight( nHighlightedItem ); if( mbAutoPopup ) @@ -5510,14 +5573,14 @@ void MenuBarWindow::ChangeHighlightItem( USHORT n, BOOL bSelectEntry, BOOL bAllo GrabFocus(); } -void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) +void MenuBarWindow::HighlightItem( sal_uInt16 nPos, sal_Bool bHighlight ) { if( ! pMenu ) return; long nX = 0; - ULONG nCount = pMenu->pItemList->Count(); - for ( ULONG n = 0; n < nCount; n++ ) + sal_uLong nCount = pMenu->pItemList->Count(); + for ( sal_uLong n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -5588,14 +5651,14 @@ void MenuBarWindow::HighlightItem( USHORT nPos, BOOL bHighlight ) } } -Rectangle MenuBarWindow::ImplGetItemRect( USHORT nPos ) +Rectangle MenuBarWindow::ImplGetItemRect( sal_uInt16 nPos ) { Rectangle aRect; if( pMenu ) { long nX = 0; - ULONG nCount = pMenu->pItemList->Count(); - for ( ULONG n = 0; n < nCount; n++ ) + sal_uLong nCount = pMenu->pItemList->Count(); + for ( sal_uLong n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( n == nPos ) @@ -5618,16 +5681,16 @@ void MenuBarWindow::KeyInput( const KeyEvent& rKEvent ) Window::KeyInput( rKEvent ); } -BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu ) +sal_Bool MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, sal_Bool bFromMenu ) { if( ! pMenu ) - return FALSE; + return sal_False; if ( pMenu->bInCallback ) - return TRUE; // schlucken + return sal_True; // schlucken - BOOL bDone = FALSE; - USHORT nCode = rKEvent.GetKeyCode().GetCode(); + sal_Bool bDone = sal_False; + sal_uInt16 nCode = rKEvent.GetKeyCode().GetCode(); if( GetParent() ) { @@ -5636,7 +5699,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu SystemWindow *pSysWin = (SystemWindow*)GetParent()->GetWindow( WINDOW_CLIENT ); if( pSysWin->GetTaskPaneList() ) if( pSysWin->GetTaskPaneList()->HandleKeyEvent( rKEvent ) ) - return TRUE; + return sal_True; } } @@ -5645,22 +5708,22 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu mbAutoPopup = ImplGetSVData()->maNWFData.mbOpenMenuOnF10; if ( nHighlightedItem == ITEMPOS_INVALID ) { - ChangeHighlightItem( 0, FALSE ); + ChangeHighlightItem( 0, sal_False ); GrabFocus(); } else { - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); nSaveFocusId = 0; } - bDone = TRUE; + bDone = sal_True; } else if ( bFromMenu ) { if ( ( nCode == KEY_LEFT ) || ( nCode == KEY_RIGHT ) || ( nCode == KEY_HOME ) || ( nCode == KEY_END ) ) { - USHORT n = nHighlightedItem; + sal_uInt16 n = nHighlightedItem; if ( n == ITEMPOS_INVALID ) { if ( nCode == KEY_LEFT) @@ -5680,10 +5743,10 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu bWasHighlight = (pSubWindow->GetHighlightedItem() != ITEMPOS_INVALID); } - USHORT nLoop = n; + sal_uInt16 nLoop = n; if( nCode == KEY_HOME ) - { n = (USHORT)-1; nLoop = n+1; } + { n = (sal_uInt16)-1; nLoop = n+1; } if( nCode == KEY_END ) { n = pMenu->GetItemCount(); nLoop = n-1; } @@ -5706,14 +5769,14 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu MenuItemData* pData = (MenuItemData*)pMenu->GetItemList()->GetDataFromPos( n ); if ( ( pData->eType != MENUITEM_SEPARATOR ) && pMenu->ImplIsVisible( n ) ) { - BOOL bDoSelect = TRUE; + sal_Bool bDoSelect = sal_True; if( ImplGetSVData()->maNWFData.mbOpenMenuOnF10 ) bDoSelect = bWasHighlight; ChangeHighlightItem( n, bDoSelect ); break; } } while ( n != nLoop ); - bDone = TRUE; + bDone = sal_True; } else if ( nCode == KEY_RETURN ) { @@ -5721,36 +5784,36 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu else if ( !mbAutoPopup ) { - ImplCreatePopup( TRUE ); - mbAutoPopup = TRUE; + ImplCreatePopup( sal_True ); + mbAutoPopup = sal_True; } - bDone = TRUE; + bDone = sal_True; } else if ( ( nCode == KEY_UP ) || ( nCode == KEY_DOWN ) ) { if ( !mbAutoPopup ) { - ImplCreatePopup( TRUE ); - mbAutoPopup = TRUE; + ImplCreatePopup( sal_True ); + mbAutoPopup = sal_True; } - bDone = TRUE; + bDone = sal_True; } else if ( nCode == KEY_ESCAPE || ( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() ) ) { if( pActivePopup ) { // bring focus to menu bar without any open popup - mbAutoPopup = FALSE; - USHORT n = nHighlightedItem; + mbAutoPopup = sal_False; + sal_uInt16 n = nHighlightedItem; nHighlightedItem = ITEMPOS_INVALID; - bStayActive = TRUE; - ChangeHighlightItem( n, FALSE ); - bStayActive = FALSE; + bStayActive = sal_True; + ChangeHighlightItem( n, sal_False ); + bStayActive = sal_False; KillActivePopup(); GrabFocus(); } else - ChangeHighlightItem( ITEMPOS_INVALID, FALSE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_False ); if( nCode == KEY_F6 && rKEvent.GetKeyCode().IsMod1() ) { @@ -5758,7 +5821,7 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu GrabFocusToDocument(); } - bDone = TRUE; + bDone = sal_True; } } @@ -5767,19 +5830,19 @@ BOOL MenuBarWindow::ImplHandleKeyEvent( const KeyEvent& rKEvent, BOOL bFromMenu xub_Unicode nCharCode = rKEvent.GetCharCode(); if ( nCharCode ) { - USHORT nEntry, nDuplicates; + sal_uInt16 nEntry, nDuplicates; MenuItemData* pData = pMenu->GetItemList()->SearchItem( nCharCode, rKEvent.GetKeyCode(), nEntry, nDuplicates, nHighlightedItem ); if ( pData && (nEntry != ITEMPOS_INVALID) ) { - mbAutoPopup = TRUE; - ChangeHighlightItem( nEntry, TRUE ); - bDone = TRUE; + mbAutoPopup = sal_True; + ChangeHighlightItem( nEntry, sal_True ); + bDone = sal_True; } else { // Wegen Systemmenu und anderen System-HotKeys, nur // eigenstaendige Character-Kombinationen auswerten - USHORT nKeyCode = rKEvent.GetKeyCode().GetCode(); + sal_uInt16 nKeyCode = rKEvent.GetKeyCode().GetCode(); if ( ((nKeyCode >= KEY_A) && (nKeyCode <= KEY_Z)) ) Sound::Beep(); } @@ -5814,7 +5877,7 @@ void MenuBarWindow::Paint( const Rectangle& ) SetFillColor( GetSettings().GetStyleSettings().GetMenuColor() ); pMenu->ImplPaint( this, 0 ); if ( nHighlightedItem != ITEMPOS_INVALID ) - HighlightItem( nHighlightedItem, TRUE ); + HighlightItem( nHighlightedItem, sal_True ); // in high contrast mode draw a separating line on the lower edge if( ! IsNativeControlSupported( CTRL_MENUBAR, PART_ENTIRE_CONTROL) && @@ -5866,20 +5929,20 @@ void MenuBarWindow::Resize() Invalidate(); } -USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const +sal_uInt16 MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const { if( pMenu ) { long nX = 0; - USHORT nCount = (USHORT)pMenu->pItemList->Count(); - for ( USHORT n = 0; n < nCount; n++ ) + sal_uInt16 nCount = (sal_uInt16)pMenu->pItemList->Count(); + for ( sal_uInt16 n = 0; n < nCount; n++ ) { MenuItemData* pData = pMenu->pItemList->GetDataFromPos( n ); if ( pMenu->ImplIsVisible( n ) ) { nX += pData->aSz.Width(); if ( nX > rMousePos.X() ) - return (USHORT)n; + return (sal_uInt16)n; } } } @@ -5888,9 +5951,9 @@ USHORT MenuBarWindow::ImplFindEntry( const Point& rMousePos ) const void MenuBarWindow::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nId = nHighlightedItem; + sal_uInt16 nId = nHighlightedItem; if ( rHEvt.GetMode() & (HELPMODE_CONTEXT | HELPMODE_EXTENDED) ) - ChangeHighlightItem( ITEMPOS_INVALID, TRUE ); + ChangeHighlightItem( ITEMPOS_INVALID, sal_True ); Rectangle aHighlightRect( ImplGetItemRect( nHighlightedItem ) ); if( !ImplHandleHelpEvent( this, pMenu, nId, rHEvt, aHighlightRect ) ) @@ -5904,7 +5967,7 @@ void MenuBarWindow::StateChanged( StateChangedType nType ) if ( ( nType == STATE_CHANGE_CONTROLFOREGROUND ) || ( nType == STATE_CHANGE_CONTROLBACKGROUND ) ) { - ImplInitMenuWindow( this, FALSE, TRUE ); + ImplInitMenuWindow( this, sal_False, sal_True ); Invalidate(); } else if( pMenu ) @@ -5916,7 +5979,7 @@ void MenuBarWindow::ImplLayoutChanged() { if( pMenu ) { - ImplInitMenuWindow( this, TRUE, TRUE ); + ImplInitMenuWindow( this, sal_True, sal_True ); // Falls sich der Font geaendert hat. long nHeight = pMenu->ImplCalcSize( this ).Height(); @@ -5968,16 +6031,16 @@ void MenuBarWindow::DataChanged( const DataChangedEvent& rDCEvt ) void MenuBarWindow::LoseFocus() { - if ( !HasChildPathFocus( TRUE ) ) - ChangeHighlightItem( ITEMPOS_INVALID, FALSE, FALSE ); + if ( !HasChildPathFocus( sal_True ) ) + ChangeHighlightItem( ITEMPOS_INVALID, sal_False, sal_False ); } void MenuBarWindow::GetFocus() { if ( nHighlightedItem == ITEMPOS_INVALID ) { - mbAutoPopup = FALSE; // do not open menu when activated by focus handling like taskpane cycling - ChangeHighlightItem( 0, FALSE ); + mbAutoPopup = sal_False; // do not open menu when activated by focus handling like taskpane cycling + ChangeHighlightItem( 0, sal_False ); } } @@ -5991,13 +6054,13 @@ void MenuBarWindow::GetFocus() return xAcc; } -USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, USHORT i_nPos ) +sal_uInt16 MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLink, const String& i_rToolTip, sal_uInt16 i_nPos ) { // find first free button id - USHORT nId = IID_DOCUMENTCLOSE; - std::map< USHORT, AddButtonEntry >::const_iterator it; + sal_uInt16 nId = IID_DOCUMENTCLOSE; + std::map< sal_uInt16, AddButtonEntry >::const_iterator it; if( i_nPos > m_aAddButtons.size() ) - i_nPos = static_cast<USHORT>(m_aAddButtons.size()); + i_nPos = static_cast<sal_uInt16>(m_aAddButtons.size()); do { nId++; @@ -6020,14 +6083,14 @@ USHORT MenuBarWindow::AddMenuBarButton( const Image& i_rImage, const Link& i_rLi return nId; } -void MenuBarWindow::SetMenuBarButtonHighlightHdl( USHORT nId, const Link& rLink ) +void MenuBarWindow::SetMenuBarButtonHighlightHdl( sal_uInt16 nId, const Link& rLink ) { - std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( nId ); + std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( nId ); if( it != m_aAddButtons.end() ) it->second.m_aHighlightLink = rLink; } -Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId ) +Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( sal_uInt16 nId ) { Rectangle aRect; if( m_aAddButtons.find( nId ) != m_aAddButtons.end() ) @@ -6052,9 +6115,9 @@ Rectangle MenuBarWindow::GetMenuBarButtonRectPixel( USHORT nId ) return aRect; } -void MenuBarWindow::RemoveMenuBarButton( USHORT nId ) +void MenuBarWindow::RemoveMenuBarButton( sal_uInt16 nId ) { - USHORT nPos = aCloser.GetItemPos( nId ); + sal_uInt16 nPos = aCloser.GetItemPos( nId ); aCloser.RemoveItem( nPos ); m_aAddButtons.erase( nId ); aCloser.calcMinSize(); @@ -6064,9 +6127,9 @@ void MenuBarWindow::RemoveMenuBarButton( USHORT nId ) pMenu->mpSalMenu->RemoveMenuBarButton( nId ); } -bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId ) +bool MenuBarWindow::HandleMenuButtonEvent( sal_uInt16 i_nButtonId ) { - std::map< USHORT, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId ); + std::map< sal_uInt16, AddButtonEntry >::iterator it = m_aAddButtons.find( i_nButtonId ); if( it != m_aAddButtons.end() ) { MenuBar::MenuBarButtonCallbackArg aArg; @@ -6075,7 +6138,7 @@ bool MenuBarWindow::HandleMenuButtonEvent( USHORT i_nButtonId ) aArg.pMenuBar = dynamic_cast<MenuBar*>(pMenu); return it->second.m_aSelectLink.Call( &aArg ); } - return FALSE; + return sal_False; } ImplMenuDelData::ImplMenuDelData( const Menu* pMenu ) diff --git a/vcl/source/window/mnemonic.cxx b/vcl/source/window/mnemonic.cxx index 3b61abb81bee..ca8bcf3c2917 100644 --- a/vcl/source/window/mnemonic.cxx +++ b/vcl/source/window/mnemonic.cxx @@ -49,9 +49,9 @@ MnemonicGenerator::MnemonicGenerator() // ----------------------------------------------------------------------- -USHORT MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c ) +sal_uInt16 MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c ) { - static USHORT const aImplMnemonicRangeTab[MNEMONIC_RANGES*2] = + static sal_uInt16 const aImplMnemonicRangeTab[MNEMONIC_RANGES*2] = { MNEMONIC_RANGE_1_START, MNEMONIC_RANGE_1_END, MNEMONIC_RANGE_2_START, MNEMONIC_RANGE_2_END, @@ -59,8 +59,8 @@ USHORT MnemonicGenerator::ImplGetMnemonicIndex( sal_Unicode c ) MNEMONIC_RANGE_4_START, MNEMONIC_RANGE_4_END }; - USHORT nMnemonicIndex = 0; - for ( USHORT i = 0; i < MNEMONIC_RANGES; i++ ) + sal_uInt16 nMnemonicIndex = 0; + for ( sal_uInt16 i = 0; i < MNEMONIC_RANGES; i++ ) { if ( (c >= aImplMnemonicRangeTab[i*2]) && (c <= aImplMnemonicRangeTab[i*2+1]) ) @@ -107,7 +107,7 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey ) sal_Unicode cMnemonic = ImplFindMnemonic( aKey ); if ( cMnemonic ) { - USHORT nMnemonicIndex = ImplGetMnemonicIndex( cMnemonic ); + sal_uInt16 nMnemonicIndex = ImplGetMnemonicIndex( cMnemonic ); if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND ) maMnemonics[nMnemonicIndex] = 0; } @@ -119,7 +119,7 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey ) { sal_Unicode c = aKey.GetChar( nIndex ); - USHORT nMnemonicIndex = ImplGetMnemonicIndex( c ); + sal_uInt16 nMnemonicIndex = ImplGetMnemonicIndex( c ); if ( nMnemonicIndex != MNEMONIC_INDEX_NOTFOUND ) { if ( maMnemonics[nMnemonicIndex] && (maMnemonics[nMnemonicIndex] < 0xFF) ) @@ -133,24 +133,24 @@ void MnemonicGenerator::RegisterMnemonic( const XubString& rKey ) // ----------------------------------------------------------------------- -BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) +sal_Bool MnemonicGenerator::CreateMnemonic( XubString& rKey ) { if ( !rKey.Len() || ImplFindMnemonic( rKey ) ) - return FALSE; + return sal_False; const ::com::sun::star::lang::Locale& rLocale = Application::GetSettings().GetUILocale(); uno::Reference < i18n::XCharacterClassification > xCharClass = GetCharClass(); // Don't crash even when we don't have access to i18n service if ( !xCharClass.is() ) - return FALSE; + return sal_False; XubString aKey = xCharClass->toUpper( rKey, 0, rKey.Len(), rLocale ); - BOOL bChanged = FALSE; + sal_Bool bChanged = sal_False; xub_StrLen nLen = aKey.Len(); - BOOL bCJK = FALSE; + sal_Bool bCJK = sal_False; switch( Application::GetSettings().GetUILanguage() ) { case LANGUAGE_JAPANESE: @@ -161,7 +161,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) case LANGUAGE_CHINESE_MACAU: case LANGUAGE_KOREAN: case LANGUAGE_KOREAN_JOHAB: - bCJK = TRUE; + bCJK = sal_True; break; default: break; @@ -173,8 +173,8 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) // #110720#, avoid CJK-style mnemonics for latin-only strings that do not contain useful mnemonic chars if( bCJK ) { - BOOL bLatinOnly = TRUE; - BOOL bMnemonicIndexFound = FALSE; + sal_Bool bLatinOnly = sal_True; + sal_Bool bMnemonicIndexFound = sal_False; sal_Unicode c; xub_StrLen nIndex; @@ -184,19 +184,19 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) if ( ((c >= 0x3000) && (c <= 0xD7FF)) || // cjk ((c >= 0xFF61) && (c <= 0xFFDC)) ) // halfwidth forms { - bLatinOnly = FALSE; + bLatinOnly = sal_False; break; } if( ImplGetMnemonicIndex( c ) != MNEMONIC_INDEX_NOTFOUND ) - bMnemonicIndexFound = TRUE; + bMnemonicIndexFound = sal_True; } if( bLatinOnly && !bMnemonicIndexFound ) - return FALSE; + return sal_False; } int nCJK = 0; - USHORT nMnemonicIndex; + sal_uInt16 nMnemonicIndex; sal_Unicode c; xub_StrLen nIndex = 0; if( !bCJK ) @@ -226,7 +226,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) { maMnemonics[nMnemonicIndex] = 0; rKey.Insert( MNEMONIC_CHAR, nIndex ); - bChanged = TRUE; + bChanged = sal_True; break; } } @@ -247,8 +247,8 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) // 2) search for a unique/uncommon character if ( !bChanged ) { - USHORT nBestCount = 0xFFFF; - USHORT nBestMnemonicIndex = 0; + sal_uInt16 nBestCount = 0xFFFF; + sal_uInt16 nBestMnemonicIndex = 0; xub_StrLen nBestIndex = 0; nIndex = 0; do @@ -278,7 +278,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) { maMnemonics[nBestMnemonicIndex] = 0; rKey.Insert( MNEMONIC_CHAR, nBestIndex ); - bChanged = TRUE; + bChanged = sal_True; } } } @@ -326,7 +326,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) nIndex--; } rKey.Insert( aStr, nIndex ); - bChanged = TRUE; + bChanged = sal_True; break; } } @@ -351,7 +351,7 @@ BOOL MnemonicGenerator::CreateMnemonic( XubString& rKey ) // { // maMnemonics[nMnemonicIndex] = 0; // rKey.Insert( MNEMONIC_CHAR, nIndex ); -// bChanged = TRUE; +// bChanged = sal_True; // break; // } // diff --git a/vcl/source/window/mnemonicengine.cxx b/vcl/source/window/mnemonicengine.cxx index f76c29e5ba9c..1ca9f2c22d57 100644 --- a/vcl/source/window/mnemonicengine.cxx +++ b/vcl/source/window/mnemonicengine.cxx @@ -103,7 +103,7 @@ namespace vcl //-------------------------------------------------------------------- bool MnemonicEngine::HandleKeyEvent( const KeyEvent& _rKEvt ) { - BOOL bAccelKey = _rKEvt.GetKeyCode().IsMod2(); + sal_Bool bAccelKey = _rKEvt.GetKeyCode().IsMod2(); if ( !bAccelKey ) return false; diff --git a/vcl/source/window/mouseevent.cxx b/vcl/source/window/mouseevent.cxx index 4dbb7385f94f..2e76750e1cf5 100644 --- a/vcl/source/window/mouseevent.cxx +++ b/vcl/source/window/mouseevent.cxx @@ -39,7 +39,7 @@ MouseEvent::MouseEvent( const ::com::sun::star::awt::MouseEvent& rEvent ) : maPos( rEvent.X, rEvent.Y ) , mnMode( 0 ) -, mnClicks( static_cast< USHORT >( rEvent.ClickCount ) ) +, mnClicks( static_cast< sal_uInt16 >( rEvent.ClickCount ) ) , mnCode( 0 ) { if( rEvent.Modifiers ) diff --git a/vcl/source/window/msgbox.cxx b/vcl/source/window/msgbox.cxx index 07eafcac357a..ae4c148d5807 100644 --- a/vcl/source/window/msgbox.cxx +++ b/vcl/source/window/msgbox.cxx @@ -70,10 +70,10 @@ void MessBox::ImplInitMessBoxData() mpFixedText = NULL; mpFixedImage = NULL; mnSoundType = 0; - mbHelpBtn = FALSE; - mbSound = TRUE; + mbHelpBtn = sal_False; + mbSound = sal_True; mpCheckBox = NULL; - mbCheck = FALSE; + mbCheck = sal_False; } // ----------------------------------------------------------------------- @@ -81,11 +81,11 @@ void MessBox::ImplInitMessBoxData() void MessBox::ImplInitButtons() { WinBits nStyle = GetStyle(); - USHORT nOKFlags = BUTTONDIALOG_OKBUTTON; - USHORT nCancelFlags = BUTTONDIALOG_CANCELBUTTON; - USHORT nRetryFlags = 0; - USHORT nYesFlags = 0; - USHORT nNoFlags = 0; + sal_uInt16 nOKFlags = BUTTONDIALOG_OKBUTTON; + sal_uInt16 nCancelFlags = BUTTONDIALOG_CANCELBUTTON; + sal_uInt16 nRetryFlags = 0; + sal_uInt16 nYesFlags = 0; + sal_uInt16 nNoFlags = 0; if ( nStyle & WB_OK_CANCEL ) { @@ -133,8 +133,8 @@ void MessBox::ImplInitButtons() } else if ( nStyle & WB_ABORT_RETRY_IGNORE ) { - USHORT nAbortFlags = 0; - USHORT nIgnoreFlags = 0; + sal_uInt16 nAbortFlags = 0; + sal_uInt16 nIgnoreFlags = 0; if ( nStyle & WB_DEF_CANCEL ) nAbortFlags |= BUTTONDIALOG_DEFBUTTON | BUTTONDIALOG_FOCUSBUTTON; @@ -186,16 +186,15 @@ MessBox::MessBox( Window* pParent, const ResId& rResId ) : ImplInitMessBoxData(); GetRes( rResId.SetRT( RSC_MESSBOX ) ); - USHORT nHiButtons = ReadShortRes(); - USHORT nLoButtons = ReadShortRes(); - USHORT nHiDefButton = ReadShortRes(); - USHORT nLoDefButton = ReadShortRes(); - USHORT nHiHelpId = ReadShortRes(); - USHORT nLoHelpId = ReadShortRes(); - /* USHORT bSysModal = */ ReadShortRes(); - SetHelpId( ((ULONG)nHiHelpId << 16) + nLoHelpId ); - WinBits nBits = (((ULONG)nHiButtons << 16) + nLoButtons) | - (((ULONG)nHiDefButton << 16) + nLoDefButton); + sal_uInt16 nHiButtons = ReadShortRes(); + sal_uInt16 nLoButtons = ReadShortRes(); + sal_uInt16 nHiDefButton = ReadShortRes(); + sal_uInt16 nLoDefButton = ReadShortRes(); + rtl::OString aHelpId( ReadByteStringRes() ); + /* sal_uInt16 bSysModal = */ ReadShortRes(); + SetHelpId( aHelpId ); + WinBits nBits = (((sal_uLong)nHiButtons << 16) + nLoButtons) | + (((sal_uLong)nHiDefButton << 16) + nLoDefButton); ImplInit( pParent, nBits | WB_MOVEABLE | WB_HORZ | WB_CENTER ); ImplLoadRes( rResId ); @@ -227,12 +226,12 @@ MessBox::~MessBox() void MessBox::ImplPosControls() { - if ( GetHelpId() ) + if ( GetHelpId().getLength() ) { if ( !mbHelpBtn ) { AddButton( BUTTON_HELP, BUTTONID_HELP, BUTTONDIALOG_HELPBUTTON, 3 ); - mbHelpBtn = TRUE; + mbHelpBtn = sal_True; } } else @@ -240,7 +239,7 @@ void MessBox::ImplPosControls() if ( mbHelpBtn ) { RemoveButton( BUTTONID_HELP ); - mbHelpBtn = FALSE; + mbHelpBtn = sal_False; } } @@ -258,7 +257,7 @@ void MessBox::ImplPosControls() long nMaxLineWidth; long nWidth; WinBits nWinStyle = WB_LEFT | WB_WORDBREAK | WB_NOLABEL | WB_INFO; - USHORT nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT; + sal_uInt16 nTextStyle = TEXT_DRAW_MULTILINE | TEXT_DRAW_TOP | TEXT_DRAW_LEFT; if ( mpFixedText ) delete mpFixedText; @@ -277,7 +276,7 @@ void MessBox::ImplPosControls() // Message-Text um Tabs bereinigen XubString aTabStr( RTL_CONSTASCII_USTRINGPARAM( " " ) ); - USHORT nIndex = 0; + sal_uInt16 nIndex = 0; while ( nIndex != STRING_NOTFOUND ) nIndex = aMessText.SearchAndReplace( '\t', aTabStr, nIndex ); @@ -414,6 +413,8 @@ void MessBox::ImplPosControls() } mpFixedText = new FixedText( this, nWinStyle ); + if( mpFixedText->GetStyle() & WB_EXTRAOFFSET ) // TODO: use CalcMinimumSize() instead + aFixedSize.Width() += 2; mpFixedText->SetPosSizePixel( aTextPos, aFixedSize ); mpFixedText->SetText( aMessText ); mpFixedText->Show(); @@ -435,14 +436,14 @@ void MessBox::StateChanged( StateChangedType nType ) // ----------------------------------------------------------------------- -BOOL MessBox::GetCheckBoxState() const +sal_Bool MessBox::GetCheckBoxState() const { return mpCheckBox ? mpCheckBox->IsChecked() : mbCheck; } // ----------------------------------------------------------------------- -void MessBox::SetCheckBoxState( BOOL bCheck ) +void MessBox::SetCheckBoxState( sal_Bool bCheck ) { if( mpCheckBox ) mpCheckBox->Check( bCheck ); mbCheck = bCheck; @@ -459,10 +460,10 @@ void MessBox::SetDefaultCheckBoxText() // ----------------------------------------------------------------------- -BOOL MessBox::SetModeImage( const Image& rImage ) +sal_Bool MessBox::SetModeImage( const Image& rImage ) { SetImage( rImage ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -494,7 +495,7 @@ void InfoBox::ImplInitInfoBoxData() SetText( Application::GetDisplayName() ); SetImage( InfoBox::GetStandardImage() ); - mnSoundType = ((USHORT)SOUND_INFO)+1; + mnSoundType = ((sal_uInt16)SOUND_INFO)+1; } // ----------------------------------------------------------------------- @@ -530,7 +531,7 @@ void WarningBox::ImplInitWarningBoxData() SetText( Application::GetDisplayName() ); SetImage( WarningBox::GetStandardImage() ); - mnSoundType = ((USHORT)SOUND_WARNING)+1; + mnSoundType = ((sal_uInt16)SOUND_WARNING)+1; } // ----------------------------------------------------------------------- @@ -576,7 +577,7 @@ void ErrorBox::ImplInitErrorBoxData() SetText( Application::GetDisplayName() ); SetImage( ErrorBox::GetStandardImage() ); - mnSoundType = ((USHORT)SOUND_ERROR)+1; + mnSoundType = ((sal_uInt16)SOUND_ERROR)+1; } // ----------------------------------------------------------------------- @@ -613,7 +614,7 @@ void QueryBox::ImplInitQueryBoxData() SetText( Application::GetDisplayName() ); SetImage( QueryBox::GetStandardImage() ); - mnSoundType = ((USHORT)SOUND_QUERY)+1; + mnSoundType = ((sal_uInt16)SOUND_QUERY)+1; } // ----------------------------------------------------------------------- diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 4932b689a9c2..40b80e234ff3 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -47,7 +47,7 @@ #include "unotools/localedatawrapper.hxx" -#include "rtl/ustrbuf.hxx" +#include "rtl/strbuf.hxx" #include "com/sun/star/lang/XMultiServiceFactory.hpp" #include "com/sun/star/container/XNameAccess.hpp" @@ -61,19 +61,23 @@ using namespace com::sun::star::lang; using namespace com::sun::star::container; using namespace com::sun::star::beans; -#define HELPID_PREFIX ".HelpId:vcl:PrintDialog" -#define SMHID2( a, b ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ":" b ) ), HID_PRINTDLG ) ) -#define SMHID1( a ) SetSmartHelpId( SmartId( String( RTL_CONSTASCII_USTRINGPARAM( HELPID_PREFIX ":" a ) ), HID_PRINTDLG ) ) - PrintDialog::PrintPreviewWindow::PrintPreviewWindow( Window* i_pParent, const ResId& i_rId ) : Window( i_pParent, i_rId ) , maOrigSize( 10, 10 ) , maPageVDev( *this ) , maToolTipString( String( VclResId( SV_PRINT_PRINTPREVIEW_TXT ) ) ) + , mbGreyscale( false ) + , maHorzDim( this, WB_HORZ | WB_CENTER ) + , maVertDim( this, WB_VERT | WB_VCENTER ) { - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); SetBackground(); maPageVDev.SetBackground( Color( COL_WHITE ) ); + maHorzDim.Show(); + maVertDim.Show(); + + maHorzDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) ); + maVertDim.SetText( String( RTL_CONSTASCII_USTRINGPARAM( "2.0in" ) ) ); } PrintDialog::PrintPreviewWindow::~PrintPreviewWindow() @@ -93,9 +97,10 @@ void PrintDialog::PrintPreviewWindow::DataChanged( const DataChangedEvent& i_rDC void PrintDialog::PrintPreviewWindow::Resize() { Size aNewSize( GetSizePixel() ); + long nTextHeight = maHorzDim.GetTextHeight(); // leave small space for decoration - aNewSize.Width() -= 2; - aNewSize.Height() -= 2; + aNewSize.Width() -= nTextHeight + 2; + aNewSize.Height() -= nTextHeight + 2; Size aScaledSize; double fScale = 1.0; @@ -136,17 +141,29 @@ void PrintDialog::PrintPreviewWindow::Resize() fZoom /= 2.0; } - maPageVDev.SetOutputSizePixel( aScaledSize, FALSE ); + maPageVDev.SetOutputSizePixel( aScaledSize, sal_False ); + + // position dimension lines + Point aRef( nTextHeight + (aNewSize.Width() - maPreviewSize.Width())/2, + nTextHeight + (aNewSize.Height() - maPreviewSize.Height())/2 ); + maHorzDim.SetPosSizePixel( Point( aRef.X(), aRef.Y() - nTextHeight ), + Size( maPreviewSize.Width(), nTextHeight ) ); + maVertDim.SetPosSizePixel( Point( aRef.X() - nTextHeight, aRef.Y() ), + Size( nTextHeight, maPreviewSize.Height() ) ); + } void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) { + long nTextHeight = maHorzDim.GetTextHeight(); Size aSize( GetSizePixel() ); + aSize.Width() -= nTextHeight; + aSize.Height() -= nTextHeight; if( maReplacementString.getLength() != 0 ) { // replacement is active Push(); - Rectangle aTextRect( Point( 0, 0 ), aSize ); + Rectangle aTextRect( Point( nTextHeight, nTextHeight ), aSize ); DecorationView aVw( this ); aVw.DrawFrame( aTextRect, FRAME_DRAW_GROUP ); aTextRect.Left() += 2; @@ -164,8 +181,8 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) { GDIMetaFile aMtf( maMtf ); - Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2, - (aSize.Height() - maPreviewSize.Height()) / 2 ); + Point aOffset( (aSize.Width() - maPreviewSize.Width()) / 2 + nTextHeight, + (aSize.Height() - maPreviewSize.Height()) / 2 + nTextHeight ); Size aVDevSize( maPageVDev.GetOutputSizePixel() ); const Size aLogicSize( maPageVDev.PixelToLogic( aVDevSize, MapMode( MAP_100TH_MM ) ) ); @@ -180,6 +197,11 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) maPageVDev.Erase(); maPageVDev.Push(); maPageVDev.SetMapMode( MAP_100TH_MM ); + sal_uLong nOldDrawMode = maPageVDev.GetDrawMode(); + if( mbGreyscale ) + maPageVDev.SetDrawMode( maPageVDev.GetDrawMode() | + ( DRAWMODE_GRAYLINE | DRAWMODE_GRAYFILL | DRAWMODE_GRAYTEXT | + DRAWMODE_GRAYBITMAP | DRAWMODE_GRAYGRADIENT ) ); aMtf.WindStart(); aMtf.Scale( fScale, fScale ); aMtf.WindStart(); @@ -189,6 +211,7 @@ void PrintDialog::PrintPreviewWindow::Paint( const Rectangle& ) SetMapMode( MAP_PIXEL ); maPageVDev.SetMapMode( MAP_PIXEL ); DrawOutDev( aOffset, maPreviewSize, Point( 0, 0 ), aVDevSize, maPageVDev ); + maPageVDev.SetDrawMode( nOldDrawMode ); DecorationView aVw( this ); Rectangle aFrame( aOffset + Point( -1, -1 ), Size( maPreviewSize.Width() + 2, maPreviewSize.Height() + 2 ) ); @@ -218,27 +241,50 @@ void PrintDialog::PrintPreviewWindow::Command( const CommandEvent& rEvt ) void PrintDialog::PrintPreviewWindow::setPreview( const GDIMetaFile& i_rNewPreview, const Size& i_rOrigSize, + const rtl::OUString& i_rPaperName, const rtl::OUString& i_rReplacement, sal_Int32 i_nDPIX, - sal_Int32 i_nDPIY + sal_Int32 i_nDPIY, + bool i_bGreyscale ) { rtl::OUStringBuffer aBuf( 256 ); aBuf.append( maToolTipString ); - #if OSL_DEBUG_LEVEL > 0 - aBuf.appendAscii( "\n---\nPageSize: " ); - aBuf.append( sal_Int32( i_rOrigSize.Width()/100) ); - aBuf.appendAscii( "mm x " ); - aBuf.append( sal_Int32( i_rOrigSize.Height()/100) ); - aBuf.appendAscii( "mm" ); - #endif SetQuickHelpText( aBuf.makeStringAndClear() ); maMtf = i_rNewPreview; maOrigSize = i_rOrigSize; maReplacementString = i_rReplacement; + mbGreyscale = i_bGreyscale; maPageVDev.SetReferenceDevice( i_nDPIX, i_nDPIY ); - maPageVDev.EnableOutput( TRUE ); + maPageVDev.EnableOutput( sal_True ); + + // use correct measurements + const LocaleDataWrapper& rLocWrap( GetSettings().GetLocaleDataWrapper() ); + MapUnit eUnit = MAP_MM; + int nDigits = 0; + if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US ) + { + eUnit = MAP_100TH_INCH; + nDigits = 2; + } + Size aLogicPaperSize( LogicToLogic( i_rOrigSize, MapMode( MAP_100TH_MM ), MapMode( eUnit ) ) ); + String aNumText( rLocWrap.getNum( aLogicPaperSize.Width(), nDigits ) ); + aBuf.append( aNumText ); + aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" ); + if( i_rPaperName.getLength() ) + { + aBuf.appendAscii( " (" ); + aBuf.append( i_rPaperName ); + aBuf.append( sal_Unicode(')') ); + } + maHorzDim.SetText( aBuf.makeStringAndClear() ); + + aNumText = rLocWrap.getNum( aLogicPaperSize.Height(), nDigits ); + aBuf.append( aNumText ); + aBuf.appendAscii( eUnit == MAP_MM ? "mm" : "in" ); + maVertDim.SetText( aBuf.makeStringAndClear() ); + Resize(); Invalidate(); } @@ -291,12 +337,18 @@ void PrintDialog::ShowNupOrderWindow::Paint( const Rectangle& i_rRect ) int nX = 0, nY = 0; switch( mnOrderMode ) { - case SV_PRINT_PRT_NUP_ORDER_LRTD: + case SV_PRINT_PRT_NUP_ORDER_LRTB: nX = (i % mnColumns); nY = (i / mnColumns); break; - case SV_PRINT_PRT_NUP_ORDER_TDLR: + case SV_PRINT_PRT_NUP_ORDER_TBLR: nX = (i / mnRows); nY = (i % mnRows); break; + case SV_PRINT_PRT_NUP_ORDER_RLTB: + nX = mnColumns - 1 - (i % mnColumns); nY = (i / mnColumns); + break; + case SV_PRINT_PRT_NUP_ORDER_TBRL: + nX = mnColumns - 1 - (i / mnRows); nY = (i % mnRows); + break; } Size aTextSize( GetTextWidth( aPageText ), nTextHeight ); int nDeltaX = (aSubSize.Width() - aTextSize.Width()) / 2; @@ -336,13 +388,13 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId ) FreeResource(); maNupOrderWin.Show(); - maPagesBtn.Check( TRUE ); - maBrochureBtn.Show( FALSE ); + maPagesBtn.Check( sal_True ); + maBrochureBtn.Show( sal_False ); // setup field units for metric fields const LocaleDataWrapper& rLocWrap( maPageMarginEdt.GetLocaleDataWrapper() ); FieldUnit eUnit = FUNIT_MM; - USHORT nDigits = 0; + sal_uInt16 nDigits = 0; if( rLocWrap.getMeasurementSystemEnum() == MEASURE_US ) { eUnit = FUNIT_INCH; @@ -356,28 +408,6 @@ PrintDialog::NUpTabPage::NUpTabPage( Window* i_pParent, const ResId& rResId ) maPageMarginEdt.SetDecimalDigits( nDigits ); maSheetMarginEdt.SetDecimalDigits( nDigits ); - SMHID1( "NUpPage" ); - maNupLine.SMHID2("NUpPage", "Layout"); - maBrochureBtn.SMHID2("NUpPage", "Brochure" ); - maPagesBtn.SMHID2( "NUpPage", "PagesPerSheet" ); - maPagesBoxTitleTxt.SMHID2( "NUpPage", "PagesPerSheetLabel" ); - maNupPagesBox.SMHID2( "NUpPage", "PagesPerSheetBox" ); - maNupNumPagesTxt.SMHID2( "NUpPage", "Columns" ); - maNupColEdt.SMHID2( "NUpPage", "ColumnsBox" ); - maNupTimesTxt.SMHID2( "NUpPage", "Rows" ); - maNupRowsEdt.SMHID2( "NUpPage", "RowsBox" ); - maPageMarginTxt1.SMHID2( "NUpPage", "PageMargin" ); - maPageMarginEdt.SMHID2( "NUpPage", "PageMarginBox" ); - maPageMarginTxt2.SMHID2( "NUpPage", "PageMarginCont" ); - maSheetMarginTxt1.SMHID2( "NUpPage", "SheetMargin" ); - maSheetMarginEdt.SMHID2( "NUpPage", "SheetMarginBox" ); - maSheetMarginTxt2.SMHID2( "NUpPage", "SheetMarginCont" ); - maNupOrientationTxt.SMHID2( "NUpPage", "Orientation" ); - maNupOrientationBox.SMHID2( "NUpPage", "OrientationBox" ); - maNupOrderTxt.SMHID2( "NUpPage", "Order" ); - maNupOrderBox.SMHID2( "NUpPage", "OrderBox" ); - maBorderCB.SMHID2( "NUpPage", "BorderBox" ); - setupLayout(); } @@ -387,7 +417,7 @@ PrintDialog::NUpTabPage::~NUpTabPage() void PrintDialog::NUpTabPage::enableNupControls( bool bEnable ) { - maNupPagesBox.Enable( TRUE ); + maNupPagesBox.Enable( sal_True ); maNupNumPagesTxt.Enable( bEnable ); maNupColEdt.Enable( bEnable ); maNupTimesTxt.Enable( bEnable ); @@ -420,22 +450,21 @@ void PrintDialog::NUpTabPage::showAdvancedControls( bool i_bShow ) maSheetMarginTxt2.Show( i_bShow ); maNupOrientationTxt.Show( i_bShow ); maNupOrientationBox.Show( i_bShow ); - maLayout.resize(); + getLayout()->resize(); } void PrintDialog::NUpTabPage::setupLayout() { + boost::shared_ptr<vcl::RowOrColumn> xLayout = + boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); Size aBorder( LogicToPixel( Size( 6, 6 ), MapMode( MAP_APPFONT ) ) ); /* According to OOo style guide, the horizontal indentation of child elements to their parent element should always be 6 map units. */ long nIndent = aBorder.Width(); - maLayout.setParentWindow( this ); - maLayout.setOuterBorder( aBorder.Width() ); - - maLayout.addWindow( &maNupLine ); - boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( &maLayout, false ) ); - maLayout.addChild( xRow ); + xLayout->addWindow( &maNupLine ); + boost::shared_ptr< vcl::RowOrColumn > xRow( new vcl::RowOrColumn( xLayout.get(), false ) ); + xLayout->addChild( xRow ); boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xRow.get() ) ); xRow->addChild( xIndent ); @@ -471,7 +500,7 @@ void PrintDialog::NUpTabPage::setupLayout() xMainCol->addRow( &maNupOrderTxt, &maNupOrderBox, nIndent ); xMainCol->setBorders( xMainCol->addWindow( &maBorderCB ), nIndent, 0, 0, 0 ); - xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, aBorder.Width() ) ) ); + xSpacer.reset( new vcl::Spacer( xMainCol.get(), 0, Size( 10, WindowArranger::getDefaultBorder() ) ) ); xMainCol->addChild( xSpacer ); xRow.reset( new vcl::RowOrColumn( xMainCol.get(), false ) ); @@ -483,11 +512,6 @@ void PrintDialog::NUpTabPage::setupLayout() showAdvancedControls( false ); } -void PrintDialog::NUpTabPage::Resize() -{ - maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetOutputSizePixel() ) ); -} - void PrintDialog::NUpTabPage::initFromMultiPageSetup( const vcl::PrinterController::MultiPageSetup& i_rMPS ) { maSheetMarginEdt.SetValue( maSheetMarginEdt.Normalize( i_rMPS.nLeftMargin ), FUNIT_100TH_MM ); @@ -523,30 +547,13 @@ PrintDialog::JobTabPage::JobTabPage( Window* i_pParent, const ResId& rResId ) , maCopyCountField( this, VclResId( SV_PRINT_COPYCOUNT_FIELD ) ) , maCollateBox( this, VclResId( SV_PRINT_COLLATE ) ) , maCollateImage( this, VclResId( SV_PRINT_COLLATE_IMAGE ) ) + , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) ) , maCollateImg( VclResId( SV_PRINT_COLLATE_IMG ) ) , maNoCollateImg( VclResId( SV_PRINT_NOCOLLATE_IMG ) ) , mnCollateUIMode( 0 ) - , maLayout( NULL, true ) { FreeResource(); - SMHID1( "JobPage" ); - maPrinterFL.SMHID2( "JobPage", "Printer" ); - maPrinters.SMHID2( "JobPage", "PrinterList" ); - maDetailsBtn.SMHID2( "JobPage", "DetailsBtn" ); - maStatusLabel.SMHID2( "JobPage", "StatusLabel" ); - maStatusTxt.SMHID2( "JobPage", "StatusText" ); - maLocationLabel.SMHID2( "JobPage", "LocationLabel" ); - maLocationTxt.SMHID2( "JobPage", "LocationText" ); - maCommentLabel.SMHID2( "JobPage", "CommentLabel" ); - maCommentTxt.SMHID2( "JobPage", "CommentText" ); - maSetupButton.SMHID2( "JobPage", "Properties" ); - maCopies.SMHID2( "JobPage", "CopiesLine" ); - maCopySpacer.SMHID2( "JobPage", "CopySpacer" ); - maCopyCount.SMHID2( "JobPage", "CopiesText" ); - maCopyCountField.SMHID2( "JobPage", "Copies" ); - maCollateBox.SMHID2( "JobPage", "Collate" ); - maCollateImage.SMHID2( "JobPage", "CollateImage" ); maCopySpacer.Show(); maStatusTxt.Show(); @@ -566,39 +573,37 @@ void PrintDialog::JobTabPage::setupLayout() // sets the results of GetOptimalSize in a normal ListBox maPrinters.SetDropDownLineCount( 4 ); - Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); - - maLayout.setParentWindow( this ); - maLayout.setOuterBorder( aBorder.Width() ); + boost::shared_ptr<vcl::RowOrColumn> xLayout = + boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); // add printer fixed line - maLayout.addWindow( &maPrinterFL ); + xLayout->addWindow( &maPrinterFL ); // add print LB - maLayout.addWindow( &maPrinters, 3 ); + xLayout->addWindow( &maPrinters, 3 ); // create a row for details button/text and properties button - boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( &maLayout, false ) ); - maLayout.addChild( xDetRow ); + boost::shared_ptr< vcl::RowOrColumn > xDetRow( new vcl::RowOrColumn( xLayout.get(), false ) ); + xLayout->addChild( xDetRow ); xDetRow->addWindow( &maDetailsBtn ); xDetRow->addChild( new vcl::Spacer( xDetRow.get(), 2 ) ); xDetRow->addWindow( &maSetupButton ); // create an indent for details - boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( &maLayout ) ); - maLayout.addChild( xIndent ); + boost::shared_ptr< vcl::Indenter > xIndent( new vcl::Indenter( xLayout.get() ) ); + xLayout->addChild( xIndent ); // remember details controls mxDetails = xIndent; // create a column for the details - boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get(), aBorder.Height() ) ); + boost::shared_ptr< vcl::LabelColumn > xLabelCol( new vcl::LabelColumn( xIndent.get() ) ); xIndent->setChild( xLabelCol ); xLabelCol->addRow( &maStatusLabel, &maStatusTxt ); xLabelCol->addRow( &maLocationLabel, &maLocationTxt ); xLabelCol->addRow( &maCommentLabel, &maCommentTxt ); // add print range and copies columns - maLayout.addWindow( &maCopies ); - boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( &maLayout, false, aBorder.Width() ) ); - maLayout.addChild( xRangeRow ); + xLayout->addWindow( &maCopies ); + boost::shared_ptr< vcl::RowOrColumn > xRangeRow( new vcl::RowOrColumn( xLayout.get(), false ) ); + xLayout->addChild( xRangeRow ); // create print range and add to range row mxPrintRange.reset( new vcl::RowOrColumn( xRangeRow.get() ) ); @@ -632,8 +637,8 @@ void PrintDialog::JobTabPage::readFromSettings() if( aValue.equalsIgnoreAsciiCaseAscii( "alwaysoff" ) ) { mnCollateUIMode = 1; - maCollateBox.Check( FALSE ); - maCollateBox.Enable( FALSE ); + maCollateBox.Check( sal_False ); + maCollateBox.Enable( sal_False ); } else { @@ -657,24 +662,13 @@ void PrintDialog::JobTabPage::storeToSettings() rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) ); } -void PrintDialog::JobTabPage::Resize() -{ - maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) ); -} - PrintDialog::OutputOptPage::OutputOptPage( Window* i_pParent, const ResId& i_rResId ) : TabPage( i_pParent, i_rResId ) , maOptionsLine( this, VclResId( SV_PRINT_OPT_PRINT_FL ) ) , maToFileBox( this, VclResId( SV_PRINT_OPT_TOFILE ) ) , maCollateSingleJobsBox( this, VclResId( SV_PRINT_OPT_SINGLEJOBS ) ) - , maReverseOrderBox( this, VclResId( SV_PRINT_OPT_REVERSE ) ) { FreeResource(); - SMHID1( "OptPage" ); - maOptionsLine.SMHID2( "OptPage", "Options" ); - maToFileBox.SMHID2( "OptPage", "ToFile" ); - maCollateSingleJobsBox.SMHID2( "OptPage", "SingleJobs" ); - maReverseOrderBox.SMHID2( "OptPage", "Reverse" ); setupLayout(); } @@ -685,20 +679,17 @@ PrintDialog::OutputOptPage::~OutputOptPage() void PrintDialog::OutputOptPage::setupLayout() { - Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); - - maLayout.setParentWindow( this ); - maLayout.setOuterBorder( aBorder.Width() ); + boost::shared_ptr<vcl::RowOrColumn> xLayout = + boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); - maLayout.addWindow( &maOptionsLine ); - boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( &maLayout, aBorder.Width() ) ); - maLayout.addChild( xIndent ); - boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get(), aBorder.Height() ) ); + xLayout->addWindow( &maOptionsLine ); + boost::shared_ptr<vcl::Indenter> xIndent( new vcl::Indenter( xLayout.get(), -1 ) ); + xLayout->addChild( xIndent ); + boost::shared_ptr<vcl::RowOrColumn> xCol( new vcl::RowOrColumn( xIndent.get() ) ); xIndent->setChild( xCol ); mxOptGroup = xCol; xCol->addWindow( &maToFileBox ); xCol->addWindow( &maCollateSingleJobsBox ); - xCol->addWindow( &maReverseOrderBox ); } void PrintDialog::OutputOptPage::readFromSettings() @@ -714,12 +705,6 @@ void PrintDialog::OutputOptPage::storeToSettings() : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("false")) ); } -void PrintDialog::OutputOptPage::Resize() -{ - maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) ); -} - - PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterController>& i_rController ) : ModalDialog( i_pParent, VclResId( SV_DLG_PRINT ) ) , maOKButton( this, VclResId( SV_PRINT_OK ) ) @@ -759,16 +744,14 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont // set symbols on forward and backward button maBackwardBtn.SetSymbol( SYMBOL_PREV ); maForwardBtn.SetSymbol( SYMBOL_NEXT ); - maBackwardBtn.ImplSetSmallSymbol( TRUE ); - maForwardBtn.ImplSetSmallSymbol( TRUE ); + maBackwardBtn.ImplSetSmallSymbol( sal_True ); + maForwardBtn.ImplSetSmallSymbol( sal_True ); maPageStr = maNumPagesText.GetText(); // init reverse print - maOptionsPage.maReverseOrderBox.Check( maPController->getReversePrint() ); + maJobPage.maReverseOrderBox.Check( maPController->getReversePrint() ); - // get the first page - preparePreview( true, true ); // fill printer listbox const std::vector< rtl::OUString >& rQueues( Printer::GetPrinterQueues() ); @@ -800,6 +783,12 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( Printer::GetDefaultPrinterName() ) ) ); } } + // not printing to file + maPController->resetPrinterOptions( false ); + + // get the first page + preparePreview( true, true ); + // update the text fields for the printer updatePrinterText(); @@ -835,7 +824,7 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont maJobPage.maDetailsBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); maNUpPage.maBorderCB.SetClickHdl( LINK( this, PrintDialog, ClickHdl ) ); maOptionsPage.maToFileBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); - maOptionsPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); + maJobPage.maReverseOrderBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); maOptionsPage.maCollateSingleJobsBox.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); maNUpPage.maPagesBtn.SetToggleHdl( LINK( this, PrintDialog, ClickHdl ) ); @@ -887,18 +876,6 @@ PrintDialog::PrintDialog( Window* i_pParent, const boost::shared_ptr<PrinterCont } } - // set HelpIDs - SMHID1( "Dialog" ); - maOKButton.SMHID1( "OK" ); - maCancelButton.SMHID1( "Cancel" ); - maHelpButton.SMHID1( "Help" ); - maPreviewWindow.SMHID1( "Preview" ); - maNumPagesText.SMHID1( "NumPagesText" ); - maPageEdit.SMHID1( "PageEdit" ); - maForwardBtn.SMHID1( "ForwardBtn" ); - maBackwardBtn.SMHID1( "BackwardBtn" ); - maTabCtrl.SMHID1( "TabPages" ); - // append further tab pages if( mbShowLayoutPage ) { @@ -927,13 +904,14 @@ PrintDialog::~PrintDialog() void PrintDialog::setupLayout() { - Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); + boost::shared_ptr<vcl::RowOrColumn> xLayout = + boost::dynamic_pointer_cast<vcl::RowOrColumn>( getLayout() ); + xLayout->setOuterBorder( 0 ); - maLayout.setParentWindow( this ); - boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( &maLayout, false ) ); - size_t nIndex = maLayout.addChild( xPreviewAndTab, 5 ); - maLayout.setBorders( nIndex, aBorder.Width(), aBorder.Width(), aBorder.Width(), 0 ); + boost::shared_ptr< vcl::RowOrColumn > xPreviewAndTab( new vcl::RowOrColumn( xLayout.get(), false ) ); + size_t nIndex = xLayout->addChild( xPreviewAndTab, 5 ); + xLayout->setBorders( nIndex, -1, -1, -1, 0 ); // setup column for preview and sub controls boost::shared_ptr< vcl::RowOrColumn > xPreview( new vcl::RowOrColumn( xPreviewAndTab.get() ) ); @@ -957,12 +935,12 @@ void PrintDialog::setupLayout() xPreviewAndTab->addWindow( &maTabCtrl ); // add the button line - maLayout.addWindow( &maButtonLine ); + xLayout->addWindow( &maButtonLine ); // add the row for the buttons - boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( &maLayout, false ) ); - nIndex = maLayout.addChild( xButtons ); - maLayout.setBorders( nIndex, aBorder.Width(), 0, aBorder.Width(), aBorder.Width() ); + boost::shared_ptr< vcl::RowOrColumn > xButtons( new vcl::RowOrColumn( xLayout.get(), false ) ); + nIndex = xLayout->addChild( xButtons ); + xLayout->setBorders( nIndex, -1, 0, -1, -1 ); Size aMinSize( maCancelButton.GetSizePixel() ); // insert help button @@ -984,10 +962,10 @@ void PrintDialog::readFromSettings() SettingsConfigItem* pItem = SettingsConfigItem::get(); rtl::OUString aValue = pItem->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintDialog" ) ), rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "LastPage" ) ) ); - USHORT nCount = maTabCtrl.GetPageCount(); - for( USHORT i = 0; i < nCount; i++ ) + sal_uInt16 nCount = maTabCtrl.GetPageCount(); + for( sal_uInt16 i = 0; i < nCount; i++ ) { - USHORT nPageId = maTabCtrl.GetPageId( i ); + sal_uInt16 nPageId = maTabCtrl.GetPageId( i ); if( aValue.equals( maTabCtrl.GetPageText( nPageId ) ) ) { maTabCtrl.SelectTabPage( nPageId ); @@ -995,6 +973,11 @@ void PrintDialog::readFromSettings() } } maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); + if( maOptionsPage.maToFileBox.IsChecked() ) + { + maPController->resetPrinterOptions( true ); + preparePreview( true, true ); + } } void PrintDialog::storeToSettings() @@ -1027,7 +1010,7 @@ int PrintDialog::getCopyCount() bool PrintDialog::isCollate() { - return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : FALSE; + return maJobPage.maCopyCountField.GetValue() > 1 ? maJobPage.maCollateBox.IsChecked() : sal_False; } bool PrintDialog::isSingleJobs() @@ -1035,35 +1018,18 @@ bool PrintDialog::isSingleJobs() return maOptionsPage.maCollateSingleJobsBox.IsChecked(); } -static void setSmartId( Window* i_pWindow, const char* i_pType, sal_Int32 i_nId = -1, const rtl::OUString& i_rPropName = rtl::OUString() ) +void setHelpId( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpIds, sal_Int32 i_nIndex ) { - rtl::OUStringBuffer aBuf( 256 ); - aBuf.appendAscii( HELPID_PREFIX ); - if( i_rPropName.getLength() ) - { - aBuf.append( sal_Unicode( ':' ) ); - aBuf.append( i_rPropName ); - } - if( i_pType ) - { - aBuf.append( sal_Unicode( ':' ) ); - aBuf.appendAscii( i_pType ); - } - if( i_nId >= 0 ) - { - aBuf.append( sal_Unicode( ':' ) ); - aBuf.append( i_nId ); - } - i_pWindow->SetSmartHelpId( SmartId( aBuf.makeStringAndClear(), HID_PRINTDLG ) ); + if( i_nIndex >= 0 && i_nIndex < i_rHelpIds.getLength() ) + i_pWindow->SetHelpId( rtl::OUStringToOString( i_rHelpIds.getConstArray()[i_nIndex], RTL_TEXTENCODING_UTF8 ) ); } -static void setHelpText( Window* /*i_pWindow*/, const Sequence< rtl::OUString >& /*i_rHelpTexts*/, sal_Int32 /*i_nIndex*/ ) +static void setHelpText( Window* i_pWindow, const Sequence< rtl::OUString >& i_rHelpTexts, sal_Int32 i_nIndex ) { // without a help text set and the correct smartID, // help texts will be retrieved from the online help system - - // passed help texts for optional UI is used only for native dialogs which currently - // cannot access the same (rather implicit) mechanism + if( i_nIndex >= 0 && i_nIndex < i_rHelpTexts.getLength() ) + i_pWindow->SetHelpText( i_rHelpTexts.getConstArray()[i_nIndex] ); } void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize ) @@ -1076,17 +1042,15 @@ void updateMaxSize( const Size& i_rCheckSize, Size& o_rMaxSize ) void PrintDialog::setupOptionalUI() { - Size aBorder( LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ) ); - - std::vector<vcl::RowOrColumn*> aDynamicColumns; - vcl::RowOrColumn* pCurColumn = 0; + std::vector< boost::shared_ptr<vcl::RowOrColumn> > aDynamicColumns; + boost::shared_ptr< vcl::RowOrColumn > pCurColumn; Window* pCurParent = 0, *pDynamicPageParent = 0; - USHORT nOptPageId = 9, nCurSubGroup = 0; + sal_uInt16 nOptPageId = 9, nCurSubGroup = 0; bool bOnStaticPage = false; bool bSubgroupOnStaticPage = false; - std::multimap< rtl::OUString, vcl::RowOrColumn* > aPropertyToDependencyRowMap; + std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> > aPropertyToDependencyRowMap; const Sequence< PropertyValue >& rOptions( maPController->getUIOptions() ); for( int i = 0; i < rOptions.getLength(); i++ ) @@ -1099,7 +1063,9 @@ void PrintDialog::setupOptionalUI() rtl::OUString aText; rtl::OUString aPropertyName; Sequence< rtl::OUString > aChoices; + Sequence< sal_Bool > aChoicesDisabled; Sequence< rtl::OUString > aHelpTexts; + Sequence< rtl::OUString > aHelpIds; sal_Int64 nMinValue = 0, nMaxValue = 0; sal_Int32 nCurHelpText = 0; rtl::OUString aGroupingHint; @@ -1122,6 +1088,10 @@ void PrintDialog::setupOptionalUI() { rEntry.Value >>= aChoices; } + else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "ChoicesDisabled" ) ) ) + { + rEntry.Value >>= aChoicesDisabled; + } else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Property" ) ) ) { PropertyValue aVal; @@ -1169,6 +1139,18 @@ void PrintDialog::setupOptionalUI() } } } + else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HelpId" ) ) ) + { + if( ! (rEntry.Value >>= aHelpIds ) ) + { + rtl::OUString aHelpId; + if( (rEntry.Value >>= aHelpId) ) + { + aHelpIds.realloc( 1 ); + *aHelpIds.getArray() = aHelpId; + } + } + } else if( rEntry.Name.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "HintNoLayoutPage" ) ) ) { sal_Bool bNoLayoutPage = sal_False; @@ -1190,37 +1172,40 @@ void PrintDialog::setupOptionalUI() { // restore to dynamic pCurParent = pDynamicPageParent; - pCurColumn = aDynamicColumns.empty() ? NULL : aDynamicColumns.back(); + if( ! aDynamicColumns.empty() ) + pCurColumn = aDynamicColumns.back(); + else + pCurColumn.reset(); bOnStaticPage = false; bSubgroupOnStaticPage = false; if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "PrintRange" ) ) ) { - pCurColumn = maJobPage.mxPrintRange.get(); + pCurColumn = maJobPage.mxPrintRange; pCurParent = &maJobPage; // set job page as current parent bOnStaticPage = true; } else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPage" ) ) ) { - pCurColumn = &maOptionsPage.maLayout; + pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maOptionsPage.getLayout()); pCurParent = &maOptionsPage; // set options page as current parent bOnStaticPage = true; } else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "OptionsPageOptGroup" ) ) ) { - pCurColumn = maOptionsPage.mxOptGroup.get(); + pCurColumn = maOptionsPage.mxOptGroup; pCurParent = &maOptionsPage; // set options page as current parent bOnStaticPage = true; } else if( aGroupingHint.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "LayoutPage" ) ) ) { - pCurColumn = &maNUpPage.maLayout; + pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maNUpPage.getLayout()); pCurParent = &maNUpPage; // set layout page as current parent bOnStaticPage = true; } else if( aGroupingHint.getLength() ) { - pCurColumn = &maJobPage.maLayout; + pCurColumn = boost::dynamic_pointer_cast<vcl::RowOrColumn>(maJobPage.getLayout()); pCurParent = &maJobPage; // set job page as current parent bOnStaticPage = true; } @@ -1238,17 +1223,16 @@ void PrintDialog::setupOptionalUI() maTabCtrl.SetTabPage( nOptPageId, pNewGroup ); // set help id - setSmartId( pNewGroup, "TabPage", nOptPageId ); + setHelpId( pNewGroup, aHelpIds, 0 ); // set help text setHelpText( pNewGroup, aHelpTexts, 0 ); // reset subgroup counter nCurSubGroup = 0; - aDynamicColumns.push_back( new vcl::RowOrColumn( NULL, true, aBorder.Width() ) ); + aDynamicColumns.push_back( boost::dynamic_pointer_cast<vcl::RowOrColumn>(pNewGroup->getLayout()) ); pCurColumn = aDynamicColumns.back(); pCurColumn->setParentWindow( pNewGroup ); - pCurColumn->setOuterBorder( aBorder.Width() ); bSubgroupOnStaticPage = false; bOnStaticPage = false; } @@ -1270,7 +1254,7 @@ void PrintDialog::setupOptionalUI() pNewSub->Show(); // set help id - setSmartId( pNewSub, "FixedLine", sal_Int32( nCurSubGroup++ ) ); + setHelpId( pNewSub, aHelpIds, 0 ); // set help text setHelpText( pNewSub, aHelpTexts, 0 ); // add group to current column @@ -1278,10 +1262,10 @@ void PrintDialog::setupOptionalUI() } // add an indent to the current column - vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, aBorder.Width() ); + vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), -1 ); pCurColumn->addChild( pIndent ); // and create a column inside the indent - pCurColumn = new vcl::RowOrColumn( pIndent ); + pCurColumn.reset( new vcl::RowOrColumn( pIndent ) ); pIndent->setChild( pCurColumn ); } // EVIL @@ -1305,17 +1289,17 @@ void PrintDialog::setupOptionalUI() maPropertyToWindowMap[ aPropertyName ].push_back( &maNUpPage.maBrochureBtn ); maControlToPropertyMap[&maNUpPage.maBrochureBtn] = aPropertyName; - aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, maNUpPage.mxBrochureDep.get() ) ); + aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, maNUpPage.mxBrochureDep ) ); } else { - vcl::RowOrColumn* pSaveCurColumn = pCurColumn; + boost::shared_ptr<vcl::RowOrColumn> pSaveCurColumn( pCurColumn ); if( bUseDependencyRow ) { // find the correct dependency row (if any) - std::pair< std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator, - std::multimap< rtl::OUString, vcl::RowOrColumn* >::iterator > aDepRange; + std::pair< std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator, + std::multimap< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >::iterator > aDepRange; aDepRange = aPropertyToDependencyRowMap.equal_range( aDependsOnName ); if( aDepRange.first != aDepRange.second ) { @@ -1350,20 +1334,20 @@ void PrintDialog::setupOptionalUI() maControlToPropertyMap[pNewBox] = aPropertyName; // set help id - setSmartId( pNewBox, "CheckBox", -1, aPropertyName ); + setHelpId( pNewBox, aHelpIds, 0 ); // set help text setHelpText( pNewBox, aHelpTexts, 0 ); - vcl::RowOrColumn* pDependencyRow = new vcl::RowOrColumn( pCurColumn, false ); + boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pCurColumn.get(), false ) ); pCurColumn->addChild( pDependencyRow ); - aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow ) ); + aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) ); // add checkbox to current column pDependencyRow->addWindow( pNewBox ); } else if( aCtrlType.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "Radio" ) ) && pCurParent ) { - vcl::RowOrColumn* pRadioColumn = pCurColumn; + boost::shared_ptr<vcl::RowOrColumn> pRadioColumn( pCurColumn ); if( aText.getLength() ) { // add a FixedText: @@ -1373,16 +1357,17 @@ void PrintDialog::setupOptionalUI() pHeading->Show(); // set help id - setSmartId( pHeading, "FixedText", -1, aPropertyName ); + setHelpId( pHeading, aHelpIds, nCurHelpText ); // set help text - setHelpText( pHeading, aHelpTexts, nCurHelpText++ ); + setHelpText( pHeading, aHelpTexts, nCurHelpText ); + nCurHelpText++; // add fixed text to current column pCurColumn->addWindow( pHeading ); // add an indent to the current column - vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn, 15 ); + vcl::Indenter* pIndent = new vcl::Indenter( pCurColumn.get(), 15 ); pCurColumn->addChild( pIndent ); // and create a column inside the indent - pRadioColumn = new vcl::RowOrColumn( pIndent ); + pRadioColumn.reset( new vcl::RowOrColumn( pIndent ) ); pIndent->setChild( pRadioColumn ); } // iterate options @@ -1392,26 +1377,29 @@ void PrintDialog::setupOptionalUI() pVal->Value >>= nSelectVal; for( sal_Int32 m = 0; m < aChoices.getLength(); m++ ) { - boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn, 1 ) ); + boost::shared_ptr<vcl::LabeledElement> pLabel( new vcl::LabeledElement( pRadioColumn.get(), 1 ) ); pRadioColumn->addChild( pLabel ); boost::shared_ptr<vcl::RowOrColumn> pDependencyRow( new vcl::RowOrColumn( pLabel.get(), false ) ); pLabel->setElement( pDependencyRow ); - aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pDependencyRow.get() ) ); + aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pDependencyRow ) ); RadioButton* pBtn = new RadioButton( pCurParent, m == 0 ? WB_GROUP : 0 ); maControls.push_front( pBtn ); pBtn->SetText( aChoices[m] ); pBtn->Check( m == nSelectVal ); pBtn->SetToggleHdl( LINK( this, PrintDialog, UIOption_RadioHdl ) ); + if( aChoicesDisabled.getLength() > m && aChoicesDisabled[m] == sal_True ) + pBtn->Enable( sal_False ); pBtn->Show(); maPropertyToWindowMap[ aPropertyName ].push_back( pBtn ); maControlToPropertyMap[pBtn] = aPropertyName; maControlToNumValMap[pBtn] = m; // set help id - setSmartId( pBtn, "RadioButton", m, aPropertyName ); + setHelpId( pBtn, aHelpIds, nCurHelpText ); // set help text - setHelpText( pBtn, aHelpTexts, nCurHelpText++ ); + setHelpText( pBtn, aHelpTexts, nCurHelpText ); + nCurHelpText++; // add the radio button to the column pLabel->setLabel( pBtn ); } @@ -1422,9 +1410,9 @@ void PrintDialog::setupOptionalUI() ) && pCurParent ) { // create a row in the current column - vcl::RowOrColumn* pFieldColumn = new vcl::RowOrColumn( pCurColumn, false ); + boost::shared_ptr<vcl::RowOrColumn> pFieldColumn( new vcl::RowOrColumn( pCurColumn.get(), false ) ); pCurColumn->addChild( pFieldColumn ); - aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, vcl::RowOrColumn* >( aPropertyName, pFieldColumn ) ); + aPropertyToDependencyRowMap.insert( std::pair< rtl::OUString, boost::shared_ptr<vcl::RowOrColumn> >( aPropertyName, pFieldColumn ) ); vcl::LabeledElement* pLabel = NULL; if( aText.getLength() ) @@ -1435,11 +1423,9 @@ void PrintDialog::setupOptionalUI() pHeading->SetText( aText ); pHeading->Show(); - // set help id - setSmartId( pHeading, "FixedText", -1, aPropertyName ); // add to row - pLabel = new vcl::LabeledElement( pFieldColumn, 2 ); + pLabel = new vcl::LabeledElement( pFieldColumn.get(), 2 ); pFieldColumn->addChild( pLabel ); pLabel->setLabel( pHeading ); } @@ -1458,13 +1444,13 @@ void PrintDialog::setupOptionalUI() PropertyValue* pVal = maPController->getValue( aPropertyName ); if( pVal && pVal->Value.hasValue() ) pVal->Value >>= nSelectVal; - pList->SelectEntryPos( static_cast<USHORT>(nSelectVal) ); + pList->SelectEntryPos( static_cast<sal_uInt16>(nSelectVal) ); pList->SetSelectHdl( LINK( this, PrintDialog, UIOption_SelectHdl ) ); - pList->SetDropDownLineCount( static_cast<USHORT>(aChoices.getLength()) ); + pList->SetDropDownLineCount( static_cast<sal_uInt16>(aChoices.getLength()) ); pList->Show(); // set help id - setSmartId( pList, "ListBox", -1, aPropertyName ); + setHelpId( pList, aHelpIds, 0 ); // set help text setHelpText( pList, aHelpTexts, 0 ); @@ -1497,7 +1483,7 @@ void PrintDialog::setupOptionalUI() pField->Show(); // set help id - setSmartId( pField, "NumericField", -1, aPropertyName ); + setHelpId( pField, aHelpIds, 0 ); // set help text setHelpText( pField, aHelpTexts, 0 ); @@ -1524,7 +1510,7 @@ void PrintDialog::setupOptionalUI() pField->Show(); // set help id - setSmartId( pField, "Edit", -1, aPropertyName ); + setHelpId( pField, aHelpIds, 0 ); // set help text setHelpText( pField, aHelpTexts, 0 ); @@ -1554,9 +1540,9 @@ void PrintDialog::setupOptionalUI() if( maNUpPage.mxPagesBtnLabel.get() ) { maNUpPage.maPagesBoxTitleTxt.SetText( maNUpPage.maPagesBtn.GetText() ); - maNUpPage.maPagesBoxTitleTxt.Show( TRUE ); + maNUpPage.maPagesBoxTitleTxt.Show( sal_True ); maNUpPage.mxPagesBtnLabel->setLabel( &maNUpPage.maPagesBoxTitleTxt ); - maNUpPage.maPagesBtn.Show( FALSE ); + maNUpPage.maPagesBtn.Show( sal_False ); } } @@ -1567,18 +1553,28 @@ void PrintDialog::setupOptionalUI() if( maJobPage.mxPrintRange->countElements() == 0 ) { maJobPage.mxPrintRange->show( false, false ); - maJobPage.maCopySpacer.Show( FALSE ); + maJobPage.maCopySpacer.Show( sal_False ); + maJobPage.maReverseOrderBox.Show( sal_False ); + } + else + { + // add an indent to the current column + vcl::Indenter* pIndent = new vcl::Indenter( maJobPage.mxPrintRange.get(), -1 ); + maJobPage.mxPrintRange->addChild( pIndent ); + // and create a column inside the indent + pIndent->setWindow( &maJobPage.maReverseOrderBox ); + maJobPage.maReverseOrderBox.Show( sal_True ); } #ifdef WNT // FIXME: the GetNativeControlRegion call on Windows has some issues // (which skew the results of GetOptimalSize()) // however fixing this thoroughly needs to take interaction with paint into - // acoount, making the right fix less simple. Fix this the right way + // account, making the right fix less simple. Fix this the right way // at some point. For now simply add some space at the lowest element - size_t nIndex = maJobPage.maLayout.countElements(); + size_t nIndex = maJobPage.getLayout()->countElements(); if( nIndex > 0 ) // sanity check - maJobPage.maLayout.setBorders( nIndex-1, 0, 0, 0, aBorder.Width() ); + maJobPage.getLayout()->setBorders( nIndex-1, 0, 0, 0, -1 ); #endif // create auto mnemomnics now so they can be calculated in layout @@ -1588,13 +1584,13 @@ void PrintDialog::setupOptionalUI() ImplWindowAutoMnemonic( this ); // calculate job page - Size aMaxSize = maJobPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ); + Size aMaxSize = maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ); // and layout page - updateMaxSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize ); + updateMaxSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize ); // and options page - updateMaxSize( maOptionsPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize ); + updateMaxSize( maOptionsPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ), aMaxSize ); - for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin(); + for( std::vector< boost::shared_ptr<vcl::RowOrColumn> >::iterator it = aDynamicColumns.begin(); it != aDynamicColumns.end(); ++it ) { Size aPageSize( (*it)->getOptimalSize( WINDOWSIZE_PREFERRED ) ); @@ -1622,19 +1618,8 @@ void PrintDialog::setupOptionalUI() maTabCtrl.SetMinimumSizePixel( maTabCtrl.GetSizePixel() ); } - // and finally arrange controls - for( std::vector< vcl::RowOrColumn* >::iterator it = aDynamicColumns.begin(); - it != aDynamicColumns.end(); ++it ) - { - (*it)->setManagedArea( Rectangle( Point(), aTabSize ) ); - delete *it; - *it = NULL; - } - maJobPage.Resize(); - maNUpPage.Resize(); - maOptionsPage.Resize(); + Size aSz = getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ); - Size aSz = maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ); SetOutputSizePixel( aSz ); } @@ -1651,7 +1636,7 @@ void PrintDialog::checkControlDependencies() if( maJobPage.maCopyCountField.GetValue() > 1 ) maJobPage.maCollateBox.Enable( maJobPage.mnCollateUIMode == 0 ); else - maJobPage.maCollateBox.Enable( FALSE ); + maJobPage.maCollateBox.Enable( sal_False ); Image aImg( maJobPage.maCollateBox.IsChecked() ? maJobPage.maCollateImg : maJobPage.maNoCollateImg ); @@ -1660,7 +1645,7 @@ void PrintDialog::checkControlDependencies() // adjust size of image maJobPage.maCollateImage.SetSizePixel( aImgSize ); maJobPage.maCollateImage.SetImage( aImg ); - maJobPage.maLayout.resize(); + maJobPage.getLayout()->resize(); // enable setup button only for printers that can be setup bool bHaveSetup = maPController->getPrinter()->HasSupport( SUPPORT_SETUPDIALOG ); @@ -1675,7 +1660,7 @@ void PrintDialog::checkControlDependencies() aPrinterSize.Width() = aSetupPos.X() - aPrinterPos.X() - LogicToPixel( Size( 5, 5 ), MapMode( MAP_APPFONT ) ).Width(); maJobPage.maPrinters.SetSizePixel( aPrinterSize ); maJobPage.maSetupButton.Show(); - maLayout.resize(); + getLayout()->resize(); } } else @@ -1689,7 +1674,7 @@ void PrintDialog::checkControlDependencies() aPrinterSize.Width() = aSetupPos.X() + aSetupSize.Width() - aPrinterPos.X(); maJobPage.maPrinters.SetSizePixel( aPrinterSize ); maJobPage.maSetupButton.Hide(); - maLayout.resize(); + getLayout()->resize(); } } } @@ -1718,6 +1703,16 @@ void PrintDialog::checkOptionalControlDependencies() } } + if( bShouldbeEnabled && dynamic_cast<RadioButton*>(it->first) ) + { + std::map< Window*, sal_Int32 >::const_iterator r_it = maControlToNumValMap.find( it->first ); + if( r_it != maControlToNumValMap.end() ) + { + bShouldbeEnabled = maPController->isUIChoiceEnabled( it->second, r_it->second ); + } + } + + bool bIsEnabled = it->first->IsEnabled(); // Enable does not do a change check first, so can be less cheap than expected if( bShouldbeEnabled != bIsEnabled ) @@ -1806,8 +1801,11 @@ void PrintDialog::preparePreview( bool i_bNewPage, bool i_bMayUseCache ) } Size aCurPageSize = aPrt->PixelToLogic( aPrt->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ); - maPreviewWindow.setPreview( aMtf, aCurPageSize, nPages > 0 ? rtl::OUString() : maNoPageStr, - aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY() + maPreviewWindow.setPreview( aMtf, aCurPageSize, + aPrt->GetPaperName( false ), + nPages > 0 ? rtl::OUString() : maNoPageStr, + aPrt->ImplGetDPIX(), aPrt->ImplGetDPIY(), + aPrt->GetPrinterOptions().IsConvertToGreyscales() ); maForwardBtn.Enable( mnCurPage < nPages-1 ); @@ -1920,7 +1918,7 @@ void PrintDialog::updateNupFromPages() if( bCustom ) { // see if we have to enlarge the dialog to make the tab page fit - Size aCurSize( maNUpPage.maLayout.getOptimalSize( WINDOWSIZE_PREFERRED ) ); + Size aCurSize( maNUpPage.getLayout()->getOptimalSize( WINDOWSIZE_PREFERRED ) ); Size aTabSize( maTabCtrl.GetTabPageSizePixel() ); if( aTabSize.Height() < aCurSize.Height() ) { @@ -1956,10 +1954,14 @@ void PrintDialog::updateNup() int nOrderMode = int(sal_IntPtr(maNUpPage.maNupOrderBox.GetEntryData( maNUpPage.maNupOrderBox.GetSelectEntryPos() ))); - if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTD ) + if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_LRTB ) aMPS.nOrder = PrinterController::LRTB; - else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TDLR ) + else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBLR ) aMPS.nOrder = PrinterController::TBLR; + else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_RLTB ) + aMPS.nOrder = PrinterController::RLTB; + else if( nOrderMode == SV_PRINT_PRT_NUP_ORDER_TBRL ) + aMPS.nOrder = PrinterController::TBRL; int nOrientationMode = int(sal_IntPtr(maNUpPage.maNupOrientationBox.GetEntryData( maNUpPage.maNupOrientationBox.GetSelectEntryPos() ))); @@ -1994,6 +1996,7 @@ IMPL_LINK( PrintDialog, SelectHdl, ListBox*, pBox ) String aNewPrinter( pBox->GetSelectEntry() ); // set new printer maPController->setPrinter( boost::shared_ptr<Printer>( new Printer( aNewPrinter ) ) ); + maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); // update text fields updatePrinterText(); } @@ -2024,8 +2027,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) Help* pHelp = Application::GetHelp(); if( pHelp ) { - // FIXME: find out proper help URL and use here - pHelp->Start( HID_PRINTDLG, GetParent() ); + pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( ".HelpID:vcl:PrintDialog:OK" ) ), &maOKButton ); } } else if( pButton == &maForwardBtn ) @@ -2039,7 +2041,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) else if( pButton == &maOptionsPage.maToFileBox ) { maOKButton.SetText( maOptionsPage.maToFileBox.IsChecked() ? maPrintToFileText : maPrintText ); - maLayout.resize(); + maPController->resetPrinterOptions( maOptionsPage.maToFileBox.IsChecked() ); + getLayout()->resize(); + preparePreview( true, true ); } else if( pButton == &maNUpPage.maBrochureBtn ) { @@ -2075,7 +2079,7 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) { maDetailsCollapsedSize = GetOutputSizePixel(); // enlarge dialog if necessary - Size aMinSize( maJobPage.maLayout.getOptimalSize( WINDOWSIZE_MINIMUM ) ); + Size aMinSize( maJobPage.getLayout()->getOptimalSize( WINDOWSIZE_MINIMUM ) ); Size aCurSize( maJobPage.GetSizePixel() ); if( aCurSize.Height() < aMinSize.Height() ) { @@ -2104,9 +2108,9 @@ IMPL_LINK( PrintDialog, ClickHdl, Button*, pButton ) makeAny( sal_Bool(isCollate()) ) ); checkControlDependencies(); } - else if( pButton == &maOptionsPage.maReverseOrderBox ) + else if( pButton == &maJobPage.maReverseOrderBox ) { - sal_Bool bChecked = maOptionsPage.maReverseOrderBox.IsChecked(); + sal_Bool bChecked = maJobPage.maReverseOrderBox.IsChecked(); maPController->setReversePrint( bChecked ); maPController->setValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "PrintReverse" ) ), makeAny( bChecked ) ); @@ -2212,7 +2216,7 @@ void PrintDialog::updateWindowFromProperty( const rtl::OUString& i_rProperty ) ListBox* pList = dynamic_cast< ListBox* >( rWindows.front() ); if( pList ) { - pList->SelectEntryPos( static_cast< USHORT >(nVal) ); + pList->SelectEntryPos( static_cast< sal_uInt16 >(nVal) ); } else if( nVal >= 0 && nVal < sal_Int32(rWindows.size() ) ) { @@ -2349,7 +2353,7 @@ void PrintDialog::Command( const CommandEvent& rEvt ) void PrintDialog::Resize() { - maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) ); + // maLayout.setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) ); // and do the preview; however the metafile does not need to be gotten anew preparePreview( false ); @@ -2453,6 +2457,7 @@ void PrintProgressDialog::tick() void PrintProgressDialog::reset() { + mbCanceled = false; setProgress( 0 ); } @@ -2477,9 +2482,9 @@ void PrintProgressDialog::Paint( const Rectangle& ) nOffset, nWidth, mnProgressHeight, - static_cast<USHORT>(0), - static_cast<USHORT>(10000*mnCur/mnMax), - static_cast<USHORT>(10000/nMaxCount), + static_cast<sal_uInt16>(0), + static_cast<sal_uInt16>(10000*mnCur/mnMax), + static_cast<sal_uInt16>(10000/nMaxCount), maProgressRect ); Pop(); diff --git a/vcl/source/window/scrwnd.cxx b/vcl/source/window/scrwnd.cxx index ab4068ac6e3d..588f4d4fa1fa 100644 --- a/vcl/source/window/scrwnd.cxx +++ b/vcl/source/window/scrwnd.cxx @@ -69,12 +69,12 @@ ImplWheelWindow::ImplWheelWindow( Window* pParent ) : DBG_ASSERT( pParent, "ImplWheelWindow::ImplWheelWindow(): Parent not set!" ); const Size aSize( pParent->GetOutputSizePixel() ); - const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags; - const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0; - const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0; + const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags; + const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0; + const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0; // calculate maximum speed distance - mnMaxWidth = (ULONG) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) ); + mnMaxWidth = (sal_uLong) ( 0.4 * hypot( (double) aSize.Width(), aSize.Height() ) ); // create wheel window SetTitleType( FLOATWIN_TITLE_NONE ); @@ -116,7 +116,7 @@ void ImplWheelWindow::ImplStop() { ReleaseMouse(); mpTimer->Stop(); - Show(FALSE); + Show(sal_False); } // ------------------------------------------------------------------------ @@ -148,7 +148,7 @@ void ImplWheelWindow::ImplCreateImageList() // ------------------------------------------------------------------------ -void ImplWheelWindow::ImplSetWheelMode( ULONG nWheelMode ) +void ImplWheelWindow::ImplSetWheelMode( sal_uLong nWheelMode ) { if( nWheelMode != mnWheelMode ) { @@ -173,7 +173,7 @@ void ImplWheelWindow::ImplSetWheelMode( ULONG nWheelMode ) void ImplWheelWindow::ImplDrawWheel() { - USHORT nId; + sal_uInt16 nId; switch( mnWheelMode ) { @@ -201,13 +201,13 @@ void ImplWheelWindow::ImplRecalcScrollValues() } else { - ULONG nCurTime; + sal_uLong nCurTime; // calc current time if( mnMaxWidth ) { const double fExp = ( (double) mnActDist / mnMaxWidth ) * log10( (double) MAX_TIME / MIN_TIME ); - nCurTime = (ULONG) ( MAX_TIME / pow( 10., fExp ) ); + nCurTime = (sal_uLong) ( MAX_TIME / pow( 10., fExp ) ); } else nCurTime = MAX_TIME; @@ -251,9 +251,9 @@ void ImplWheelWindow::ImplRecalcScrollValues() PointerStyle ImplWheelWindow::ImplGetMousePointer( long nDistX, long nDistY ) { PointerStyle eStyle; - const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags; - const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0; - const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0; + const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags; + const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0; + const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0; if( bHorz || bVert ) { @@ -331,13 +331,13 @@ void ImplWheelWindow::MouseMove( const MouseEvent& rMEvt ) const long nDistX = aMousePos.X() - maCenter.X(); const long nDistY = aMousePos.Y() - maCenter.Y(); - mnActDist = (ULONG) hypot( (double) nDistX, nDistY ); + mnActDist = (sal_uLong) hypot( (double) nDistX, nDistY ); const PointerStyle eActStyle = ImplGetMousePointer( nDistX, nDistY ); - const USHORT nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags; - const BOOL bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0; - const BOOL bVert = ( nFlags & AUTOSCROLL_VERT ) != 0; - const BOOL bOuter = mnActDist > WHEEL_RADIUS; + const sal_uInt16 nFlags = ImplGetSVData()->maWinData.mnAutoScrollFlags; + const sal_Bool bHorz = ( nFlags & AUTOSCROLL_HORZ ) != 0; + const sal_Bool bVert = ( nFlags & AUTOSCROLL_VERT ) != 0; + const sal_Bool bOuter = mnActDist > WHEEL_RADIUS; if( bOuter && ( maLastMousePos != aMousePos ) ) { @@ -389,17 +389,17 @@ IMPL_LINK( ImplWheelWindow, ImplScrollHdl, Timer*, EMPTYARG ) const Point aMousePos( pWindow->OutputToScreenPixel( pWindow->GetPointerPosPixel() ) ); Point aCmdMousePos( pWindow->ImplFrameToOutput( aMousePos ) ); CommandScrollData aScrollData( mnActDeltaX, mnActDeltaY ); - CommandEvent aCEvt( aCmdMousePos, COMMAND_AUTOSCROLL, TRUE, &aScrollData ); + CommandEvent aCEvt( aCmdMousePos, COMMAND_AUTOSCROLL, sal_True, &aScrollData ); NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt ); if ( !ImplCallPreNotify( aNCmdEvt ) ) { - const ULONG nTime = Time::GetSystemTicks(); + const sal_uLong nTime = Time::GetSystemTicks(); ImplDelData aDel( this ); pWindow->Command( aCEvt ); if( aDel.IsDead() ) return 0; - mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (ULONG)1 ); + mnRepaintTime = Max( Time::GetSystemTicks() - nTime, (sal_uLong)1 ); ImplRecalcScrollValues(); } } diff --git a/vcl/source/window/scrwnd.hxx b/vcl/source/window/scrwnd.hxx index 0b00d0940059..ccc38c778c99 100644 --- a/vcl/source/window/scrwnd.hxx +++ b/vcl/source/window/scrwnd.hxx @@ -58,12 +58,12 @@ private: Point maLastMousePos; Point maCenter; Timer* mpTimer; - ULONG mnRepaintTime; - ULONG mnTimeout; - ULONG mnWheelMode; - ULONG mnMaxWidth; - ULONG mnActWidth; - ULONG mnActDist; + sal_uLong mnRepaintTime; + sal_uLong mnTimeout; + sal_uLong mnWheelMode; + sal_uLong mnMaxWidth; + sal_uLong mnActWidth; + sal_uLong mnActDist; long mnActDeltaX; long mnActDeltaY; @@ -88,8 +88,8 @@ public: ~ImplWheelWindow(); void ImplStop(); - void ImplSetWheelMode( ULONG nWheelMode ); - ULONG ImplGetWheelMode() const { return mnWheelMode; } + void ImplSetWheelMode( sal_uLong nWheelMode ); + sal_uLong ImplGetWheelMode() const { return mnWheelMode; } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/seleng.cxx b/vcl/source/window/seleng.cxx index 0c0352893a68..b8b6735d81ca 100644 --- a/vcl/source/window/seleng.cxx +++ b/vcl/source/window/seleng.cxx @@ -37,7 +37,7 @@ -inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const +inline sal_Bool SelectionEngine::ShouldDeselect( sal_Bool bModifierKey1 ) const { // return !( eSelMode == MULTIPLE_SELECTION && bModifierKey1 ); return eSelMode != MULTIPLE_SELECTION || !bModifierKey1; @@ -53,7 +53,7 @@ inline BOOL SelectionEngine::ShouldDeselect( BOOL bModifierKey1 ) const *************************************************************************/ SelectionEngine::SelectionEngine( Window* pWindow, FunctionSet* pFuncSet, - ULONG nAutoRepeatInterval ) : + sal_uLong nAutoRepeatInterval ) : pWin( pWindow ), nUpdateInterval( nAutoRepeatInterval ) { @@ -118,7 +118,7 @@ void SelectionEngine::ActivateDragMode() |* *************************************************************************/ -void SelectionEngine::CursorPosChanging( BOOL bShift, BOOL bMod1 ) +void SelectionEngine::CursorPosChanging( sal_Bool bShift, sal_Bool bMod1 ) { if ( !pFunctionSet ) return; @@ -172,19 +172,19 @@ void SelectionEngine::CursorPosChanging( BOOL bShift, BOOL bMod1 ) |* *************************************************************************/ -BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) +sal_Bool SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) { nFlags &= (~SELENG_CMDEVT); if ( !pFunctionSet || !pWin ) - return FALSE; + return sal_False; const bool bRightClickCursorPositioning = rMEvt.IsRight() && rMEvt.GetClicks() == 1 && !IsInSelection(); if ( (rMEvt.GetClicks() > 1 || rMEvt.IsRight()) && !bRightClickCursorPositioning ) - return FALSE; + return sal_False; - USHORT nModifier = rMEvt.GetModifier() | nLockedMods; + sal_uInt16 nModifier = rMEvt.GetModifier() | nLockedMods; if ( nModifier & KEY_MOD2 ) - return FALSE; + return sal_False; // in SingleSelection: Control-Taste filtern (damit auch // mit Ctrl-Click ein D&D gestartet werden kann) if ( nModifier == KEY_MOD1 && eSelMode == SINGLE_SELECTION ) @@ -207,14 +207,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) { case 0: // KEY_NO_KEY { - BOOL bSelAtPoint = pFunctionSet->IsSelectionAtPoint( aPos ); + sal_Bool bSelAtPoint = pFunctionSet->IsSelectionAtPoint( aPos ); nFlags &= (~SELENG_IN_ADD); if ( (nFlags & SELENG_DRG_ENAB) && bSelAtPoint ) { nFlags |= SELENG_WAIT_UPEVT; nFlags &= ~(SELENG_IN_SEL); pWin->ReleaseMouse(); - return TRUE; //auf STARTDRAG-Command-Event warten + return sal_True; //auf STARTDRAG-Command-Event warten } if ( eSelMode != SINGLE_SELECTION ) { @@ -222,14 +222,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) pFunctionSet->DeselectAll(); else pFunctionSet->DestroyAnchor(); - nFlags &= (~SELENG_HAS_ANCH); // bHasAnchor = FALSE; + nFlags &= (~SELENG_HAS_ANCH); // bHasAnchor = sal_False; } pFunctionSet->SetCursorAtPoint( aPos ); // Sonderbehandlung Single-Selection, damit Select+Drag // in einem Zug moeglich ist if (eSelMode == SINGLE_SELECTION && (nFlags & SELENG_DRG_ENAB)) nFlags |= SELENG_WAIT_UPEVT; - return TRUE; + return sal_True; } case KEY_SHIFT: @@ -237,7 +237,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) { pWin->ReleaseMouse(); nFlags &= (~SELENG_IN_SEL); - return FALSE; + return sal_False; } if ( nFlags & SELENG_ADD_ALW ) nFlags |= SELENG_IN_ADD; @@ -252,7 +252,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) nFlags |= SELENG_HAS_ANCH; } pFunctionSet->SetCursorAtPoint( aPos ); - return TRUE; + return sal_True; case KEY_MOD1: // Control nur bei Mehrfachselektion erlaubt @@ -260,7 +260,7 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) { nFlags &= (~SELENG_IN_SEL); pWin->ReleaseMouse(); - return TRUE; // Mausclick verschlucken + return sal_True; // Mausclick verschlucken } if ( nFlags & SELENG_HAS_ANCH ) { @@ -271,32 +271,32 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) if ( pFunctionSet->IsSelectionAtPoint( aPos ) ) { pFunctionSet->DeselectAtPoint( aPos ); - pFunctionSet->SetCursorAtPoint( aPos, TRUE ); + pFunctionSet->SetCursorAtPoint( aPos, sal_True ); } else { pFunctionSet->SetCursorAtPoint( aPos ); } - return TRUE; + return sal_True; case KEY_SHIFT + KEY_MOD1: if ( eSelMode != MULTIPLE_SELECTION ) { pWin->ReleaseMouse(); nFlags &= (~SELENG_IN_SEL); - return FALSE; + return sal_False; } - nFlags |= SELENG_IN_ADD; //bIsInAddMode = TRUE; + nFlags |= SELENG_IN_ADD; //bIsInAddMode = sal_True; if ( !(nFlags & SELENG_HAS_ANCH) ) { pFunctionSet->CreateAnchor(); nFlags |= SELENG_HAS_ANCH; } pFunctionSet->SetCursorAtPoint( aPos ); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } /************************************************************************* @@ -305,14 +305,14 @@ BOOL SelectionEngine::SelMouseButtonDown( const MouseEvent& rMEvt ) |* *************************************************************************/ -BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) +sal_Bool SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) { aWTimer.Stop(); //DbgOut("Up"); if( !pFunctionSet || !pWin ) { nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL); - return FALSE; + return sal_False; } if( !rMEvt.IsRight() ) @@ -325,7 +325,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) { // MouseButtonDown in Sel aber kein CommandEvent eingetrudelt // ==> deselektieren - USHORT nModifier = aLastMove.GetModifier() | nLockedMods; + sal_uInt16 nModifier = aLastMove.GetModifier() | nLockedMods; if( nModifier == KEY_MOD1 || IsAlwaysAdding() ) { if( !(nModifier & KEY_SHIFT) ) @@ -335,7 +335,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) } pFunctionSet->DeselectAtPoint( aLastMove.GetPosPixel() ); nFlags &= (~SELENG_HAS_ANCH); // nix Anker - pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), TRUE ); + pFunctionSet->SetCursorAtPoint( aLastMove.GetPosPixel(), sal_True ); } else { @@ -346,7 +346,7 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) } nFlags &= ~(SELENG_CMDEVT | SELENG_WAIT_UPEVT | SELENG_IN_SEL); - return TRUE; + return sal_True; } /************************************************************************* @@ -355,21 +355,21 @@ BOOL SelectionEngine::SelMouseButtonUp( const MouseEvent& rMEvt ) |* *************************************************************************/ -BOOL SelectionEngine::SelMouseMove( const MouseEvent& rMEvt ) +sal_Bool SelectionEngine::SelMouseMove( const MouseEvent& rMEvt ) { if ( !pFunctionSet || !(nFlags & SELENG_IN_SEL) || (nFlags & (SELENG_CMDEVT | SELENG_WAIT_UPEVT)) ) - return FALSE; + return sal_False; if( !(nFlags & SELENG_EXPANDONMOVE) ) - return FALSE; // auf DragEvent warten! + return sal_False; // auf DragEvent warten! aLastMove = rMEvt; // wenn die Maus ausserhalb der Area steht, dann wird die // Frequenz des SetCursorAtPoint() nur durch den Timer bestimmt if( aWTimer.IsActive() && !aArea.IsInside( rMEvt.GetPosPixel() )) - return TRUE; + return sal_True; aWTimer.SetTimeout( nUpdateInterval ); aWTimer.Start(); @@ -386,7 +386,7 @@ BOOL SelectionEngine::SelMouseMove( const MouseEvent& rMEvt ) //DbgOut("Move:SetCursor"); pFunctionSet->SetCursorAtPoint( rMEvt.GetPosPixel() ); - return TRUE; + return sal_True; } /************************************************************************* @@ -456,7 +456,7 @@ void SelectionEngine::Command( const CommandEvent& rCEvt ) } } -void SelectionEngine::SetUpdateInterval( ULONG nInterval ) +void SelectionEngine::SetUpdateInterval( sal_uLong nInterval ) { if (nInterval < SELENG_AUTOREPEAT_INTERVAL_MIN) // Set a lower threshold. On Windows, setting this value too low diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index df03cf321ce3..1d4c8bfae815 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -61,13 +61,13 @@ namespace void Splitter::ImplInitSplitterData() { - ImplGetWindowImpl()->mbSplitter = TRUE; + ImplGetWindowImpl()->mbSplitter = sal_True; mpRefWin = NULL; mnSplitPos = 0; mnLastSplitPos = 0; mnStartSplitPos = 0; - mbDragFull = FALSE; - mbKbdSplitting = FALSE; + mbDragFull = sal_False; + mbKbdSplitting = sal_False; mbInKeyEvent = 0; mnKeyboardStepSize = SPLITTER_DEFAULTSTEPSIZE; } @@ -89,13 +89,13 @@ void Splitter::ImplInit( Window* pParent, WinBits nWinStyle ) if ( nWinStyle & WB_HSCROLL ) { ePointerStyle = POINTER_HSPLIT; - mbHorzSplit = TRUE; + mbHorzSplit = sal_True; SetSizePixel( Size( nB, nA ) ); } else { ePointerStyle = POINTER_VSPLIT; - mbHorzSplit = FALSE; + mbHorzSplit = sal_False; SetSizePixel( Size( nA, nB ) ); } @@ -218,11 +218,11 @@ Splitter* Splitter::ImplFindSibling() // ----------------------------------------------------------------------- -BOOL Splitter::ImplSplitterActive() +sal_Bool Splitter::ImplSplitterActive() { // is splitter in document or at scrollbar handle ? - BOOL bActive = TRUE; + sal_Bool bActive = sal_True; const StyleSettings& rSettings = GetSettings().GetStyleSettings(); long nA = rSettings.GetScrollBarSize(); long nB = rSettings.GetSplitSize(); @@ -231,12 +231,12 @@ BOOL Splitter::ImplSplitterActive() if ( mbHorzSplit ) { if( aSize.Width() == nB && aSize.Height() == nA ) - bActive = FALSE; + bActive = sal_False; } else { if( aSize.Width() == nA && aSize.Height() == nB ) - bActive = FALSE; + bActive = sal_False; } return bActive; } @@ -352,13 +352,13 @@ void Splitter::Tracking( const TrackingEvent& rTEvt ) void Splitter::ImplKbdTracking( KeyCode aKeyCode ) { - USHORT nCode = aKeyCode.GetCode(); + sal_uInt16 nCode = aKeyCode.GetCode(); if ( nCode == KEY_ESCAPE || nCode == KEY_RETURN ) { if( !mbKbdSplitting ) return; else - mbKbdSplitting = FALSE; + mbKbdSplitting = sal_False; if ( nCode != KEY_ESCAPE ) { @@ -553,7 +553,7 @@ void Splitter::ImplStartKbdSplitting() if( mbKbdSplitting ) return; - mbKbdSplitting = TRUE; + mbKbdSplitting = sal_True; StartSplit(); @@ -625,7 +625,7 @@ void Splitter::LoseFocus() { KeyCode aReturnKey( KEY_RETURN ); ImplKbdTracking( aReturnKey ); - mbKbdSplitting = FALSE; + mbKbdSplitting = sal_False; } Invalidate(); } @@ -641,7 +641,7 @@ void Splitter::KeyInput( const KeyEvent& rKEvt ) Splitter *pSibling = ImplFindSibling(); KeyCode aKeyCode = rKEvt.GetKeyCode(); - USHORT nCode = aKeyCode.GetCode(); + sal_uInt16 nCode = aKeyCode.GetCode(); switch ( nCode ) { case KEY_UP: diff --git a/vcl/source/window/splitwin.cxx b/vcl/source/window/splitwin.cxx index 3cf2af7bacc8..d0bf60b6412c 100644 --- a/vcl/source/window/splitwin.cxx +++ b/vcl/source/window/splitwin.cxx @@ -46,7 +46,8 @@ // ======================================================================= -// Achtung: Darf keine Objekte enthalten, da mit memmove/memcpy gearbeitet wird +// Attention: Must not contain non-PODs because array is enlarged/copied +// with the use of memmove/memcpy. struct ImplSplitItem { long mnSize; @@ -64,10 +65,14 @@ struct ImplSplitItem ImplSplitSet* mpSet; Window* mpWindow; Window* mpOrgParent; - USHORT mnId; + sal_uInt16 mnId; SplitWindowItemBits mnBits; - BOOL mbFixed; - BOOL mbSubSize; + sal_Bool mbFixed; + sal_Bool mbSubSize; + /// Minimal width or height of the item. -1 means no restriction. + long mnMinSize; + /// Maximal width or height of the item. -1 means no restriction. + long mnMaxSize; }; struct ImplSplitSet @@ -77,25 +82,47 @@ struct ImplSplitSet Bitmap* mpBitmap; long mnLastSize; long mnSplitSize; - USHORT mnItems; - USHORT mnId; - BOOL mbCalcPix; + sal_uInt16 mnItems; + sal_uInt16 mnId; + sal_Bool mbCalcPix; }; + + +/** Check whether the given size is inside the valid range defined by + [rItem.mnMinSize,rItem.mnMaxSize]. When it is not inside it then return + the upper or lower bound, respectively. Otherwise return the given size + unmodified. + Note that either mnMinSize and/or mnMaxSize can be -1 in which case the + size has not lower or upper bound. +*/ +namespace { + long ValidateSize (const long nSize, const ImplSplitItem rItem) + { + if (rItem.mnMinSize>=0 && nSize<rItem.mnMinSize) + return rItem.mnMinSize; + else if (rItem.mnMaxSize>0 && nSize>rItem.mnMaxSize) + return rItem.mnMaxSize; + else + return nSize; + } +} + + #define SPLITWIN_SPLITSIZE 3 #define SPLITWIN_SPLITSIZEEX 4 #define SPLITWIN_SPLITSIZEEXLN 6 #define SPLITWIN_SPLITSIZEAUTOHIDE 36 #define SPLITWIN_SPLITSIZEFADE 36 -#define SPLIT_HORZ ((USHORT)0x0001) -#define SPLIT_VERT ((USHORT)0x0002) -#define SPLIT_WINDOW ((USHORT)0x0004) -#define SPLIT_NOSPLIT ((USHORT)0x8000) +#define SPLIT_HORZ ((sal_uInt16)0x0001) +#define SPLIT_VERT ((sal_uInt16)0x0002) +#define SPLIT_WINDOW ((sal_uInt16)0x0004) +#define SPLIT_NOSPLIT ((sal_uInt16)0x8000) // ======================================================================= -static void ImplCalcBorder( WindowAlign eAlign, BOOL bNoAlign, +static void ImplCalcBorder( WindowAlign eAlign, sal_Bool bNoAlign, long& rLeft, long& rTop, long& rRight, long& rBottom ) { @@ -250,13 +277,13 @@ void SplitWindow::ImplDrawBorderLine( SplitWindow* pWin ) // ----------------------------------------------------------------------- -static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, USHORT nId ) +static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, sal_uInt16 nId ) { if ( pSet->mnId == nId ) return pSet; - USHORT i; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nItems = pSet->mnItems; ImplSplitItem* pItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) @@ -280,10 +307,10 @@ static ImplSplitSet* ImplFindSet( ImplSplitSet* pSet, USHORT nId ) // ----------------------------------------------------------------------- -static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, USHORT nId, USHORT& rPos ) +static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, sal_uInt16 nId, sal_uInt16& rPos ) { - USHORT i; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nItems = pSet->mnItems; ImplSplitItem* pItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) @@ -310,10 +337,10 @@ static ImplSplitSet* ImplFindItem( ImplSplitSet* pSet, USHORT nId, USHORT& rPos // ----------------------------------------------------------------------- -static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow ) +static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, Window* pWindow ) { - USHORT i; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nItems = pSet->mnItems; ImplSplitItem* pItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) @@ -324,7 +351,7 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow ) { if ( pItems[i].mpSet ) { - USHORT nId = ImplFindItem( pItems[i].mpSet, pWindow ); + sal_uInt16 nId = ImplFindItem( pItems[i].mpSet, pWindow ); if ( nId ) return nId; } @@ -336,11 +363,11 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, Window* pWindow ) // ----------------------------------------------------------------------- -static USHORT ImplFindItem( ImplSplitSet* pSet, const Point& rPos, - BOOL bRows, BOOL bDown = TRUE ) +static sal_uInt16 ImplFindItem( ImplSplitSet* pSet, const Point& rPos, + sal_Bool bRows, sal_Bool bDown = sal_True ) { - USHORT i; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nItems = pSet->mnItems; ImplSplitItem* pItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) @@ -386,8 +413,8 @@ static USHORT ImplFindItem( ImplSplitSet* pSet, const Point& rPos, static void ImplDeleteSet( ImplSplitSet* pSet ) { - USHORT i; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nItems = pSet->mnItems; ImplSplitItem* pItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) @@ -411,7 +438,7 @@ static void ImplDeleteSet( ImplSplitSet* pSet ) static void ImplSetSplitSize( ImplSplitSet* pSet, long nNewSize ) { pSet->mnSplitSize = nNewSize; - for ( USHORT i = 0; i < pSet->mnItems; i++ ) + for ( sal_uInt16 i = 0; i < pSet->mnItems; i++ ) { if ( pSet->mpItems[i].mpSet ) ImplSetSplitSize( pSet->mpItems[i].mpSet, nNewSize ); @@ -423,18 +450,18 @@ static void ImplSetSplitSize( ImplSplitSet* pSet, long nNewSize ) static void ImplCalcSet( ImplSplitSet* pSet, long nSetLeft, long nSetTop, long nSetWidth, long nSetHeight, - BOOL bRows, BOOL bDown = TRUE ) + sal_Bool bRows, sal_Bool bDown = sal_True ) { if ( !pSet->mpItems ) return; - USHORT i; - USHORT j; - USHORT nMins; - USHORT nCalcItems; - USHORT nItems = pSet->mnItems; - USHORT nVisItems; - USHORT nAbsItems; + sal_uInt16 i; + sal_uInt16 j; + sal_uInt16 nMins; + sal_uInt16 nCalcItems; + sal_uInt16 nItems = pSet->mnItems; + sal_uInt16 nVisItems; + sal_uInt16 nAbsItems; long nCalcSize; long nSizeDelta; long nCurSize; @@ -448,7 +475,7 @@ static void ImplCalcSet( ImplSplitSet* pSet, long nMaxPos; long* pSize; ImplSplitItem* pItems = pSet->mpItems; - BOOL bEmpty; + sal_Bool bEmpty; // Anzahl sichtbarer Items ermitteln nVisItems = 0; @@ -528,7 +555,7 @@ static void ImplCalcSet( ImplSplitSet* pSet, nCurSize += pItems[i].mnPixSize; } - pSet->mbCalcPix = FALSE; + pSet->mbCalcPix = sal_False; pSet->mnLastSize = nCalcSize; // Fenster einpassen @@ -552,7 +579,7 @@ static void ImplCalcSet( ImplSplitSet* pSet, } } // Rundungsfehler werden hier nicht ausgelichen - if ( (nAbsItems < (USHORT)(Abs( nSizeDelta ))) && nSizeWinSize ) + if ( (nAbsItems < (sal_uInt16)(Abs( nSizeDelta ))) && nSizeWinSize ) { for ( i = 0; i < nItems; i++ ) { @@ -579,10 +606,10 @@ static void ImplCalcSet( ImplSplitSet* pSet, { for ( i = 0; i < nItems; i++ ) { - pItems[i].mbSubSize = FALSE; + pItems[i].mbSubSize = sal_False; if ( j >= 2 ) - pItems[i].mbSubSize = TRUE; + pItems[i].mbSubSize = sal_True; else { if ( !(pItems[i].mnBits & SWIB_INVISIBLE) ) @@ -590,11 +617,11 @@ static void ImplCalcSet( ImplSplitSet* pSet, if ( (nSizeDelta > 0) || pItems[i].mnPixSize ) { if ( j >= 1 ) - pItems[i].mbSubSize = TRUE; + pItems[i].mbSubSize = sal_True; else { if ( (j == 0) && (pItems[i].mnBits & (SWIB_RELATIVESIZE | SWIB_PERCENTSIZE)) ) - pItems[i].mbSubSize = TRUE; + pItems[i].mbSubSize = sal_True; } } } @@ -691,20 +718,20 @@ static void ImplCalcSet( ImplSplitSet* pSet, pItems[i].mnOldHeight = pItems[i].mnHeight; if ( pItems[i].mnBits & SWIB_INVISIBLE ) - bEmpty = TRUE; + bEmpty = sal_True; else { - bEmpty = FALSE; + bEmpty = sal_False; if ( bDown ) { if ( nPos+pItems[i].mnPixSize > nMaxPos ) - bEmpty = TRUE; + bEmpty = sal_True; } else { nPos -= pItems[i].mnPixSize; if ( nPos < nMaxPos ) - bEmpty = TRUE; + bEmpty = sal_True; } } @@ -775,9 +802,9 @@ static void ImplCalcSet( ImplSplitSet* pSet, // Fixed setzen for ( i = 0; i < nItems; i++ ) { - pItems[i].mbFixed = FALSE; + pItems[i].mbFixed = sal_False; if ( pItems[i].mnBits & SWIB_FIXED ) - pItems[i].mbFixed = TRUE; + pItems[i].mbFixed = sal_True; else { // Wenn Child-Set vorhanden, ist dieses Item auch Fixed, wenn @@ -788,7 +815,7 @@ static void ImplCalcSet( ImplSplitSet* pSet, { if ( pItems[i].mpSet->mpItems[j].mbFixed ) { - pItems[i].mbFixed = TRUE; + pItems[i].mbFixed = sal_True; break; } } @@ -799,11 +826,11 @@ static void ImplCalcSet( ImplSplitSet* pSet, // ----------------------------------------------------------------------- -void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL bHide, - BOOL bRows, BOOL /*bDown*/ ) +void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, sal_Bool bHide, + sal_Bool bRows, sal_Bool /*bDown*/ ) { - USHORT i; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nItems = pSet->mnItems; ImplSplitItem* pItems = pSet->mpItems; if ( pWindow->IsReallyVisible() && pWindow->IsUpdateMode() && pWindow->mbInvalidate ) @@ -873,9 +900,9 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL b { if ( pItems[i].mpSet ) { - BOOL bTempHide = bHide; + sal_Bool bTempHide = bHide; if ( !pItems[i].mnWidth || !pItems[i].mnHeight ) - bTempHide = TRUE; + bTempHide = sal_True; ImplCalcSet2( pWindow, pItems[i].mpSet, bTempHide, ((pItems[i].mnBits & SWIB_COLSET) == 0) ); } @@ -902,10 +929,10 @@ void SplitWindow::ImplCalcSet2( SplitWindow* pWindow, ImplSplitSet* pSet, BOOL b // ----------------------------------------------------------------------- -static void ImplCalcLogSize( ImplSplitItem* pItems, USHORT nItems ) +static void ImplCalcLogSize( ImplSplitItem* pItems, sal_uInt16 nItems ) { // Original-Groessen updaten - USHORT i; + sal_uInt16 i; long nRelSize = 0; long nPerSize = 0; for ( i = 0; i < nItems; i++ ) @@ -970,8 +997,8 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, const Rectangle& rRect, void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet ) { - USHORT i; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nItems = pSet->mnItems; ImplSplitItem* pItems = pSet->mpItems; // Beim Mainset auch den Hintergrund zeichnen @@ -1013,20 +1040,20 @@ void SplitWindow::ImplDrawBack( SplitWindow* pWindow, ImplSplitSet* pSet ) // ----------------------------------------------------------------------- static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet, - BOOL bRows, BOOL bDown = TRUE ) + sal_Bool bRows, sal_Bool bDown = sal_True ) { if ( !pSet->mpItems ) return; - USHORT i; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nItems = pSet->mnItems; long nPos; long nTop; long nBottom; ImplSplitItem* pItems = pSet->mpItems; const StyleSettings& rStyleSettings = pWindow->GetSettings().GetStyleSettings(); - BOOL bFlat = (pWindow->GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW; + sal_Bool bFlat = (pWindow->GetStyle() & WB_FLATSPLITDRAW) == WB_FLATSPLITDRAW; for ( i = 0; i < nItems-1; i++ ) { @@ -1107,16 +1134,16 @@ static void ImplDrawSplit( SplitWindow* pWindow, ImplSplitSet* pSet, // ----------------------------------------------------------------------- -USHORT SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos, - long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos, - BOOL bRows, BOOL /*bDown*/ ) +sal_uInt16 SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos, + long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos, + sal_Bool bRows, sal_Bool /*bDown*/ ) { if ( !pSet->mpItems ) return 0; - USHORT i; - USHORT nSplitTest; - USHORT nItems = pSet->mnItems; + sal_uInt16 i; + sal_uInt16 nSplitTest; + sal_uInt16 nItems = pSet->mnItems; long nMPos1; long nMPos2; long nPos; @@ -1187,8 +1214,8 @@ USHORT SplitWindow::ImplTestSplit( ImplSplitSet* pSet, const Point& rPos, // ----------------------------------------------------------------------- -USHORT SplitWindow::ImplTestSplit( SplitWindow* pWindow, const Point& rPos, - long& rMouseOff, ImplSplitSet** ppFoundSet, USHORT& rFoundPos ) +sal_uInt16 SplitWindow::ImplTestSplit( SplitWindow* pWindow, const Point& rPos, + long& rMouseOff, ImplSplitSet** ppFoundSet, sal_uInt16& rFoundPos ) { // Resizeable SplitWindow muss anders behandelt werden if ( pWindow->mnWinStyle & WB_SIZEABLE ) @@ -1300,7 +1327,7 @@ void SplitWindow::ImplInit( Window* pParent, WinBits nStyle ) pNewSet->mnItems = 0; pNewSet->mnId = 0; pNewSet->mnSplitSize = SPLITWIN_SPLITSIZE; - pNewSet->mbCalcPix = TRUE; + pNewSet->mbCalcPix = sal_True; mpMainSet = pNewSet; mpBaseSet = pNewSet; @@ -1321,29 +1348,29 @@ void SplitWindow::ImplInit( Window* pParent, WinBits nStyle ) mnMouseModifier = 0; mnMStartPos = 0; mnMSplitPos = 0; - mbDragFull = FALSE; - mbHorz = TRUE; - mbBottomRight = FALSE; - mbCalc = FALSE; - mbRecalc = TRUE; - mbInvalidate = TRUE; - mbAutoHide = FALSE; - mbFadeIn = FALSE; - mbFadeOut = FALSE; - mbAutoHideIn = FALSE; - mbAutoHideDown = FALSE; - mbFadeInDown = FALSE; - mbFadeOutDown = FALSE; - mbAutoHidePressed = FALSE; - mbFadeInPressed = FALSE; - mbFadeOutPressed = FALSE; - mbFadeNoButtonMode = FALSE; - mbNoAlign = FALSE; + mbDragFull = sal_False; + mbHorz = sal_True; + mbBottomRight = sal_False; + mbCalc = sal_False; + mbRecalc = sal_True; + mbInvalidate = sal_True; + mbAutoHide = sal_False; + mbFadeIn = sal_False; + mbFadeOut = sal_False; + mbAutoHideIn = sal_False; + mbAutoHideDown = sal_False; + mbFadeInDown = sal_False; + mbFadeOutDown = sal_False; + mbAutoHidePressed = sal_False; + mbFadeInPressed = sal_False; + mbFadeOutPressed = sal_False; + mbFadeNoButtonMode = sal_False; + mbNoAlign = sal_False; if ( nStyle & WB_NOSPLITDRAW ) { pNewSet->mnSplitSize -= 2; - mbInvalidate = FALSE; + mbInvalidate = sal_False; } if ( nStyle & WB_BORDER ) @@ -1476,7 +1503,7 @@ Size SplitWindow::CalcLayoutSizePixel( const Size& aNewSize ) { long nCurSize; long nCalcSize = 0; - USHORT i; + sal_uInt16 i; for ( i = 0; i < mpMainSet->mnItems; i++ ) { @@ -1544,7 +1571,7 @@ void SplitWindow::ImplCalcLayout() { long nCurSize; long nCalcSize = 0; - USHORT i; + sal_uInt16 i; for ( i = 0; i < mpMainSet->mnItems; i++ ) { @@ -1563,9 +1590,9 @@ void SplitWindow::ImplCalcLayout() nCurSize -= nSplitSize; nCurSize -= (mpMainSet->mnItems-1)*mpMainSet->mnSplitSize; - mbRecalc = FALSE; + mbRecalc = sal_False; ImplSetWindowSize( nCalcSize-nCurSize ); - mbRecalc = TRUE; + mbRecalc = sal_True; } } @@ -1606,15 +1633,15 @@ void SplitWindow::ImplCalcLayout() // Sets rekursiv berechnen ImplCalcSet( mpMainSet, nL, nT, nW, nH, mbHorz, !mbBottomRight ); - ImplCalcSet2( this, mpMainSet, FALSE, mbHorz, !mbBottomRight ); - mbCalc = FALSE; + ImplCalcSet2( this, mpMainSet, sal_False, mbHorz, !mbBottomRight ); + mbCalc = sal_False; } // ----------------------------------------------------------------------- void SplitWindow::ImplUpdate() { - mbCalc = TRUE; + mbCalc = sal_True; if ( IsReallyShown() && IsUpdateMode() && mbRecalc ) { @@ -1654,7 +1681,7 @@ void SplitWindow::ImplUpdateSet( ImplSplitSet* pSet ) else { ImplSplitItem* pItem; - USHORT nPos; + sal_uInt16 nPos; pSet = ImplFindItem( mpMainSet, pSet->mnId, nPos ); pItem = &(pSet->mpItems[nPos]); @@ -1694,7 +1721,7 @@ void SplitWindow::ImplSplitMousePos( Point& rMousePos ) // ----------------------------------------------------------------------- -void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) const +void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, sal_Bool bTest ) const { long nSplitSize = mpMainSet->mnSplitSize-2; if ( mbAutoHide || mbFadeOut || mbFadeIn ) @@ -1767,7 +1794,7 @@ void SplitWindow::ImplGetButtonRect( Rectangle& rRect, long nEx, BOOL bTest ) co // ----------------------------------------------------------------------- -void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest ) const +void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, sal_Bool bTest ) const { Rectangle aRect; @@ -1784,7 +1811,7 @@ void SplitWindow::ImplGetAutoHideRect( Rectangle& rRect, BOOL bTest ) const // ----------------------------------------------------------------------- -void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, BOOL bTest ) const +void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, sal_Bool bTest ) const { Rectangle aRect; @@ -1796,12 +1823,12 @@ void SplitWindow::ImplGetFadeInRect( Rectangle& rRect, BOOL bTest ) const // ----------------------------------------------------------------------- -void SplitWindow::ImplGetFadeOutRect( Rectangle& rRect, BOOL ) const +void SplitWindow::ImplGetFadeOutRect( Rectangle& rRect, sal_Bool ) const { Rectangle aRect; if ( mbFadeOut ) - ImplGetButtonRect( aRect, 0, FALSE ); + ImplGetButtonRect( aRect, 0, sal_False ); rRect = aRect; } @@ -1876,7 +1903,7 @@ void SplitWindow::ImplDrawButtonRect( const Rectangle& rRect, long nSize ) // ----------------------------------------------------------------------- -void SplitWindow::ImplDrawAutoHide( BOOL bInPaint ) +void SplitWindow::ImplDrawAutoHide( sal_Bool bInPaint ) { if ( mbAutoHide ) { @@ -1921,7 +1948,7 @@ void SplitWindow::ImplDrawAutoHide( BOOL bInPaint ) } // Image ermitteln und zurueckgeben - USHORT nId; + sal_uInt16 nId; if ( mbAutoHidePressed ) { if ( mbAutoHideIn ) @@ -1953,7 +1980,7 @@ void SplitWindow::ImplDrawAutoHide( BOOL bInPaint ) // ----------------------------------------------------------------------- -void SplitWindow::ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft ) +void SplitWindow::ImplDrawFadeArrow( const Point& rPt, sal_Bool bHorz, sal_Bool bLeft ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -2009,14 +2036,14 @@ void SplitWindow::ImplDrawFadeArrow( const Point& rPt, BOOL bHorz, BOOL bLeft ) } } -void SplitWindow::ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft ) +void SplitWindow::ImplDrawGrip( const Rectangle& rRect, sal_Bool bHorz, sal_Bool bLeft ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); if( rRect.IsInside( GetPointerPosPixel() ) ) { DrawWallpaper( rRect, Wallpaper( Color( COL_WHITE ) ) ); - DrawSelectionBackground( rRect, 2, FALSE, FALSE, FALSE ); + DrawSelectionBackground( rRect, 2, sal_False, sal_False, sal_False ); } if( bHorz ) @@ -2067,7 +2094,7 @@ void SplitWindow::ImplDrawGrip( const Rectangle& rRect, BOOL bHorz, BOOL bLeft ) } } -void SplitWindow::ImplDrawFadeIn( BOOL bInPaint ) +void SplitWindow::ImplDrawFadeIn( sal_Bool bInPaint ) { if ( mbFadeIn ) { @@ -2075,17 +2102,17 @@ void SplitWindow::ImplDrawFadeIn( BOOL bInPaint ) Image aImage; ImplGetFadeInRect( aTempRect ); - BOOL bLeft; + sal_Bool bLeft; if ( meAlign == WINDOWALIGN_TOP ) - bLeft = FALSE; + bLeft = sal_False; else if ( meAlign == WINDOWALIGN_BOTTOM ) - bLeft = TRUE; + bLeft = sal_True; else if ( meAlign == WINDOWALIGN_LEFT ) - bLeft = FALSE; + bLeft = sal_False; else if ( meAlign == WINDOWALIGN_RIGHT ) - bLeft = TRUE; + bLeft = sal_True; else - bLeft = TRUE; + bLeft = sal_True; if ( !bInPaint ) Erase( aTempRect ); @@ -2096,7 +2123,7 @@ void SplitWindow::ImplDrawFadeIn( BOOL bInPaint ) // ----------------------------------------------------------------------- -void SplitWindow::ImplDrawFadeOut( BOOL bInPaint ) +void SplitWindow::ImplDrawFadeOut( sal_Bool bInPaint ) { if ( mbFadeOut ) { @@ -2104,17 +2131,17 @@ void SplitWindow::ImplDrawFadeOut( BOOL bInPaint ) Image aImage; ImplGetFadeOutRect( aTempRect ); - BOOL bLeft; + sal_Bool bLeft; if ( meAlign == WINDOWALIGN_TOP ) - bLeft = TRUE; + bLeft = sal_True; else if ( meAlign == WINDOWALIGN_BOTTOM ) - bLeft = FALSE; + bLeft = sal_False; else if ( meAlign == WINDOWALIGN_LEFT ) - bLeft = TRUE; + bLeft = sal_True; else if ( meAlign == WINDOWALIGN_RIGHT ) - bLeft = FALSE; + bLeft = sal_False; else - bLeft = TRUE; + bLeft = sal_True; if ( !bInPaint ) Erase( aTempRect ); @@ -2133,15 +2160,15 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) { ImplSplitItem* pSplitItem; long nCurMaxSize; - USHORT nTemp; - BOOL bDown; - BOOL bPropSmaller; + sal_uInt16 nTemp; + sal_Bool bDown; + sal_Bool bPropSmaller; mnMouseModifier = rMEvt.GetModifier(); if ( !(mnMouseModifier & KEY_SHIFT) || (mnSplitPos+1 >= mpSplitSet->mnItems) ) - bPropSmaller = FALSE; + bPropSmaller = sal_False; else - bPropSmaller = TRUE; + bPropSmaller = sal_True; // Hier kann noch die maximale Groesse gesetzt werden StartSplit(); @@ -2159,9 +2186,9 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) if ( mpSplitSet->mpItems ) { - bDown = TRUE; + bDown = sal_True; if ( (mpSplitSet == mpMainSet) && mbBottomRight ) - bDown = FALSE; + bDown = sal_False; pSplitItem = &(mpSplitSet->mpItems[mnSplitPos]); maDragRect.Left() = pSplitItem->mnLeft; @@ -2292,9 +2319,9 @@ void SplitWindow::ImplStartSplit( const MouseEvent& rMEvt ) else { ImplSplitItem* pItems = mpSplitSet->mpItems; - USHORT nItems = mpSplitSet->mnItems; + sal_uInt16 nItems = mpSplitSet->mnItems; mpLastSizes = new long[nItems*2]; - for ( USHORT i = 0; i < nItems; i++ ) + for ( sal_uInt16 i = 0; i < nItems; i++ ) { mpLastSizes[i*2] = pItems[i].mnSize; mpLastSizes[i*2+1] = pItems[i].mnPixSize; @@ -2369,35 +2396,35 @@ void SplitWindow::MouseButtonDown( const MouseEvent& rMEvt ) Point aMousePosPixel = rMEvt.GetPosPixel(); Rectangle aTestRect; - mbFadeNoButtonMode = FALSE; - ImplGetAutoHideRect( aTestRect, TRUE ); + mbFadeNoButtonMode = sal_False; + ImplGetAutoHideRect( aTestRect, sal_True ); if ( aTestRect.IsInside( aMousePosPixel ) ) { - mbAutoHideDown = TRUE; - mbAutoHidePressed = TRUE; - ImplDrawAutoHide( FALSE ); + mbAutoHideDown = sal_True; + mbAutoHidePressed = sal_True; + ImplDrawAutoHide( sal_False ); } else { - ImplGetFadeOutRect( aTestRect, TRUE ); + ImplGetFadeOutRect( aTestRect, sal_True ); if ( aTestRect.IsInside( aMousePosPixel ) ) { - mbFadeOutDown = TRUE; - mbFadeOutPressed = TRUE; - ImplDrawFadeOut( FALSE ); + mbFadeOutDown = sal_True; + mbFadeOutPressed = sal_True; + ImplDrawFadeOut( sal_False ); } else { - ImplGetFadeInRect( aTestRect, TRUE ); + ImplGetFadeInRect( aTestRect, sal_True ); if ( aTestRect.IsInside( aMousePosPixel ) ) { - mbFadeInDown = TRUE; - mbFadeInPressed = TRUE; - ImplDrawFadeIn( FALSE ); + mbFadeInDown = sal_True; + mbFadeInPressed = sal_True; + ImplDrawFadeIn( sal_False ); } else if ( !aTestRect.IsEmpty() && !(mnWinStyle & WB_SIZEABLE) ) { - mbFadeNoButtonMode = TRUE; + mbFadeNoButtonMode = sal_True; FadeIn(); return; } @@ -2419,8 +2446,8 @@ void SplitWindow::MouseMove( const MouseEvent& rMEvt ) Point aPos = rMEvt.GetPosPixel(); long nTemp; ImplSplitSet* pTempSplitSet; - USHORT nTempSplitPos; - USHORT nSplitTest = ImplTestSplit( this, aPos, nTemp, &pTempSplitSet, nTempSplitPos ); + sal_uInt16 nTempSplitPos; + sal_uInt16 nSplitTest = ImplTestSplit( this, aPos, nTemp, &pTempSplitSet, nTempSplitPos ); PointerStyle eStyle = POINTER_ARROW; Rectangle aAutoHideRect; Rectangle aFadeInRect; @@ -2457,30 +2484,30 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingEnded() ) { - mbAutoHideDown = FALSE; + mbAutoHideDown = sal_False; if ( mbAutoHidePressed ) { - mbAutoHidePressed = FALSE; + mbAutoHidePressed = sal_False; if ( !rTEvt.IsTrackingCanceled() ) { mbAutoHideIn = !mbAutoHideIn; - ImplDrawAutoHide( FALSE ); + ImplDrawAutoHide( sal_False ); AutoHide(); } else - ImplDrawAutoHide( FALSE ); + ImplDrawAutoHide( sal_False ); } } else { Rectangle aTestRect; - ImplGetAutoHideRect( aTestRect, TRUE ); - BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel ); + ImplGetAutoHideRect( aTestRect, sal_True ); + sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel ); if ( bNewPressed != mbAutoHidePressed ) { mbAutoHidePressed = bNewPressed; - ImplDrawAutoHide( FALSE ); + ImplDrawAutoHide( sal_False ); } } } @@ -2488,11 +2515,11 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingEnded() ) { - mbFadeInDown = FALSE; + mbFadeInDown = sal_False; if ( mbFadeInPressed ) { - mbFadeInPressed = FALSE; - ImplDrawFadeIn( FALSE ); + mbFadeInPressed = sal_False; + ImplDrawFadeIn( sal_False ); if ( !rTEvt.IsTrackingCanceled() ) FadeIn(); @@ -2501,12 +2528,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) else { Rectangle aTestRect; - ImplGetFadeInRect( aTestRect, TRUE ); - BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel ); + ImplGetFadeInRect( aTestRect, sal_True ); + sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel ); if ( bNewPressed != mbFadeInPressed ) { mbFadeInPressed = bNewPressed; - ImplDrawFadeIn( FALSE ); + ImplDrawFadeIn( sal_False ); } } } @@ -2514,11 +2541,11 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingEnded() ) { - mbFadeOutDown = FALSE; + mbFadeOutDown = sal_False; if ( mbFadeOutPressed ) { - mbFadeOutPressed = FALSE; - ImplDrawFadeOut( FALSE ); + mbFadeOutPressed = sal_False; + ImplDrawFadeOut( sal_False ); if ( !rTEvt.IsTrackingCanceled() ) FadeOut(); @@ -2527,12 +2554,12 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) else { Rectangle aTestRect; - ImplGetFadeOutRect( aTestRect, TRUE ); - BOOL bNewPressed = aTestRect.IsInside( aMousePosPixel ); - if ( bNewPressed == FALSE ) + ImplGetFadeOutRect( aTestRect, sal_True ); + sal_Bool bNewPressed = aTestRect.IsInside( aMousePosPixel ); + if ( bNewPressed == sal_False ) { mbFadeOutPressed = bNewPressed; - ImplDrawFadeOut( FALSE ); + ImplDrawFadeOut( sal_False ); // We need a mouseevent with a position inside the button for the // ImplStartSplit function! @@ -2542,14 +2569,14 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) aOrgMEvt.GetModifier() ); ImplStartSplit( aNewMEvt ); - mbFadeOutDown = FALSE; + mbFadeOutDown = sal_False; } } } else { ImplSplitMousePos( aMousePosPixel ); - BOOL bSplit = TRUE; + sal_Bool bSplit = sal_True; if ( mbDragFull ) { if ( rTEvt.IsTrackingEnded() ) @@ -2557,8 +2584,8 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) if ( rTEvt.IsTrackingCanceled() ) { ImplSplitItem* pItems = mpSplitSet->mpItems; - USHORT nItems = mpSplitSet->mnItems; - for ( USHORT i = 0; i < nItems; i++ ) + sal_uInt16 nItems = mpSplitSet->mnItems; + for ( sal_uInt16 i = 0; i < nItems; i++ ) { pItems[i].mnSize = mpLastSizes[i*2]; pItems[i].mnPixSize = mpLastSizes[i*2+1]; @@ -2566,7 +2593,7 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) ImplUpdate(); Split(); } - bSplit = FALSE; + bSplit = sal_False; } } else @@ -2579,14 +2606,14 @@ void SplitWindow::Tracking( const TrackingEvent& rTEvt ) else { ImplDrawSplitTracking( this, aMousePosPixel ); - bSplit = FALSE; + bSplit = sal_False; } } if ( bSplit ) { - BOOL bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? TRUE : FALSE; - BOOL bPropGreater = (mnMouseModifier & KEY_MOD1) ? TRUE : FALSE; + sal_Bool bPropSmaller = (mnMouseModifier & KEY_SHIFT) ? sal_True : sal_False; + sal_Bool bPropGreater = (mnMouseModifier & KEY_MOD1) ? sal_True : sal_False; long nDelta = mnMSplitPos-mnMStartPos; if ( (mnSplitTest & SPLIT_WINDOW) && !mpMainSet->mpItems ) @@ -2670,9 +2697,9 @@ void SplitWindow::Paint( const Rectangle& ) ImplDrawBorder( this ); ImplDrawBorderLine( this ); - ImplDrawFadeOut( TRUE ); - ImplDrawFadeIn( TRUE ); - ImplDrawAutoHide( TRUE ); + ImplDrawFadeOut( sal_True ); + ImplDrawFadeIn( sal_True ); + ImplDrawAutoHide( sal_True ); // FrameSet-Hintergruende zeichnen ImplDrawBack( this, mpMainSet ); @@ -2710,9 +2737,9 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt ) { Point aMousePosPixel = ScreenToOutputPixel( rHEvt.GetMousePosPixel() ); Rectangle aHelpRect; - USHORT nHelpResId = 0; + sal_uInt16 nHelpResId = 0; - ImplGetAutoHideRect( aHelpRect, TRUE ); + ImplGetAutoHideRect( aHelpRect, sal_True ); if ( aHelpRect.IsInside( aMousePosPixel ) ) { if ( mbAutoHideIn ) @@ -2722,12 +2749,12 @@ void SplitWindow::RequestHelp( const HelpEvent& rHEvt ) } else { - ImplGetFadeInRect( aHelpRect, TRUE ); + ImplGetFadeInRect( aHelpRect, sal_True ); if ( aHelpRect.IsInside( aMousePosPixel ) ) nHelpResId = SV_HELPTEXT_FADEIN; else { - ImplGetFadeOutRect( aHelpRect, TRUE ); + ImplGetFadeOutRect( aHelpRect, sal_True ); if ( aHelpRect.IsInside( aMousePosPixel ) ) nHelpResId = SV_HELPTEXT_FADEOUT; } @@ -2798,17 +2825,17 @@ void SplitWindow::DataChanged( const DataChangedEvent& rDCEvt ) // ----------------------------------------------------------------------- -void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize, - USHORT nPos, USHORT nSetId, +void SplitWindow::InsertItem( sal_uInt16 nId, Window* pWindow, long nSize, + sal_uInt16 nPos, sal_uInt16 nSetId, SplitWindowItemBits nBits ) { #ifdef DBG_UTIL - USHORT nDbgDummy; + sal_uInt16 nDbgDummy; DBG_ASSERT( ImplFindSet( mpMainSet, nSetId ), "SplitWindow::InsertItem() - Set not exists" ); DBG_ASSERT( !ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::InsertItem() - Id already exists" ); #endif - // Size muss min. 1 sein + // Size has to be at least 1. if ( nSize < 1 ) nSize = 1; @@ -2816,7 +2843,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize, ImplSplitSet* pNewSet; ImplSplitItem* pItem; - // Platz fuer neues Item schaffen + // Make room for the new item. if ( nPos > pSet->mnItems ) nPos = pSet->mnItems; ImplSplitItem* pNewItems = new ImplSplitItem[pSet->mnItems+1]; @@ -2827,21 +2854,23 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize, delete[] pSet->mpItems; pSet->mpItems = pNewItems; pSet->mnItems++; - pSet->mbCalcPix = TRUE; + pSet->mbCalcPix = sal_True; - // Item anlegen und erweitern + // Create and initialize item. pItem = &(pSet->mpItems[nPos]); memset( pItem, 0, sizeof( ImplSplitItem ) ); pItem->mnSize = nSize; pItem->mnId = nId; pItem->mnBits = nBits; + pItem->mnMinSize=-1; + pItem->mnMaxSize=-1; if ( pWindow ) { pItem->mpWindow = pWindow; pItem->mpOrgParent = pWindow->GetParent(); - // Window mit SplitWindow verbinden + // Attach window to SplitWindow. pWindow->Hide(); pWindow->SetParent( this ); } @@ -2855,7 +2884,7 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize, pNewSet->mnItems = 0; pNewSet->mnId = nId; pNewSet->mnSplitSize = pSet->mnSplitSize; - pNewSet->mbCalcPix = TRUE; + pNewSet->mbCalcPix = sal_True; pItem->mpSet = pNewSet; } @@ -2865,8 +2894,8 @@ void SplitWindow::InsertItem( USHORT nId, Window* pWindow, long nSize, // ----------------------------------------------------------------------- -void SplitWindow::InsertItem( USHORT nId, long nSize, - USHORT nPos, USHORT nSetId, +void SplitWindow::InsertItem( sal_uInt16 nId, long nSize, + sal_uInt16 nPos, sal_uInt16 nSetId, SplitWindowItemBits nBits ) { InsertItem( nId, NULL, nSize, nPos, nSetId, nBits ); @@ -2874,15 +2903,15 @@ void SplitWindow::InsertItem( USHORT nId, long nSize, // ----------------------------------------------------------------------- -void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId ) +void SplitWindow::MoveItem( sal_uInt16 nId, sal_uInt16 nNewPos, sal_uInt16 nNewSetId ) { #ifdef DBG_UTIL - USHORT nDbgDummy; + 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 - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pNewSet = ImplFindSet( mpMainSet, nNewSetId ); ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos ); ImplSplitItem aTempItem; @@ -2915,7 +2944,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId ) nNewPos = pNewSet->mnItems; memcpy( &aTempItem, &(pSet->mpItems[nPos]), sizeof( aTempItem ) ); pSet->mnItems--; - pSet->mbCalcPix = TRUE; + pSet->mbCalcPix = sal_True; if ( pSet->mnItems ) { memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1, @@ -2937,7 +2966,7 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId ) delete[] pNewSet->mpItems; pNewSet->mpItems = pNewItems; pNewSet->mnItems++; - pNewSet->mbCalcPix = TRUE; + pNewSet->mbCalcPix = sal_True; memcpy( &(pNewSet->mpItems[nNewPos]), &aTempItem, sizeof( aTempItem ) ); ImplUpdate(); } @@ -2945,15 +2974,15 @@ void SplitWindow::MoveItem( USHORT nId, USHORT nNewPos, USHORT nNewSetId ) // ----------------------------------------------------------------------- -void SplitWindow::RemoveItem( USHORT nId, BOOL bHide ) +void SplitWindow::RemoveItem( sal_uInt16 nId, sal_Bool bHide ) { #ifdef DBG_UTIL - USHORT nDbgDummy; + sal_uInt16 nDbgDummy; DBG_ASSERT( ImplFindItem( mpMainSet, nId, nDbgDummy ), "SplitWindow::RemoveItem() - Id not found" ); #endif // Set suchen - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpMainSet, nId, nPos ); ImplSplitItem* pItem = &(pSet->mpItems[nPos]); Window* pWindow = pItem->mpWindow; @@ -2965,7 +2994,7 @@ void SplitWindow::RemoveItem( USHORT nId, BOOL bHide ) // Item entfernen pSet->mnItems--; - pSet->mbCalcPix = TRUE; + pSet->mbCalcPix = sal_True; if ( pSet->mnItems ) { memmove( pSet->mpItems+nPos, pSet->mpItems+nPos+1, @@ -3007,7 +3036,7 @@ void SplitWindow::Clear() mpMainSet->mnItems = 0; mpMainSet->mnId = 0; mpMainSet->mnSplitSize = SPLITWIN_SPLITSIZE; - mpMainSet->mbCalcPix = TRUE; + mpMainSet->mbCalcPix = sal_True; if ( mnWinStyle & WB_NOSPLITDRAW ) mpMainSet->mnSplitSize -= 2; mpBaseSet = mpMainSet; @@ -3018,22 +3047,22 @@ void SplitWindow::Clear() // ----------------------------------------------------------------------- -void SplitWindow::SetBaseSet( USHORT nSetId ) +void SplitWindow::SetBaseSet( sal_uInt16 nSetId ) { mpBaseSet = ImplFindSet( mpMainSet, nSetId ); } // ----------------------------------------------------------------------- -USHORT SplitWindow::GetBaseSet() const +sal_uInt16 SplitWindow::GetBaseSet() const { return mpBaseSet->mnId; } // ----------------------------------------------------------------------- -void SplitWindow::SetSplitSize( USHORT nSetId, long nSplitSize, - BOOL bWithChilds ) +void SplitWindow::SetSplitSize( sal_uInt16 nSetId, long nSplitSize, + sal_Bool bWithChilds ) { ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); if ( pSet ) @@ -3048,7 +3077,7 @@ void SplitWindow::SetSplitSize( USHORT nSetId, long nSplitSize, // ----------------------------------------------------------------------- -long SplitWindow::GetSplitSize( USHORT nSetId ) const +long SplitWindow::GetSplitSize( sal_uInt16 nSetId ) const { ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); if ( pSet ) @@ -3059,7 +3088,7 @@ long SplitWindow::GetSplitSize( USHORT nSetId ) const // ----------------------------------------------------------------------- -void SplitWindow::SetItemBackground( USHORT nSetId ) +void SplitWindow::SetItemBackground( sal_uInt16 nSetId ) { Wallpaper aWall; SetItemBackground( nSetId, aWall ); @@ -3067,13 +3096,13 @@ void SplitWindow::SetItemBackground( USHORT nSetId ) // ----------------------------------------------------------------------- -void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper ) +void SplitWindow::SetItemBackground( sal_uInt16 nSetId, const Wallpaper& rWallpaper ) { ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); if ( pSet ) { - BOOL bUpdate = TRUE; + sal_Bool bUpdate = sal_True; if ( rWallpaper.GetStyle() == WALLPAPER_NULL ) { @@ -3083,12 +3112,12 @@ void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper pSet->mpWallpaper = NULL; } else - bUpdate = FALSE; + bUpdate = sal_False; } else { // Ab jetzt muss immer invalidiert werden - mbInvalidate = TRUE; + mbInvalidate = sal_True; if ( !pSet->mpWallpaper ) pSet->mpWallpaper = new Wallpaper( rWallpaper ); @@ -3107,7 +3136,7 @@ void SplitWindow::SetItemBackground( USHORT nSetId, const Wallpaper& rWallpaper // ----------------------------------------------------------------------- -Wallpaper SplitWindow::GetItemBackground( USHORT nSetId ) const +Wallpaper SplitWindow::GetItemBackground( sal_uInt16 nSetId ) const { ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); @@ -3122,25 +3151,25 @@ Wallpaper SplitWindow::GetItemBackground( USHORT nSetId ) const // ----------------------------------------------------------------------- -BOOL SplitWindow::IsItemBackground( USHORT nSetId ) const +sal_Bool SplitWindow::IsItemBackground( sal_uInt16 nSetId ) const { ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); if ( pSet && pSet->mpWallpaper ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap ) +void SplitWindow::SetItemBitmap( sal_uInt16 nSetId, const Bitmap& rBitmap ) { ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); if ( pSet ) { - BOOL bUpdate = TRUE; + sal_Bool bUpdate = sal_True; if ( !rBitmap ) { @@ -3150,12 +3179,12 @@ void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap ) pSet->mpBitmap = NULL; } else - bUpdate = FALSE; + bUpdate = sal_False; } else { // Ab jetzt muss immer invalidiert werden - mbInvalidate = TRUE; + mbInvalidate = sal_True; if ( !pSet->mpBitmap ) pSet->mpBitmap = new Bitmap( rBitmap ); @@ -3174,7 +3203,7 @@ void SplitWindow::SetItemBitmap( USHORT nSetId, const Bitmap& rBitmap ) // ----------------------------------------------------------------------- -Bitmap SplitWindow::GetItemBitmap( USHORT nSetId ) const +Bitmap SplitWindow::GetItemBitmap( sal_uInt16 nSetId ) const { ImplSplitSet* pSet = ImplFindSet( mpMainSet, nSetId ); @@ -3189,15 +3218,15 @@ Bitmap SplitWindow::GetItemBitmap( USHORT nSetId ) const // ----------------------------------------------------------------------- -void SplitWindow::SplitItem( USHORT nId, long nNewSize, - BOOL bPropSmall, BOOL bPropGreat ) +void SplitWindow::SplitItem( sal_uInt16 nId, long nNewSize, + sal_Bool bPropSmall, sal_Bool bPropGreat ) { - USHORT nItems; - USHORT nPos; - USHORT nMin; - USHORT nMax; - USHORT i; - USHORT n; + sal_uInt16 nItems; + sal_uInt16 nPos; + sal_uInt16 nMin; + sal_uInt16 nMax; + sal_uInt16 i; + sal_uInt16 n; long nDelta; long nTempDelta; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); @@ -3209,6 +3238,10 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize, nItems = pSet->mnItems; pItems = pSet->mpItems; + // When there is an explicit minimum or maximum size then move nNewSize + // into that range (when it is not yet already in it.) + nNewSize = ValidateSize(nNewSize, pItems[nPos]); + if ( mbCalc ) { pItems[nPos].mnSize = nNewSize; @@ -3234,8 +3267,8 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize, } // Wenn das Fenster sizeable ist, wird das TopSet anders behandelt - BOOL bSmall = TRUE; - BOOL bGreat = TRUE; + sal_Bool bSmall = sal_True; + sal_Bool bGreat = sal_True; if ( (pSet == mpMainSet) && (mnWinStyle & WB_SIZEABLE) ) { if ( nPos < pSet->mnItems-1 ) @@ -3245,29 +3278,29 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize, ((nDelta < 0) && bPropGreat)) ) { if ( nDelta < 0 ) - bGreat = FALSE; + bGreat = sal_False; else - bSmall = FALSE; + bSmall = sal_False; } } else { if ( nDelta < 0 ) - bGreat = FALSE; + bGreat = sal_False; else - bSmall = FALSE; + bSmall = sal_False; } } else if ( nPos >= nMax ) { - bSmall = FALSE; - bGreat = FALSE; + bSmall = sal_False; + bGreat = sal_False; } else if ( nPos && (nPos >= pSet->mnItems-1) ) { nPos--; nDelta *= -1; - BOOL bTemp = bPropSmall; + sal_Bool bTemp = bPropSmall; bPropSmall = bPropGreat; bPropGreat = bTemp; } @@ -3420,9 +3453,9 @@ void SplitWindow::SplitItem( USHORT nId, long nNewSize, // ----------------------------------------------------------------------- -void SplitWindow::SetItemSize( USHORT nId, long nNewSize ) +void SplitWindow::SetItemSize( sal_uInt16 nId, long nNewSize ) { - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); ImplSplitItem* pItem; @@ -3435,16 +3468,16 @@ void SplitWindow::SetItemSize( USHORT nId, long nNewSize ) { // Neue Groesse setzen und neu durchrechnen pItem->mnSize = nNewSize; - pSet->mbCalcPix = TRUE; + pSet->mbCalcPix = sal_True; ImplUpdate(); } } // ----------------------------------------------------------------------- -long SplitWindow::GetItemSize( USHORT nId ) const +long SplitWindow::GetItemSize( sal_uInt16 nId ) const { - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); if ( pSet ) @@ -3455,9 +3488,9 @@ long SplitWindow::GetItemSize( USHORT nId ) const // ----------------------------------------------------------------------- -long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const +long SplitWindow::GetItemSize( sal_uInt16 nId, SplitWindowItemBits nBits ) const { - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); if ( pSet ) @@ -3471,9 +3504,9 @@ long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const long nRelSize = 0; long nPerSize = 0; ImplSplitItem* pItems; - USHORT nItems; + sal_uInt16 nItems; SplitWindowItemBits nTempBits; - USHORT i; + sal_uInt16 i; nItems = pSet->mnItems; pItems = pSet->mpItems; for ( i = 0; i < nItems; i++ ) @@ -3510,11 +3543,41 @@ long SplitWindow::GetItemSize( USHORT nId, SplitWindowItemBits nBits ) const return 0; } + + + +void SplitWindow::SetItemSizeRange (sal_uInt16 nId, const Range aRange) +{ + sal_uInt16 nPos; + ImplSplitSet* pSet = ImplFindItem(mpBaseSet, nId, nPos); + + if (pSet != NULL) + { + pSet->mpItems[nPos].mnMinSize = aRange.Min(); + pSet->mpItems[nPos].mnMaxSize = aRange.Max(); + } +} + + + + +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( USHORT nId, SplitWindowItemBits nNewBits ) +void SplitWindow::SetItemBits( sal_uInt16 nId, SplitWindowItemBits nNewBits ) { - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); ImplSplitItem* pItem; @@ -3529,16 +3592,16 @@ void SplitWindow::SetItemBits( USHORT nId, SplitWindowItemBits nNewBits ) { // Neue Bits setzen und neu durchrechnen pItem->mnBits = nNewBits; - pSet->mbCalcPix = TRUE; + pSet->mbCalcPix = sal_True; ImplUpdate(); } } // ----------------------------------------------------------------------- -SplitWindowItemBits SplitWindow::GetItemBits( USHORT nId ) const +SplitWindowItemBits SplitWindow::GetItemBits( sal_uInt16 nId ) const { - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); if ( pSet ) @@ -3549,9 +3612,9 @@ SplitWindowItemBits SplitWindow::GetItemBits( USHORT nId ) const // ----------------------------------------------------------------------- -Window* SplitWindow::GetItemWindow( USHORT nId ) const +Window* SplitWindow::GetItemWindow( sal_uInt16 nId ) const { - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); if ( pSet ) @@ -3562,9 +3625,9 @@ Window* SplitWindow::GetItemWindow( USHORT nId ) const // ----------------------------------------------------------------------- -USHORT SplitWindow::GetSet( USHORT nId ) const +sal_uInt16 SplitWindow::GetSet( sal_uInt16 nId ) const { - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); if ( pSet ) @@ -3575,55 +3638,55 @@ USHORT SplitWindow::GetSet( USHORT nId ) const // ----------------------------------------------------------------------- -BOOL SplitWindow::GetSet( USHORT nId, USHORT& rSetId, USHORT& rPos ) 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 TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL SplitWindow::IsItemValid( USHORT nId ) const +sal_Bool SplitWindow::IsItemValid( sal_uInt16 nId ) const { - USHORT nPos; + sal_uInt16 nPos; ImplSplitSet* pSet = ImplFindItem( mpBaseSet, nId, nPos ); if ( pSet ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -USHORT SplitWindow::GetItemId( Window* pWindow ) const +sal_uInt16 SplitWindow::GetItemId( Window* pWindow ) const { return ImplFindItem( mpBaseSet, pWindow ); } // ----------------------------------------------------------------------- -USHORT SplitWindow::GetItemId( const Point& rPos ) const +sal_uInt16 SplitWindow::GetItemId( const Point& rPos ) const { return ImplFindItem( mpBaseSet, rPos, mbHorz, !mbBottomRight ); } // ----------------------------------------------------------------------- -USHORT SplitWindow::GetItemPos( USHORT nId, USHORT nSetId ) const +sal_uInt16 SplitWindow::GetItemPos( sal_uInt16 nId, sal_uInt16 nSetId ) const { ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId ); - USHORT nPos = SPLITWINDOW_ITEM_NOTFOUND; + sal_uInt16 nPos = SPLITWINDOW_ITEM_NOTFOUND; if ( pSet ) { - for ( USHORT i = 0; i < pSet->mnItems; i++ ) + for ( sal_uInt16 i = 0; i < pSet->mnItems; i++ ) { if ( pSet->mpItems[i].mnId == nId ) { @@ -3638,7 +3701,7 @@ USHORT SplitWindow::GetItemPos( USHORT nId, USHORT nSetId ) const // ----------------------------------------------------------------------- -USHORT SplitWindow::GetItemId( USHORT nPos, USHORT nSetId ) const +sal_uInt16 SplitWindow::GetItemId( sal_uInt16 nPos, sal_uInt16 nSetId ) const { ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId ); if ( pSet && (nPos < pSet->mnItems) ) @@ -3649,7 +3712,7 @@ USHORT SplitWindow::GetItemId( USHORT nPos, USHORT nSetId ) const // ----------------------------------------------------------------------- -USHORT SplitWindow::GetItemCount( USHORT nSetId ) const +sal_uInt16 SplitWindow::GetItemCount( sal_uInt16 nSetId ) const { ImplSplitSet* pSet = ImplFindSet( mpBaseSet, nSetId ); if ( pSet ) @@ -3664,28 +3727,28 @@ void SplitWindow::ImplNewAlign() { if ( mbNoAlign ) { - mbHorz = FALSE; - mbBottomRight = FALSE; + mbHorz = sal_False; + mbBottomRight = sal_False; } else if ( meAlign == WINDOWALIGN_TOP ) { - mbHorz = TRUE; - mbBottomRight = FALSE; + mbHorz = sal_True; + mbBottomRight = sal_False; } else if ( meAlign == WINDOWALIGN_BOTTOM ) { - mbHorz = TRUE; - mbBottomRight = TRUE; + mbHorz = sal_True; + mbBottomRight = sal_True; } else if ( meAlign == WINDOWALIGN_LEFT ) { - mbHorz = FALSE; - mbBottomRight = FALSE; + mbHorz = sal_False; + mbBottomRight = sal_False; } else if ( meAlign == WINDOWALIGN_RIGHT ) { - mbHorz = FALSE; - mbBottomRight = TRUE; + mbHorz = sal_False; + mbBottomRight = sal_True; } if ( mnWinStyle & WB_BORDER ) @@ -3701,7 +3764,7 @@ void SplitWindow::ImplNewAlign() // ----------------------------------------------------------------------- -void SplitWindow::SetNoAlign( BOOL bNoAlign ) +void SplitWindow::SetNoAlign( sal_Bool bNoAlign ) { bNoAlign = bNoAlign != 0; if ( mbNoAlign != bNoAlign ) @@ -3725,7 +3788,7 @@ void SplitWindow::SetAlign( WindowAlign eNewAlign ) // ----------------------------------------------------------------------- Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign, - WinBits nWinStyle, BOOL bExtra ) + WinBits nWinStyle, sal_Bool bExtra ) { long nLeft; long nTop; @@ -3733,7 +3796,7 @@ Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign, long nBottom; Size aSize = rSize; - ImplCalcBorder( eAlign, FALSE, nLeft, nTop, nRight, nBottom ); + ImplCalcBorder( eAlign, sal_False, nLeft, nTop, nRight, nBottom ); aSize.Width() += nLeft+nRight; aSize.Height() += nTop+nBottom; @@ -3758,7 +3821,7 @@ Size SplitWindow::CalcWindowSizePixel( const Size& rSize, WindowAlign eAlign, // ----------------------------------------------------------------------- -void SplitWindow::ShowAutoHideButton( BOOL bShow ) +void SplitWindow::ShowAutoHideButton( sal_Bool bShow ) { mbAutoHide = bShow; ImplUpdate(); @@ -3766,7 +3829,7 @@ void SplitWindow::ShowAutoHideButton( BOOL bShow ) // ----------------------------------------------------------------------- -void SplitWindow::ShowFadeInHideButton( BOOL bShow ) +void SplitWindow::ShowFadeInHideButton( sal_Bool bShow ) { mbFadeIn = bShow; ImplUpdate(); @@ -3774,7 +3837,7 @@ void SplitWindow::ShowFadeInHideButton( BOOL bShow ) // ----------------------------------------------------------------------- -void SplitWindow::ShowFadeOutButton( BOOL bShow ) +void SplitWindow::ShowFadeOutButton( sal_Bool bShow ) { mbFadeOut = bShow; ImplUpdate(); @@ -3782,7 +3845,7 @@ void SplitWindow::ShowFadeOutButton( BOOL bShow ) // ----------------------------------------------------------------------- -void SplitWindow::SetAutoHideState( BOOL bAutoHide ) +void SplitWindow::SetAutoHideState( sal_Bool bAutoHide ) { mbAutoHideIn = bAutoHide; if ( IsReallyVisible() ) @@ -3812,7 +3875,7 @@ long SplitWindow::GetFadeInSize() const Rectangle SplitWindow::GetAutoHideRect() const { Rectangle aRect; - ImplGetAutoHideRect( aRect, TRUE ); + ImplGetAutoHideRect( aRect, sal_True ); return aRect; } @@ -3821,7 +3884,7 @@ Rectangle SplitWindow::GetAutoHideRect() const Rectangle SplitWindow::GetFadeInRect() const { Rectangle aRect; - ImplGetFadeInRect( aRect, TRUE ); + ImplGetFadeInRect( aRect, sal_True ); return aRect; } @@ -3830,7 +3893,7 @@ Rectangle SplitWindow::GetFadeInRect() const Rectangle SplitWindow::GetFadeOutRect() const { Rectangle aRect; - ImplGetFadeOutRect( aRect, TRUE ); + ImplGetFadeOutRect( aRect, sal_True ); return aRect; } diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx index 924cb837545c..9280bb25b80c 100644 --- a/vcl/source/window/status.cxx +++ b/vcl/source/window/status.cxx @@ -78,7 +78,7 @@ StatusBar::ImplData::~ImplData() struct ImplStatusItem { - USHORT mnId; + sal_uInt16 mnId; StatusBarItemBits mnBits; long mnWidth; long mnOffset; @@ -87,16 +87,16 @@ struct ImplStatusItem XubString maText; XubString maHelpText; XubString maQuickHelpText; - ULONG mnHelpId; + rtl::OString maHelpId; void* mpUserData; - BOOL mbVisible; + sal_Bool mbVisible; XubString maAccessibleName; XubString maCommand; }; // ======================================================================= -inline long ImplCalcProgessWidth( USHORT nMax, long nSize ) +inline long ImplCalcProgessWidth( sal_uInt16 nMax, long nSize ) { return ((nMax*(nSize+(nSize/2)))-(nSize/2)+(STATUSBAR_PRGS_OFFSET*2)); } @@ -104,7 +104,7 @@ inline long ImplCalcProgessWidth( USHORT nMax, long nSize ) // ----------------------------------------------------------------------- static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize, - USHORT nStyle ) + sal_uInt16 nStyle ) { long nX; long nY; @@ -124,12 +124,12 @@ static Point ImplGetItemTextPos( const Size& rRectSize, const Size& rTextSize, // ----------------------------------------------------------------------- -BOOL StatusBar::ImplIsItemUpdate() +sal_Bool StatusBar::ImplIsItemUpdate() { if ( !mbProgressMode && mbVisibleItems && IsReallyVisible() && IsUpdateMode() ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -148,11 +148,11 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle ) mpItemList = new ImplStatusItemList; mpImplData->mpVirDev = new VirtualDevice( *this ); mnCurItemId = 0; - mbFormat = TRUE; - mbVisibleItems = TRUE; - mbProgressMode = FALSE; - mbInUserDraw = FALSE; - mbBottomBorder = FALSE; + mbFormat = sal_True; + mbVisibleItems = sal_True; + mbProgressMode = sal_False; + mbInUserDraw = sal_False; + mbBottomBorder = sal_False; mnItemsWidth = STATUSBAR_OFFSET_X; mnDX = 0; mnDY = 0; @@ -160,7 +160,7 @@ void StatusBar::ImplInit( Window* pParent, WinBits nStyle ) mnItemY = STATUSBAR_OFFSET_Y; mnTextY = STATUSBAR_OFFSET_TEXTY; - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); SetLineColor(); SetOutputSizePixel( CalcWindowSizePixel() ); @@ -205,8 +205,8 @@ StatusBar::~StatusBar() // ----------------------------------------------------------------------- -void StatusBar::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void StatusBar::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); @@ -253,7 +253,7 @@ void StatusBar::ImplInitSettings( BOOL bFont, IsNativeControlSupported( CTRL_WINDOW_BACKGROUND, PART_BACKGROUND_WINDOW ) ) { ImplGetWindowImpl()->mnNativeBackground = PART_BACKGROUND_WINDOW; - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); } } } @@ -266,7 +266,7 @@ void StatusBar::ImplFormat() long nExtraWidth; long nExtraWidth2; long nX; - USHORT nAutoSizeItems = 0; + sal_uInt16 nAutoSizeItems = 0; // Breiten zusammenrechnen mnItemsWidth = STATUSBAR_OFFSET_X; @@ -309,6 +309,8 @@ void StatusBar::ImplFormat() nExtraWidth2 = 0; } nX = STATUSBAR_OFFSET_X; + if( ImplHasMirroredGraphics() && IsRTLEnabled() ) + nX += ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset; } for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) { @@ -329,12 +331,12 @@ void StatusBar::ImplFormat() } } - mbFormat = FALSE; + mbFormat = sal_False; } // ----------------------------------------------------------------------- -Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const +Rectangle StatusBar::ImplGetItemRectPos( sal_uInt16 nPos ) const { Rectangle aRect; ImplStatusItem* pItem; @@ -357,7 +359,7 @@ Rectangle StatusBar::ImplGetItemRectPos( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT StatusBar::ImplGetFirstVisiblePos() const +sal_uInt16 StatusBar::ImplGetFirstVisiblePos() const { ImplStatusItem* pItem; @@ -367,7 +369,7 @@ USHORT StatusBar::ImplGetFirstVisiblePos() const if ( pItem ) { if ( pItem->mbVisible ) - return USHORT(nPos); + return sal_uInt16(nPos); } } @@ -376,7 +378,7 @@ USHORT StatusBar::ImplGetFirstVisiblePos() const // ----------------------------------------------------------------------- -void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth ) +void StatusBar::ImplDrawText( sal_Bool bOffScreen, long nOldTextWidth ) { // Das ueberschreiben der Item-Box verhindern Rectangle aTextRect; @@ -390,7 +392,7 @@ void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth ) { // Position ermitteln XubString aStr = GetText(); - USHORT nPos = aStr.Search( _LF ); + sal_uInt16 nPos = aStr.Search( _LF ); if ( nPos != STRING_NOTFOUND ) aStr.Erase( nPos ); @@ -413,7 +415,7 @@ void StatusBar::ImplDrawText( BOOL bOffScreen, long nOldTextWidth ) // ----------------------------------------------------------------------- -void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL bDrawFrame ) +void StatusBar::ImplDrawItem( sal_Bool bOffScreen, sal_uInt16 nPos, sal_Bool bDrawText, sal_Bool bDrawFrame ) { Rectangle aRect = ImplGetItemRectPos( nPos ); @@ -455,12 +457,12 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL { if ( bOffScreen ) { - mbInUserDraw = TRUE; + mbInUserDraw = sal_True; mpImplData->mpVirDev->EnableRTL( IsRTLEnabled() ); UserDrawEvent aODEvt( mpImplData->mpVirDev, Rectangle( Point(), aTextRectSize ), pItem->mnId ); UserDraw( aODEvt ); - mpImplData->mpVirDev->EnableRTL( FALSE ); - mbInUserDraw = FALSE; + mpImplData->mpVirDev->EnableRTL( sal_False ); + mbInUserDraw = sal_False; } else { @@ -481,7 +483,7 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL { if( !(pItem->mnBits & SIB_FLAT) ) { - USHORT nStyle; + sal_uInt16 nStyle; if ( pItem->mnBits & SIB_IN ) nStyle = FRAME_DRAW_IN; @@ -515,7 +517,7 @@ void StatusBar::ImplDrawItem( BOOL bOffScreen, USHORT nPos, BOOL bDrawText, BOOL void DrawProgress( Window* pWindow, const Point& rPos, long nOffset, long nPrgsWidth, long nPrgsHeight, - USHORT nPercent1, USHORT nPercent2, USHORT nPercentCount, + sal_uInt16 nPercent1, sal_uInt16 nPercent2, sal_uInt16 nPercentCount, const Rectangle& rFramePosSize ) { @@ -553,7 +555,7 @@ void DrawProgress( Window* pWindow, const Point& rPos, pWindow->Push( PUSH_CLIPREGION ); pWindow->IntersectClipRegion( rFramePosSize ); } - BOOL bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, + sal_Bool bNativeOK = pWindow->DrawNativeControl( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, CTRL_STATE_ENABLED, aValue, rtl::OUString() ); if( bNeedErase ) pWindow->Pop(); @@ -565,8 +567,8 @@ void DrawProgress( Window* pWindow, const Point& rPos, } // Werte vorberechnen - USHORT nPerc1 = nPercent1 / nPercentCount; - USHORT nPerc2 = nPercent2 / nPercentCount; + sal_uInt16 nPerc1 = nPercent1 / nPercentCount; + sal_uInt16 nPerc2 = nPercent2 / nPercentCount; if ( nPerc1 > nPerc2 ) { @@ -631,8 +633,8 @@ void DrawProgress( Window* pWindow, const Point& rPos, // ----------------------------------------------------------------------- -void StatusBar::ImplDrawProgress( BOOL bPaint, - USHORT nPercent1, USHORT nPercent2 ) +void StatusBar::ImplDrawProgress( sal_Bool bPaint, + sal_uInt16 nPercent1, sal_uInt16 nPercent2 ) { bool bNative = IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ); // bPaint: draw text also, else only update progress @@ -675,7 +677,7 @@ void StatusBar::ImplCalcProgressRect() // calculate size of progress rects mnPrgsSize = maPrgsFrameRect.Bottom()-maPrgsFrameRect.Top()-(STATUSBAR_PRGS_OFFSET*2); - USHORT nMaxPercent = STATUSBAR_PRGS_COUNT; + sal_uInt16 nMaxPercent = STATUSBAR_PRGS_COUNT; long nMaxWidth = mnDX-STATUSBAR_OFFSET-1; @@ -690,7 +692,7 @@ void StatusBar::ImplCalcProgressRect() // save the divisor for later mnPercentCount = 10000 / nMaxPercent; - BOOL bNativeOK = FALSE; + sal_Bool bNativeOK = sal_False; if( IsNativeControlSupported( CTRL_PROGRESS, PART_ENTIRE_CONTROL ) ) { ImplControlValue aValue; @@ -698,7 +700,7 @@ void StatusBar::ImplCalcProgressRect() Rectangle aNativeControlRegion, aNativeContentRegion; if( (bNativeOK = GetNativeControlRegion( CTRL_PROGRESS, PART_ENTIRE_CONTROL, aControlRegion, CTRL_STATE_ENABLED, aValue, rtl::OUString(), - aNativeControlRegion, aNativeContentRegion ) ) != FALSE ) + aNativeControlRegion, aNativeContentRegion ) ) != sal_False ) { long nProgressHeight = aNativeControlRegion.GetHeight(); if( nProgressHeight > maPrgsFrameRect.GetHeight() ) @@ -730,7 +732,7 @@ void StatusBar::MouseButtonDown( const MouseEvent& rMEvt ) { ImplStatusItem* pItem = (*mpItemList)[ i ]; // Ist es dieses Item - if ( ImplGetItemRectPos( USHORT(i) ).IsInside( aMousePos ) ) + if ( ImplGetItemRectPos( sal_uInt16(i) ).IsInside( aMousePos ) ) { mnCurItemId = pItem->mnId; if ( rMEvt.GetClicks() == 2 ) @@ -760,22 +762,22 @@ void StatusBar::Paint( const Rectangle& ) if ( mbFormat ) ImplFormat(); - USHORT nItemCount = USHORT( mpItemList->size() ); + sal_uInt16 nItemCount = sal_uInt16( mpItemList->size() ); if ( mbProgressMode ) - ImplDrawProgress( TRUE, 0, mnPercent ); + ImplDrawProgress( sal_True, 0, mnPercent ); else { // Text zeichen if ( !mbVisibleItems || (GetStyle() & WB_RIGHT) ) - ImplDrawText( FALSE, 0 ); + ImplDrawText( sal_False, 0 ); // Items zeichnen if ( mbVisibleItems ) { // Items zeichnen - for ( USHORT i = 0; i < nItemCount; i++ ) - ImplDrawItem( FALSE, i, TRUE, TRUE ); + for ( sal_uInt16 i = 0; i < nItemCount; i++ ) + ImplDrawItem( sal_False, i, sal_True, sal_True ); } } @@ -812,7 +814,7 @@ void StatusBar::Resize() { // Breite und Hoehe abfragen und merken Size aSize = GetOutputSizePixel(); - mnDX = aSize.Width(); + mnDX = aSize.Width() - ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset; mnDY = aSize.Height(); mnCalcHeight = mnDY; // subtract border @@ -829,7 +831,7 @@ void StatusBar::Resize() mnTextY += 2; // Formatierung neu ausloesen - mbFormat = TRUE; + mbFormat = sal_True; if ( mbProgressMode ) ImplCalcProgressRect(); @@ -845,7 +847,7 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt ) if( rHEvt.KeyboardActivated() ) return; - USHORT nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); + sal_uInt16 nItemId = GetItemId( ScreenToOutputPixel( rHEvt.GetMousePosPixel() ) ); if ( nItemId ) { @@ -883,9 +885,9 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt ) else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { String aCommand = GetItemCommand( nItemId ); - ULONG nHelpId = GetHelpId( nItemId ); + rtl::OString aHelpId( GetHelpId( nItemId ) ); - if ( aCommand.Len() || nHelpId ) + if ( aCommand.Len() || aHelpId.getLength() ) { // Wenn eine Hilfe existiert, dann ausloesen Help* pHelp = Application::GetHelp(); @@ -893,8 +895,8 @@ void StatusBar::RequestHelp( const HelpEvent& rHEvt ) { if ( aCommand.Len() ) pHelp->Start( aCommand, this ); - else if ( nHelpId ) - pHelp->Start( nHelpId, this ); + else if ( aHelpId.getLength() ) + pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return; } @@ -917,18 +919,18 @@ void StatusBar::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - mbFormat = TRUE; - ImplInitSettings( TRUE, FALSE, FALSE ); + mbFormat = sal_True; + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); + ImplInitSettings( sal_False, sal_False, sal_True ); Invalidate(); } } @@ -947,8 +949,8 @@ void StatusBar::DataChanged( const DataChangedEvent& rDCEvt ) ) ) { - mbFormat = TRUE; - ImplInitSettings( TRUE, TRUE, TRUE ); + mbFormat = sal_True; + ImplInitSettings( sal_True, sal_True, sal_True ); long nFudge = GetTextHeight() / 4; for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) { @@ -990,9 +992,9 @@ void StatusBar::UserDraw( const UserDrawEvent& ) // ----------------------------------------------------------------------- -void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth, +void StatusBar::InsertItem( sal_uInt16 nItemId, sal_uLong nWidth, StatusBarItemBits nBits, - long nOffset, USHORT nPos ) + long nOffset, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "StatusBar::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == STATUSBAR_ITEM_NOTFOUND, @@ -1011,9 +1013,8 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth, pItem->mnBits = nBits; pItem->mnWidth = (long)nWidth+nFudge+STATUSBAR_OFFSET; pItem->mnOffset = nOffset; - pItem->mnHelpId = 0; pItem->mpUserData = 0; - pItem->mbVisible = TRUE; + pItem->mbVisible = sal_True; // Item in die Liste einfuegen if ( nPos < mpItemList->size() ) { @@ -1022,7 +1023,7 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth, mpItemList->push_back( pItem ); } - mbFormat = TRUE; + mbFormat = sal_True; if ( ImplIsItemUpdate() ) Invalidate(); @@ -1031,15 +1032,15 @@ void StatusBar::InsertItem( USHORT nItemId, ULONG nWidth, // ----------------------------------------------------------------------- -void StatusBar::RemoveItem( USHORT nItemId ) +void StatusBar::RemoveItem( sal_uInt16 nItemId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { delete (*mpItemList)[ nPos ]; mpItemList->erase( mpItemList->begin() + nPos ); - mbFormat = TRUE; + mbFormat = sal_True; if ( ImplIsItemUpdate() ) Invalidate(); @@ -1049,18 +1050,18 @@ void StatusBar::RemoveItem( USHORT nItemId ) // ----------------------------------------------------------------------- -void StatusBar::ShowItem( USHORT nItemId ) +void StatusBar::ShowItem( sal_uInt16 nItemId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { ImplStatusItem* pItem = (*mpItemList)[ nPos ]; if ( !pItem->mbVisible ) { - pItem->mbVisible = TRUE; + pItem->mbVisible = sal_True; - mbFormat = TRUE; + mbFormat = sal_True; if ( ImplIsItemUpdate() ) Invalidate(); @@ -1071,18 +1072,18 @@ void StatusBar::ShowItem( USHORT nItemId ) // ----------------------------------------------------------------------- -void StatusBar::HideItem( USHORT nItemId ) +void StatusBar::HideItem( sal_uInt16 nItemId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { ImplStatusItem* pItem = (*mpItemList)[ nPos ]; if ( pItem->mbVisible ) { - pItem->mbVisible = FALSE; + pItem->mbVisible = sal_False; - mbFormat = TRUE; + mbFormat = sal_True; if ( ImplIsItemUpdate() ) Invalidate(); @@ -1093,14 +1094,14 @@ void StatusBar::HideItem( USHORT nItemId ) // ----------------------------------------------------------------------- -BOOL StatusBar::IsItemVisible( USHORT nItemId ) const +sal_Bool StatusBar::IsItemVisible( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->mbVisible; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -1109,7 +1110,7 @@ void StatusBar::ShowItems() { if ( !mbVisibleItems ) { - mbVisibleItems = TRUE; + mbVisibleItems = sal_True; if ( !mbProgressMode ) Invalidate(); @@ -1123,7 +1124,7 @@ void StatusBar::HideItems() { if ( mbVisibleItems ) { - mbVisibleItems = FALSE; + mbVisibleItems = sal_False; if ( !mbProgressMode ) Invalidate(); @@ -1146,7 +1147,7 @@ void StatusBar::CopyItems( const StatusBar& rStatusBar ) mpItemList->push_back( new ImplStatusItem( *(*rStatusBar.mpItemList)[ i ] ) ); } - mbFormat = TRUE; + mbFormat = sal_True; if ( ImplIsItemUpdate() ) Invalidate(); } @@ -1161,7 +1162,7 @@ void StatusBar::Clear() } mpItemList->clear(); - mbFormat = TRUE; + mbFormat = sal_True; if ( ImplIsItemUpdate() ) Invalidate(); @@ -1170,14 +1171,14 @@ void StatusBar::Clear() // ----------------------------------------------------------------------- -USHORT StatusBar::GetItemCount() const +sal_uInt16 StatusBar::GetItemCount() const { - return (USHORT)mpItemList->size(); + return (sal_uInt16)mpItemList->size(); } // ----------------------------------------------------------------------- -USHORT StatusBar::GetItemId( USHORT nPos ) const +sal_uInt16 StatusBar::GetItemId( sal_uInt16 nPos ) const { if ( nPos < mpItemList->size() ) return (*mpItemList)[ nPos ]->mnId; @@ -1186,11 +1187,11 @@ USHORT StatusBar::GetItemId( USHORT nPos ) const // ----------------------------------------------------------------------- -USHORT StatusBar::GetItemPos( USHORT nItemId ) const +sal_uInt16 StatusBar::GetItemPos( sal_uInt16 nItemId ) const { for ( size_t i = 0, n = mpItemList->size(); i < n; ++i ) { if ( (*mpItemList)[ i ]->mnId == nItemId ) { - return USHORT( i ); + return sal_uInt16( i ); } } @@ -1199,12 +1200,12 @@ USHORT StatusBar::GetItemPos( USHORT nItemId ) const // ----------------------------------------------------------------------- -USHORT StatusBar::GetItemId( const Point& rPos ) const +sal_uInt16 StatusBar::GetItemId( const Point& rPos ) const { if ( AreItemsVisible() && !mbFormat ) { - USHORT nItemCount = GetItemCount(); - USHORT nPos; + sal_uInt16 nItemCount = GetItemCount(); + sal_uInt16 nPos; for ( nPos = 0; nPos < nItemCount; nPos++ ) { // Rechteck holen @@ -1219,13 +1220,13 @@ USHORT StatusBar::GetItemId( const Point& rPos ) const // ----------------------------------------------------------------------- -Rectangle StatusBar::GetItemRect( USHORT nItemId ) const +Rectangle StatusBar::GetItemRect( sal_uInt16 nItemId ) const { Rectangle aRect; if ( AreItemsVisible() && !mbFormat ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { // Rechteck holen und Rahmen abziehen @@ -1244,11 +1245,11 @@ Rectangle StatusBar::GetItemRect( USHORT nItemId ) const // ----------------------------------------------------------------------- -Point StatusBar::GetItemTextPos( USHORT nItemId ) const +Point StatusBar::GetItemTextPos( sal_uInt16 nItemId ) const { if ( !mbFormat ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { // Rechteck holen @@ -1274,9 +1275,9 @@ Point StatusBar::GetItemTextPos( USHORT nItemId ) const // ----------------------------------------------------------------------- -ULONG StatusBar::GetItemWidth( USHORT nItemId ) const +sal_uLong StatusBar::GetItemWidth( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->mnWidth; @@ -1286,9 +1287,9 @@ ULONG StatusBar::GetItemWidth( USHORT nItemId ) const // ----------------------------------------------------------------------- -StatusBarItemBits StatusBar::GetItemBits( USHORT nItemId ) const +StatusBarItemBits StatusBar::GetItemBits( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->mnBits; @@ -1298,9 +1299,9 @@ StatusBarItemBits StatusBar::GetItemBits( USHORT nItemId ) const // ----------------------------------------------------------------------- -long StatusBar::GetItemOffset( USHORT nItemId ) const +long StatusBar::GetItemOffset( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->mnOffset; @@ -1310,9 +1311,9 @@ long StatusBar::GetItemOffset( USHORT nItemId ) const // ----------------------------------------------------------------------- -void StatusBar::SetItemText( USHORT nItemId, const XubString& rText ) +void StatusBar::SetItemText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { @@ -1338,7 +1339,7 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText ) if ( pItem->mbVisible && !mbFormat && ImplIsItemUpdate() ) { Update(); - ImplDrawItem( TRUE, nPos, TRUE, FALSE ); + ImplDrawItem( sal_True, nPos, sal_True, sal_False ); Flush(); } } @@ -1347,9 +1348,9 @@ void StatusBar::SetItemText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -const XubString& StatusBar::GetItemText( USHORT nItemId ) const +const XubString& StatusBar::GetItemText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->maText; @@ -1359,9 +1360,9 @@ const XubString& StatusBar::GetItemText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void StatusBar::SetItemCommand( USHORT nItemId, const XubString& rCommand ) +void StatusBar::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { @@ -1374,9 +1375,9 @@ void StatusBar::SetItemCommand( USHORT nItemId, const XubString& rCommand ) // ----------------------------------------------------------------------- -const XubString& StatusBar::GetItemCommand( USHORT nItemId ) +const XubString& StatusBar::GetItemCommand( sal_uInt16 nItemId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->maCommand; @@ -1386,9 +1387,9 @@ const XubString& StatusBar::GetItemCommand( USHORT nItemId ) // ----------------------------------------------------------------------- -void StatusBar::SetItemData( USHORT nItemId, void* pNewData ) +void StatusBar::SetItemData( sal_uInt16 nItemId, void* pNewData ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { @@ -1400,7 +1401,7 @@ void StatusBar::SetItemData( USHORT nItemId, void* pNewData ) !mbFormat && ImplIsItemUpdate() ) { Update(); - ImplDrawItem( TRUE, nPos, FALSE, FALSE ); + ImplDrawItem( sal_True, nPos, sal_False, sal_False ); Flush(); } } @@ -1408,9 +1409,9 @@ void StatusBar::SetItemData( USHORT nItemId, void* pNewData ) // ----------------------------------------------------------------------- -void* StatusBar::GetItemData( USHORT nItemId ) const +void* StatusBar::GetItemData( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->mpUserData; @@ -1420,9 +1421,9 @@ void* StatusBar::GetItemData( USHORT nItemId ) const // ----------------------------------------------------------------------- -void StatusBar::SetHelpText( USHORT nItemId, const XubString& rText ) +void StatusBar::SetHelpText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) (*mpItemList)[ nPos ]->maHelpText = rText; @@ -1430,22 +1431,22 @@ void StatusBar::SetHelpText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -const XubString& StatusBar::GetHelpText( USHORT nItemId ) const +const XubString& StatusBar::GetHelpText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { ImplStatusItem* pItem = (*mpItemList)[ nPos ]; - if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommand.Len() )) + if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommand.Len() )) { Help* pHelp = Application::GetHelp(); if ( pHelp ) { if ( pItem->maCommand.Len() ) pItem->maHelpText = pHelp->GetHelpText( pItem->maCommand, this ); - if ( !pItem->maHelpText.Len() && pItem->mnHelpId ) - pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this ); + if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() ) + pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } } @@ -1457,9 +1458,9 @@ const XubString& StatusBar::GetHelpText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText ) +void StatusBar::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) (*mpItemList)[ nPos ]->maQuickHelpText = rText; @@ -1467,9 +1468,9 @@ void StatusBar::SetQuickHelpText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const +const XubString& StatusBar::GetQuickHelpText( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { @@ -1482,24 +1483,31 @@ const XubString& StatusBar::GetQuickHelpText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void StatusBar::SetHelpId( USHORT nItemId, ULONG nHelpId ) +void StatusBar::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) - (*mpItemList)[ nPos ]->mnHelpId = nHelpId; + (*mpItemList)[ nPos ]->maHelpId = rHelpId; } // ----------------------------------------------------------------------- -ULONG StatusBar::GetHelpId( USHORT nItemId ) const +rtl::OString StatusBar::GetHelpId( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); + rtl::OString aRet; if ( nPos != STATUSBAR_ITEM_NOTFOUND ) - return (*mpItemList)[ nPos ]->mnHelpId; + { + ImplStatusItem* pItem = (*mpItemList)[ nPos ]; + if ( pItem->maHelpId.getLength() ) + aRet = pItem->maHelpId; + else + aRet = ::rtl::OUStringToOString( pItem->maCommand, RTL_TEXTENCODING_UTF8 ); + } - return 0; + return aRet; } // ----------------------------------------------------------------------- @@ -1516,11 +1524,11 @@ void StatusBar::ImplCalcBorder( ) } if ( IsBottomBorder() ) mnCalcHeight -= 2; - mbFormat = TRUE; + mbFormat = sal_True; Invalidate(); } -void StatusBar::SetBottomBorder( BOOL bBottomBorder ) +void StatusBar::SetBottomBorder( sal_Bool bBottomBorder ) { if ( mbBottomBorder != bBottomBorder ) { @@ -1529,7 +1537,7 @@ void StatusBar::SetBottomBorder( BOOL bBottomBorder ) } } -void StatusBar::SetTopBorder( BOOL bTopBorder ) +void StatusBar::SetTopBorder( sal_Bool bTopBorder ) { if ( mpImplData->mbTopBorder != static_cast<bool>(bTopBorder) ) { @@ -1538,7 +1546,7 @@ void StatusBar::SetTopBorder( BOOL bTopBorder ) } } -BOOL StatusBar::IsTopBorder() const +sal_Bool StatusBar::IsTopBorder() const { return mpImplData->mbTopBorder; } @@ -1549,7 +1557,7 @@ void StatusBar::StartProgressMode( const XubString& rText ) { DBG_ASSERT( !mbProgressMode, "StatusBar::StartProgressMode(): progress mode is active" ); - mbProgressMode = TRUE; + mbProgressMode = sal_True; mnPercent = 0; maPrgsTxt = rText; @@ -1573,7 +1581,7 @@ void StatusBar::StartProgressMode( const XubString& rText ) // ----------------------------------------------------------------------- -void StatusBar::SetProgressValue( USHORT nNewPercent ) +void StatusBar::SetProgressValue( sal_uInt16 nNewPercent ) { DBG_ASSERT( mbProgressMode, "StatusBar::SetProgressValue(): no progrss mode" ); DBG_ASSERTWARNING( nNewPercent <= 100, "StatusBar::SetProgressValue(): nPercent > 100" ); @@ -1584,7 +1592,7 @@ void StatusBar::SetProgressValue( USHORT nNewPercent ) { Update(); SetLineColor(); - ImplDrawProgress( FALSE, mnPercent, nNewPercent ); + ImplDrawProgress( sal_False, mnPercent, nNewPercent ); Flush(); } mnPercent = nNewPercent; @@ -1596,7 +1604,7 @@ void StatusBar::EndProgressMode() { DBG_ASSERT( mbProgressMode, "StatusBar::EndProgressMode(): no progress mode" ); - mbProgressMode = FALSE; + mbProgressMode = sal_False; maPrgsTxt.Erase(); // Paint neu ausloesen um StatusBar wieder herzustellen @@ -1643,7 +1651,7 @@ void StatusBar::SetText( const XubString& rText ) Update(); long nOldTextWidth = GetTextWidth( GetText() ); Window::SetText( rText ); - ImplDrawText( TRUE, nOldTextWidth ); + ImplDrawText( sal_True, nOldTextWidth ); Flush(); } } @@ -1727,9 +1735,9 @@ Size StatusBar::CalcWindowSizePixel() const // ----------------------------------------------------------------------- -void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName ) +void StatusBar::SetAccessibleName( sal_uInt16 nItemId, const XubString& rName ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) { @@ -1745,9 +1753,9 @@ void StatusBar::SetAccessibleName( USHORT nItemId, const XubString& rName ) // ----------------------------------------------------------------------- -const XubString& StatusBar::GetAccessibleName( USHORT nItemId ) const +const XubString& StatusBar::GetAccessibleName( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != STATUSBAR_ITEM_NOTFOUND ) return (*mpItemList)[ nPos ]->maAccessibleName; diff --git a/vcl/source/window/syschild.cxx b/vcl/source/window/syschild.cxx index a1a33b905cdf..6d9de205dfce 100644 --- a/vcl/source/window/syschild.cxx +++ b/vcl/source/window/syschild.cxx @@ -30,23 +30,38 @@ #include "precompiled_vcl.hxx" #include <svsys.h> +#include <rtl/process.h> +#include <rtl/ref.hxx> +#include <tools/rc.h> +#include <vcl/window.h> #include <vcl/salinst.hxx> #include <vcl/salframe.hxx> #include <vcl/window.hxx> #include <vcl/salobj.hxx> - -#include <tools/rc.h> #include <vcl/svdata.hxx> -#include <vcl/window.h> +#include <vcl/sysdata.hxx> #include <vcl/svapp.hxx> #include <vcl/syschild.hxx> +#include <vcl/unohelp.hxx> + +#ifdef SOLAR_JAVA +#include <jni.h> +#endif + +#include <comphelper/processfactory.hxx> +#include <jvmaccess/virtualmachine.hxx> +#include <com/sun/star/java/XJavaVM.hpp> +#include <com/sun/star/java/XJavaThreadRegister_11.hpp> +#include <com/sun/star/lang/XMultiServiceFactory.hpp> +#include <vcl/syschild.hxx> +using namespace ::com::sun::star; // ======================================================================= long ImplSysChildProc( void* pInst, SalObject* /* pObject */, - USHORT nEvent, const void* /* pEvent */ ) + sal_uInt16 nEvent, const void* /* pEvent */ ) { SystemChildWindow* pWindow = (SystemChildWindow*)pInst; long nRet = 0; @@ -58,33 +73,33 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */, // Focus holen und zwar so, das alle Handler gerufen // werden, als ob dieses Fenster den Focus bekommt, // ohne das der Frame den Focus wieder klaut - pWindow->ImplGetFrameData()->mbSysObjFocus = TRUE; - pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = TRUE; + pWindow->ImplGetFrameData()->mbSysObjFocus = sal_True; + pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_True; pWindow->ToTop( TOTOP_NOGRABFOCUS ); if( aDogTag.IsDead() ) break; - pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = FALSE; - pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = TRUE; + pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_False; + pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = sal_True; pWindow->GrabFocus(); if( aDogTag.IsDead() ) break; - pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = FALSE; + pWindow->ImplGetFrameData()->mbInSysObjFocusHdl = sal_False; break; case SALOBJ_EVENT_LOSEFOCUS: // Hintenrum einen LoseFocus ausloesen, das der Status // der Fenster dem entsprechenden Activate-Status // entspricht - pWindow->ImplGetFrameData()->mbSysObjFocus = FALSE; + pWindow->ImplGetFrameData()->mbSysObjFocus = sal_False; if ( !pWindow->ImplGetFrameData()->mnFocusId ) { - pWindow->ImplGetFrameData()->mbStartFocusState = TRUE; + pWindow->ImplGetFrameData()->mbStartFocusState = sal_True; Application::PostUserEvent( pWindow->ImplGetFrameData()->mnFocusId, LINK( pWindow->ImplGetFrameWindow(), Window, ImplAsyncFocusHdl ) ); } break; case SALOBJ_EVENT_TOTOP: - pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = TRUE; + pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_True; if ( !Application::GetFocusWindow() || pWindow->HasChildPathFocus() ) pWindow->ToTop( TOTOP_NOGRABFOCUS ); else @@ -94,7 +109,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */, pWindow->GrabFocus(); if( aDogTag.IsDead() ) break; - pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = FALSE; + pWindow->ImplGetFrameData()->mbInSysObjToTopHdl = sal_False; break; } @@ -103,7 +118,7 @@ long ImplSysChildProc( void* pInst, SalObject* /* pObject */, // ======================================================================= -void SystemChildWindow::ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow ) +void SystemChildWindow::ImplInitSysChild( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow ) { mpWindowImpl->mpSysObj = ImplGetSVData()->mpDefInst->CreateObject( pParent->ImplGetFrame(), pData, bShow ); @@ -128,7 +143,7 @@ SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle ) : // ----------------------------------------------------------------------- -SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, BOOL bShow ) : +SystemChildWindow::SystemChildWindow( Window* pParent, WinBits nStyle, SystemWindowData *pData, sal_Bool bShow ) : Window( WINDOW_SYSTEMCHILDWINDOW ) { ImplInitSysChild( pParent, nStyle, pData, bShow ); @@ -172,24 +187,161 @@ const SystemEnvData* SystemChildWindow::GetSystemData() const // ----------------------------------------------------------------------- -void SystemChildWindow::EnableEraseBackground( BOOL bEnable ) +void SystemChildWindow::EnableEraseBackground( sal_Bool bEnable ) { if ( mpWindowImpl->mpSysObj ) mpWindowImpl->mpSysObj->EnableEraseBackground( bEnable ); } -BOOL SystemChildWindow::IsEraseBackgroundEnabled() +// ----------------------------------------------------------------------- + +sal_Bool SystemChildWindow::IsEraseBackgroundEnabled() { if ( mpWindowImpl->mpSysObj ) return mpWindowImpl->mpSysObj->IsEraseBackgroundEnabled(); else - return FALSE; + return sal_False; +} + +// ----------------------------------------------------------------------- + +void SystemChildWindow::ImplTestJavaException( void* pEnv ) +{ +#ifdef SOLAR_JAVA + JNIEnv* pJavaEnv = reinterpret_cast< JNIEnv* >( pEnv ); + jthrowable jtThrowable = pJavaEnv->ExceptionOccurred(); + + if( jtThrowable ) + { // is it a java exception ? +#if OSL_DEBUG_LEVEL > 1 + pJavaEnv->ExceptionDescribe(); +#endif // OSL_DEBUG_LEVEL > 1 + pJavaEnv->ExceptionClear(); + + jclass jcThrowable = pJavaEnv->FindClass("java/lang/Throwable"); + jmethodID jmThrowable_getMessage = pJavaEnv->GetMethodID(jcThrowable, "getMessage", "()Ljava/lang/String;"); + jstring jsMessage = (jstring) pJavaEnv->CallObjectMethod(jtThrowable, jmThrowable_getMessage); + ::rtl::OUString ouMessage; + + if(jsMessage) + { + const jchar * jcMessage = pJavaEnv->GetStringChars(jsMessage, NULL); + ouMessage = ::rtl::OUString(jcMessage); + pJavaEnv->ReleaseStringChars(jsMessage, jcMessage); + } + + throw uno::RuntimeException(ouMessage, uno::Reference<uno::XInterface>()); + } +#endif // SOLAR_JAVA } -void SystemChildWindow::SetForwardKey( BOOL bEnable ) +void SystemChildWindow::SetForwardKey( sal_Bool bEnable ) +{ + if ( mpWindowImpl->mpSysObj ) + mpWindowImpl->mpSysObj->SetForwardKey( bEnable ); +} + +// ----------------------------------------------------------------------- + +sal_IntPtr SystemChildWindow::GetParentWindowHandle( sal_Bool bUseJava ) { - if ( mpWindowImpl->mpSysObj ) - mpWindowImpl->mpSysObj->SetForwardKey( bEnable ); + sal_IntPtr nRet = 0; + +#if defined WNT + nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->hWnd ); +#elif defined QUARTZ + // FIXME: this is wrong + nRet = reinterpret_cast< sal_IntPtr >( GetSystemData()->pView ); +#elif defined UNX + if( !bUseJava ) + { + nRet = (sal_IntPtr) GetSystemData()->aWindow; + } +#ifdef SOLAR_JAVA + else + { + uno::Reference< lang::XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); + + if( xFactory.is() && ( GetSystemData()->aWindow > 0 ) ) + { + try + { + ::rtl::Reference< ::jvmaccess::VirtualMachine > xVM; + uno::Reference< java::XJavaVM > xJavaVM( xFactory->createInstance( rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.java.JavaVirtualMachine") ) ), uno::UNO_QUERY ); + uno::Sequence< sal_Int8 > aProcessID( 17 ); + + rtl_getGlobalProcessId( (sal_uInt8*) aProcessID.getArray() ); + aProcessID[ 16 ] = 0; + OSL_ENSURE(sizeof (sal_Int64) >= sizeof (jvmaccess::VirtualMachine *), "Pointer cannot be represented as sal_Int64"); + sal_Int64 nPointer = reinterpret_cast< sal_Int64 >( static_cast< jvmaccess::VirtualMachine * >(0)); + xJavaVM->getJavaVM(aProcessID) >>= nPointer; + xVM = reinterpret_cast< jvmaccess::VirtualMachine * >(nPointer); + + if( xVM.is() ) + { + try + { + ::jvmaccess::VirtualMachine::AttachGuard aVMAttachGuard( xVM ); + JNIEnv* pEnv = aVMAttachGuard.getEnvironment(); + + jclass jcToolkit = pEnv->FindClass("java/awt/Toolkit"); + ImplTestJavaException(pEnv); + + jmethodID jmToolkit_getDefaultToolkit = pEnv->GetStaticMethodID( jcToolkit, "getDefaultToolkit", "()Ljava/awt/Toolkit;" ); + ImplTestJavaException(pEnv); + + pEnv->CallStaticObjectMethod(jcToolkit, jmToolkit_getDefaultToolkit); + ImplTestJavaException(pEnv); + + jclass jcMotifAppletViewer = pEnv->FindClass("sun/plugin/navig/motif/MotifAppletViewer"); + if( pEnv->ExceptionOccurred() ) + { + pEnv->ExceptionClear(); + + jcMotifAppletViewer = pEnv->FindClass( "sun/plugin/viewer/MNetscapePluginContext"); + ImplTestJavaException(pEnv); + } + + jclass jcClassLoader = pEnv->FindClass("java/lang/ClassLoader"); + ImplTestJavaException(pEnv); + + jmethodID jmClassLoader_loadLibrary = pEnv->GetStaticMethodID( jcClassLoader, "loadLibrary", "(Ljava/lang/Class;Ljava/lang/String;Z)V"); + ImplTestJavaException(pEnv); + + jstring jsplugin = pEnv->NewStringUTF("javaplugin_jni"); + ImplTestJavaException(pEnv); + + pEnv->CallStaticVoidMethod(jcClassLoader, jmClassLoader_loadLibrary, jcMotifAppletViewer, jsplugin, JNI_FALSE); + ImplTestJavaException(pEnv); + + jmethodID jmMotifAppletViewer_getWidget = pEnv->GetStaticMethodID( jcMotifAppletViewer, "getWidget", "(IIIII)I" ); + ImplTestJavaException(pEnv); + + const Size aSize( GetOutputSizePixel() ); + jint ji_widget = pEnv->CallStaticIntMethod( jcMotifAppletViewer, jmMotifAppletViewer_getWidget, + GetSystemData()->aWindow, 0, 0, aSize.Width(), aSize.Height() ); + ImplTestJavaException(pEnv); + + nRet = static_cast< sal_IntPtr >( ji_widget ); + } + catch( uno::RuntimeException& ) + { + } + + if( !nRet ) + nRet = static_cast< sal_IntPtr >( GetSystemData()->aWindow ); + } + } + catch( ... ) + { + } + } + } +#endif // SOLAR_JAVA +#else // WNT || QUARTZ || UNX +#endif + + return nRet; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/syswin.cxx b/vcl/source/window/syswin.cxx index fe3b6f5a585b..3343779f632b 100644 --- a/vcl/source/window/syswin.cxx +++ b/vcl/source/window/syswin.cxx @@ -79,16 +79,16 @@ SystemWindow::SystemWindow( WindowType nType ) : Window( nType ) { mpImplData = new ImplData; - mpWindowImpl->mbSysWin = TRUE; + mpWindowImpl->mbSysWin = sal_True; mpWindowImpl->mnActivateMode = ACTIVATE_MODE_GRABFOCUS; mpMenuBar = NULL; - mbPined = FALSE; - mbRollUp = FALSE; - mbRollFunc = FALSE; - mbDockBtn = FALSE; - mbHideBtn = FALSE; - mbSysChild = FALSE; + mbPined = sal_False; + mbRollUp = sal_False; + mbRollFunc = sal_False; + mbDockBtn = sal_False; + mbHideBtn = sal_False; + mbSysChild = sal_False; mnMenuBarMode = MENUBAR_MODE_NORMAL; mnIcon = 0; } @@ -113,8 +113,8 @@ long SystemWindow::Notify( NotifyEvent& rNEvt ) if( pWin && pWin->IsSystemWindow() ) pMBar = ((SystemWindow*)pWin)->GetMenuBar(); } - if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), FALSE ) ) - return TRUE; + if ( pMBar && pMBar->ImplHandleKeyEvent( *rNEvt.GetKeyEvent(), sal_False ) ) + return sal_True; } return Window::Notify( rNEvt ); @@ -133,7 +133,7 @@ long SystemWindow::PreNotify( NotifyEvent& rNEvt ) { // Ctrl-F6 goes directly to the document GrabFocusToDocument(); - return TRUE; + return sal_True; } else { @@ -158,7 +158,7 @@ long SystemWindow::PreNotify( NotifyEvent& rNEvt ) pTList = pSysWin->mpImplData->mpTaskPaneList; } if( pTList && pTList->HandleKeyEvent( *rNEvt.GetKeyEvent() ) ) - return TRUE; + return sal_True; } } return Window::PreNotify( rNEvt ); @@ -188,17 +188,17 @@ TaskPaneList* SystemWindow::GetTaskPaneList() // ----------------------------------------------------------------------- -BOOL SystemWindow::Close() +sal_Bool SystemWindow::Close() { ImplDelData aDelData; ImplAddDel( &aDelData ); ImplCallEventListeners( VCLEVENT_WINDOW_CLOSE ); if ( aDelData.IsDelete() ) - return FALSE; + return sal_False; ImplRemoveDel( &aDelData ); if ( mpWindowImpl->mxWindowPeer.is() && IsCreatedWithToolkit() ) - return FALSE; + return sal_False; // Is Window not closeable, ignore close Window* pBorderWin = ImplGetBorderWindow(); @@ -210,17 +210,17 @@ BOOL SystemWindow::Close() if ( !(nStyle & WB_CLOSEABLE) ) { Sound::Beep( SOUND_DISABLE, this ); - return FALSE; + return sal_False; } Hide(); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- -void SystemWindow::TitleButtonClick( USHORT ) +void SystemWindow::TitleButtonClick( sal_uInt16 ) { } @@ -244,14 +244,14 @@ void SystemWindow::Resizing( Size& ) // ----------------------------------------------------------------------- -void SystemWindow::SetZLevel( BYTE nLevel ) +void SystemWindow::SetZLevel( sal_uInt8 nLevel ) { Window* pWindow = this; while ( pWindow->mpWindowImpl->mpBorderWindow ) pWindow = pWindow->mpWindowImpl->mpBorderWindow; if ( pWindow->mpWindowImpl->mbOverlapWin && !pWindow->mpWindowImpl->mbFrame ) { - BYTE nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel; + sal_uInt8 nOldLevel = pWindow->mpWindowImpl->mpOverlapData->mnTopLevel; pWindow->mpWindowImpl->mpOverlapData->mnTopLevel = nLevel; // Wenn der neue Level groesser als der alte ist, schieben // wir das Fenster nach hinten @@ -297,7 +297,7 @@ const rtl::OUString& SystemWindow::GetRepresentedURL() const // ----------------------------------------------------------------------- -void SystemWindow::SetIcon( USHORT nIcon ) +void SystemWindow::SetIcon( sal_uInt16 nIcon ) { if ( mnIcon == nIcon ) return; @@ -317,7 +317,7 @@ void SystemWindow::SetIcon( USHORT nIcon ) // ----------------------------------------------------------------------- -BYTE SystemWindow::GetZLevel() const +sal_uInt8 SystemWindow::GetZLevel() const { const Window* pWindow = this; while ( pWindow->mpWindowImpl->mpBorderWindow ) @@ -325,12 +325,12 @@ BYTE SystemWindow::GetZLevel() const if ( pWindow->mpWindowImpl->mpOverlapData ) return pWindow->mpWindowImpl->mpOverlapData->mnTopLevel; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void SystemWindow::EnableSaveBackground( BOOL bSave ) +void SystemWindow::EnableSaveBackground( sal_Bool bSave ) { if( ImplGetSVData()->maWinData.mbNoSaveBackground ) bSave = false; @@ -348,7 +348,7 @@ void SystemWindow::EnableSaveBackground( BOOL bSave ) // ----------------------------------------------------------------------- -BOOL SystemWindow::IsSaveBackgroundEnabled() const +sal_Bool SystemWindow::IsSaveBackgroundEnabled() const { const Window* pWindow = this; while ( pWindow->mpWindowImpl->mpBorderWindow ) @@ -356,12 +356,12 @@ BOOL SystemWindow::IsSaveBackgroundEnabled() const if ( pWindow->mpWindowImpl->mpOverlapData ) return pWindow->mpWindowImpl->mpOverlapData->mbSaveBack; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void SystemWindow::ShowTitleButton( USHORT nButton, BOOL bVisible ) +void SystemWindow::ShowTitleButton( sal_uInt16 nButton, sal_Bool bVisible ) { if ( nButton == TITLE_BUTTON_DOCKING ) { @@ -392,7 +392,7 @@ void SystemWindow::ShowTitleButton( USHORT nButton, BOOL bVisible ) // ----------------------------------------------------------------------- -BOOL SystemWindow::IsTitleButtonVisible( USHORT nButton ) const +sal_Bool SystemWindow::IsTitleButtonVisible( sal_uInt16 nButton ) const { if ( nButton == TITLE_BUTTON_DOCKING ) return mbDockBtn; @@ -402,7 +402,7 @@ BOOL SystemWindow::IsTitleButtonVisible( USHORT nButton ) const // ----------------------------------------------------------------------- -void SystemWindow::SetPin( BOOL bPin ) +void SystemWindow::SetPin( sal_Bool bPin ) { if ( bPin != mbPined ) { @@ -419,16 +419,16 @@ void SystemWindow::RollUp() if ( !mbRollUp ) { maOrgSize = GetOutputSizePixel(); - mbRollFunc = TRUE; + mbRollFunc = sal_True; Size aSize = maRollUpOutSize; if ( !aSize.Width() ) aSize.Width() = GetOutputSizePixel().Width(); - mbRollUp = TRUE; + mbRollUp = sal_True; if ( mpWindowImpl->mpBorderWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( TRUE, aSize ); + ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( sal_True, aSize ); else SetOutputSizePixel( aSize ); - mbRollFunc = FALSE; + mbRollFunc = sal_False; } } @@ -438,9 +438,9 @@ void SystemWindow::RollDown() { if ( mbRollUp ) { - mbRollUp = FALSE; + mbRollUp = sal_False; if ( mpWindowImpl->mpBorderWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( FALSE, maOrgSize ); + ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetRollUp( sal_False, maOrgSize ); else SetOutputSizePixel( maOrgSize ); } @@ -502,7 +502,7 @@ Size SystemWindow::GetResizeOutputSizePixel() const static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rStr ) { - ULONG nValidMask = 0; + sal_uLong nValidMask = 0; xub_StrLen nIndex = 0; ByteString aTokenStr; @@ -555,7 +555,7 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS { // #94144# allow Minimize again, should be masked out when read from configuration // 91625 - ignore Minimize - ULONG nState = (ULONG)aTokenStr.ToInt32(); + sal_uLong nState = (sal_uLong)aTokenStr.ToInt32(); //nState &= ~(WINDOWSTATE_STATE_MINIMIZED); rData.SetState( nState ); nValidMask |= WINDOWSTATE_MASK_STATE; @@ -617,7 +617,7 @@ static void ImplWindowStateFromStr( WindowStateData& rData, const ByteString& rS static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr ) { - ULONG nValidMask = rData.GetMask(); + sal_uLong nValidMask = rData.GetMask(); if ( !nValidMask ) return; @@ -637,7 +637,7 @@ static void ImplWindowStateToStr( const WindowStateData& rData, ByteString& rStr { // #94144# allow Minimize again, should be masked out when read from configuration // 91625 - ignore Minimize - ULONG nState = rData.GetState(); + sal_uLong nState = rData.GetState(); //nState &= ~(WINDOWSTATE_STATE_MINIMIZED); rStr.Append( ByteString::CreateFromInt32( (long)nState ) ); } @@ -717,7 +717,7 @@ void SystemWindow::ImplMoveToScreen( long& io_rX, long& io_rY, long i_nWidth, lo void SystemWindow::SetWindowStateData( const WindowStateData& rData ) { - ULONG nValidMask = rData.GetMask(); + sal_uLong nValidMask = rData.GetMask(); if ( !nValidMask ) return; @@ -730,7 +730,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) if ( pWindow->mpWindowImpl->mbFrame ) { - ULONG nState = rData.GetState(); + sal_uLong nState = rData.GetState(); SalFrameState aState; aState.mnMask = rData.GetMask(); aState.mnX = rData.GetX(); @@ -769,7 +769,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) Rectangle aDesktop = GetDesktopRectPixel(); ImplSVData *pSVData = ImplGetSVData(); Window *pWin = pSVData->maWinData.mpFirstFrame; - BOOL bWrapped = FALSE; + sal_Bool bWrapped = sal_False; while( pWin ) { if( !pWin->ImplIsRealParentPath( this ) && ( pWin != this ) && @@ -790,7 +790,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) (unsigned long) (aState.mnY + displacement + aState.mnHeight + g.nBottomDecoration) > (unsigned long) aDesktop.nBottom ) break; // further displacement not possible -> break // avoid endless testing - bWrapped = TRUE; + bWrapped = sal_True; } else { @@ -827,7 +827,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) } else { - USHORT nPosSize = 0; + sal_uInt16 nPosSize = 0; if ( nValidMask & WINDOWSTATE_MASK_X ) nPosSize |= WINDOW_POSSIZE_X; if ( nValidMask & WINDOWSTATE_MASK_Y ) @@ -859,7 +859,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) // 91625 - ignore Minimize if ( nValidMask & WINDOWSTATE_MASK_STATE ) { - ULONG nState = rData.GetState(); + sal_uLong nState = rData.GetState(); if ( nState & WINDOWSTATE_STATE_ROLLUP ) RollUp(); else @@ -872,7 +872,7 @@ void SystemWindow::SetWindowStateData( const WindowStateData& rData ) void SystemWindow::GetWindowStateData( WindowStateData& rData ) const { - ULONG nValidMask = rData.GetMask(); + sal_uLong nValidMask = rData.GetMask(); if ( !nValidMask ) return; @@ -934,7 +934,7 @@ void SystemWindow::GetWindowStateData( WindowStateData& rData ) const { Point aPos = GetPosPixel(); Size aSize = GetSizePixel(); - ULONG nState = 0; + sal_uLong nState = 0; if ( IsRollUp() ) { @@ -969,7 +969,7 @@ void SystemWindow::SetWindowState( const ByteString& rStr ) // ----------------------------------------------------------------------- -ByteString SystemWindow::GetWindowState( ULONG nMask ) const +ByteString SystemWindow::GetWindowState( sal_uLong nMask ) const { WindowStateData aData; aData.SetMask( nMask ); @@ -1013,7 +1013,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar ) ImplToBottomChild(); if ( pOldMenuBar ) { - BOOL bDelete = (pMenuBar == 0) ? TRUE : FALSE; + sal_Bool bDelete = (pMenuBar == 0) ? sal_True : sal_False; if( bDelete && pOldWindow ) { if( mpImplData->mpTaskPaneList ) @@ -1046,7 +1046,7 @@ void SystemWindow::SetMenuBar( MenuBar* pMenuBar ) // ----------------------------------------------------------------------- -void SystemWindow::SetMenuBarMode( USHORT nMode ) +void SystemWindow::SetMenuBarMode( sal_uInt16 nMode ) { if ( mnMenuBarMode != nMode ) { @@ -1054,20 +1054,20 @@ void SystemWindow::SetMenuBarMode( USHORT nMode ) if ( mpWindowImpl->mpBorderWindow && (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) ) { if ( nMode == MENUBAR_MODE_HIDE ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( TRUE ); + ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( sal_True ); else - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( FALSE ); + ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->SetMenuBarMode( sal_False ); } } } // ----------------------------------------------------------------------- -BOOL SystemWindow::ImplIsInTaskPaneList( Window* pWin ) +sal_Bool SystemWindow::ImplIsInTaskPaneList( Window* pWin ) { if( mpImplData && mpImplData->mpTaskPaneList ) return mpImplData->mpTaskPaneList->IsInList( pWin ); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- diff --git a/vcl/source/window/tabdlg.cxx b/vcl/source/window/tabdlg.cxx index 54985a3a36e2..32e8a0dcec92 100644 --- a/vcl/source/window/tabdlg.cxx +++ b/vcl/source/window/tabdlg.cxx @@ -42,7 +42,7 @@ void TabDialog::ImplInitTabDialogData() mpFixedLine = NULL; mpViewWindow = NULL; meViewAlign = WINDOWALIGN_LEFT; - mbPosControls = TRUE; + mbPosControls = sal_True; } // ----------------------------------------------------------------------- @@ -104,7 +104,7 @@ void TabDialog::ImplPosControls() long nViewOffY = 0; long nViewWidth = 0; long nViewHeight = 0; - USHORT nViewPosFlags = WINDOW_POSSIZE_POS; + sal_uInt16 nViewPosFlags = WINDOW_POSSIZE_POS; Size aViewSize = mpViewWindow->GetSizePixel(); if ( meViewAlign == WINDOWALIGN_TOP ) { @@ -152,7 +152,7 @@ void TabDialog::ImplPosControls() pTabControl->SetPosPixel( aTabOffset ); // Alle anderen Childs positionieren - BOOL bTabCtrl = FALSE; + sal_Bool bTabCtrl = sal_False; int nLines = 0; long nX; long nY = aDlgSize.Height(); @@ -170,7 +170,7 @@ void TabDialog::ImplPosControls() if ( pChild2->IsVisible() && (pChild2 != mpViewWindow) ) { if ( pChild2 == pTabControl ) - bTabCtrl = TRUE; + bTabCtrl = sal_True; else if ( bTabCtrl ) { if ( !nLines ) @@ -212,7 +212,7 @@ void TabDialog::ImplPosControls() mpFixedLine->Show(); } - mbPosControls = FALSE; + mbPosControls = sal_False; } // ----------------------------------------------------------------------- diff --git a/vcl/source/window/tabpage.cxx b/vcl/source/window/tabpage.cxx index cccd315d7189..f109f2079a4c 100644 --- a/vcl/source/window/tabpage.cxx +++ b/vcl/source/window/tabpage.cxx @@ -57,7 +57,7 @@ void TabPage::ImplInit( Window* pParent, WinBits nStyle ) // if the tabpage is drawn (ie filled) by a native widget, make sure all contols will have transparent background // otherwise they will paint with a wrong background if( IsNativeControlSupported(CTRL_TAB_BODY, PART_ENTIRE_CONTROL) && GetParent() && (GetParent()->GetType() == WINDOW_TABCONTROL) ) - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); } // ----------------------------------------------------------------------- @@ -67,16 +67,16 @@ void TabPage::ImplInitSettings() Window* pParent = GetParent(); if ( pParent->IsChildTransparentModeEnabled() && !IsControlBackground() ) { - EnableChildTransparentMode( TRUE ); + EnableChildTransparentMode( sal_True ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); SetBackground(); } else { - EnableChildTransparentMode( FALSE ); + EnableChildTransparentMode( sal_False ); SetParentClipMode( 0 ); - SetPaintTransparent( FALSE ); + SetPaintTransparent( sal_False ); if ( IsControlBackground() ) SetBackground( GetControlBackground() ); @@ -166,7 +166,7 @@ void TabPage::Paint( const Rectangle& ) } // ----------------------------------------------------------------------- -void TabPage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, ULONG ) +void TabPage::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong ) { Point aPos = pDev->LogicToPixel( rPos ); Size aSize = pDev->LogicToPixel( rSize ); diff --git a/vcl/source/window/taskpanelist.cxx b/vcl/source/window/taskpanelist.cxx index f705609306a1..56bd9d799cce 100644 --- a/vcl/source/window/taskpanelist.cxx +++ b/vcl/source/window/taskpanelist.cxx @@ -140,7 +140,7 @@ void TaskPaneList::AddWindow( Window *pWindow ) } mTaskPanes.insert( insertionPos, pWindow ); - pWindow->ImplIsInTaskPaneList( TRUE ); + pWindow->ImplIsInTaskPaneList( sal_True ); } } @@ -153,25 +153,25 @@ void TaskPaneList::RemoveWindow( Window *pWindow ) if( p != mTaskPanes.end() ) { mTaskPanes.erase( p ); - pWindow->ImplIsInTaskPaneList( FALSE ); + pWindow->ImplIsInTaskPaneList( sal_False ); } } // -------------------------------------------------- -BOOL TaskPaneList::IsInList( Window *pWindow ) +sal_Bool TaskPaneList::IsInList( Window *pWindow ) { ::std::vector< Window* >::iterator p; p = ::std::find( mTaskPanes.begin(), mTaskPanes.end(), pWindow ); if( p != mTaskPanes.end() ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } // -------------------------------------------------- -BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) +sal_Bool TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) { // F6 cycles through everything and works always @@ -183,11 +183,11 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) // // Since the design of Ctrl-Tab looks to be inconsistent ( non-modal dialogs are not reachable // and the shortcut conflicts with tab-control shortcut ), it is no more supported - BOOL bSplitterOnly = FALSE; - BOOL bFocusInList = FALSE; + sal_Bool bSplitterOnly = sal_False; + sal_Bool bFocusInList = sal_False; KeyCode aKeyCode = aKeyEvent.GetKeyCode(); - BOOL bForward = !aKeyCode.IsShift(); - if( aKeyCode.GetCode() == KEY_F6 ) // F6 + sal_Bool bForward = !aKeyCode.IsShift(); + if( aKeyCode.GetCode() == KEY_F6 && ! aKeyCode.IsMod2() ) // F6 { bSplitterOnly = aKeyCode.IsMod1() && aKeyCode.IsShift(); @@ -196,43 +196,43 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) while( p != mTaskPanes.end() ) { Window *pWin = *p; - if( pWin->HasChildPathFocus( TRUE ) ) + if( pWin->HasChildPathFocus( sal_True ) ) { - bFocusInList = TRUE; + bFocusInList = sal_True; // Ctrl-F6 goes directly to the document if( !pWin->IsDialog() && aKeyCode.IsMod1() && !aKeyCode.IsShift() ) { pWin->GrabFocusToDocument(); - return TRUE; + return sal_True; } // activate next task pane Window *pNextWin = NULL; if( bSplitterOnly ) - pNextWin = FindNextSplitter( *p, TRUE ); + pNextWin = FindNextSplitter( *p, sal_True ); else pNextWin = FindNextFloat( *p, bForward ); if( pNextWin != pWin ) { - ImplGetSVData()->maWinData.mbNoSaveFocus = TRUE; + ImplGetSVData()->maWinData.mbNoSaveFocus = sal_True; ImplTaskPaneListGrabFocus( pNextWin ); - ImplGetSVData()->maWinData.mbNoSaveFocus = FALSE; + ImplGetSVData()->maWinData.mbNoSaveFocus = sal_False; } else { // forward key if no splitter found if( bSplitterOnly ) - return FALSE; + return sal_False; // we did not find another taskpane, so // put focus back into document pWin->GrabFocusToDocument(); } - return TRUE; + return sal_True; } else p++; @@ -243,24 +243,24 @@ BOOL TaskPaneList::HandleKeyEvent( KeyEvent aKeyEvent ) { Window *pWin; if( bSplitterOnly ) - pWin = FindNextSplitter( NULL, TRUE ); + pWin = FindNextSplitter( NULL, sal_True ); else pWin = FindNextFloat( NULL, bForward ); if( pWin ) { ImplTaskPaneListGrabFocus( pWin ); - return TRUE; + return sal_True; } } } - return FALSE; + return sal_False; } // -------------------------------------------------- // returns next valid pane -Window* TaskPaneList::FindNextPane( Window *pWindow, BOOL bForward ) +Window* TaskPaneList::FindNextPane( Window *pWindow, sal_Bool bForward ) { if( bForward ) ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() ); @@ -295,7 +295,7 @@ Window* TaskPaneList::FindNextPane( Window *pWindow, BOOL bForward ) // -------------------------------------------------- // returns next splitter -Window* TaskPaneList::FindNextSplitter( Window *pWindow, BOOL bForward ) +Window* TaskPaneList::FindNextSplitter( Window *pWindow, sal_Bool bForward ) { if( bForward ) ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() ); @@ -334,7 +334,7 @@ Window* TaskPaneList::FindNextSplitter( Window *pWindow, BOOL bForward ) // -------------------------------------------------- // returns first valid item (regardless of type) if pWindow==0, otherwise returns next valid float -Window* TaskPaneList::FindNextFloat( Window *pWindow, BOOL bForward ) +Window* TaskPaneList::FindNextFloat( Window *pWindow, sal_Bool bForward ) { if( bForward ) ::std::stable_sort( mTaskPanes.begin(), mTaskPanes.end(), LTRSort() ); diff --git a/vcl/source/window/toolbox.cxx b/vcl/source/window/toolbox.cxx index d8698966d14e..0eae498111ab 100644 --- a/vcl/source/window/toolbox.cxx +++ b/vcl/source/window/toolbox.cxx @@ -108,24 +108,24 @@ DBG_NAMEEX( Window ) #define TB_MAX_GROUPS 100 -#define DOCK_LINEHSIZE ((USHORT)0x0001) -#define DOCK_LINEVSIZE ((USHORT)0x0002) -#define DOCK_LINERIGHT ((USHORT)0x1000) -#define DOCK_LINEBOTTOM ((USHORT)0x2000) -#define DOCK_LINELEFT ((USHORT)0x4000) -#define DOCK_LINETOP ((USHORT)0x8000) +#define DOCK_LINEHSIZE ((sal_uInt16)0x0001) +#define DOCK_LINEVSIZE ((sal_uInt16)0x0002) +#define DOCK_LINERIGHT ((sal_uInt16)0x1000) +#define DOCK_LINEBOTTOM ((sal_uInt16)0x2000) +#define DOCK_LINELEFT ((sal_uInt16)0x4000) +#define DOCK_LINETOP ((sal_uInt16)0x8000) #define DOCK_LINEOFFSET 3 // ----------------------------------------------------------------------- -static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highlight, BOOL bChecked, BOOL bEnabled, BOOL bIsWindow ); +static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow ); // ----------------------------------------------------------------------- struct ImplToolSize { long mnWidth; long mnHeight; - USHORT mnLines; + sal_uInt16 mnLines; }; struct ImplToolSizeArray @@ -153,12 +153,12 @@ private: Accelerator maAccel; long mnMinWidth; long mnMaxWidth; - USHORT mnLineMode; - USHORT mnStartLines; + sal_uInt16 mnLineMode; + sal_uInt16 mnStartLines; void* mpCustomizeData; - BOOL mbCustomizeMode; - BOOL mbResizeMode; - BOOL mbShowDragRect; + sal_Bool mbCustomizeMode; + sal_Bool mbResizeMode; + sal_Bool mbShowDragRect; public: ImplTBDragMgr(); @@ -182,18 +182,18 @@ public: void StartDragging( ToolBox* pDragBox, const Point& rPos, const Rectangle& rRect, - USHORT nLineMode, BOOL bResizeItem, + sal_uInt16 nLineMode, sal_Bool bResizeItem, void* pData = NULL ); void Dragging( const Point& rPos ); - void EndDragging( BOOL bOK = TRUE ); + void EndDragging( sal_Bool bOK = sal_True ); void HideDragRect() { if ( mbShowDragRect ) mpDragBox->HideTracking(); } void UpdateDragRect(); DECL_LINK( SelectHdl, Accelerator* ); void StartCustomizeMode(); void EndCustomizeMode(); - BOOL IsCustomizeMode() { return mbCustomizeMode; } - BOOL IsResizeMode() { return mbResizeMode; } + sal_Bool IsCustomizeMode() { return mbCustomizeMode; } + sal_Bool IsResizeMode() { return mbResizeMode; } }; // ----------------------------------------------------------------------- @@ -338,7 +338,7 @@ void ToolBox::ImplDrawGrip( ToolBox* pThis ) // execute pending paint requests ImplCheckUpdate( pThis ); - BOOL bNativeOk = FALSE; + sal_Bool bNativeOk = sal_False; if( pThis->IsNativeControlSupported( CTRL_TOOLBAR, pThis->mbHorz ? PART_THUMB_HORZ : PART_THUMB_VERT ) ) { ToolbarValue aToolbarValue; @@ -422,7 +422,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp g.SetStartColor( startCol ); g.SetEndColor( endCol ); - BOOL bLineColor = pThis->IsLineColor(); + sal_Bool bLineColor = pThis->IsLineColor(); Color aOldCol = pThis->GetLineColor(); pThis->SetLineColor( pThis->GetSettings().GetStyleSettings().GetShadowColor() ); @@ -512,7 +512,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp if( pThis->mbHorz ) { long y = 0; - BOOL bDrawSep = FALSE; // pThis->ImplIsFloatingMode() && ( pThis->mnWinStyle & WB_LINESPACING ); + sal_Bool bDrawSep = sal_False; // pThis->ImplIsFloatingMode() && ( pThis->mnWinStyle & WB_LINESPACING ); pThis->DrawGradient( Rectangle( 0, y, aTopLineSz.Width(), y+aTopLineSz.Height()), g ); y += aTopLineSz.Height(); @@ -554,7 +554,7 @@ void ToolBox::ImplDrawGradientBackground( ToolBox* pThis, ImplDockingWindowWrapp } -BOOL ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & ) +sal_Bool ToolBox::ImplDrawNativeBackground( ToolBox* pThis, const Region & ) { // use NWF Point aPt; @@ -578,7 +578,7 @@ void ToolBox::ImplDrawTransparentBackground( ToolBox* pThis, const Region &rRegi pThis->mpData->mbIsPaintLocked = bOldPaintLock; } -void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, BOOL bIsInPopupMode ) +void ToolBox::ImplDrawConstantBackground( ToolBox* pThis, const Region &rRegion, sal_Bool bIsInPopupMode ) { // draw a constant color if( !bIsInPopupMode ) @@ -599,7 +599,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect ) ImplCheckUpdate( pThis ); ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( pThis ); - BOOL bIsInPopupMode = pThis->ImplIsInPopupMode(); + sal_Bool bIsInPopupMode = pThis->ImplIsInPopupMode(); Region aPaintRegion( rRect ); @@ -624,7 +624,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect ) // toolbars known to the dockingmanager will be drawn using NWF or a gradient // docked toolbars are transparent and NWF is already used in the docking area which is their common background // so NWF is used here for floating toolbars only - BOOL bNativeOk = FALSE; + sal_Bool bNativeOk = sal_False; if( pThis->ImplIsFloatingMode() && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL) ) bNativeOk = ImplDrawNativeBackground( pThis, aPaintRegion ); @@ -644,7 +644,7 @@ void ToolBox::ImplDrawBackground( ToolBox* pThis, const Rectangle &rRect ) pThis->Pop(); } -void ToolBox::ImplErase( ToolBox* pThis, const Rectangle &rRect, BOOL bHighlight, BOOL bHasOpenPopup ) +void ToolBox::ImplErase( ToolBox* pThis, const Rectangle &rRect, sal_Bool bHighlight, sal_Bool bHasOpenPopup ) { // the background of non NWF buttons is painted in a constant color // to have the same highlight color (transparency in DrawSelectionBackground()) @@ -763,7 +763,7 @@ const ImplToolItem *ToolBox::ImplGetFirstClippedItem( const ToolBox* pThis ) // ----------------------------------------------------------------------- -Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCalcMode ) +Size ToolBox::ImplCalcSize( const ToolBox* pThis, sal_uInt16 nCalcLines, sal_uInt16 nCalcMode ) { long nMax; long nLeft = 0; @@ -772,45 +772,45 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCal long nBottom = 0; Size aSize; WindowAlign eOldAlign = pThis->meAlign; - BOOL bOldHorz = pThis->mbHorz; - BOOL bOldAssumeDocked = pThis->mpData->mbAssumeDocked; - BOOL bOldAssumeFloating = pThis->mpData->mbAssumeFloating; + sal_Bool bOldHorz = pThis->mbHorz; + sal_Bool bOldAssumeDocked = pThis->mpData->mbAssumeDocked; + sal_Bool bOldAssumeFloating = pThis->mpData->mbAssumeFloating; if ( nCalcMode ) { - BOOL bOldFloatingMode = pThis->ImplIsFloatingMode(); + sal_Bool bOldFloatingMode = pThis->ImplIsFloatingMode(); - pThis->mpData->mbAssumeDocked = FALSE; - pThis->mpData->mbAssumeFloating = FALSE; + pThis->mpData->mbAssumeDocked = sal_False; + pThis->mpData->mbAssumeFloating = sal_False; if ( nCalcMode == TB_CALCMODE_HORZ ) { - pThis->mpData->mbAssumeDocked = TRUE; // force non-floating mode during calculation + pThis->mpData->mbAssumeDocked = sal_True; // force non-floating mode during calculation ImplCalcBorder( WINDOWALIGN_TOP, nLeft, nTop, nRight, nBottom, pThis ); - ((ToolBox*)pThis)->mbHorz = TRUE; + ((ToolBox*)pThis)->mbHorz = sal_True; if ( pThis->mbHorz != bOldHorz ) ((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP; } else if ( nCalcMode == TB_CALCMODE_VERT ) { - pThis->mpData->mbAssumeDocked = TRUE; // force non-floating mode during calculation + pThis->mpData->mbAssumeDocked = sal_True; // force non-floating mode during calculation ImplCalcBorder( WINDOWALIGN_LEFT, nLeft, nTop, nRight, nBottom, pThis ); - ((ToolBox*)pThis)->mbHorz = FALSE; + ((ToolBox*)pThis)->mbHorz = sal_False; if ( pThis->mbHorz != bOldHorz ) ((ToolBox*)pThis)->meAlign = WINDOWALIGN_LEFT; } else if ( nCalcMode == TB_CALCMODE_FLOAT ) { - pThis->mpData->mbAssumeFloating = TRUE; // force non-floating mode during calculation + pThis->mpData->mbAssumeFloating = sal_True; // force non-floating mode during calculation nLeft = nTop = nRight = nBottom = 0; - ((ToolBox*)pThis)->mbHorz = TRUE; + ((ToolBox*)pThis)->mbHorz = sal_True; if ( pThis->mbHorz != bOldHorz ) ((ToolBox*)pThis)->meAlign = WINDOWALIGN_TOP; } if ( (pThis->meAlign != eOldAlign) || (pThis->mbHorz != bOldHorz) || (pThis->ImplIsFloatingMode() != bOldFloatingMode ) ) - ((ToolBox*)pThis)->mbCalc = TRUE; + ((ToolBox*)pThis)->mbCalc = sal_True; } else ImplCalcBorder( pThis->meAlign, nLeft, nTop, nRight, nBottom, pThis ); @@ -872,7 +872,7 @@ Size ToolBox::ImplCalcSize( const ToolBox* pThis, USHORT nCalcLines, USHORT nCal { ((ToolBox*)pThis)->meAlign = eOldAlign; ((ToolBox*)pThis)->mbHorz = bOldHorz; - ((ToolBox*)pThis)->mbCalc = TRUE; + ((ToolBox*)pThis)->mbCalc = sal_True; } } @@ -918,13 +918,13 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis ) // calc an upper bound for ImplCalcBreaks below long upperBoundWidth = nCalcSize * pThis->mpData->m_aItems.size(); - USHORT i; - USHORT nLines; - USHORT nCalcLines; - USHORT nTempLines; + sal_uInt16 i; + sal_uInt16 nLines; + sal_uInt16 nCalcLines; + sal_uInt16 nTempLines; long nHeight; long nMaxLineWidth; - nCalcLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, TRUE ); + nCalcLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, sal_True ); pThis->mpFloatSizeAry = new ImplToolSizeArray; pThis->mpFloatSizeAry->mpSize = new ImplToolSize[nCalcLines]; @@ -946,7 +946,7 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis ) do { nCalcSize += pThis->mnMaxItemWidth; - nTempLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, TRUE ); + nTempLines = pThis->ImplCalcBreaks( nCalcSize, &nMaxLineWidth, sal_True ); } while ( (nCalcSize < upperBoundWidth) && (nLines < nTempLines) && (nTempLines != 1) ); if ( nTempLines < nLines ) @@ -958,7 +958,7 @@ void ToolBox::ImplCalcFloatSizes( ToolBox* pThis ) // ----------------------------------------------------------------------- -Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines ) +Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, sal_uInt16& rLines ) { ImplCalcFloatSizes( pThis ); @@ -969,7 +969,7 @@ Size ToolBox::ImplCalcFloatSize( ToolBox* pThis, USHORT& rLines ) rLines = pThis->mnLines; } - USHORT i = 0; + sal_uInt16 i = 0; while ( i < pThis->mpFloatSizeAry->mnLastEntry && rLines < pThis->mpFloatSizeAry->mpSize[i].mnLines ) i++; @@ -988,7 +988,7 @@ void ToolBox::ImplCalcMinMaxFloatSize( ToolBox* pThis, Size& rMinSize, Size& rMa { ImplCalcFloatSizes( pThis ); - USHORT i = 0; + sal_uInt16 i = 0; rMinSize = Size( pThis->mpFloatSizeAry->mpSize[i].mnWidth, pThis->mpFloatSizeAry->mpSize[i].mnHeight ); rMaxSize = Size( pThis->mpFloatSizeAry->mpSize[i].mnWidth, pThis->mpFloatSizeAry->mpSize[i].mnHeight ); while ( ++i <= pThis->mpFloatSizeAry->mnLastEntry ) @@ -1014,7 +1014,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis ) { pWrapper->SetMinOutputSizePixel( aMinSize ); pWrapper->SetMaxOutputSizePixel( aMaxSize ); - pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? TRUE : FALSE ); + pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( pThis->GetMenuType() & TOOLBOX_MENUTYPE_CUSTOMIZE) ? sal_True : sal_False ); } else { @@ -1027,7 +1027,7 @@ void ToolBox::ImplSetMinMaxFloatSize( ToolBox *pThis ) // ----------------------------------------------------------------------- -USHORT ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize ) +sal_uInt16 ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize ) { long nLineHeight; @@ -1055,12 +1055,12 @@ USHORT ToolBox::ImplCalcLines( ToolBox* pThis, long nToolSize ) if( nLines < 1 ) nLines = 1; - return static_cast<USHORT>(nLines); + return static_cast<sal_uInt16>(nLines); } // ----------------------------------------------------------------------- -USHORT ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos ) +sal_uInt16 ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos ) { if ( !pThis->ImplIsFloatingMode() && (!pThis->mbScroll || (pThis->mnLines > 1) || (pThis->mnCurLines > pThis->mnVisLines)) ) @@ -1095,9 +1095,9 @@ USHORT ToolBox::ImplTestLineSize( ToolBox* pThis, const Point& rPos ) // ----------------------------------------------------------------------- void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRect, - USHORT nLineMode ) + sal_uInt16 nLineMode ) { - BOOL mbHorz; + sal_Bool mbHorz; long nOneLineSize; long nCurSize; long nMaxSize; @@ -1107,31 +1107,31 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec if ( nLineMode & DOCK_LINERIGHT ) { nCurSize = rPos.X() - rRect.Left(); - mbHorz = FALSE; + mbHorz = sal_False; } else if ( nLineMode & DOCK_LINEBOTTOM ) { nCurSize = rPos.Y() - rRect.Top(); - mbHorz = TRUE; + mbHorz = sal_True; } else if ( nLineMode & DOCK_LINELEFT ) { nCurSize = rRect.Right() - rPos.X(); - mbHorz = FALSE; + mbHorz = sal_False; } else if ( nLineMode & DOCK_LINETOP ) { nCurSize = rRect.Bottom() - rPos.Y(); - mbHorz = TRUE; + mbHorz = sal_True; } else { OSL_FAIL( "ImplLineSizing: Trailing else" ); nCurSize = 0; - mbHorz = FALSE; + mbHorz = sal_False; } Size aWinSize = pThis->GetSizePixel(); - USHORT nMaxLines = (pThis->mnLines > pThis->mnCurLines) ? pThis->mnLines : pThis->mnCurLines; + sal_uInt16 nMaxLines = (pThis->mnLines > pThis->mnCurLines) ? pThis->mnLines : pThis->mnCurLines; if ( nMaxLines > TB_MAXLINES ) nMaxLines = TB_MAXLINES; if ( mbHorz ) @@ -1149,7 +1149,7 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec nMaxSize = aWinSize.Width(); } - USHORT i = 1; + sal_uInt16 i = 1; if ( nCurSize <= nOneLineSize ) nSize = nOneLineSize; else @@ -1190,9 +1190,9 @@ void ToolBox::ImplLineSizing( ToolBox* pThis, const Point& rPos, Rectangle& rRec // ----------------------------------------------------------------------- -USHORT ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos ) +sal_uInt16 ToolBox::ImplFindItemPos( ToolBox* pBox, const Point& rPos ) { - USHORT nPos = 0; + sal_uInt16 nPos = 0; long nLast = 0; Point aPos = rPos; Size aSize( pBox->mnDX, pBox->mnDY ); @@ -1259,9 +1259,9 @@ ImplTBDragMgr::ImplTBDragMgr() mpBoxList = new ImplTBList(); mnLineMode = 0; mnStartLines = 0; - mbCustomizeMode = FALSE; - mbResizeMode = FALSE; - mbShowDragRect = FALSE; + mbCustomizeMode = sal_False; + mbResizeMode = sal_False; + mbShowDragRect = sal_False; mpDragBox = NULL; maAccel.InsertItem( KEY_RETURN, KeyCode( KEY_RETURN ) ); @@ -1311,12 +1311,12 @@ ToolBox* ImplTBDragMgr::FindToolBox( const Rectangle& rRect ) void ImplTBDragMgr::StartDragging( ToolBox* pToolBox, const Point& rPos, const Rectangle& rRect, - USHORT nDragLineMode, BOOL bResizeItem, + sal_uInt16 nDragLineMode, sal_Bool bResizeItem, void* pData ) { mpDragBox = pToolBox; pToolBox->CaptureMouse(); - pToolBox->mbDragging = TRUE; + pToolBox->mbDragging = sal_True; Application::InsertAccel( &maAccel ); if ( nDragLineMode ) @@ -1348,7 +1348,7 @@ void ImplTBDragMgr::StartDragging( ToolBox* pToolBox, maMouseOff.Y() = rRect.Top() - rPos.Y(); maRect = rRect; maStartRect = rRect; - mbShowDragRect = TRUE; + mbShowDragRect = sal_True; pToolBox->ShowTracking( maRect ); } @@ -1388,12 +1388,12 @@ void ImplTBDragMgr::Dragging( const Point& rPos ) // ----------------------------------------------------------------------- -void ImplTBDragMgr::EndDragging( BOOL bOK ) +void ImplTBDragMgr::EndDragging( sal_Bool bOK ) { mpDragBox->HideTracking(); mpDragBox->ReleaseMouse(); - mpDragBox->mbDragging = FALSE; - mbShowDragRect = FALSE; + mpDragBox->mbDragging = sal_False; + mbShowDragRect = sal_False; Application::RemoveAccel( &maAccel ); if ( mnLineMode ) @@ -1401,16 +1401,16 @@ void ImplTBDragMgr::EndDragging( BOOL bOK ) if ( !bOK ) { mpDragBox->mnDockLines = mnStartLines; - mpDragBox->EndDocking( maStartRect, FALSE ); + mpDragBox->EndDocking( maStartRect, sal_False ); } else - mpDragBox->EndDocking( maRect, FALSE ); + mpDragBox->EndDocking( maRect, sal_False ); mnLineMode = 0; mnStartLines = 0; } else { - USHORT nTempItem = mpDragBox->mnConfigItem; + sal_uInt16 nTempItem = mpDragBox->mnConfigItem; if ( nTempItem ) { mpDragBox->mnConfigItem = 0; @@ -1428,7 +1428,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK ) pItem->mpWindow->SetSizePixel( aSize ); // ToolBox neu brechnen und neu ausgeben - mpDragBox->ImplInvalidate( TRUE ); + mpDragBox->ImplInvalidate( sal_True ); mpDragBox->Customize( ToolBoxCustomizeEvent( mpDragBox, nTempItem, TOOLBOX_CUSTOMIZE_RESIZE, mpCustomizeData ) ); @@ -1455,7 +1455,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK ) } aPos = pDropBox->ScreenToOutputPixel( aPos ); - USHORT nPos = ToolBox::ImplFindItemPos( pDropBox, aPos ); + sal_uInt16 nPos = ToolBox::ImplFindItemPos( pDropBox, aPos ); mpDragBox->Customize( ToolBoxCustomizeEvent( pDropBox, nTempItem, nPos, mpCustomizeData ) ); } @@ -1467,7 +1467,7 @@ void ImplTBDragMgr::EndDragging( BOOL bOK ) } } mpCustomizeData = NULL; - mbResizeMode = FALSE; + mbResizeMode = sal_False; mpDragBox->Deactivate(); } @@ -1490,18 +1490,18 @@ void ImplTBDragMgr::UpdateDragRect() IMPL_LINK( ImplTBDragMgr, SelectHdl, Accelerator*, pAccel ) { if ( pAccel->GetCurItemId() == KEY_ESCAPE ) - EndDragging( FALSE ); + EndDragging( sal_False ); else - EndDragging( TRUE ); + EndDragging( sal_True ); - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- void ImplTBDragMgr::StartCustomizeMode() { - mbCustomizeMode = TRUE; + mbCustomizeMode = sal_True; for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) { (*mpBoxList)[ i ]->ImplStartCustomizeMode(); @@ -1512,7 +1512,7 @@ void ImplTBDragMgr::StartCustomizeMode() void ImplTBDragMgr::EndCustomizeMode() { - mbCustomizeMode = FALSE; + mbCustomizeMode = sal_False; for ( size_t i = 0, n = mpBoxList->size(); i < n; ++i ) { (*mpBoxList)[ i ]->ImplEndCustomizeMode(); @@ -1523,7 +1523,7 @@ void ImplTBDragMgr::EndCustomizeMode() static void ImplDrawOutButton( OutputDevice* pOutDev, const Rectangle& rRect, - USHORT nStyle ) + sal_uInt16 nStyle ) { const StyleSettings& rStyleSettings = pOutDev->GetSettings().GetStyleSettings(); Color aShadowColor = rStyleSettings.GetShadowColor(); @@ -1571,7 +1571,7 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) { // Variablen initialisieren - ImplGetWindowImpl()->mbToolBox = TRUE; + ImplGetWindowImpl()->mbToolBox = sal_True; mpBtnDev = NULL; mpFloatSizeAry = NULL; mpData = new ImplToolBoxPrivateData; @@ -1602,25 +1602,25 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) mnConfigItem = 0; mnMouseClicks = 0; mnMouseModifier = 0; - mbDrag = FALSE; - mbSelection = FALSE; - mbCommandDrag = FALSE; - mbUpper = FALSE; - mbLower = FALSE; - mbNextTool = FALSE; - mbIn = FALSE; - mbCalc = TRUE; - mbFormat = FALSE; - mbFullPaint = FALSE; - mbHorz = TRUE; + mbDrag = sal_False; + mbSelection = sal_False; + mbCommandDrag = sal_False; + mbUpper = sal_False; + mbLower = sal_False; + mbNextTool = sal_False; + mbIn = sal_False; + mbCalc = sal_True; + mbFormat = sal_False; + mbFullPaint = sal_False; + mbHorz = sal_True; mbScroll = (nStyle & WB_SCROLL) != 0; - mbCustomize = FALSE; - mbCustomizeMode = FALSE; - mbDragging = FALSE; - mbMenuStrings = FALSE; - mbIsShift = FALSE; - mbIsKeyEvent = FALSE; - mbChangingHighlight = FALSE; + mbCustomize = sal_False; + mbCustomizeMode = sal_False; + mbDragging = sal_False; + mbMenuStrings = sal_False; + mbIsShift = sal_False; + mbIsKeyEvent = sal_False; + mbChangingHighlight = sal_False; meButtonType = BUTTON_SYMBOL; meAlign = WINDOWALIGN_TOP; meLastStyle = POINTER_ARROW; @@ -1647,13 +1647,13 @@ void ToolBox::ImplInit( Window* pParent, WinBits nStyle ) ImplGetWindowImpl()->mnStyle &= ~WB_DIALOGCONTROL; } - ImplInitSettings( TRUE, TRUE, TRUE ); + ImplInitSettings( sal_True, sal_True, sal_True ); } // ----------------------------------------------------------------------- -void ToolBox::ImplInitSettings( BOOL bFont, - BOOL bForeground, BOOL bBackground ) +void ToolBox::ImplInitSettings( sal_Bool bFont, + sal_Bool bForeground, sal_Bool bBackground ) { mpData->mbNativeButtons = IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ); @@ -1687,7 +1687,7 @@ void ToolBox::ImplInitSettings( BOOL bFont, { aColor = GetControlBackground(); SetBackground( aColor ); - SetPaintTransparent( FALSE ); + SetPaintTransparent( sal_False ); SetParentClipMode( 0 ); } else @@ -1695,7 +1695,7 @@ void ToolBox::ImplInitSettings( BOOL bFont, if( IsNativeControlSupported( CTRL_TOOLBAR, PART_ENTIRE_CONTROL ) ) { SetBackground(); - SetPaintTransparent( TRUE ); + SetPaintTransparent( sal_True ); SetParentClipMode( PARENTCLIPMODE_NOCLIP ); mpData->maDisplayBackground = Wallpaper( rStyleSettings.GetFaceColor() ); } @@ -1707,7 +1707,7 @@ void ToolBox::ImplInitSettings( BOOL bFont, aColor = rStyleSettings.GetWindowColor(); SetBackground( aColor ); - SetPaintTransparent( FALSE ); + SetPaintTransparent( sal_False ); SetParentClipMode( 0 ); ImplUpdateImageList(); @@ -1726,7 +1726,7 @@ void ToolBox::ImplLoadRes( const ResId& rResId ) DockingWindow::ImplLoadRes( rResId ); - ULONG nObjMask; + sal_uLong nObjMask; nObjMask = ReadLongRes(); @@ -1737,17 +1737,17 @@ void ToolBox::ImplLoadRes( const ResId& rResId ) SetAlign( (WindowAlign)ReadLongRes() ); if ( nObjMask & RSC_TOOLBOX_LINECOUNT ) - SetLineCount( sal::static_int_cast<USHORT>(ReadLongRes()) ); + SetLineCount( sal::static_int_cast<sal_uInt16>(ReadLongRes()) ); if ( nObjMask & RSC_TOOLBOX_CUSTOMIZE ) { - BOOL bCust = (BOOL)ReadShortRes(); + sal_Bool bCust = (sal_Bool)ReadShortRes(); EnableCustomize( bCust ); } if ( nObjMask & RSC_TOOLBOX_MENUSTRINGS ) { - BOOL bCust = (BOOL)ReadShortRes(); + sal_Bool bCust = (sal_Bool)ReadShortRes(); EnableMenuStrings( bCust ); } @@ -1762,10 +1762,10 @@ void ToolBox::ImplLoadRes( const ResId& rResId ) if ( nObjMask & RSC_TOOLBOX_ITEMLIST ) { - ULONG nEle = ReadLongRes(); + sal_uLong nEle = ReadLongRes(); // Item hinzufuegen - for ( ULONG i = 0; i < nEle; i++ ) + for ( sal_uLong i = 0; i < nEle; i++ ) { InsertItem( ResId( (RSHEADER_TYPE *)GetClassRes(), *pMgr ) ); IncrementRes( GetObjSizeRes( (RSHEADER_TYPE *)GetClassRes() ) ); @@ -1796,7 +1796,7 @@ ToolBox::ToolBox( Window* pParent, const ResId& rResId ) : // Groesse des FloatingWindows berechnen und umschalten, wenn die // ToolBox initial im FloatingModus ist if ( ImplIsFloatingMode() ) - mbHorz = TRUE; + mbHorz = sal_True; else Resize(); @@ -1847,7 +1847,7 @@ ToolBox::~ToolBox() // ----------------------------------------------------------------------- -ImplToolItem* ToolBox::ImplGetItem( USHORT nItemId ) const +ImplToolItem* ToolBox::ImplGetItem( sal_uInt16 nItemId ) const { std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); while ( it != mpData->m_aItems.end() ) @@ -1861,7 +1861,7 @@ ImplToolItem* ToolBox::ImplGetItem( USHORT nItemId ) const } // ----------------------------------------------------------------------- -static void ImplAddButtonBorder( long &rWidth, long& rHeight, USHORT aOutStyle, BOOL bNativeButtons ) +static void ImplAddButtonBorder( long &rWidth, long& rHeight, sal_uInt16 aOutStyle, sal_Bool bNativeButtons ) { if ( aOutStyle & TOOLBOX_STYLE_OUTBUTTON ) { @@ -1884,13 +1884,13 @@ static void ImplAddButtonBorder( long &rWidth, long& rHeight, USHORT aOutStyle, // ----------------------------------------------------------------------- -BOOL ToolBox::ImplCalcItem() +sal_Bool ToolBox::ImplCalcItem() { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); // recalc required ? if ( !mbCalc ) - return FALSE; + return sal_False; ImplDisableFlatButtons(); @@ -1982,27 +1982,27 @@ BOOL ToolBox::ImplCalcItem() std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); while ( it != mpData->m_aItems.end() ) { - BOOL bImage; - BOOL bText; + sal_Bool bImage; + sal_Bool bText; - it->mbVisibleText = FALSE; // indicates if text will definitely be drawn, influences dropdown pos + it->mbVisibleText = sal_False; // indicates if text will definitely be drawn, influences dropdown pos if ( it->meType == TOOLBOXITEM_BUTTON ) { // check if image and/or text exists if ( !(it->maImage) ) - bImage = FALSE; + bImage = sal_False; else - bImage = TRUE; + bImage = sal_True; if ( !it->maText.Len() ) - bText = FALSE; + bText = sal_False; else - bText = TRUE; + bText = sal_True; ButtonType tmpButtonType = determineButtonType( &(*it), meButtonType ); // default to toolbox setting if ( bImage || bText ) { - it->mbEmptyBtn = FALSE; + it->mbEmptyBtn = sal_False; if ( tmpButtonType == BUTTON_SYMBOL ) { @@ -2015,7 +2015,7 @@ BOOL ToolBox::ImplCalcItem() { it->maItemSize = Size( GetCtrlTextWidth( it->maText )+TB_TEXTOFFSET, GetTextHeight() ); - it->mbVisibleText = TRUE; + it->mbVisibleText = sal_True; } } else if ( tmpButtonType == BUTTON_TEXT ) @@ -2025,7 +2025,7 @@ BOOL ToolBox::ImplCalcItem() { it->maItemSize = Size( GetCtrlTextWidth( it->maText )+TB_TEXTOFFSET, GetTextHeight() ); - it->mbVisibleText = TRUE; + it->mbVisibleText = sal_True; } else { @@ -2053,7 +2053,7 @@ BOOL ToolBox::ImplCalcItem() else { // no image and no text it->maItemSize = Size( nDefWidth, nDefHeight ); - it->mbEmptyBtn = TRUE; + it->mbEmptyBtn = sal_True; } // Gegebenenfalls die Fensterhoehe mit beruecksichtigen @@ -2133,8 +2133,8 @@ BOOL ToolBox::ImplCalcItem() nMaxWidth = nFixedWidth; } - mbCalc = FALSE; - mbFormat = TRUE; + mbCalc = sal_False; + mbFormat = sal_True; // do we have to recalc the sizes ? if ( (nMaxWidth != mnMaxItemWidth) || (nMaxHeight != mnMaxItemHeight) ) @@ -2142,25 +2142,25 @@ BOOL ToolBox::ImplCalcItem() mnMaxItemWidth = nMaxWidth; mnMaxItemHeight = nMaxHeight; - return TRUE; + return sal_True; } else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz ) +sal_uInt16 ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, sal_Bool bCalcHorz ) { - ULONG nLineStart = 0; - ULONG nGroupStart = 0; + sal_uLong nLineStart = 0; + sal_uLong nGroupStart = 0; long nLineWidth = 0; long nCurWidth; long nLastGroupLineWidth = 0; long nMaxLineWidth = 0; - USHORT nLines = 1; - BOOL bWindow; - BOOL bBreak = FALSE; + sal_uInt16 nLines = 1; + sal_Bool bWindow; + sal_Bool bBreak = sal_False; long nWidthTotal = nWidth; // when docked the menubutton will be in the first line @@ -2172,12 +2172,12 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz while ( it != mpData->m_aItems.end() ) { it->mbBreak = bBreak; - bBreak = FALSE; + bBreak = sal_False; if ( it->mbVisible ) { - bWindow = FALSE; - bBreak = FALSE; + bWindow = sal_False; + bBreak = sal_False; nCurWidth = 0; if ( it->meType == TOOLBOXITEM_BUTTON || it->meType == TOOLBOXITEM_SPACE ) @@ -2193,7 +2193,7 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz if ( !mbScroll || (nWinItemWidth <= nWidthTotal) ) { nCurWidth = nWinItemWidth; - bWindow = TRUE; + bWindow = sal_True; } else { @@ -2206,13 +2206,13 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz // check for line break if ( (nLineWidth+nCurWidth > nWidthTotal) && mbScroll ) - bBreak = TRUE; + bBreak = sal_True; } else if ( it->meType == TOOLBOXITEM_SEPARATOR ) nCurWidth = it->mnSepSize; // treat breaks as separators, except when using old style toolbars (ie. no menu button) else if ( (it->meType == TOOLBOXITEM_BREAK) && !IsMenuEnabled() ) - bBreak = TRUE; + bBreak = sal_True; if ( bBreak ) { @@ -2228,8 +2228,8 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz nLineWidth = 0; nLineStart = it - mpData->m_aItems.begin(); nGroupStart = nLineStart; - it->mbBreak = TRUE; - bBreak = FALSE; + it->mbBreak = sal_True; + bBreak = sal_False; } else { @@ -2293,7 +2293,7 @@ USHORT ToolBox::ImplCalcBreaks( long nWidth, long* pMaxLineWidth, BOOL bCalcHorz // ----------------------------------------------------------------------- namespace { - BOOL ImplFollowedByVisibleButton( std::vector< ImplToolItem >::iterator _aSeparator, std::vector< ImplToolItem >::iterator _aEnd ) + sal_Bool ImplFollowedByVisibleButton( std::vector< ImplToolItem >::iterator _aSeparator, std::vector< ImplToolItem >::iterator _aEnd ) { std::vector< ImplToolItem >::iterator aLookup = _aSeparator; while ( ++aLookup != _aEnd ) @@ -2302,9 +2302,9 @@ namespace return ImplFollowedByVisibleButton( aLookup, _aEnd ); if ( ( aLookup->meType == TOOLBOXITEM_BUTTON ) && aLookup->mbVisible ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } } @@ -2324,7 +2324,7 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode ) if( eMode == FSMODE_AUTO || eMode == FSMODE_FAVOURHEIGHT ) { // calc number of floating lines for current window height - USHORT nFloatLinesHeight = ImplCalcLines( this, mnDY ); + sal_uInt16 nFloatLinesHeight = ImplCalcLines( this, mnDY ); // calc window size according to this number aSize1 = ImplCalcFloatSize( this, nFloatLinesHeight ); @@ -2340,9 +2340,9 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode ) int nBorderY = 2*TB_BORDER_OFFSET2 + mnTopBorder + mnBottomBorder + 2*mnBorderY; Size aSz( aCurrentSize ); long maxX; - USHORT nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz ); + sal_uInt16 nLines = ImplCalcBreaks( aSz.Width()-nBorderX, &maxX, mbHorz ); - USHORT manyLines = 1000; + sal_uInt16 manyLines = 1000; Size aMinimalFloatSize = ImplCalcFloatSize( this, manyLines ); aSz.Height() = nBorderY + nLineHeight * nLines; @@ -2379,7 +2379,7 @@ Size ToolBox::ImplGetOptimalFloatingSize( FloatingSizeMode eMode ) } -void ToolBox::ImplFormat( BOOL bResize ) +void ToolBox::ImplFormat( sal_Bool bResize ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -2399,15 +2399,15 @@ void ToolBox::ImplFormat( BOOL bResize ) long nMax; // width of layoutarea in pixels long nX; long nY; - USHORT nFormatLine; - BOOL bMustFullPaint; - BOOL bLastSep; + sal_uInt16 nFormatLine; + sal_Bool bMustFullPaint; + sal_Bool bLastSep; std::vector< ImplToolItem >::iterator it; std::vector< ImplToolItem >::iterator temp_it; ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); - BOOL bIsInPopupMode = ImplIsInPopupMode(); + sal_Bool bIsInPopupMode = ImplIsInPopupMode(); // FloatSizeAry gegebenenfalls loeschen if ( mpFloatSizeAry ) @@ -2426,9 +2426,9 @@ void ToolBox::ImplFormat( BOOL bResize ) ImplUpdateDragArea( this ); if ( ImplCalcItem() ) - bMustFullPaint = TRUE; + bMustFullPaint = sal_True; else - bMustFullPaint = FALSE; + bMustFullPaint = sal_False; // calculate new size during interactive resize or @@ -2571,7 +2571,7 @@ void ToolBox::ImplFormat( BOOL bResize ) nX = nLeft; // top-left offset nY = nTop; nFormatLine = 1; - bLastSep = TRUE; + bLastSep = sal_True; // save old scroll rectangles and reset them Rectangle aOldLowerRect = maLowerRect; @@ -2705,7 +2705,7 @@ void ToolBox::ImplFormat( BOOL bResize ) // hide double separators if ( it->meType == TOOLBOXITEM_SEPARATOR ) { - it->mbVisible = FALSE; + it->mbVisible = sal_False; if ( !bLastSep ) { // check if any visible items have to appear behind it @@ -2716,18 +2716,18 @@ void ToolBox::ImplFormat( BOOL bResize ) ((temp_it->meType == TOOLBOXITEM_BUTTON) && temp_it->mbVisible) ) { - it->mbVisible = TRUE; + it->mbVisible = sal_True; break; } ++temp_it; } } - bLastSep = TRUE; + bLastSep = sal_True; } else if ( it->mbVisible ) - bLastSep = FALSE; + bLastSep = sal_False; - it->mbShowWindow = FALSE; + it->mbShowWindow = sal_False; // check for line break and advance nX/nY accordingly if ( it->mbBreak ) @@ -2908,7 +2908,7 @@ void ToolBox::ImplFormat( BOOL bResize ) } // indicate formatting is done - mbFormat = FALSE; + mbFormat = sal_False; } // ----------------------------------------------------------------------- @@ -2919,7 +2919,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG ) (mpData->m_aItems[ mnCurPos ].mnBits & TIB_DROPDOWN) ) { - mpData->mbDropDownByKeyboard = FALSE; + mpData->mbDropDownByKeyboard = sal_False; GetDropdownClickHdl().Call( this ); // do not reset data if the dropdown handler opened a floating window @@ -2928,7 +2928,7 @@ IMPL_LINK( ToolBox, ImplDropdownLongClickHdl, ToolBox*, EMPTYARG ) { // no floater was opened Deactivate(); - ImplDrawItem( mnCurPos, FALSE ); + ImplDrawItem( mnCurPos, sal_False ); mnCurPos = TOOLBOX_ITEM_NOTFOUND; mnCurItemId = 0; @@ -2956,7 +2956,7 @@ IMPL_LINK( ToolBox, ImplUpdateHdl, void*, EMPTYARG ) // ----------------------------------------------------------------------- -static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, BOOL bSetColor, BOOL bRotate ) +static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, sal_Bool bSetColor, sal_Bool bRotate ) { Color aOldFillColor = pBox->GetFillColor(); Color aOldLineColor = pBox->GetLineColor(); @@ -3011,10 +3011,10 @@ static void ImplDrawMoreIndicator( ToolBox *pBox, const Rectangle& rRect, BOOL b pBox->SetLineColor( aOldLineColor ); } -static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect, BOOL bSetColor, BOOL bRotate ) +static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect, sal_Bool bSetColor, sal_Bool bRotate ) { - BOOL bLineColor = pBox->IsLineColor(); - BOOL bFillColor = pBox->IsFillColor(); + sal_Bool bLineColor = pBox->IsLineColor(); + sal_Bool bFillColor = pBox->IsFillColor(); Color aOldFillColor = pBox->GetFillColor(); Color aOldLineColor = pBox->GetLineColor(); pBox->SetLineColor(); @@ -3064,8 +3064,8 @@ static void ImplDrawDropdownArrow( ToolBox *pBox, const Rectangle& rDropDownRect pBox->SetLineColor( ); } -void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, BOOL bColTransform, - BOOL bLeft, BOOL bTop, long nSize ) +void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, sal_Bool bBlack, sal_Bool bColTransform, + sal_Bool bLeft, sal_Bool bTop, long nSize ) { Color aOldFillColor = pBox->GetFillColor(); WindowAlign eAlign = pBox->meAlign; @@ -3160,7 +3160,7 @@ void ToolBox::ImplDrawToolArrow( ToolBox* pBox, long nX, long nY, BOOL bBlack, B } void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY, - BOOL bLeft, BOOL bTop, long nSize ) + sal_Bool bLeft, sal_Bool bTop, long nSize ) { WindowAlign eAlign = pBox->meAlign; long nHalfSize; @@ -3215,7 +3215,7 @@ void ToolBox::SetToolArrowClipregion( ToolBox* pBox, long nX, long nY, // ----------------------------------------------------------------------- -void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight ) +void ToolBox::ImplDrawMenubutton( ToolBox *pThis, sal_Bool bHighlight ) { if( !pThis->mpData->maMenubuttonItem.maRect.IsEmpty() ) { @@ -3226,11 +3226,11 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight ) // execute pending paint requests ImplCheckUpdate( pThis ); - BOOL bFillColor = pThis->IsFillColor(); - BOOL bLineColor = pThis->IsLineColor(); + sal_Bool bFillColor = pThis->IsFillColor(); + sal_Bool bLineColor = pThis->IsLineColor(); Color aOldFillCol = pThis->GetFillColor(); Color aOldLineCol = pThis->GetLineColor(); - BOOL bNativeButtons = pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ); + sal_Bool bNativeButtons = pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ); Rectangle aInnerRect( pThis->mpData->maMenubuttonItem.maRect ); if( pThis->mpData->mnMenuButtonWidth > TB_MENUBUTTON_SIZE ) @@ -3270,9 +3270,9 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight ) if( bHighlight ) { if( bNativeButtons ) - ImplDrawButton( pThis, pThis->mpData->maMenubuttonItem.maRect, 2, FALSE, TRUE, FALSE ); + ImplDrawButton( pThis, pThis->mpData->maMenubuttonItem.maRect, 2, sal_False, sal_True, sal_False ); else - pThis->DrawSelectionBackground( aInnerRect, 2, FALSE, FALSE, FALSE ); + pThis->DrawSelectionBackground( aInnerRect, 2, sal_False, sal_False, sal_False ); } else { @@ -3294,7 +3294,7 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight ) aRect.Left() = aRect.Right() - aRect.getWidth()/3; if( pThis->mpData->maMenuType & TOOLBOX_MENUTYPE_CUSTOMIZE ) - ImplDrawDropdownArrow( pThis, aRect, TRUE, !pThis->mbHorz ); + ImplDrawDropdownArrow( pThis, aRect, sal_True, !pThis->mbHorz ); if( pThis->ImplHasClippedItems() ) { @@ -3304,7 +3304,7 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight ) else aRect.Right() = aRect.Left() + aRect.getWidth()/3; - ImplDrawMoreIndicator( pThis, aRect, TRUE, !pThis->mbHorz ); + ImplDrawMoreIndicator( pThis, aRect, sal_True, !pThis->mbHorz ); } // store highlight state @@ -3324,30 +3324,30 @@ void ToolBox::ImplDrawMenubutton( ToolBox *pThis, BOOL bHighlight ) // ----------------------------------------------------------------------- -void ToolBox::ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn ) +void ToolBox::ImplDrawSpin( sal_Bool bUpperIn, sal_Bool bLowerIn ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - BOOL bTmpUpper; - BOOL bTmpLower; + sal_Bool bTmpUpper; + sal_Bool bTmpLower; if ( maUpperRect.IsEmpty() || maLowerRect.IsEmpty() ) return; if ( mnCurLine > 1 ) - bTmpUpper = TRUE; + bTmpUpper = sal_True; else - bTmpUpper = FALSE; + bTmpUpper = sal_False; if ( mnCurLine+mnVisLines-1 < mnCurLines ) - bTmpLower = TRUE; + bTmpLower = sal_True; else - bTmpLower = FALSE; + bTmpLower = sal_False; if ( !IsEnabled() ) { - bTmpUpper = FALSE; - bTmpLower = FALSE; + bTmpUpper = sal_False; + bTmpLower = sal_False; } ImplDrawSpinButton( this, maUpperRect, maLowerRect, @@ -3356,7 +3356,7 @@ void ToolBox::ImplDrawSpin( BOOL bUpperIn, BOOL bLowerIn ) // ----------------------------------------------------------------------- -void ToolBox::ImplDrawNext( BOOL bIn ) +void ToolBox::ImplDrawNext( sal_Bool bIn ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -3368,7 +3368,7 @@ void ToolBox::ImplDrawNext( BOOL bIn ) // Button malen long nX = SMALLBUTTON_OFF_NORMAL_X; long nY = SMALLBUTTON_OFF_NORMAL_Y; - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; if ( bIn == 1 ) { nStyle |= BUTTON_DRAW_PRESSED; @@ -3378,17 +3378,17 @@ void ToolBox::ImplDrawNext( BOOL bIn ) aDecoView.DrawButton( maNextToolRect, nStyle ); // Inhalt ausgeben - BOOL bLeft = FALSE; - BOOL bTop = FALSE; + sal_Bool bLeft = sal_False; + sal_Bool bTop = sal_False; if ( mbHorz ) { - bLeft = TRUE; + bLeft = sal_True; nX += (maNextToolRect.GetWidth()-6)/2-4; nY += (maNextToolRect.GetHeight()-6)/2-6; } else { - bTop = TRUE; + bTop = sal_True; nY += (maNextToolRect.GetHeight()-6)/2-4; nX += (maNextToolRect.GetWidth()-6)/2-6; } @@ -3397,14 +3397,14 @@ void ToolBox::ImplDrawNext( BOOL bIn ) nY += maNextToolRect.Top(); SetLineColor(); SetFillColor( COL_LIGHTBLUE ); - ImplDrawToolArrow( this, nX, nY, TRUE, FALSE, bLeft, bTop, 10 ); + ImplDrawToolArrow( this, nX, nY, sal_True, sal_False, bLeft, bTop, 10 ); } // ----------------------------------------------------------------------- -void ToolBox::ImplDrawSeparator( USHORT nPos, Rectangle rRect ) +void ToolBox::ImplDrawSeparator( sal_uInt16 nPos, Rectangle rRect ) { - BOOL bNativeOk = FALSE; + bool bNativeOk = false; ImplToolItem* pItem = &mpData->m_aItems[nPos]; if( IsNativeControlSupported( CTRL_TOOLBAR, PART_SEPARATOR ) ) @@ -3450,12 +3450,12 @@ void ToolBox::ImplDrawSeparator( USHORT nPos, Rectangle rRect ) // ----------------------------------------------------------------------- -static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highlight, BOOL bChecked, BOOL bEnabled, BOOL bIsWindow ) +static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bEnabled, sal_Bool bIsWindow ) { // draws toolbar button background either native or using a coloured selection - // if bIsWindow is TRUE, the corresponding item is a control and only a selection border will be drawn + // if bIsWindow is sal_True, the corresponding item is a control and only a selection border will be drawn - BOOL bNativeOk = FALSE; + sal_Bool bNativeOk = sal_False; if( !bIsWindow && pThis->IsNativeControlSupported( CTRL_TOOLBAR, PART_BUTTON ) ) { ImplControlValue aControlValue; @@ -3473,10 +3473,10 @@ static void ImplDrawButton( ToolBox* pThis, const Rectangle &rRect, USHORT highl } if( !bNativeOk ) - pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, TRUE, bIsWindow, 2, NULL, NULL ); + pThis->DrawSelectionBackground( rRect, bIsWindow ? 3 : highlight, bChecked, sal_True, bIsWindow, 2, NULL, NULL ); } -void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLayout ) +void ToolBox::ImplDrawItem( sal_uInt16 nPos, sal_Bool bHighlight, sal_Bool bPaint, sal_Bool bLayout ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -3494,6 +3494,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay MetricVector* pVector = bLayout ? &mpData->m_pLayoutData->m_aUnicodeBoundRects : NULL; String* pDisplayText = bLayout ? &mpData->m_pLayoutData->m_aDisplayText : NULL; + bHighlight = bHighlight && pItem->mbEnabled; + // Falls Rechteck ausserhalb des sichbaren Bereichs liegt if ( pItem->maRect.IsEmpty() ) return; @@ -3501,13 +3503,13 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); // no gradient background for items that have a popup open - BOOL bHasOpenPopup = (mpFloatWin != NULL) && (mnDownItemId==pItem->mnId); + sal_Bool bHasOpenPopup = (mpFloatWin != NULL) && (mnDownItemId==pItem->mnId); - BOOL bHighContrastWhite = FALSE; + sal_Bool bHighContrastWhite = sal_False; // check the face color as highcontrast indicator // because the toolbox itself might have a gradient if( rStyleSettings.GetFaceColor() == Color( COL_WHITE ) ) - bHighContrastWhite = TRUE; + bHighContrastWhite = sal_True; // Compute buttons area. Size aBtnSize = pItem->maRect.GetSize(); @@ -3534,7 +3536,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay long nImageOffY = 0; long nTextOffX = 0; long nTextOffY = 0; - USHORT nStyle = 0; + sal_uInt16 nStyle = 0; // draw separators in flat style only if ( !bLayout && @@ -3577,18 +3579,18 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay Size aSize( GetCtrlTextWidth( pItem->maText ), GetTextHeight() ); Point aPos( pItem->maRect.Left()+2, pItem->maRect.Top() ); aPos.Y() += (pItem->maRect.GetHeight()-aSize.Height())/2; - BOOL bClip; + sal_Bool bClip; if ( (aSize.Width() > pItem->maRect.GetWidth()-2) || (aSize.Height() > pItem->maRect.GetHeight()-2) ) { - bClip = TRUE; + bClip = sal_True; Rectangle aTempRect( pItem->maRect.Left()+1, pItem->maRect.Top()+1, pItem->maRect.Right()-1, pItem->maRect.Bottom()-1 ); Region aTempRegion( aTempRect ); SetClipRegion( aTempRegion ); } else - bClip = FALSE; + bClip = sal_False; if( bLayout ) { mpData->m_pLayoutData->m_aLineIndices.push_back( mpData->m_pLayoutData->m_aDisplayText.Len() ); @@ -3656,8 +3658,8 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay nOffY += pItem->maRect.Top(); // determine what has to be drawn on the button: image, text or both - BOOL bImage; - BOOL bText; + sal_Bool bImage; + sal_Bool bText; ButtonType tmpButtonType = determineButtonType( pItem, meButtonType ); // default to toolbox setting pItem->DetermineButtonDrawStyle( tmpButtonType, bImage, bText ); @@ -3676,7 +3678,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay if ( bImage && ! bLayout ) { const Image* pImage; - if ( bHighlight && (!(pItem->maHighImage)) == FALSE ) + if ( bHighlight && (!(pItem->maHighImage)) == sal_False ) pImage = &(pItem->maHighImage); else pImage = &(pItem->maImage); @@ -3684,7 +3686,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay aImageSize = pImage->GetSizePixel(); // determine drawing flags - USHORT nImageStyle = 0; + sal_uInt16 nImageStyle = 0; if ( !pItem->mbEnabled || !IsEnabled() ) nImageStyle |= IMAGE_DRAW_DISABLE; @@ -3715,7 +3717,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay if( bHasOpenPopup ) ImplDrawFloatwinBorder( pItem ); else - ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? TRUE : FALSE ); + ImplDrawButton( this, aButtonRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False ); if( bHighlight ) { @@ -3727,7 +3729,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay } // draw the text - BOOL bRotate = FALSE; + sal_Bool bRotate = sal_False; if ( bText ) { nTextOffX = nOffX; @@ -3738,7 +3740,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay if( pItem->mbVisibleText && !ImplIsFloatingMode() && ((meAlign == WINDOWALIGN_LEFT) || (meAlign == WINDOWALIGN_RIGHT)) ) { - bRotate = TRUE; + bRotate = sal_True; Font aRotateFont = aOldFont; /* @@ -3781,10 +3783,10 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay if( bHasOpenPopup ) ImplDrawFloatwinBorder( pItem ); else - ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? TRUE : FALSE ); + ImplDrawButton( this, pItem->maRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), pItem->mbShowWindow ? sal_True : sal_False ); } - USHORT nTextStyle = 0; + sal_uInt16 nTextStyle = 0; if ( !pItem->mbEnabled ) nTextStyle |= TEXT_DRAW_DISABLE; if( bLayout ) @@ -3806,10 +3808,10 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay if ( pItem->mnBits & TIB_DROPDOWN ) { Rectangle aDropDownRect( pItem->GetDropDownRect( mbHorz ) ); - BOOL bSetColor = TRUE; + sal_Bool bSetColor = sal_True; if ( !pItem->mbEnabled || !IsEnabled() ) { - bSetColor = FALSE; + bSetColor = sal_False; SetFillColor( rStyleSettings.GetShadowColor() ); } @@ -3823,7 +3825,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay if( bHasOpenPopup ) ImplDrawFloatwinBorder( pItem ); else - ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), FALSE ); + ImplDrawButton( this, aDropDownRect, bHighlight, pItem->meState == STATE_CHECK, pItem->mbEnabled && IsEnabled(), sal_False ); } } ImplDrawDropdownArrow( this, aDropDownRect, bSetColor, bRotate ); @@ -3838,7 +3840,7 @@ void ToolBox::ImplDrawItem( USHORT nPos, BOOL bHighlight, BOOL bPaint, BOOL bLay void ToolBox::ImplStartCustomizeMode() { - mbCustomizeMode = TRUE; + mbCustomizeMode = sal_True; mpData->ImplClearLayoutData(); @@ -3857,7 +3859,7 @@ void ToolBox::ImplStartCustomizeMode() } } -void ToolBox::SetCustomizeMode( BOOL bSet ) +void ToolBox::SetCustomizeMode( sal_Bool bSet ) { if ( bSet ) ImplStartCustomizeMode(); @@ -3869,7 +3871,7 @@ void ToolBox::SetCustomizeMode( BOOL bSet ) void ToolBox::ImplEndCustomizeMode() { - mbCustomizeMode = FALSE; + mbCustomizeMode = sal_False; mpData->ImplClearLayoutData(); @@ -3925,7 +3927,7 @@ void ToolBox::ImplDrawFloatwinBorder( ImplToolItem* pItem ) } } -void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow ) +void ToolBox::ImplFloatControl( sal_Bool bStart, FloatingWindow* pFloatWindow ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -3934,9 +3936,9 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow ) mpFloatWin = pFloatWindow; // redraw item, to trigger drawing of a special border - ImplDrawItem( mnCurPos, TRUE ); + ImplDrawItem( mnCurPos, sal_True ); - mbDrag = FALSE; + mbDrag = sal_False; EndTracking(); ReleaseMouse(); } @@ -3946,7 +3948,7 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow ) // if focus is still in this toolbox, then the floater was opened by keyboard // draw current item with highlight and keep old state - BOOL bWasKeyboardActivate = mpData->mbDropDownByKeyboard; + sal_Bool bWasKeyboardActivate = mpData->mbDropDownByKeyboard; if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND ) @@ -3966,15 +3968,15 @@ void ToolBox::ImplFloatControl( BOOL bStart, FloatingWindow* pFloatWindow ) // ----------------------------------------------------------------------- -void ToolBox::ShowLine( BOOL bNext ) +void ToolBox::ShowLine( sal_Bool bNext ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - mbFormat = TRUE; + mbFormat = sal_True; if ( mpData->mbPageScroll ) { - USHORT delta = mnVisLines; + sal_uInt16 delta = mnVisLines; if ( bNext ) { mnCurLine = mnCurLine + delta; @@ -4002,7 +4004,7 @@ void ToolBox::ShowLine( BOOL bNext ) // ----------------------------------------------------------------------- -BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat ) +sal_Bool ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, sal_Bool bRepeat ) { Point aMousePos = rMEvt.GetPosPixel(); @@ -4015,7 +4017,7 @@ BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat ) { if ( !mnCurItemId ) { - ImplDrawItem( mnCurPos, TRUE ); + ImplDrawItem( mnCurPos, sal_True ); mnCurItemId = pItem->mnId; Highlight(); } @@ -4034,48 +4036,48 @@ BOOL ToolBox::ImplHandleMouseMove( const MouseEvent& rMEvt, BOOL bRepeat ) } } - return TRUE; + return sal_True; } if ( mbUpper ) { - BOOL bNewIn = maUpperRect.IsInside( aMousePos ); + sal_Bool bNewIn = maUpperRect.IsInside( aMousePos ); if ( bNewIn != mbIn ) { mbIn = bNewIn; - ImplDrawSpin( mbIn, FALSE ); + ImplDrawSpin( mbIn, sal_False ); } - return TRUE; + return sal_True; } if ( mbLower ) { - BOOL bNewIn = maLowerRect.IsInside( aMousePos ); + sal_Bool bNewIn = maLowerRect.IsInside( aMousePos ); if ( bNewIn != mbIn ) { mbIn = bNewIn; - ImplDrawSpin( FALSE, mbIn ); + ImplDrawSpin( sal_False, mbIn ); } - return TRUE; + return sal_True; } if ( mbNextTool ) { - BOOL bNewIn = maNextToolRect.IsInside( aMousePos ); + sal_Bool bNewIn = maNextToolRect.IsInside( aMousePos ); if ( bNewIn != mbIn ) { mbIn = bNewIn; ImplDrawNext( mbIn ); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel ) +sal_Bool ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, sal_Bool bCancel ) { ImplDisableFlatButtons(); @@ -4099,12 +4101,12 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel ) Deactivate(); if ( mbDrag ) - mbDrag = FALSE; + mbDrag = sal_False; else { - mbSelection = FALSE; + mbSelection = sal_False; if ( mnCurPos == TOOLBOX_ITEM_NOTFOUND ) - return TRUE; + return sal_True; } // Wurde Maus ueber dem Item losgelassen @@ -4142,7 +4144,7 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel ) ImplAddDel( &aDelData ); Select(); if ( aDelData.IsDelete() ) - return TRUE; + return sal_True; ImplRemoveDel( &aDelData ); } } @@ -4154,11 +4156,11 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel ) // Items nicht geloescht, im Select-Handler if ( mnCurItemId ) { - BOOL bHighlight; + sal_Bool bHighlight; if ( (mnCurItemId == mnHighItemId) && (mnOutStyle & TOOLBOX_STYLE_FLAT) ) bHighlight = 2; else - bHighlight = FALSE; + bHighlight = sal_False; // Get current pos for the case that items are inserted/removed // in the toolBox mnCurPos = GetItemPos( mnCurItemId ); @@ -4176,28 +4178,28 @@ BOOL ToolBox::ImplHandleMouseButtonUp( const MouseEvent& rMEvt, BOOL bCancel ) mnDownItemId = 0; mnMouseClicks = 0; mnMouseModifier = 0; - return TRUE; + return sal_True; } else if ( mbUpper || mbLower ) { if ( mbIn ) ShowLine( !mbUpper ); - mbUpper = FALSE; - mbLower = FALSE; - mbIn = FALSE; - ImplDrawSpin( FALSE, FALSE ); - return TRUE; + mbUpper = sal_False; + mbLower = sal_False; + mbIn = sal_False; + ImplDrawSpin( sal_False, sal_False ); + return sal_True; } else if ( mbNextTool ) { - mbNextTool = FALSE; - mbIn = FALSE; - ImplDrawNext( FALSE ); + mbNextTool = sal_False; + mbIn = sal_False; + ImplDrawNext( sal_False ); NextToolBox(); - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -4219,10 +4221,10 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) // only highlight when the focus is not inside a child window of a toolbox // eg, in a edit control // and do not hilight when focus is in a different toolbox - BOOL bDrawHotSpot = TRUE; + sal_Bool bDrawHotSpot = sal_True; Window *pWin = Application::GetFocusWindow(); if( pWin && pWin->ImplGetWindowImpl()->mbToolBox && pWin != this ) - bDrawHotSpot = FALSE; + bDrawHotSpot = sal_False; /* else if( pWin && !pWin->ImplGetWindowImpl()->mbToolBox ) @@ -4231,7 +4233,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) pWin = pWin->GetParent(); if( pWin && pWin->ImplGetWindowImpl()->mbToolBox ) { - bDrawHotSpot = FALSE; + bDrawHotSpot = sal_False; break; } } @@ -4239,8 +4241,8 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) if ( mbSelection && bDrawHotSpot ) { - USHORT i = 0; - USHORT nNewPos = TOOLBOX_ITEM_NOTFOUND; + sal_uInt16 i = 0; + sal_uInt16 nNewPos = TOOLBOX_ITEM_NOTFOUND; // Item suchen, das geklickt wurde std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); @@ -4283,7 +4285,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND ) { mnCurItemId = mnHighItemId = it->mnId; - ImplDrawItem( mnCurPos, 2 /*TRUE*/ ); // always use shadow effect (2) + ImplDrawItem( mnCurPos, 2 /*sal_True*/ ); // always use shadow effect (2) } else mnCurItemId = mnHighItemId = 0; @@ -4311,7 +4313,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) { if ( rMEvt.GetMode() & MOUSE_SIMPLEMOVE ) { - USHORT nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() ); + sal_uInt16 nLinePtr = ImplTestLineSize( this, rMEvt.GetPosPixel() ); if ( nLinePtr & DOCK_LINEHSIZE ) { if ( meAlign == WINDOWALIGN_LEFT ) @@ -4354,7 +4356,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) if ( bDrawHotSpot && ( ((eStyle == POINTER_ARROW) && (mnOutStyle & TOOLBOX_STYLE_HANDPOINTER)) || (mnOutStyle & TOOLBOX_STYLE_FLAT) || !mnOutStyle ) ) { - BOOL bClearHigh = TRUE; + sal_Bool bClearHigh = sal_True; if ( !rMEvt.IsLeaveWindow() && (mnCurPos == TOOLBOX_ITEM_NOTFOUND) ) { std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); @@ -4366,21 +4368,21 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) { if ( !mnOutStyle || (mnOutStyle & TOOLBOX_STYLE_FLAT) ) { - bClearHigh = FALSE; + bClearHigh = sal_False; if ( mnHighItemId != it->mnId ) { - USHORT nTempPos = sal::static_int_cast<USHORT>(it - mpData->m_aItems.begin()); + sal_uInt16 nTempPos = sal::static_int_cast<sal_uInt16>(it - mpData->m_aItems.begin()); if ( mnHighItemId ) { ImplHideFocus(); - USHORT nPos = GetItemPos( mnHighItemId ); + sal_uInt16 nPos = GetItemPos( mnHighItemId ); ImplDrawItem( nPos ); ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) ); } if ( mpData->mbMenubuttonSelected ) { // remove highlight from menubutton - ImplDrawMenubutton( this, FALSE ); + ImplDrawMenubutton( this, sal_False ); } mnHighItemId = it->mnId; ImplDrawItem( nTempPos, 2 ); @@ -4399,21 +4401,21 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) } // only clear highlight when focus is not in toolbar - BOOL bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos ); + sal_Bool bMenuButtonHit = mpData->maMenubuttonItem.maRect.IsInside( aMousePos ); if ( bClearHigh || bMenuButtonHit ) { if ( !bMenuButtonHit && mpData->mbMenubuttonSelected ) { // remove highlight from menubutton - ImplDrawMenubutton( this, FALSE ); + ImplDrawMenubutton( this, sal_False ); } if( mnHighItemId ) { - USHORT nClearPos = GetItemPos( mnHighItemId ); + sal_uInt16 nClearPos = GetItemPos( mnHighItemId ); if ( nClearPos != TOOLBOX_ITEM_NOTFOUND ) { - ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? TRUE : FALSE ); + ImplDrawItem( nClearPos, (nClearPos == mnCurPos) ? sal_True : sal_False ); if( nClearPos != mnCurPos ) ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nClearPos ) ); } @@ -4423,7 +4425,7 @@ void ToolBox::MouseMove( const MouseEvent& rMEvt ) if( bMenuButtonHit ) { - ImplDrawMenubutton( this, TRUE ); + ImplDrawMenubutton( this, sal_True ); } } } @@ -4458,8 +4460,8 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) } Point aMousePos = rMEvt.GetPosPixel(); - USHORT i = 0; - USHORT nNewPos = TOOLBOX_ITEM_NOTFOUND; + sal_uInt16 i = 0; + sal_uInt16 nNewPos = TOOLBOX_ITEM_NOTFOUND; // Item suchen, das geklickt wurde std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); @@ -4494,12 +4496,12 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) Rectangle aItemRect = GetItemRect( it->mnId ); mnConfigItem = it->mnId; - BOOL bResizeItem; + sal_Bool bResizeItem; if ( mbCustomizeMode && it->mbShowWindow && (it->maRect.Right()-TB_RESIZE_OFFSET <= aMousePos.X()) ) - bResizeItem = TRUE; + bResizeItem = sal_True; else - bResizeItem = FALSE; + bResizeItem = sal_False; pMgr->StartDragging( this, aMousePos, aItemRect, 0, bResizeItem ); return; } @@ -4513,7 +4515,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) // Aktuelle Daten setzen - USHORT nTrackFlags = 0; + sal_uInt16 nTrackFlags = 0; mnCurPos = i; mnCurItemId = it->mnId; mnDownItemId = mnCurItemId; @@ -4525,13 +4527,13 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( mbSelection ) { - ImplDrawItem( mnCurPos, TRUE ); + ImplDrawItem( mnCurPos, sal_True ); Highlight(); } else { // Hier schon bDrag setzen, da in EndSelection ausgewertet wird - mbDrag = TRUE; + mbDrag = sal_True; // Bei Doppelklick nur den Handler rufen, aber bevor der // Button gehiltet wird, da evt. in diesem Handler der @@ -4542,7 +4544,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( mbDrag ) { - ImplDrawItem( mnCurPos, TRUE ); + ImplDrawItem( mnCurPos, sal_True ); Highlight(); } @@ -4554,7 +4556,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) // dropdownonly always triggers the dropdown handler, over the whole button area // the drop down arrow should not trigger the item action - mpData->mbDropDownByKeyboard = FALSE; + mpData->mbDropDownByKeyboard = sal_False; GetDropdownClickHdl().Call( this ); // do not reset data if the dropdown handler opened a floating window @@ -4563,7 +4565,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) { // no floater was opened Deactivate(); - ImplDrawItem( mnCurPos, FALSE ); + ImplDrawItem( mnCurPos, sal_False ); mnCurPos = TOOLBOX_ITEM_NOTFOUND; mnCurItemId = 0; @@ -4613,9 +4615,9 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( mnCurLine > 1 ) { StartTracking(); - mbUpper = TRUE; - mbIn = TRUE; - ImplDrawSpin( TRUE, FALSE ); + mbUpper = sal_True; + mbIn = sal_True; + ImplDrawSpin( sal_True, sal_False ); } return; } @@ -4624,25 +4626,25 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) if ( mnCurLine+mnVisLines-1 < mnCurLines ) { StartTracking(); - mbLower = TRUE; - mbIn = TRUE; - ImplDrawSpin( FALSE, TRUE ); + mbLower = sal_True; + mbIn = sal_True; + ImplDrawSpin( sal_False, sal_True ); } return; } if ( maNextToolRect.IsInside( aMousePos ) ) { StartTracking(); - mbNextTool = TRUE; - mbIn = TRUE; - ImplDrawNext( TRUE ); + mbNextTool = sal_True; + mbIn = sal_True; + ImplDrawNext( sal_True ); return; } // Linesizing testen if ( (mnWinStyle & TB_WBLINESIZING) == TB_WBLINESIZING ) { - USHORT nLineMode = ImplTestLineSize( this, aMousePos ); + sal_uInt16 nLineMode = ImplTestLineSize( this, aMousePos ); if ( nLineMode ) { ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); @@ -4657,7 +4659,7 @@ void ToolBox::MouseButtonDown( const MouseEvent& rMEvt ) // Dragging starten pMgr->StartDragging( this, aMousePos, Rectangle( aPos, aSize ), - nLineMode, FALSE ); + nLineMode, sal_False ); return; } } @@ -4686,7 +4688,7 @@ void ToolBox::MouseButtonUp( const MouseEvent& rMEvt ) pMgr->EndDragging(); return; } - mbCommandDrag = FALSE; + mbCommandDrag = sal_False; DockingWindow::MouseButtonUp( rMEvt ); } @@ -4717,9 +4719,9 @@ void ToolBox::Paint( const Rectangle& rPaintRect ) if( mpData->mbIsPaintLocked ) return; if ( rPaintRect == Rectangle( 0, 0, mnDX-1, mnDY-1 ) ) - mbFullPaint = TRUE; + mbFullPaint = sal_True; ImplFormat(); - mbFullPaint = FALSE; + mbFullPaint = sal_False; ImplDrawBackground( this, rPaintRect ); @@ -4736,28 +4738,28 @@ void ToolBox::Paint( const Rectangle& rPaintRect ) if ( mnWinStyle & WB_SCROLL ) { if ( mnCurLines > mnLines ) - ImplDrawSpin( FALSE, FALSE ); + ImplDrawSpin( sal_False, sal_False ); } // NextButton zeichnen - ImplDrawNext( FALSE ); + ImplDrawNext( sal_False ); // Buttons zeichnen - USHORT nHighPos; + sal_uInt16 nHighPos; if ( mnHighItemId ) nHighPos = GetItemPos( mnHighItemId ); else nHighPos = TOOLBOX_ITEM_NOTFOUND; - USHORT nCount = (USHORT)mpData->m_aItems.size(); - for( USHORT i = 0; i < nCount; i++ ) + sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size(); + for( sal_uInt16 i = 0; i < nCount; i++ ) { ImplToolItem* pItem = &mpData->m_aItems[i]; // Nur malen, wenn Rechteck im PaintRectangle liegt if ( !pItem->maRect.IsEmpty() && rPaintRect.IsOver( pItem->maRect ) ) { - BOOL bHighlight = FALSE; + sal_Bool bHighlight = sal_False; if ( i == mnCurPos ) bHighlight = 1; else if ( i == nHighPos ) @@ -4800,9 +4802,9 @@ void ToolBox::Resize() { if ( !mbFormat ) { - mbFormat = TRUE; + mbFormat = sal_True; if( IsReallyVisible() ) - ImplFormat( TRUE ); + ImplFormat( sal_True ); } } @@ -4834,21 +4836,21 @@ void ToolBox::Resize() } // ----------------------------------------------------------------------- -const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const +const XubString& ToolBox::ImplGetHelpText( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem ) { - if ( !pItem->maHelpText.Len() && ( pItem->mnHelpId || pItem->maCommandStr.Len() )) + if ( !pItem->maHelpText.Len() && ( pItem->maHelpId.getLength() || pItem->maCommandStr.Len() )) { Help* pHelp = Application::GetHelp(); if ( pHelp ) { if ( pItem->maCommandStr.Len() ) pItem->maHelpText = pHelp->GetHelpText( pItem->maCommandStr, this ); - if ( !pItem->maHelpText.Len() && pItem->mnHelpId ) - pItem->maHelpText = pHelp->GetHelpText( pItem->mnHelpId, this ); + if ( !pItem->maHelpText.Len() && pItem->maHelpId.getLength() ) + pItem->maHelpText = pHelp->GetHelpText( rtl::OStringToOUString( pItem->maHelpId, RTL_TEXTENCODING_UTF8 ), this ); } } @@ -4862,7 +4864,7 @@ const XubString& ToolBox::ImplGetHelpText( USHORT nItemId ) const void ToolBox::RequestHelp( const HelpEvent& rHEvt ) { - USHORT nItemId; + sal_uInt16 nItemId; Point aHelpPos; if( !rHEvt.KeyboardActivated() ) @@ -4914,9 +4916,9 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt ) else if ( rHEvt.GetMode() & HELPMODE_EXTENDED ) { String aCommand = GetItemCommand( nItemId ); - ULONG nHelpId = GetHelpId( nItemId ); + rtl::OString aHelpId( GetHelpId( nItemId ) ); - if ( aCommand.Len() || nHelpId ) + if ( aCommand.Len() || aHelpId.getLength() ) { // Wenn eine Hilfe existiert, dann ausloesen Help* pHelp = Application::GetHelp(); @@ -4924,8 +4926,8 @@ void ToolBox::RequestHelp( const HelpEvent& rHEvt ) { if ( aCommand.Len() ) pHelp->Start( aCommand, this ); - else if ( nHelpId ) - pHelp->Start( nHelpId, this ); + else if ( aHelpId.getLength() ) + pHelp->Start( rtl::OStringToOUString( aHelpId, RTL_TEXTENCODING_UTF8 ), this ); } return; } @@ -4963,20 +4965,20 @@ long ToolBox::Notify( NotifyEvent& rNEvt ) { KeyEvent aKEvt = *rNEvt.GetKeyEvent(); KeyCode aKeyCode = aKEvt.GetKeyCode(); - USHORT nKeyCode = aKeyCode.GetCode(); + sal_uInt16 nKeyCode = aKeyCode.GetCode(); switch( nKeyCode ) { case KEY_TAB: { // internal TAB cycling only if parent is not a dialog or if we are the ony child // otherwise the dialog control will take over - BOOL bNoTabCycling = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL && + sal_Bool bNoTabCycling = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL && ImplGetParent()->GetChildCount() != 1 ); if( bNoTabCycling && ! (GetStyle() & WB_FORCETABCYCLE) ) return DockingWindow::Notify( rNEvt ); - else if( ImplChangeHighlightUpDn( aKeyCode.IsShift() ? TRUE : FALSE , bNoTabCycling ) ) - return FALSE; + else if( ImplChangeHighlightUpDn( aKeyCode.IsShift() ? sal_True : sal_False , bNoTabCycling ) ) + return sal_False; else return DockingWindow::Notify( rNEvt ); } @@ -4997,9 +4999,9 @@ long ToolBox::Notify( NotifyEvent& rNEvt ) } else if( (GetGetFocusFlags() & (GETFOCUS_BACKWARD|GETFOCUS_TAB) ) == (GETFOCUS_BACKWARD|GETFOCUS_TAB)) // Shift-TAB was pressed in the parent - ImplChangeHighlightUpDn( FALSE ); + ImplChangeHighlightUpDn( sal_False ); else - ImplChangeHighlightUpDn( TRUE ); + ImplChangeHighlightUpDn( sal_True ); mnLastFocusItemId = 0; @@ -5064,7 +5066,7 @@ void ToolBox::Command( const CommandEvent& rCEvt ) // dann mache nichts if ( (it->meType == TOOLBOXITEM_BUTTON) && !it->mbShowWindow ) - mbCommandDrag = TRUE; + mbCommandDrag = sal_True; break; } @@ -5088,10 +5090,10 @@ void ToolBox::Command( const CommandEvent& rCEvt ) if ( pData->GetMode() == COMMAND_WHEEL_SCROLL ) { if ( (mnCurLine > 1) && (pData->GetDelta() > 0) ) - ShowLine( FALSE ); + ShowLine( sal_False ); else if ( (mnCurLine+mnVisLines-1 < mnCurLines) && (pData->GetDelta() < 0) ) - ShowLine( TRUE ); - ImplDrawSpin( FALSE, FALSE ); + ShowLine( sal_True ); + ImplDrawSpin( sal_False, sal_False ); return; } } @@ -5118,19 +5120,19 @@ void ToolBox::StateChanged( StateChangedType nType ) else if ( (nType == STATE_CHANGE_ZOOM) || (nType == STATE_CHANGE_CONTROLFONT) ) { - mbCalc = TRUE; - mbFormat = TRUE; - ImplInitSettings( TRUE, FALSE, FALSE ); + mbCalc = sal_True; + mbFormat = sal_True; + ImplInitSettings( sal_True, sal_False, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLFOREGROUND ) { - ImplInitSettings( FALSE, TRUE, FALSE ); + ImplInitSettings( sal_False, sal_True, sal_False ); Invalidate(); } else if ( nType == STATE_CHANGE_CONTROLBACKGROUND ) { - ImplInitSettings( FALSE, FALSE, TRUE ); // font, foreground, background + ImplInitSettings( sal_False, sal_False, sal_True ); // font, foreground, background Invalidate(); } } @@ -5147,16 +5149,16 @@ void ToolBox::DataChanged( const DataChangedEvent& rDCEvt ) ((rDCEvt.GetType() == DATACHANGED_SETTINGS) && (rDCEvt.GetFlags() & SETTINGS_STYLE)) ) { - mbCalc = TRUE; - mbFormat = TRUE; - ImplInitSettings( TRUE, TRUE, TRUE ); + mbCalc = sal_True; + mbFormat = sal_True; + ImplInitSettings( sal_True, sal_True, sal_True ); Invalidate(); } } // ----------------------------------------------------------------------- -BOOL ToolBox::PrepareToggleFloatingMode() +sal_Bool ToolBox::PrepareToggleFloatingMode() { return DockingWindow::PrepareToggleFloatingMode(); } @@ -5167,27 +5169,27 @@ void ToolBox::ToggleFloatingMode() { DockingWindow::ToggleFloatingMode(); - BOOL mbOldHorz = mbHorz; + sal_Bool mbOldHorz = mbHorz; if ( ImplIsFloatingMode() ) { - mbHorz = TRUE; + mbHorz = sal_True; meAlign = WINDOWALIGN_TOP; - mbScroll = TRUE; + mbScroll = sal_True; if( mbOldHorz != mbHorz ) - mbCalc = TRUE; // orientation was changed ! + mbCalc = sal_True; // orientation was changed ! ImplSetMinMaxFloatSize( this ); SetOutputSizePixel( ImplCalcFloatSize( this, mnFloatLines ) ); } else { - mbScroll = (mnWinStyle & WB_SCROLL) ? TRUE : FALSE; + mbScroll = (mnWinStyle & WB_SCROLL) ? sal_True : sal_False; if ( (meAlign == WINDOWALIGN_TOP) || (meAlign == WINDOWALIGN_BOTTOM) ) - mbHorz = TRUE; + mbHorz = sal_True; else - mbHorz = FALSE; + mbHorz = sal_False; // set focus back to document ImplGetFrameWindow()->GetWindow( WINDOW_CLIENT )->GrabFocus(); @@ -5197,11 +5199,11 @@ void ToolBox::ToggleFloatingMode() { // if orientation changes, the toolbox has to be initialized again // to update the direction of the gradient - mbCalc = TRUE; - ImplInitSettings( TRUE, TRUE, TRUE ); + mbCalc = sal_True; + ImplInitSettings( sal_True, sal_True, sal_True ); } - mbFormat = TRUE; + mbFormat = sal_True; ImplFormat(); } @@ -5217,13 +5219,13 @@ void ToolBox::StartDocking() // ----------------------------------------------------------------------- -BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect ) +sal_Bool ToolBox::Docking( const Point& rPos, Rectangle& rRect ) { // Wenn Dragging, dann nicht machen, da vorher schon berechnet if ( mbDragging ) - return FALSE; + return sal_False; - BOOL bFloatMode = FALSE; + sal_Bool bFloatMode = sal_False; DockingWindow::Docking( rPos, rRect ); @@ -5236,7 +5238,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect ) // to get a floating mode as result - switch to floating size // so the calculation only depends on the position of the rectangle, not the current // docking state of the window - USHORT nTemp = 0; + sal_uInt16 nTemp = 0; aDockingRect.SetSize( ImplCalcFloatSize( this, nTemp ) ); // in this mode docking is never done by keyboard, so it's OK to use the mouse position @@ -5271,7 +5273,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect ) // FloatWindow werden Rectangle aIntersect = aInRect.GetIntersection( aDockingRect ); if ( aIntersect == aDockingRect ) - bFloatMode = TRUE; + bFloatMode = sal_True; else { // docking rectangle is in the "sensible area" @@ -5325,14 +5327,14 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect ) } } else - bFloatMode = TRUE; + bFloatMode = sal_True; if ( bFloatMode ) { meDockAlign = meAlign; if ( !mbLastFloatMode ) { - USHORT nTemp = 0; + sal_uInt16 nTemp = 0; aDockingRect.SetSize( ImplCalcFloatSize( this, nTemp ) ); } } @@ -5345,7 +5347,7 @@ BOOL ToolBox::Docking( const Point& rPos, Rectangle& rRect ) // ----------------------------------------------------------------------- -void ToolBox::EndDocking( const Rectangle& rRect, BOOL bFloatMode ) +void ToolBox::EndDocking( const Rectangle& rRect, sal_Bool bFloatMode ) { if ( !IsDockingCanceled() ) { @@ -5362,8 +5364,8 @@ void ToolBox::EndDocking( const Rectangle& rRect, BOOL bFloatMode ) void ToolBox::Resizing( Size& rSize ) { - USHORT nCalcLines; - USHORT nTemp; + sal_uInt16 nCalcLines; + sal_uInt16 nTemp; // Alle Floatinggroessen berechnen ImplCalcFloatSizes( this ); @@ -5399,20 +5401,20 @@ void ToolBox::Resizing( Size& rSize ) // ----------------------------------------------------------------------- -Size ToolBox::CalcWindowSizePixel( USHORT nCalcLines ) const +Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines ) const { return ImplCalcSize( this, nCalcLines ); } -Size ToolBox::CalcWindowSizePixel( USHORT nCalcLines, WindowAlign eAlign ) const +Size ToolBox::CalcWindowSizePixel( sal_uInt16 nCalcLines, WindowAlign eAlign ) const { return ImplCalcSize( this, nCalcLines, (eAlign == WINDOWALIGN_TOP || eAlign == WINDOWALIGN_BOTTOM) ? TB_CALCMODE_HORZ : TB_CALCMODE_VERT ); } -USHORT ToolBox::ImplCountLineBreaks( const ToolBox *pThis ) +sal_uInt16 ToolBox::ImplCountLineBreaks( const ToolBox *pThis ) { - USHORT nLines = 0; + sal_uInt16 nLines = 0; std::vector< ImplToolItem >::const_iterator it = ((ToolBox*)pThis)->mpData->m_aItems.begin(); while ( it != ((ToolBox*)pThis)->mpData->m_aItems.end() ) @@ -5427,19 +5429,19 @@ USHORT ToolBox::ImplCountLineBreaks( const ToolBox *pThis ) Size ToolBox::CalcPopupWindowSizePixel() const { // count number of breaks and calc corresponding floating window size - USHORT nLines = ImplCountLineBreaks( this ); + sal_uInt16 nLines = ImplCountLineBreaks( this ); if( nLines ) ++nLines; // add the first line else { // no breaks found: use quadratic layout - nLines = (USHORT) ceil( sqrt( (double) GetItemCount() ) ); + nLines = (sal_uInt16) ceil( sqrt( (double) GetItemCount() ) ); } - BOOL bPopup = mpData->mbAssumePopupMode; + sal_Bool bPopup = mpData->mbAssumePopupMode; ToolBox *pThis = (ToolBox*) this; - pThis->mpData->mbAssumePopupMode = TRUE; + pThis->mpData->mbAssumePopupMode = sal_True; Size aSize = CalcFloatingWindowSizePixel( nLines ); @@ -5449,24 +5451,24 @@ Size ToolBox::CalcPopupWindowSizePixel() const Size ToolBox::CalcFloatingWindowSizePixel() const { - USHORT nLines = ImplCountLineBreaks( this ); + sal_uInt16 nLines = ImplCountLineBreaks( this ); ++nLines; // add the first line return CalcFloatingWindowSizePixel( nLines ); } -Size ToolBox::CalcFloatingWindowSizePixel( USHORT nCalcLines ) const +Size ToolBox::CalcFloatingWindowSizePixel( sal_uInt16 nCalcLines ) const { - BOOL bFloat = mpData->mbAssumeFloating; - BOOL bDocking = mpData->mbAssumeDocked; + sal_Bool bFloat = mpData->mbAssumeFloating; + sal_Bool bDocking = mpData->mbAssumeDocked; // simulate floating mode and force reformat before calculating ToolBox *pThis = (ToolBox*) this; - pThis->mpData->mbAssumeFloating = TRUE; - pThis->mpData->mbAssumeDocked = FALSE; + pThis->mpData->mbAssumeFloating = sal_True; + pThis->mpData->mbAssumeDocked = sal_False; Size aSize = ImplCalcFloatSize( (ToolBox*) this, nCalcLines ); - pThis->mbFormat = TRUE; + pThis->mbFormat = sal_True; pThis->mpData->mbAssumeFloating = bFloat; pThis->mpData->mbAssumeDocked = bDocking; @@ -5518,7 +5520,7 @@ Size ToolBox::CalcMinimumWindowSizePixel() const // ----------------------------------------------------------------------- -void ToolBox::EnableCustomize( BOOL bEnable ) +void ToolBox::EnableCustomize( sal_Bool bEnable ) { if ( bEnable != mbCustomize ) { @@ -5548,7 +5550,7 @@ void ToolBox::StartCustomize( const Rectangle& rRect, void* pData ) aMousePos = ScreenToOutputPixel( aPos ); Pointer aPtr; SetPointer( aPtr ); - pMgr->StartDragging( this, aMousePos, aRect, 0, FALSE, pData ); + pMgr->StartDragging( this, aMousePos, aRect, 0, sal_False, pData ); } // ----------------------------------------------------------------------- @@ -5569,7 +5571,7 @@ void ToolBox::EndCustomizeMode() // ----------------------------------------------------------------------- -BOOL ToolBox::IsCustomizeMode() +sal_Bool ToolBox::IsCustomizeMode() { ImplTBDragMgr* pMgr = ImplGetTBDragMgr(); return pMgr->IsCustomizeMode(); @@ -5586,7 +5588,7 @@ void ToolBox::GetFocus() void ToolBox::LoseFocus() { - ImplChangeHighlight( NULL, TRUE ); + ImplChangeHighlight( NULL, sal_True ); DockingWindow::LoseFocus(); } @@ -5594,10 +5596,10 @@ void ToolBox::LoseFocus() // ----------------------------------------------------------------------- // performs the action associated with an item, ie simulates clicking the item -void ToolBox::TriggerItem( USHORT nItemId, BOOL bShift, BOOL bCtrl ) +void ToolBox::TriggerItem( sal_uInt16 nItemId, sal_Bool bShift, sal_Bool bCtrl ) { mnHighItemId = nItemId; - USHORT nModifier = 0; + sal_uInt16 nModifier = 0; if( bShift ) nModifier |= KEY_SHIFT; if( bCtrl ) @@ -5609,24 +5611,24 @@ void ToolBox::TriggerItem( USHORT nItemId, BOOL bShift, BOOL bCtrl ) // ----------------------------------------------------------------------- // calls the button's action handler -// returns TRUE if action was called -BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode ) +// returns sal_True if action was called +sal_Bool ToolBox::ImplActivateItem( KeyCode aKeyCode ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; if( mnHighItemId ) { ImplToolItem *pToolItem = ImplGetItem( mnHighItemId ); // #107712#, activate can also be called for disabled entries if( pToolItem && !pToolItem->mbEnabled ) - return TRUE; + return sal_True; if( pToolItem && pToolItem->mpWindow && HasFocus() ) { ImplHideFocus(); - mbChangingHighlight = TRUE; // avoid focus change due to loose focus + mbChangingHighlight = sal_True; // avoid focus change due to loose focus pToolItem->mpWindow->ImplControlFocus( GETFOCUS_TAB ); - mbChangingHighlight = FALSE; + mbChangingHighlight = sal_False; } else { @@ -5648,7 +5650,7 @@ BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode ) } } mnMouseModifier = aKeyCode.GetModifier(); - mbIsKeyEvent = TRUE; + mbIsKeyEvent = sal_True; Activate(); Click(); @@ -5661,18 +5663,18 @@ BOOL ToolBox::ImplActivateItem( KeyCode aKeyCode ) ImplRemoveDel( &aDelData ); Deactivate(); - mbIsKeyEvent = FALSE; + mbIsKeyEvent = sal_False; mnMouseModifier = 0; } } else - bRet = FALSE; + bRet = sal_False; return bRet; } // ----------------------------------------------------------------------- -BOOL ImplCloseLastPopup( Window *pParent ) +sal_Bool ImplCloseLastPopup( Window *pParent ) { // close last popup toolbox (see also: // ImplHandleMouseFloatMode(...) in winproc.cxx ) @@ -5684,23 +5686,23 @@ BOOL ImplCloseLastPopup( Window *pParent ) if( pLastLevelFloat && pLastLevelFloat != pParent ) { pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } // opens a drop down toolbox item -// returns TRUE if item was opened -BOOL ToolBox::ImplOpenItem( KeyCode aKeyCode ) +// returns sal_True if item was opened +sal_Bool ToolBox::ImplOpenItem( KeyCode aKeyCode ) { - USHORT nCode = aKeyCode.GetCode(); - BOOL bRet = TRUE; + sal_uInt16 nCode = aKeyCode.GetCode(); + sal_Bool bRet = sal_True; // arrow keys should work only in the opposite direction of alignment (to not break cursor travelling) if ( ((nCode == KEY_LEFT || nCode == KEY_RIGHT) && IsHorizontal()) || ((nCode == KEY_UP || nCode == KEY_DOWN) && !IsHorizontal()) ) - return FALSE; + return sal_False; if( IsMenuEnabled() && mpData->mbMenubuttonSelected ) { @@ -5720,19 +5722,19 @@ BOOL ToolBox::ImplOpenItem( KeyCode aKeyCode ) mnCurPos = GetItemPos( mnCurItemId ); mnLastFocusItemId = mnCurItemId; // save item id for possible later focus restore mnMouseModifier = aKeyCode.GetModifier(); - mbIsShift = TRUE; - mbIsKeyEvent = TRUE; + mbIsShift = sal_True; + mbIsKeyEvent = sal_True; Activate(); - mpData->mbDropDownByKeyboard = TRUE; + mpData->mbDropDownByKeyboard = sal_True; GetDropdownClickHdl().Call( this ); - mbIsKeyEvent = FALSE; - mbIsShift = FALSE; + mbIsKeyEvent = sal_False; + mbIsShift = sal_False; mnMouseModifier = 0; } else - bRet = FALSE; + bRet = sal_False; return bRet; } @@ -5743,10 +5745,10 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) { KeyCode aKeyCode = rKEvt.GetKeyCode(); mnKeyModifier = aKeyCode.GetModifier(); - USHORT nCode = aKeyCode.GetCode(); - BOOL bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL ); - BOOL bForwardKey = FALSE; - BOOL bGrabFocusToDocument = FALSE; + sal_uInt16 nCode = aKeyCode.GetCode(); + sal_Bool bParentIsDialog = ( ( ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL ); + sal_Bool bForwardKey = sal_False; + sal_Bool bGrabFocusToDocument = sal_False; // #107776# we might be destroyed in the keyhandler ImplDelData aDelData; @@ -5760,7 +5762,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) if( aKeyCode.GetModifier() ) // allow only pure cursor keys break; if( !IsHorizontal() ) - ImplChangeHighlightUpDn( TRUE ); + ImplChangeHighlightUpDn( sal_True ); else ImplOpenItem( aKeyCode ); } @@ -5770,7 +5772,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) if( aKeyCode.GetModifier() ) // allow only pure cursor keys break; if( IsHorizontal() ) - ImplChangeHighlightUpDn( TRUE ); + ImplChangeHighlightUpDn( sal_True ); else ImplOpenItem( aKeyCode ); } @@ -5780,7 +5782,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) if( aKeyCode.GetModifier() ) // allow only pure cursor keys break; if( !IsHorizontal() ) - ImplChangeHighlightUpDn( FALSE ); + ImplChangeHighlightUpDn( sal_False ); else ImplOpenItem( aKeyCode ); } @@ -5790,7 +5792,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) if( aKeyCode.GetModifier() ) // allow only pure cursor keys break; if( IsHorizontal() ) - ImplChangeHighlightUpDn( FALSE ); + ImplChangeHighlightUpDn( sal_False ); else ImplOpenItem( aKeyCode ); } @@ -5802,9 +5804,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) mnCurLine = mnCurLine - mnVisLines; else mnCurLine = 1; - mbFormat = TRUE; + mbFormat = sal_True; ImplFormat(); - ImplDrawSpin( FALSE, FALSE ); + ImplDrawSpin( sal_False, sal_False ); ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) ); } break; @@ -5815,22 +5817,22 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) mnCurLine = mnCurLine + mnVisLines; else mnCurLine = mnCurLines; - mbFormat = TRUE; + mbFormat = sal_True; ImplFormat(); - ImplDrawSpin( FALSE, FALSE ); + ImplDrawSpin( sal_False, sal_False ); ImplChangeHighlight( ImplGetFirstValidItem( mnCurLine ) ); } break; case KEY_END: { ImplChangeHighlight( NULL ); - ImplChangeHighlightUpDn( FALSE ); + ImplChangeHighlightUpDn( sal_False ); } break; case KEY_HOME: { ImplChangeHighlight( NULL ); - ImplChangeHighlightUpDn( TRUE ); + ImplChangeHighlightUpDn( sal_True ); } break; case KEY_ESCAPE: @@ -5863,7 +5865,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) if( !pItem->mbEnabled ) { Sound::Beep( SOUND_DISABLE, this ); - bGrabFocusToDocument = TRUE; + bGrabFocusToDocument = sal_True; } } if( !bGrabFocusToDocument ) @@ -5872,7 +5874,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) break; default: { - USHORT aKeyGroup = aKeyCode.GetGroup(); + sal_uInt16 aKeyGroup = aKeyCode.GetGroup(); ImplToolItem *pItem = NULL; if( mnHighItemId ) pItem = ImplGetItem( mnHighItemId ); @@ -5881,9 +5883,9 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) { Window *pFocusWindow = Application::GetFocusWindow(); ImplHideFocus(); - mbChangingHighlight = TRUE; // avoid focus change due to loose focus + mbChangingHighlight = sal_True; // avoid focus change due to loose focus pItem->mpWindow->ImplControlFocus( GETFOCUS_TAB ); - mbChangingHighlight = FALSE; + mbChangingHighlight = sal_False; if( pFocusWindow != Application::GetFocusWindow() ) Application::GetFocusWindow()->KeyInput( rKEvt ); } @@ -5893,7 +5895,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) // while the toolbox has the focus // just forward function and special keys and combinations with Alt-key if( aKeyGroup == KEYGROUP_FKEYS || aKeyGroup == KEYGROUP_MISC || aKeyCode.IsMod2() ) - bForwardKey = TRUE; + bForwardKey = sal_True; } } } @@ -5905,7 +5907,7 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) // #107251# move focus away if this toolbox was disabled during keyinput if( HasFocus() && mpData->mbKeyInputDisabled && (ImplGetParent()->GetStyle() & (WB_DIALOGCONTROL | WB_NODIALOGCONTROL) ) == WB_DIALOGCONTROL) { - USHORT n = 0; + sal_uInt16 n = 0; Window *pFocusControl = ImplGetParent()->ImplGetDlgWindow( n, DLGWINDOW_FIRST ); if ( pFocusControl && pFocusControl != this ) pFocusControl->ImplControlFocus( GETFOCUS_INIT ); @@ -5927,10 +5929,10 @@ void ToolBox::KeyInput( const KeyEvent& rKEvt ) // ----------------------------------------------------------------------- // returns the current toolbox line of the item -USHORT ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem ) +sal_uInt16 ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem ) { std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); - USHORT nLine = 1; + sal_uInt16 nLine = 1; while( it != mpData->m_aItems.end() ) { if ( it->mbBreak ) @@ -5943,7 +5945,7 @@ USHORT ToolBox::ImplGetItemLine( ImplToolItem* pCurrentItem ) } // returns the first displayable item in the given line -ImplToolItem* ToolBox::ImplGetFirstValidItem( USHORT nLine ) +ImplToolItem* ToolBox::ImplGetFirstValidItem( sal_uInt16 nLine ) { if( !nLine || nLine > mnCurLines ) return NULL; @@ -5975,7 +5977,7 @@ ImplToolItem* ToolBox::ImplGetFirstValidItem( USHORT nLine ) } // returns the last displayable item in the given line -ImplToolItem* ToolBox::ImplGetLastValidItem( USHORT nLine ) +ImplToolItem* ToolBox::ImplGetLastValidItem( sal_uInt16 nLine ) { if( !nLine || nLine > mnCurLines ) return NULL; @@ -6009,11 +6011,11 @@ ImplToolItem* ToolBox::ImplGetLastValidItem( USHORT nLine ) // ----------------------------------------------------------------------- -USHORT ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList ) +sal_uInt16 ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< ImplToolItem >& rList ) { if( pItem ) { - USHORT nPos; + sal_uInt16 nPos; for( nPos = 0; nPos < rList.size(); ++nPos ) if( &rList[ nPos ] == pItem ) return nPos; @@ -6021,34 +6023,34 @@ USHORT ToolBox::ImplFindItemPos( const ImplToolItem* pItem, const std::vector< I return TOOLBOX_ITEM_NOTFOUND; } -void ToolBox::ChangeHighlight( USHORT nPos ) +void ToolBox::ChangeHighlight( sal_uInt16 nPos ) { if ( nPos < GetItemCount() ) { ImplGrabFocus( 0 ); - ImplChangeHighlight ( ImplGetItem ( GetItemId ( (USHORT) nPos ) ), FALSE ); + ImplChangeHighlight ( ImplGetItem ( GetItemId ( (sal_uInt16) nPos ) ), sal_False ); } } -void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus ) +void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, sal_Bool bNoGrabFocus ) { // avoid recursion due to focus change if( mbChangingHighlight ) return; - mbChangingHighlight = TRUE; + mbChangingHighlight = sal_True; ImplToolItem* pOldItem = NULL; if ( mnHighItemId ) { ImplHideFocus(); - USHORT nPos = GetItemPos( mnHighItemId ); + sal_uInt16 nPos = GetItemPos( mnHighItemId ); pOldItem = ImplGetItem( mnHighItemId ); // #i89962# ImplDrawItem can cause Invalidate/Update // which will in turn ImplShowFocus again // set mnHighItemId to 0 already to prevent this hen/egg problem mnHighItemId = 0; - ImplDrawItem( nPos, FALSE ); + ImplDrawItem( nPos, sal_False ); ImplCallEventListeners( VCLEVENT_TOOLBOX_HIGHLIGHTOFF, reinterpret_cast< void* >( nPos ) ); } @@ -6060,21 +6062,21 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus ) if( pItem ) { - USHORT aPos = ToolBox::ImplFindItemPos( pItem, mpData->m_aItems ); + sal_uInt16 aPos = ToolBox::ImplFindItemPos( pItem, mpData->m_aItems ); if( aPos != TOOLBOX_ITEM_NOTFOUND) { // check for line breaks - USHORT nLine = ImplGetItemLine( pItem ); + sal_uInt16 nLine = ImplGetItemLine( pItem ); if( nLine >= mnCurLine + mnVisLines ) { mnCurLine = nLine - mnVisLines + 1; - mbFormat = TRUE; + mbFormat = sal_True; } else if ( nLine < mnCurLine ) { mnCurLine = nLine; - mbFormat = TRUE; + mbFormat = sal_True; } if( mbFormat ) @@ -6099,23 +6101,23 @@ void ToolBox::ImplChangeHighlight( ImplToolItem* pItem, BOOL bNoGrabFocus ) mnCurPos = TOOLBOX_ITEM_NOTFOUND; } - mbChangingHighlight = FALSE; + mbChangingHighlight = sal_False; } // ----------------------------------------------------------------------- // check for keyboard accessible items -static BOOL ImplIsValidItem( const ImplToolItem* pItem, BOOL bNotClipped ) +static sal_Bool ImplIsValidItem( const ImplToolItem* pItem, sal_Bool bNotClipped ) { - BOOL bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem )); + sal_Bool bValid = (pItem && pItem->meType == TOOLBOXITEM_BUTTON && pItem->mbVisible && !ImplIsFixedControl( pItem )); if( bValid && bNotClipped && pItem->IsClipped() ) - bValid = FALSE; + bValid = sal_False; return bValid; } // ----------------------------------------------------------------------- -BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) +sal_Bool ToolBox::ImplChangeHighlightUpDn( sal_Bool bUp, sal_Bool bNoCycle ) { ImplToolItem* pToolItem = ImplGetItem( mnHighItemId ); @@ -6132,13 +6134,13 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) while( it != mpData->m_aItems.begin() ) { --it; - if ( ImplIsValidItem( &(*it), TRUE ) ) + if ( ImplIsValidItem( &(*it), sal_True ) ) { pItem = &(*it); break; } } - ImplDrawMenubutton( this, FALSE ); + ImplDrawMenubutton( this, sal_False ); ImplChangeHighlight( pItem ); } else @@ -6147,17 +6149,17 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); while( it != mpData->m_aItems.end() ) { - if ( ImplIsValidItem( &(*it), TRUE ) ) + if ( ImplIsValidItem( &(*it), sal_True ) ) break; ++it; } if( it != mpData->m_aItems.end() ) { - ImplDrawMenubutton( this, FALSE ); + ImplDrawMenubutton( this, sal_False ); ImplChangeHighlight( &(*it) ); } } - return TRUE; + return sal_True; } if( bUp ) @@ -6166,7 +6168,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) std::vector< ImplToolItem >::iterator it = mpData->m_aItems.begin(); while( it != mpData->m_aItems.end() ) { - if ( ImplIsValidItem( &(*it), FALSE ) ) + if ( ImplIsValidItem( &(*it), sal_False ) ) break; ++it; } @@ -6175,11 +6177,11 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) if( (it != mpData->m_aItems.end() && &(*it) == ImplGetFirstClippedItem( this )) && IsMenuEnabled() ) { ImplChangeHighlight( NULL ); - ImplDrawMenubutton( this, TRUE ); + ImplDrawMenubutton( this, sal_True ); } else ImplChangeHighlight( (it != mpData->m_aItems.end()) ? &(*it) : NULL ); - return TRUE; + return sal_True; } else { @@ -6189,7 +6191,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) if( IsMenuEnabled() && !ImplIsFloatingMode() ) { ImplChangeHighlight( NULL ); - ImplDrawMenubutton( this, TRUE ); + ImplDrawMenubutton( this, sal_True ); } else { @@ -6198,7 +6200,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) while( it != mpData->m_aItems.begin() ) { --it; - if ( ImplIsValidItem( &(*it), FALSE ) ) + if ( ImplIsValidItem( &(*it), sal_False ) ) { pItem = &(*it); break; @@ -6206,16 +6208,16 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) } ImplChangeHighlight( pItem ); } - return TRUE; + return sal_True; } } if( pToolItem ) { - ULONG pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems ); - ULONG nCount = mpData->m_aItems.size(); + sal_uLong pos = ToolBox::ImplFindItemPos( pToolItem, mpData->m_aItems ); + sal_uLong nCount = mpData->m_aItems.size(); - ULONG i=0; + sal_uLong i=0; do { if( bUp ) @@ -6223,14 +6225,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) if( !pos-- ) { if( bNoCycle ) - return FALSE; + return sal_False; // highlight the menu button if it is the last item if( IsMenuEnabled() && !ImplIsFloatingMode() ) { ImplChangeHighlight( NULL ); - ImplDrawMenubutton( this, TRUE ); - return TRUE; + ImplDrawMenubutton( this, sal_True ); + return sal_True; } else pos = nCount-1; @@ -6241,14 +6243,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) if( ++pos >= nCount ) { if( bNoCycle ) - return FALSE; + return sal_False; // highlight the menu button if it is the last item if( IsMenuEnabled() && !ImplIsFloatingMode() ) { ImplChangeHighlight( NULL ); - ImplDrawMenubutton( this, TRUE ); - return TRUE; + ImplDrawMenubutton( this, sal_True ); + return sal_True; } else pos = 0; @@ -6257,7 +6259,7 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) pToolItem = &mpData->m_aItems[pos]; - if ( ImplIsValidItem( pToolItem, FALSE ) ) + if ( ImplIsValidItem( pToolItem, sal_False ) ) break; } while( ++i < nCount); @@ -6266,14 +6268,14 @@ BOOL ToolBox::ImplChangeHighlightUpDn( BOOL bUp, BOOL bNoCycle ) { // select the menu button if a clipped item would be selected ImplChangeHighlight( NULL ); - ImplDrawMenubutton( this, TRUE ); + ImplDrawMenubutton( this, sal_True ); } else if( i != nCount ) ImplChangeHighlight( pToolItem ); else - return FALSE; + return sal_False; } - return TRUE; + return sal_True; } // ----------------------------------------------------------------------- @@ -6286,7 +6288,7 @@ void ToolBox::ImplShowFocus() if( pItem->mpWindow ) { Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow; - pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = TRUE; + pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = sal_True; pWin->Invalidate( 0 ); } } @@ -6302,7 +6304,7 @@ void ToolBox::ImplHideFocus() if( pItem->mpWindow ) { Window *pWin = pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow ? pItem->mpWindow->ImplGetWindowImpl()->mpBorderWindow : pItem->mpWindow; - pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = FALSE; + pWin->ImplGetWindowImpl()->mbDrawSelectionBackground = sal_False; pWin->Invalidate( 0 ); } } @@ -6310,7 +6312,7 @@ void ToolBox::ImplHideFocus() if ( mpData->mbMenubuttonSelected ) { // remove highlight from menubutton - ImplDrawMenubutton( this, FALSE ); + ImplDrawMenubutton( this, sal_False ); } } @@ -6330,7 +6332,7 @@ void ToolBox::ImplDisableFlatButtons() &hkey) ) { DWORD dwType = 0; - WIN_BYTE Data[6]; // possible values: "true", "false", "1", "0", DWORD + sal_uInt8 Data[6]; // possible values: "true", "false", "1", "0", DWORD DWORD cbData = sizeof(Data); if( ERROR_SUCCESS == RegQueryValueEx(hkey, "DisableFlatToolboxButtons", diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx index f17c7d0ef87e..37650232fd7f 100644 --- a/vcl/source/window/toolbox2.cxx +++ b/vcl/source/window/toolbox2.cxx @@ -72,17 +72,17 @@ ImplToolBoxPrivateData::ImplToolBoxPrivateData() : mnMenuButtonWidth = TB_MENUBUTTON_SIZE; - mbIsLocked = FALSE; - mbNativeButtons = FALSE; - mbIsPaintLocked = FALSE; - mbAssumeDocked = FALSE; - mbAssumePopupMode = FALSE; - mbAssumeFloating = FALSE; - mbKeyInputDisabled = FALSE; - mbMenubuttonSelected = FALSE; - mbPageScroll = FALSE; - mbWillUsePopupMode = FALSE; - mbDropDownByKeyboard = FALSE; + mbIsLocked = sal_False; + mbNativeButtons = sal_False; + mbIsPaintLocked = sal_False; + mbAssumeDocked = sal_False; + mbAssumePopupMode = sal_False; + mbAssumeFloating = sal_False; + mbKeyInputDisabled = sal_False; + mbMenubuttonSelected = sal_False; + mbPageScroll = sal_False; + mbWillUsePopupMode = sal_False; + mbDropDownByKeyboard = sal_False; } ImplToolBoxPrivateData::~ImplToolBoxPrivateData() @@ -98,40 +98,38 @@ ImplToolItem::ImplToolItem() mnId = 0; mpWindow = NULL; mpUserData = NULL; - mnHelpId = 0; meType = TOOLBOXITEM_BUTTON; mnBits = 0; meState = STATE_NOCHECK; - mbEnabled = TRUE; - mbVisible = TRUE; - mbEmptyBtn = TRUE; - mbShowWindow = FALSE; - mbBreak = FALSE; + mbEnabled = sal_True; + mbVisible = sal_True; + mbEmptyBtn = sal_True; + mbShowWindow = sal_False; + mbBreak = sal_False; mnSepSize = TB_SEP_SIZE; mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH; mnImageAngle = 0; - mbMirrorMode = FALSE; - mbVisibleText = FALSE; + mbMirrorMode = sal_False; + mbVisibleText = sal_False; } // ----------------------------------------------------------------------- -ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage, +ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const Image& rImage, ToolBoxItemBits nItemBits ) : maImage( rImage ) { mnId = nItemId; mpWindow = NULL; mpUserData = NULL; - mnHelpId = 0; meType = TOOLBOXITEM_BUTTON; mnBits = nItemBits; meState = STATE_NOCHECK; - mbEnabled = TRUE; - mbVisible = TRUE; - mbEmptyBtn = FALSE; - mbShowWindow = FALSE; - mbBreak = FALSE; + mbEnabled = sal_True; + mbVisible = sal_True; + mbEmptyBtn = sal_False; + mbShowWindow = sal_False; + mbBreak = sal_False; mnSepSize = TB_SEP_SIZE; mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH; mnImageAngle = 0; @@ -141,22 +139,21 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage, // ----------------------------------------------------------------------- -ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText, +ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const XubString& rText, ToolBoxItemBits nItemBits ) : maText( rText ) { mnId = nItemId; mpWindow = NULL; mpUserData = NULL; - mnHelpId = 0; meType = TOOLBOXITEM_BUTTON; mnBits = nItemBits; meState = STATE_NOCHECK; - mbEnabled = TRUE; - mbVisible = TRUE; - mbEmptyBtn = FALSE; - mbShowWindow = FALSE; - mbBreak = FALSE; + mbEnabled = sal_True; + mbVisible = sal_True; + mbEmptyBtn = sal_False; + mbShowWindow = sal_False; + mbBreak = sal_False; mnSepSize = TB_SEP_SIZE; mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH; mnImageAngle = 0; @@ -166,7 +163,7 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const XubString& rText, // ----------------------------------------------------------------------- -ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage, +ImplToolItem::ImplToolItem( sal_uInt16 nItemId, const Image& rImage, const XubString& rText, ToolBoxItemBits nItemBits ) : maImage( rImage ), maText( rText ) @@ -174,15 +171,14 @@ ImplToolItem::ImplToolItem( USHORT nItemId, const Image& rImage, mnId = nItemId; mpWindow = NULL; mpUserData = NULL; - mnHelpId = 0; meType = TOOLBOXITEM_BUTTON; mnBits = nItemBits; meState = STATE_NOCHECK; - mbEnabled = TRUE; - mbVisible = TRUE; - mbEmptyBtn = FALSE; - mbShowWindow = FALSE; - mbBreak = FALSE; + mbEnabled = sal_True; + mbVisible = sal_True; + mbEmptyBtn = sal_False; + mbShowWindow = sal_False; + mbBreak = sal_False; mnSepSize = TB_SEP_SIZE; mnDropDownArrowWidth = TB_DROPDOWNARROWWIDTH; mnImageAngle = 0; @@ -203,7 +199,7 @@ ImplToolItem::ImplToolItem( const ImplToolItem& rItem ) : maQuickHelpText ( rItem.maQuickHelpText ), maHelpText ( rItem.maHelpText ), maCommandStr ( rItem.maCommandStr ), - mnHelpId ( rItem.mnHelpId ), + maHelpId ( rItem.maHelpId ), maRect ( rItem.maRect ), maCalcRect ( rItem.maCalcRect ), maItemSize ( rItem.maItemSize ), @@ -242,7 +238,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem ) maQuickHelpText = rItem.maQuickHelpText; maHelpText = rItem.maHelpText; maCommandStr = rItem.maCommandStr; - mnHelpId = rItem.mnHelpId; + maHelpId = rItem.maHelpId; maRect = rItem.maRect; maCalcRect = rItem.maCalcRect; mnSepSize = rItem.mnSepSize; @@ -263,7 +259,7 @@ ImplToolItem& ImplToolItem::operator=( const ImplToolItem& rItem ) // ----------------------------------------------------------------------- -Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, const Size& rDefaultSize ) +Size ImplToolItem::GetSize( sal_Bool bHorz, sal_Bool bCheckMaxWidth, long maxWidth, const Size& rDefaultSize ) { Size aSize( rDefaultSize ); // the size of 'standard' toolbox items // non-standard items are eg windows or buttons with text @@ -275,13 +271,13 @@ Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, cons if ( mpWindow && bHorz ) { // get size of item window and check if it fits - // no windows in vertical toolbars (the default is mbShowWindow=FALSE) + // no windows in vertical toolbars (the default is mbShowWindow=sal_False) Size aWinSize = mpWindow->GetSizePixel(); if ( !bCheckMaxWidth || (aWinSize.Width() <= maxWidth) ) { aSize.Width() = aWinSize.Width(); aSize.Height() = aWinSize.Height(); - mbShowWindow = TRUE; + mbShowWindow = sal_True; } else { @@ -317,27 +313,27 @@ Size ImplToolItem::GetSize( BOOL bHorz, BOOL bCheckMaxWidth, long maxWidth, cons // ----------------------------------------------------------------------- -void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbImage, BOOL& rbText ) const +void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, sal_Bool& rbImage, sal_Bool& rbText ) const { if ( meType != TOOLBOXITEM_BUTTON ) { // no button -> draw nothing - rbImage = rbText = FALSE; + rbImage = rbText = sal_False; return; } - BOOL bHasImage; - BOOL bHasText; + sal_Bool bHasImage; + sal_Bool bHasText; // check for image and/or text if ( !(maImage) ) - bHasImage = FALSE; + bHasImage = sal_False; else - bHasImage = TRUE; + bHasImage = sal_True; if ( !maText.Len() ) - bHasText = FALSE; + bHasText = sal_False; else - bHasText = TRUE; + bHasText = sal_True; // prefer images if symbolonly buttons are drawn // prefer texts if textonly buttons are dreawn @@ -346,38 +342,38 @@ void ImplToolItem::DetermineButtonDrawStyle( ButtonType eButtonType, BOOL& rbIma { if( bHasImage || !bHasText ) { - rbImage = TRUE; - rbText = FALSE; + rbImage = sal_True; + rbText = sal_False; } else { - rbImage = FALSE; - rbText = TRUE; + rbImage = sal_False; + rbText = sal_True; } } else if ( eButtonType == BUTTON_TEXT ) // drawing text only { if( bHasText || !bHasImage ) { - rbImage = FALSE; - rbText = TRUE; + rbImage = sal_False; + rbText = sal_True; } else { - rbImage = TRUE; - rbText = FALSE; + rbImage = sal_True; + rbText = sal_False; } } else // drawing icons and text both { - rbImage = TRUE; - rbText = TRUE; + rbImage = sal_True; + rbText = sal_True; } } // ----------------------------------------------------------------------- -Rectangle ImplToolItem::GetDropDownRect( BOOL bHorz ) const +Rectangle ImplToolItem::GetDropDownRect( sal_Bool bHorz ) const { Rectangle aRect; if( (mnBits & TIB_DROPDOWN) && !maRect.IsEmpty() ) @@ -395,7 +391,7 @@ Rectangle ImplToolItem::GetDropDownRect( BOOL bHorz ) const // ----------------------------------------------------------------------- -BOOL ImplToolItem::IsClipped() const +sal_Bool ImplToolItem::IsClipped() const { return ( meType == TOOLBOXITEM_BUTTON && mbVisible && maRect.IsEmpty() ); } @@ -414,16 +410,16 @@ const XubString& ToolBox::ImplConvertMenuString( const XubString& rStr ) // ----------------------------------------------------------------------- -void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint ) +void ToolBox::ImplInvalidate( sal_Bool bNewCalc, sal_Bool bFullPaint ) { ImplUpdateInputEnable(); if ( bNewCalc ) - mbCalc = TRUE; + mbCalc = sal_True; if ( bFullPaint ) { - mbFormat = TRUE; + mbFormat = sal_True; // Muss ueberhaupt eine neue Ausgabe erfolgen if ( IsReallyVisible() && IsUpdateMode() ) @@ -437,7 +433,7 @@ void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint ) { if ( !mbFormat ) { - mbFormat = TRUE; + mbFormat = sal_True; // Muss ueberhaupt eine neue Ausgabe erfolgen if ( IsReallyVisible() && IsUpdateMode() ) @@ -451,7 +447,7 @@ void ToolBox::ImplInvalidate( BOOL bNewCalc, BOOL bFullPaint ) // ----------------------------------------------------------------------- -void ToolBox::ImplUpdateItem( USHORT nIndex ) +void ToolBox::ImplUpdateItem( sal_uInt16 nIndex ) { // Muss ueberhaupt eine neue Ausgabe erfolgen if ( IsReallyVisible() && IsUpdateMode() ) @@ -558,10 +554,10 @@ void ToolBox::UserDraw( const UserDrawEvent& ) // ----------------------------------------------------------------------- -void ToolBox::InsertItem( const ResId& rResId, USHORT nPos ) +void ToolBox::InsertItem( const ResId& rResId, sal_uInt16 nPos ) { - ULONG nObjMask; - BOOL bImage = FALSE; // Wurde Image gesetzt + sal_uLong nObjMask; + sal_Bool bImage = sal_False; // Wurde Image gesetzt // Item anlegen ImplToolItem aItem; @@ -570,7 +566,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos ) nObjMask = ReadLongRes(); if ( nObjMask & RSC_TOOLBOXITEM_ID ) - aItem.mnId = sal::static_int_cast<USHORT>(ReadLongRes()); + aItem.mnId = sal::static_int_cast<sal_uInt16>(ReadLongRes()); else aItem.mnId = 1; @@ -581,7 +577,7 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos ) aItem.mnBits = (ToolBoxItemBits)ReadLongRes(); if( nObjMask & RSC_TOOLBOXITEM_HELPID ) - aItem.mnHelpId = ReadLongRes(); + aItem.maHelpId = ReadByteStringRes(); if ( nObjMask & RSC_TOOLBOXITEM_TEXT ) { @@ -596,22 +592,22 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos ) Bitmap aBmp = Bitmap( ResId( (RSHEADER_TYPE*)GetClassRes(), *rResId.GetResMgr() ) ); IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) ); aItem.maImage = Image( aBmp, IMAGE_STDBTN_COLOR ); - bImage = TRUE; + bImage = sal_True; } if ( nObjMask & RSC_TOOLBOXITEM_IMAGE ) { aItem.maImage = Image( ResId( (RSHEADER_TYPE*)GetClassRes(), *rResId.GetResMgr() ) ); IncrementRes( GetObjSizeRes( (RSHEADER_TYPE*)GetClassRes() ) ); - bImage = TRUE; + bImage = sal_True; } if ( nObjMask & RSC_TOOLBOXITEM_DISABLE ) - aItem.mbEnabled = !(BOOL)ReadShortRes(); + aItem.mbEnabled = !(sal_Bool)ReadShortRes(); if ( nObjMask & RSC_TOOLBOXITEM_STATE ) aItem.meState = (TriState)ReadLongRes(); if ( nObjMask & RSC_TOOLBOXITEM_HIDE ) - aItem.mbVisible = !((BOOL)ReadShortRes()); + aItem.mbVisible = !((sal_Bool)ReadShortRes()); if ( nObjMask & RSC_TOOLBOXITEM_COMMAND ) aItem.maCommandStr = ReadStringRes(); @@ -622,15 +618,15 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos ) aItem.maImage = maImageList.GetImage( aItem.mnId ); // Wenn es sich um ein ButtonItem handelt, die ID ueberpruefen - BOOL bNewCalc; + sal_Bool bNewCalc; if ( aItem.meType != TOOLBOXITEM_BUTTON ) { - bNewCalc = FALSE; + bNewCalc = sal_False; aItem.mnId = 0; } else { - bNewCalc = TRUE; + bNewCalc = sal_True; DBG_ASSERT( aItem.mnId, "ToolBox::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( aItem.mnId ) == TOOLBOX_ITEM_NOTFOUND, @@ -645,14 +641,14 @@ void ToolBox::InsertItem( const ResId& rResId, USHORT nPos ) ImplInvalidate( bNewCalc ); // Notify - USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } // ----------------------------------------------------------------------- -void ToolBox::InsertItem( USHORT nItemId, const Image& rImage, - ToolBoxItemBits nBits, USHORT nPos ) +void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, + ToolBoxItemBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, @@ -662,18 +658,18 @@ void ToolBox::InsertItem( USHORT nItemId, const Image& rImage, mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, nBits ) ); mpData->ImplClearLayoutData(); - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); // Notify - USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >(nNewPos ) ); } // ----------------------------------------------------------------------- -void ToolBox::InsertItem( USHORT nItemId, const Image& rImage, +void ToolBox::InsertItem( sal_uInt16 nItemId, const Image& rImage, const XubString& rText, - ToolBoxItemBits nBits, USHORT nPos ) + ToolBoxItemBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, @@ -683,17 +679,17 @@ void ToolBox::InsertItem( USHORT nItemId, const Image& rImage, mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, rImage, ImplConvertMenuString( rText ), nBits ) ); mpData->ImplClearLayoutData(); - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); // Notify - USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } // ----------------------------------------------------------------------- -void ToolBox::InsertItem( USHORT nItemId, const XubString& rText, - ToolBoxItemBits nBits, USHORT nPos ) +void ToolBox::InsertItem( sal_uInt16 nItemId, const XubString& rText, + ToolBoxItemBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ToolBox::InsertItem(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, @@ -703,17 +699,17 @@ void ToolBox::InsertItem( USHORT nItemId, const XubString& rText, mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), ImplToolItem( nItemId, ImplConvertMenuString( rText ), nBits ) ); mpData->ImplClearLayoutData(); - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); // Notify - USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } // ----------------------------------------------------------------------- -void ToolBox::InsertWindow( USHORT nItemId, Window* pWindow, - ToolBoxItemBits nBits, USHORT nPos ) +void ToolBox::InsertWindow( sal_uInt16 nItemId, Window* pWindow, + ToolBoxItemBits nBits, sal_uInt16 nPos ) { DBG_ASSERT( nItemId, "ToolBox::InsertWindow(): ItemId == 0" ); DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, @@ -731,80 +727,80 @@ void ToolBox::InsertWindow( USHORT nItemId, Window* pWindow, if ( pWindow ) pWindow->Hide(); - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); // Notify - USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } // ----------------------------------------------------------------------- -void ToolBox::InsertSpace( USHORT nPos ) +void ToolBox::InsertSpace( sal_uInt16 nPos ) { // Item anlegen und in die Liste einfuegen ImplToolItem aItem; aItem.meType = TOOLBOXITEM_SPACE; - aItem.mbEnabled = FALSE; + aItem.mbEnabled = sal_False; mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem ); mpData->ImplClearLayoutData(); - ImplInvalidate( FALSE ); + ImplInvalidate( sal_False ); // Notify - USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } // ----------------------------------------------------------------------- -void ToolBox::InsertSeparator( USHORT nPos, USHORT nPixSize ) +void ToolBox::InsertSeparator( sal_uInt16 nPos, sal_uInt16 nPixSize ) { // Item anlegen und in die Liste einfuegen ImplToolItem aItem; aItem.meType = TOOLBOXITEM_SEPARATOR; - aItem.mbEnabled = FALSE; + aItem.mbEnabled = sal_False; if ( nPixSize ) aItem.mnSepSize = nPixSize; mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem ); mpData->ImplClearLayoutData(); - ImplInvalidate( FALSE ); + ImplInvalidate( sal_False ); // Notify - USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } // ----------------------------------------------------------------------- -void ToolBox::InsertBreak( USHORT nPos ) +void ToolBox::InsertBreak( sal_uInt16 nPos ) { // Item anlegen und in die Liste einfuegen ImplToolItem aItem; aItem.meType = TOOLBOXITEM_BREAK; - aItem.mbEnabled = FALSE; + aItem.mbEnabled = sal_False; mpData->m_aItems.insert( (nPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nPos : mpData->m_aItems.end(), aItem ); mpData->ImplClearLayoutData(); - ImplInvalidate( FALSE ); + ImplInvalidate( sal_False ); // Notify - USHORT nNewPos = sal::static_int_cast<USHORT>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); + sal_uInt16 nNewPos = sal::static_int_cast<sal_uInt16>(( nPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos ) ); } // ----------------------------------------------------------------------- -void ToolBox::RemoveItem( USHORT nPos ) +void ToolBox::RemoveItem( sal_uInt16 nPos ) { if( nPos < mpData->m_aItems.size() ) { - BOOL bMustCalc; + sal_Bool bMustCalc; if ( mpData->m_aItems[nPos].meType == TOOLBOXITEM_BUTTON ) - bMustCalc = TRUE; + bMustCalc = sal_True; else - bMustCalc = FALSE; + bMustCalc = sal_False; if ( mpData->m_aItems[nPos].mpWindow ) mpData->m_aItems[nPos].mpWindow->Hide(); @@ -830,9 +826,9 @@ void ToolBox::RemoveItem( USHORT nPos ) // ----------------------------------------------------------------------- -void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos ) +void ToolBox::MoveItem( sal_uInt16 nItemId, sal_uInt16 nNewPos ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos == nNewPos ) return; @@ -850,14 +846,14 @@ void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos ) mpData->ImplClearLayoutData(); // ToolBox neu ausgeben - ImplInvalidate( FALSE ); + ImplInvalidate( sal_False ); // Notify if( nPos < nNewPos ) // only send one event, all indices above this item are invalid anyway ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMREMOVED, reinterpret_cast< void* >( nPos ) ); else { - USHORT nNewPos2 = sal::static_int_cast<USHORT>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos); + sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) ); } } @@ -865,13 +861,13 @@ void ToolBox::MoveItem( USHORT nItemId, USHORT nNewPos ) // ----------------------------------------------------------------------- -void ToolBox::CopyItem( const ToolBox& rToolBox, USHORT nItemId, - USHORT nNewPos ) +void ToolBox::CopyItem( const ToolBox& rToolBox, sal_uInt16 nItemId, + sal_uInt16 nNewPos ) { DBG_ASSERT( GetItemPos( nItemId ) == TOOLBOX_ITEM_NOTFOUND, "ToolBox::CopyItem(): ItemId already exists" ); - USHORT nPos = rToolBox.GetItemPos( nItemId ); + sal_uInt16 nPos = rToolBox.GetItemPos( nItemId ); // Existiert Item if ( nPos != TOOLBOX_ITEM_NOTFOUND ) @@ -880,15 +876,15 @@ void ToolBox::CopyItem( const ToolBox& rToolBox, USHORT nItemId, ImplToolItem aNewItem = rToolBox.mpData->m_aItems[nPos]; // Bestimme Daten zuruecksetzen aNewItem.mpWindow = NULL; - aNewItem.mbShowWindow = FALSE; + aNewItem.mbShowWindow = sal_False; mpData->m_aItems.insert( (nNewPos < mpData->m_aItems.size()) ? mpData->m_aItems.begin()+nNewPos : mpData->m_aItems.end(), aNewItem ); mpData->ImplClearLayoutData(); // ToolBox neu ausgeben - ImplInvalidate( FALSE ); + ImplInvalidate( sal_False ); // Notify - USHORT nNewPos2 = sal::static_int_cast<USHORT>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos); + sal_uInt16 nNewPos2 = sal::static_int_cast<sal_uInt16>(( nNewPos == TOOLBOX_APPEND ) ? ( mpData->m_aItems.size() - 1 ) : nNewPos); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMADDED, reinterpret_cast< void* >( nNewPos2 ) ); } } @@ -907,10 +903,10 @@ void ToolBox::CopyItems( const ToolBox& rToolBox ) it != mpData->m_aItems.end(); ++it ) { it->mpWindow = NULL; - it->mbShowWindow = FALSE; + it->mbShowWindow = sal_False; } - ImplInvalidate( TRUE, TRUE ); + ImplInvalidate( sal_True, sal_True ); // Notify ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED ); @@ -927,7 +923,7 @@ void ToolBox::Clear() mnCurItemId = 0; mnHighItemId = 0; - ImplInvalidate( TRUE, TRUE ); + ImplInvalidate( sal_True, sal_True ); // Notify ImplCallEventListeners( VCLEVENT_TOOLBOX_ALLITEMSCHANGED ); @@ -943,7 +939,7 @@ void ToolBox::SetButtonType( ButtonType eNewType ) // Hier besser alles neu ausgeben, da es ansonsten zu Problemen // mit den per CopyBits kopierten Bereichen geben kann - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); } } @@ -954,8 +950,8 @@ void ToolBox::SetToolboxButtonSize( ToolBoxButtonSize eSize ) if( mpData->meButtonSize != eSize ) { mpData->meButtonSize = eSize; - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; } } @@ -970,10 +966,10 @@ const Size& ToolBox::GetDefaultImageSize() const { static Size aSmallButtonSize( TB_SMALLIMAGESIZE, TB_SMALLIMAGESIZE ); - static ULONG s_nSymbolsStyle = STYLE_SYMBOLS_DEFAULT; + static sal_uLong s_nSymbolsStyle = STYLE_SYMBOLS_DEFAULT; static Size aLargeButtonSize( TB_LARGEIMAGESIZE, TB_LARGEIMAGESIZE ); - ULONG nSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle(); + sal_uLong nSymbolsStyle = Application::GetSettings().GetStyleSettings().GetCurrentSymbolsStyle(); if ( s_nSymbolsStyle != nSymbolsStyle ) { s_nSymbolsStyle = nSymbolsStyle; @@ -1008,13 +1004,13 @@ void ToolBox::SetAlign( WindowAlign eNewAlign ) { // Setzen, ob Items horizontal oder vertikal angeordnet werden sollen if ( (eNewAlign == WINDOWALIGN_LEFT) || (eNewAlign == WINDOWALIGN_RIGHT) ) - mbHorz = FALSE; + mbHorz = sal_False; else - mbHorz = TRUE; + mbHorz = sal_True; // Hier alles neu ausgeben, da sich Border auch aendert - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; if ( IsReallyVisible() && IsUpdateMode() ) Invalidate(); } @@ -1023,7 +1019,7 @@ void ToolBox::SetAlign( WindowAlign eNewAlign ) // ----------------------------------------------------------------------- -void ToolBox::SetLineCount( USHORT nNewLines ) +void ToolBox::SetLineCount( sal_uInt16 nNewLines ) { if ( !nNewLines ) nNewLines = 1; @@ -1034,18 +1030,18 @@ void ToolBox::SetLineCount( USHORT nNewLines ) // Hier besser alles neu ausgeben, da es ansonsten zu Problemen // mit den per CopyBits kopierten Bereichen geben kann - ImplInvalidate( FALSE ); + ImplInvalidate( sal_False ); } } // ----------------------------------------------------------------------- -void ToolBox::SetPageScroll( BOOL b ) +void ToolBox::SetPageScroll( sal_Bool b ) { mpData->mbPageScroll = b; } -BOOL ToolBox::GetPageScroll() +sal_Bool ToolBox::GetPageScroll() { return mpData->mbPageScroll; } @@ -1054,45 +1050,45 @@ BOOL ToolBox::GetPageScroll() void ToolBox::SetNextToolBox( const XubString& rStr ) { - BOOL bCalcNew = (!maNextToolBoxStr.Len() != !rStr.Len()); + sal_Bool bCalcNew = (!maNextToolBoxStr.Len() != !rStr.Len()); maNextToolBoxStr = rStr; if ( bCalcNew ) - ImplInvalidate( TRUE, FALSE ); + ImplInvalidate( sal_True, sal_False ); } // ----------------------------------------------------------------------- -USHORT ToolBox::GetItemCount() const +sal_uInt16 ToolBox::GetItemCount() const { - return (USHORT)mpData->m_aItems.size(); + return (sal_uInt16)mpData->m_aItems.size(); } // ----------------------------------------------------------------------- -ToolBoxItemType ToolBox::GetItemType( USHORT nPos ) const +ToolBoxItemType ToolBox::GetItemType( sal_uInt16 nPos ) const { return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].meType : TOOLBOXITEM_DONTKNOW; } // ----------------------------------------------------------------------- -USHORT ToolBox::GetItemPos( USHORT nItemId ) const +sal_uInt16 ToolBox::GetItemPos( sal_uInt16 nItemId ) const { int nCount = mpData->m_aItems.size(); for( int nPos = 0; nPos < nCount; nPos++ ) if( mpData->m_aItems[nPos].mnId == nItemId ) - return (USHORT)nPos; + return (sal_uInt16)nPos; return TOOLBOX_ITEM_NOTFOUND; } // ----------------------------------------------------------------------- -USHORT ToolBox::GetItemPos( const Point& rPos ) const +sal_uInt16 ToolBox::GetItemPos( const Point& rPos ) const { // search the item position on the given point - USHORT nRet = TOOLBOX_ITEM_NOTFOUND; - USHORT nPos = 0; + sal_uInt16 nRet = TOOLBOX_ITEM_NOTFOUND; + sal_uInt16 nPos = 0; std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); while( it != mpData->m_aItems.end() ) { @@ -1112,14 +1108,14 @@ USHORT ToolBox::GetItemPos( const Point& rPos ) const // ----------------------------------------------------------------------- -USHORT ToolBox::GetItemId( USHORT nPos ) const +sal_uInt16 ToolBox::GetItemId( sal_uInt16 nPos ) const { return (nPos < mpData->m_aItems.size()) ? mpData->m_aItems[nPos].mnId : 0; } // ----------------------------------------------------------------------- -USHORT ToolBox::GetItemId( const Point& rPos ) const +sal_uInt16 ToolBox::GetItemId( const Point& rPos ) const { // Item suchen, das geklickt wurde std::vector< ImplToolItem >::const_iterator it = mpData->m_aItems.begin(); @@ -1197,25 +1193,25 @@ Point ToolBox::ImplGetPopupPosition( const Rectangle& rRect, const Size& rSize ) } -Point ToolBox::GetItemPopupPosition( USHORT nItemId, const Size& rSize ) const +Point ToolBox::GetItemPopupPosition( sal_uInt16 nItemId, const Size& rSize ) const { return ImplGetPopupPosition( GetItemRect( nItemId ), rSize ); } // ----------------------------------------------------------------------- -Rectangle ToolBox::GetItemRect( USHORT nItemId ) const +Rectangle ToolBox::GetItemRect( sal_uInt16 nItemId ) const { if ( mbCalc || mbFormat ) ((ToolBox*)this)->ImplFormat(); - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); return GetItemPosRect( nPos ); } // ----------------------------------------------------------------------- -Rectangle ToolBox::GetItemPosRect( USHORT nPos ) const +Rectangle ToolBox::GetItemPosRect( sal_uInt16 nPos ) const { if ( mbCalc || mbFormat ) ((ToolBox*)this)->ImplFormat(); @@ -1227,18 +1223,18 @@ Rectangle ToolBox::GetItemPosRect( USHORT nPos ) const } // ----------------------------------------------------------------------- -Rectangle ToolBox::GetItemDropDownRect( USHORT nItemId ) const +Rectangle ToolBox::GetItemDropDownRect( sal_uInt16 nItemId ) const { if ( mbCalc || mbFormat ) ((ToolBox*)this)->ImplFormat(); - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); return GetItemPosDropDownRect( nPos ); } // ----------------------------------------------------------------------- -Rectangle ToolBox::GetItemPosDropDownRect( USHORT nPos ) const +Rectangle ToolBox::GetItemPosDropDownRect( sal_uInt16 nPos ) const { if ( mbCalc || mbFormat ) ((ToolBox*)this)->ImplFormat(); @@ -1256,24 +1252,24 @@ Rectangle ToolBox::GetMenubuttonRect() const return mpData->maMenubuttonItem.maRect; } -BOOL ToolBox::ImplHasExternalMenubutton() +sal_Bool ToolBox::ImplHasExternalMenubutton() { // check if the borderwindow (i.e. the decoration) provides the menu button - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if( ImplIsFloatingMode() ) { // custom menu is placed in the decoration ImplBorderWindow *pBorderWin = dynamic_cast<ImplBorderWindow*>( GetWindow( WINDOW_BORDER ) ); if( pBorderWin && !pBorderWin->GetMenuRect().IsEmpty() ) - bRet = TRUE; + bRet = sal_True; } return bRet; } // ----------------------------------------------------------------------- -void ToolBox::SetItemBits( USHORT nItemId, ToolBoxItemBits nBits ) +void ToolBox::SetItemBits( sal_uInt16 nItemId, ToolBoxItemBits nBits ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos < mpData->m_aItems.size() ) { @@ -1282,15 +1278,15 @@ void ToolBox::SetItemBits( USHORT nItemId, ToolBoxItemBits nBits ) nBits &= TIB_LEFT | TIB_AUTOSIZE | TIB_DROPDOWN; nOldBits &= TIB_LEFT | TIB_AUTOSIZE | TIB_DROPDOWN; // trigger reformat when the item width has changed (dropdown arrow) - BOOL bFormat = (nBits & TIB_DROPDOWN) != (nOldBits & TIB_DROPDOWN); + sal_Bool bFormat = (nBits & TIB_DROPDOWN) != (nOldBits & TIB_DROPDOWN); if ( nBits != nOldBits ) - ImplInvalidate( TRUE, bFormat ); + ImplInvalidate( sal_True, bFormat ); } } // ----------------------------------------------------------------------- -ToolBoxItemBits ToolBox::GetItemBits( USHORT nItemId ) const +ToolBoxItemBits ToolBox::GetItemBits( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1302,9 +1298,9 @@ ToolBoxItemBits ToolBox::GetItemBits( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ToolBox::SetItemData( USHORT nItemId, void* pNewData ) +void ToolBox::SetItemData( sal_uInt16 nItemId, void* pNewData ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos < mpData->m_aItems.size() ) { @@ -1315,7 +1311,7 @@ void ToolBox::SetItemData( USHORT nItemId, void* pNewData ) // ----------------------------------------------------------------------- -void* ToolBox::GetItemData( USHORT nItemId ) const +void* ToolBox::GetItemData( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1327,9 +1323,9 @@ void* ToolBox::GetItemData( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ToolBox::SetItemImage( USHORT nItemId, const Image& rImage ) +void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) { @@ -1340,7 +1336,7 @@ void ToolBox::SetItemImage( USHORT nItemId, const Image& rImage ) Size aOldSize = pItem->maImage.GetSizePixel(); pItem->maImage = rImage; if ( aOldSize != pItem->maImage.GetSizePixel() ) - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); else ImplUpdateItem( nPos ); } @@ -1355,8 +1351,8 @@ void ToolBox::SetImageList( const ImageList& rImageList ) { maImageList = rImageList; - USHORT nCount = (USHORT)mpData->m_aItems.size(); - for( USHORT i = 0; i < nCount; i++ ) + sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size(); + for( sal_uInt16 i = 0; i < nCount; i++ ) { Image aImage; if ( mpData->m_aItems[i].mnId ) @@ -1378,9 +1374,9 @@ static Image ImplRotImage( const Image& rImage, long nAngle10 ) return Image( aRotBitmapEx ); } -void ToolBox::SetItemImageAngle( USHORT nItemId, long nAngle10 ) +void ToolBox::SetItemImageAngle( sal_uInt16 nItemId, long nAngle10 ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) { @@ -1402,7 +1398,7 @@ void ToolBox::SetItemImageAngle( USHORT nItemId, long nAngle10 ) if ( !mbCalc ) { if ( aOldSize != pItem->maImage.GetSizePixel() ) - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); else ImplUpdateItem( nPos ); } @@ -1421,9 +1417,9 @@ static Image ImplMirrorImage( const Image& rImage ) return Image( aMirrBitmapEx ); } -void ToolBox::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror ) +void ToolBox::SetItemImageMirrorMode( sal_uInt16 nItemId, sal_Bool bMirror ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) { @@ -1449,7 +1445,7 @@ void ToolBox::SetItemImageMirrorMode( USHORT nItemId, BOOL bMirror ) // ----------------------------------------------------------------------- -Image ToolBox::GetItemImage( USHORT nItemId ) const +Image ToolBox::GetItemImage( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1461,7 +1457,7 @@ Image ToolBox::GetItemImage( USHORT nItemId ) const // ----------------------------------------------------------------------- -long ToolBox::GetItemImageAngle( USHORT nItemId ) const +long ToolBox::GetItemImageAngle( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1473,32 +1469,32 @@ long ToolBox::GetItemImageAngle( USHORT nItemId ) const // ----------------------------------------------------------------------- -BOOL ToolBox::GetItemImageMirrorMode( USHORT nItemId ) const +sal_Bool ToolBox::GetItemImageMirrorMode( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem ) return pItem->mbMirrorMode; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void ToolBox::SetItemHighImage( USHORT nItemId, const Image& rImage ) +void ToolBox::SetItemHighImage( sal_uInt16 nItemId, const Image& rImage ) { ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem ) { DBG_ASSERT( (pItem->maImage.GetSizePixel() == rImage.GetSizePixel()) || - ((!rImage) == TRUE), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" ); + ((!rImage) == sal_True), "ToolBox::SetItemHighImage() - ImageSize != HighImageSize" ); pItem->maHighImage = rImage; } } // ----------------------------------------------------------------------- -Image ToolBox::GetItemHighImage( USHORT nItemId ) const +Image ToolBox::GetItemHighImage( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1510,9 +1506,9 @@ Image ToolBox::GetItemHighImage( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ToolBox::SetItemText( USHORT nItemId, const XubString& rText ) +void ToolBox::SetItemText( sal_uInt16 nItemId, const XubString& rText ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) { @@ -1525,7 +1521,7 @@ void ToolBox::SetItemText( USHORT nItemId, const XubString& rText ) pItem->maText = ImplConvertMenuString( rText ); mpData->ImplClearLayoutData(); if ( nOldWidth != GetCtrlTextWidth( pItem->maText ) ) - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); else ImplUpdateItem( nPos ); } @@ -1542,7 +1538,7 @@ void ToolBox::SetItemText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -const XubString& ToolBox::GetItemText( USHORT nItemId ) const +const XubString& ToolBox::GetItemText( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1554,9 +1550,9 @@ const XubString& ToolBox::GetItemText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ToolBox::SetItemWindow( USHORT nItemId, Window* pNewWindow ) +void ToolBox::SetItemWindow( sal_uInt16 nItemId, Window* pNewWindow ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) { @@ -1564,14 +1560,14 @@ void ToolBox::SetItemWindow( USHORT nItemId, Window* pNewWindow ) pItem->mpWindow = pNewWindow; if ( pNewWindow ) pNewWindow->Hide(); - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); ImplCallEventListeners( VCLEVENT_TOOLBOX_ITEMWINDOWCHANGED, reinterpret_cast< void* >( nPos ) ); } } // ----------------------------------------------------------------------- -Window* ToolBox::GetItemWindow( USHORT nItemId ) const +Window* ToolBox::GetItemWindow( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1590,7 +1586,7 @@ void ToolBox::StartSelection() if ( !mbSelection ) { - mbSelection = TRUE; + mbSelection = sal_True; mnCurPos = TOOLBOX_ITEM_NOTFOUND; mnCurItemId = 0; Activate(); @@ -1601,13 +1597,13 @@ void ToolBox::StartSelection() void ToolBox::EndSelection() { - mbCommandDrag = FALSE; + mbCommandDrag = sal_False; if ( mbDrag || mbSelection ) { // Daten zuruecksetzen - mbDrag = FALSE; - mbSelection = FALSE; + mbDrag = sal_False; + mbSelection = sal_False; if ( mnCurPos != TOOLBOX_ITEM_NOTFOUND ) ImplDrawItem( mnCurPos ); EndTracking(); @@ -1624,9 +1620,9 @@ void ToolBox::EndSelection() // ----------------------------------------------------------------------- -void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease ) +void ToolBox::SetItemDown( sal_uInt16 nItemId, sal_Bool bDown, sal_Bool bRelease ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) { @@ -1635,7 +1631,7 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease ) if ( nPos != mnCurPos ) { mnCurPos = nPos; - ImplDrawItem( mnCurPos, TRUE ); + ImplDrawItem( mnCurPos, sal_True ); Flush(); } } @@ -1643,7 +1639,7 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease ) { if ( nPos == mnCurPos ) { - ImplDrawItem( mnCurPos, FALSE ); + ImplDrawItem( mnCurPos, sal_False ); Flush(); mnCurPos = TOOLBOX_ITEM_NOTFOUND; } @@ -1653,8 +1649,8 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease ) { if ( mbDrag || mbSelection ) { - mbDrag = FALSE; - mbSelection = FALSE; + mbDrag = sal_False; + mbSelection = sal_False; EndTracking(); ReleaseMouse(); Deactivate(); @@ -1670,21 +1666,21 @@ void ToolBox::SetItemDown( USHORT nItemId, BOOL bDown, BOOL bRelease ) // ----------------------------------------------------------------------- -BOOL ToolBox::IsItemDown( USHORT nItemId ) const +sal_Bool ToolBox::IsItemDown( sal_uInt16 nItemId ) const { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) return (nPos == mnCurPos); else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void ToolBox::SetItemState( USHORT nItemId, TriState eState ) +void ToolBox::SetItemState( sal_uInt16 nItemId, TriState eState ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) { @@ -1698,8 +1694,8 @@ void ToolBox::SetItemState( USHORT nItemId, TriState eState ) (pItem->mnBits & TIB_RADIOCHECK) ) { ImplToolItem* pGroupItem; - USHORT nGroupPos; - USHORT nItemCount = GetItemCount(); + sal_uInt16 nGroupPos; + sal_uInt16 nItemCount = GetItemCount(); nGroupPos = nPos; while ( nGroupPos ) @@ -1744,7 +1740,7 @@ void ToolBox::SetItemState( USHORT nItemId, TriState eState ) // ----------------------------------------------------------------------- -TriState ToolBox::GetItemState( USHORT nItemId ) const +TriState ToolBox::GetItemState( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1756,15 +1752,15 @@ TriState ToolBox::GetItemState( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ToolBox::EnableItem( USHORT nItemId, BOOL bEnable ) +void ToolBox::EnableItem( sal_uInt16 nItemId, sal_Bool bEnable ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) { ImplToolItem* pItem = &mpData->m_aItems[nPos]; if ( bEnable ) - bEnable = TRUE; + bEnable = sal_True; if ( pItem->mbEnabled != bEnable ) { pItem->mbEnabled = bEnable; @@ -1788,21 +1784,21 @@ void ToolBox::EnableItem( USHORT nItemId, BOOL bEnable ) // ----------------------------------------------------------------------- -BOOL ToolBox::IsItemEnabled( USHORT nItemId ) const +sal_Bool ToolBox::IsItemEnabled( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem ) return pItem->mbEnabled; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -void ToolBox::ShowItem( USHORT nItemId, BOOL bVisible ) +void ToolBox::ShowItem( sal_uInt16 nItemId, sal_Bool bVisible ) { - USHORT nPos = GetItemPos( nItemId ); + sal_uInt16 nPos = GetItemPos( nItemId ); mpData->ImplClearLayoutData(); if ( nPos != TOOLBOX_ITEM_NOTFOUND ) @@ -1811,36 +1807,36 @@ void ToolBox::ShowItem( USHORT nItemId, BOOL bVisible ) if ( pItem->mbVisible != bVisible ) { pItem->mbVisible = bVisible; - ImplInvalidate( FALSE ); + ImplInvalidate( sal_False ); } } } // ----------------------------------------------------------------------- -BOOL ToolBox::IsItemVisible( USHORT nItemId ) const +sal_Bool ToolBox::IsItemVisible( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem ) return pItem->mbVisible; else - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL ToolBox::IsItemReallyVisible( USHORT nItemId ) const +sal_Bool ToolBox::IsItemReallyVisible( sal_uInt16 nItemId ) const { // is the item on the visible area of the toolbox? - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; Rectangle aRect( mnLeftBorder, mnTopBorder, mnDX-mnRightBorder, mnDY-mnBottomBorder ); ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem && pItem->mbVisible && !pItem->maRect.IsEmpty() && aRect.IsOver( pItem->maRect ) ) { - bRet = TRUE; + bRet = sal_True; } return bRet; @@ -1848,7 +1844,7 @@ BOOL ToolBox::IsItemReallyVisible( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ToolBox::SetItemCommand( USHORT nItemId, const XubString& rCommand ) +void ToolBox::SetItemCommand( sal_uInt16 nItemId, const XubString& rCommand ) { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1858,7 +1854,7 @@ void ToolBox::SetItemCommand( USHORT nItemId, const XubString& rCommand ) // ----------------------------------------------------------------------- -const XubString& ToolBox::GetItemCommand( USHORT nItemId ) const +const XubString& ToolBox::GetItemCommand( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1870,7 +1866,7 @@ const XubString& ToolBox::GetItemCommand( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ToolBox::SetQuickHelpText( USHORT nItemId, const XubString& rText ) +void ToolBox::SetQuickHelpText( sal_uInt16 nItemId, const XubString& rText ) { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1880,7 +1876,7 @@ void ToolBox::SetQuickHelpText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -const XubString& ToolBox::GetQuickHelpText( USHORT nItemId ) const +const XubString& ToolBox::GetQuickHelpText( sal_uInt16 nItemId ) const { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1892,7 +1888,7 @@ const XubString& ToolBox::GetQuickHelpText( USHORT nItemId ) const // ----------------------------------------------------------------------- -void ToolBox::SetHelpText( USHORT nItemId, const XubString& rText ) +void ToolBox::SetHelpText( sal_uInt16 nItemId, const XubString& rText ) { ImplToolItem* pItem = ImplGetItem( nItemId ); @@ -1902,31 +1898,38 @@ void ToolBox::SetHelpText( USHORT nItemId, const XubString& rText ) // ----------------------------------------------------------------------- -const XubString& ToolBox::GetHelpText( USHORT nItemId ) const +const XubString& ToolBox::GetHelpText( sal_uInt16 nItemId ) const { return ImplGetHelpText( nItemId ); } // ----------------------------------------------------------------------- -void ToolBox::SetHelpId( USHORT nItemId, ULONG nHelpId ) +void ToolBox::SetHelpId( sal_uInt16 nItemId, const rtl::OString& rHelpId ) { ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem ) - pItem->mnHelpId = nHelpId; + pItem->maHelpId = rHelpId; } // ----------------------------------------------------------------------- -ULONG ToolBox::GetHelpId( USHORT nItemId ) const +rtl::OString ToolBox::GetHelpId( sal_uInt16 nItemId ) const { + rtl::OString aRet; + ImplToolItem* pItem = ImplGetItem( nItemId ); if ( pItem ) - return pItem->mnHelpId; - else - return 0; + { + if ( pItem->maHelpId.getLength() ) + aRet = pItem->maHelpId; + else + aRet = ::rtl::OUStringToOString( pItem->maCommandStr, RTL_TEXTENCODING_UTF8 ); + } + + return aRet; } // ----------------------------------------------------------------------- @@ -1936,12 +1939,12 @@ void ToolBox::SetBorder( long nX, long nY ) mnBorderX = nX; mnBorderY = nY; - ImplInvalidate( TRUE, TRUE ); + ImplInvalidate( sal_True, sal_True ); } // ----------------------------------------------------------------------- -void ToolBox::SetOutStyle( USHORT nNewStyle ) +void ToolBox::SetOutStyle( sal_uInt16 nNewStyle ) { // always force flat looking toolbars since NWF nNewStyle |= TOOLBOX_STYLE_FLAT; @@ -1958,7 +1961,7 @@ void ToolBox::SetOutStyle( USHORT nNewStyle ) mnMaxItemHeight = 1; } - ImplInvalidate( TRUE, TRUE ); + ImplInvalidate( sal_True, sal_True ); } } @@ -1966,7 +1969,7 @@ void ToolBox::SetOutStyle( USHORT nNewStyle ) void ToolBox::RecalcItems() { - ImplInvalidate( TRUE ); + ImplInvalidate( sal_True ); } // ----------------------------------------------------------------------- @@ -1981,11 +1984,11 @@ void ToolBox::ImplUpdateInputEnable() if( it->mbEnabled ) { // at least one useful entry - mpData->mbKeyInputDisabled = FALSE; + mpData->mbKeyInputDisabled = sal_False; return; } } - mpData->mbKeyInputDisabled = TRUE; + mpData->mbKeyInputDisabled = sal_True; } // ----------------------------------------------------------------------- @@ -1994,14 +1997,14 @@ void ToolBox::ImplFillLayoutData() const { mpData->m_pLayoutData = new ToolBoxLayoutData(); - USHORT nCount = (USHORT)mpData->m_aItems.size(); - for( USHORT i = 0; i < nCount; i++ ) + sal_uInt16 nCount = (sal_uInt16)mpData->m_aItems.size(); + for( sal_uInt16 i = 0; i < nCount; i++ ) { ImplToolItem* pItem = &mpData->m_aItems[i]; // Nur malen, wenn Rechteck im PaintRectangle liegt if ( !pItem->maRect.IsEmpty() ) - const_cast<ToolBox*>(this)->ImplDrawItem( i, FALSE, FALSE, TRUE ); + const_cast<ToolBox*>(this)->ImplDrawItem( i, sal_False, sal_False, sal_True ); } } @@ -2016,14 +2019,14 @@ String ToolBox::GetDisplayText() const // ----------------------------------------------------------------------- -Rectangle ToolBox::GetCharacterBounds( USHORT nItemID, long nIndex ) const +Rectangle ToolBox::GetCharacterBounds( sal_uInt16 nItemID, long nIndex ) const { long nItemIndex = -1; if( ! mpData->m_pLayoutData ) ImplFillLayoutData(); if( mpData->m_pLayoutData ) { - for( ULONG i = 0; i < mpData->m_pLayoutData->m_aLineItemIds.size(); i++ ) + for( sal_uLong i = 0; i < mpData->m_pLayoutData->m_aLineItemIds.size(); i++ ) { if( mpData->m_pLayoutData->m_aLineItemIds[i] == nItemID ) { @@ -2037,7 +2040,7 @@ Rectangle ToolBox::GetCharacterBounds( USHORT nItemID, long nIndex ) const // ----------------------------------------------------------------------- -long ToolBox::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const +long ToolBox::GetIndexForPoint( const Point& rPoint, sal_uInt16& rItemID ) const { long nIndex = -1; rItemID = 0; @@ -2046,7 +2049,7 @@ long ToolBox::GetIndexForPoint( const Point& rPoint, USHORT& rItemID ) const if( mpData->m_pLayoutData ) { nIndex = mpData->m_pLayoutData->GetIndexForPoint( rPoint ); - for( ULONG i = 0; i < mpData->m_pLayoutData->m_aLineIndices.size(); i++ ) + for( sal_uLong i = 0; i < mpData->m_pLayoutData->m_aLineIndices.size(); i++ ) { if( mpData->m_pLayoutData->m_aLineIndices[i] <= nIndex && (i == mpData->m_pLayoutData->m_aLineIndices.size()-1 || mpData->m_pLayoutData->m_aLineIndices[i+1] > nIndex) ) @@ -2079,12 +2082,12 @@ Pair ToolBox::GetTextStartEnd( long nText ) const // ----------------------------------------------------------------------- -USHORT ToolBox::GetDisplayItemId( long nText ) const +sal_uInt16 ToolBox::GetDisplayItemId( long nText ) const { - USHORT nItemId = 0; + sal_uInt16 nItemId = 0; if( ! mpData->m_pLayoutData ) ImplFillLayoutData(); - if( mpData->m_pLayoutData && nText >= 0 && (ULONG)nText < mpData->m_pLayoutData->m_aLineItemIds.size() ) + if( mpData->m_pLayoutData && nText >= 0 && (sal_uLong)nText < mpData->m_pLayoutData->m_aLineItemIds.size() ) nItemId = mpData->m_pLayoutData->m_aLineItemIds[nText]; return nItemId; } @@ -2104,7 +2107,7 @@ const Link& ToolBox::GetDropdownClickHdl() const // ----------------------------------------------------------------------- -void ToolBox::SetMenuType( USHORT aType ) +void ToolBox::SetMenuType( sal_uInt16 aType ) { if( aType != mpData->maMenuType ) { @@ -2114,9 +2117,9 @@ void ToolBox::SetMenuType( USHORT aType ) // the menu button may have to be moved into the decoration which changes the layout ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); if( pWrapper ) - pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) ? TRUE : FALSE ); + pWrapper->ShowTitleButton( TITLE_BUTTON_MENU, ( aType & TOOLBOX_MENUTYPE_CUSTOMIZE) ? sal_True : sal_False ); - mbFormat = TRUE; + mbFormat = sal_True; ImplFormat(); ImplSetMinMaxFloatSize( this ); } @@ -2129,12 +2132,12 @@ void ToolBox::SetMenuType( USHORT aType ) } } -USHORT ToolBox::GetMenuType() const +sal_uInt16 ToolBox::GetMenuType() const { return mpData->maMenuType; } -BOOL ToolBox::IsMenuEnabled() const +sal_Bool ToolBox::IsMenuEnabled() const { return mpData->maMenuType != TOOLBOX_MENUTYPE_NONE; } @@ -2156,7 +2159,7 @@ const Link& ToolBox::GetMenuButtonHdl() const // ----------------------------------------------------------------------- -BOOL ToolBox::ImplHasClippedItems() +sal_Bool ToolBox::ImplHasClippedItems() { // are any items currently clipped ? ImplFormat(); @@ -2164,10 +2167,10 @@ BOOL ToolBox::ImplHasClippedItems() while ( it != mpData->m_aItems.end() ) { if( it->IsClipped() ) - return TRUE; + return sal_True; ++it; } - return FALSE; + return sal_False; } void ToolBox::ImplUpdateCustomMenu() @@ -2178,7 +2181,7 @@ void ToolBox::ImplUpdateCustomMenu() PopupMenu *pMenu = GetMenu(); - USHORT i = 0; + sal_uInt16 i = 0; // remove old entries while( i < pMenu->GetItemCount() ) { @@ -2199,7 +2202,7 @@ void ToolBox::ImplUpdateCustomMenu() { if( it->IsClipped() ) { - USHORT id = it->mnId + TOOLBOX_MENUITEM_START; + sal_uInt16 id = it->mnId + TOOLBOX_MENUITEM_START; pMenu->InsertItem( id, it->maText, it->maImage, 0, 0 ); pMenu->EnableItem( id, it->mbEnabled ); pMenu->CheckItem( id, it->meState == STATE_CHECK ); @@ -2212,9 +2215,9 @@ IMPL_LINK( ToolBox, ImplCustomMenuListener, VclMenuEvent*, pEvent ) { if( pEvent->GetMenu() == GetMenu() && pEvent->GetId() == VCLEVENT_MENU_SELECT ) { - USHORT id = GetMenu()->GetItemId( pEvent->GetItemPos() ); + sal_uInt16 id = GetMenu()->GetItemId( pEvent->GetItemPos() ); if( id >= TOOLBOX_MENUITEM_START ) - TriggerItem( id - TOOLBOX_MENUITEM_START, FALSE, FALSE ); + TriggerItem( id - TOOLBOX_MENUITEM_START, sal_False, sal_False ); } return 0; } @@ -2262,7 +2265,7 @@ void ToolBox::ImplExecuteCustomMenu() } } - USHORT uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ), + sal_uInt16 uId = GetMenu()->Execute( pWin, Rectangle( ImplGetPopupPosition( aMenuRect, Size() ), Size() ), POPUPMENU_EXECUTE_DOWN | POPUPMENU_NOMOUSEUPCLOSE ); if ( aDelData.IsDelete() ) @@ -2299,24 +2302,24 @@ void ToolBox::ExecuteCustomMenu() // ----------------------------------------------------------------------- // checks override first, useful during calculation of sizes -BOOL ToolBox::ImplIsFloatingMode() const +sal_Bool ToolBox::ImplIsFloatingMode() const { DBG_ASSERT( !(mpData->mbAssumeDocked && mpData->mbAssumeFloating), "ToolBox::ImplIsFloatingMode(): cannot assume docked and floating" ); if( mpData->mbAssumeDocked ) - return FALSE; + return sal_False; else if( mpData->mbAssumeFloating ) - return TRUE; + return sal_True; else return IsFloatingMode(); } // checks override first, useful during calculation of sizes -BOOL ToolBox::ImplIsInPopupMode() const +sal_Bool ToolBox::ImplIsInPopupMode() const { if( mpData->mbAssumePopupMode ) - return TRUE; + return sal_True; else { ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); @@ -2326,7 +2329,7 @@ BOOL ToolBox::ImplIsInPopupMode() const // ----------------------------------------------------------------------- -void ToolBox::Lock( BOOL bLock ) +void ToolBox::Lock( sal_Bool bLock ) { ImplDockingWindowWrapper *pWrapper = ImplGetDockingManager()->GetDockingWindowWrapper( this ); if( !pWrapper ) @@ -2336,8 +2339,8 @@ void ToolBox::Lock( BOOL bLock ) mpData->mbIsLocked = bLock; if( !ImplIsFloatingMode() ) { - mbCalc = TRUE; - mbFormat = TRUE; + mbCalc = sal_True; + mbFormat = sal_True; SetSizePixel( CalcWindowSizePixel(1) ); Invalidate(); } @@ -2346,7 +2349,7 @@ void ToolBox::Lock( BOOL bLock ) // ----------------------------------------------------------------------- -BOOL ToolBox::AlwaysLocked() +sal_Bool ToolBox::AlwaysLocked() { // read config item to determine toolbox behaviour, used for subtoolbars @@ -2362,35 +2365,35 @@ BOOL ToolBox::AlwaysLocked() if ( aNode.isValid() ) { // feature enabled ? - BOOL bStatesEnabled = BOOL(); + sal_Bool bStatesEnabled = sal_Bool(); ::com::sun::star::uno::Any aValue = aNode.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("StatesEnabled")) ); if( aValue >>= bStatesEnabled ) { - if( bStatesEnabled == TRUE ) + if( bStatesEnabled == sal_True ) { // now read the locking state utl::OConfigurationNode aNode2 = utl::OConfigurationTreeRoot::tryCreateWithServiceFactory( vcl::unohelper::GetMultiServiceFactory(), OUString(RTL_CONSTASCII_USTRINGPARAM("/org.openoffice.Office.UI.GlobalSettings/Toolbars/States")) ); // note: case sensisitive ! - BOOL bLocked = BOOL(); + sal_Bool bLocked = sal_Bool(); ::com::sun::star::uno::Any aValue2 = aNode2.getNodeValue( OUString(RTL_CONSTASCII_USTRINGPARAM("Locked")) ); if( aValue2 >>= bLocked ) - nAlwaysLocked = (bLocked == TRUE) ? 1 : 0; + nAlwaysLocked = (bLocked == sal_True) ? 1 : 0; } } } } - return nAlwaysLocked == 1 ? TRUE : FALSE; + return nAlwaysLocked == 1 ? sal_True : sal_False; } -BOOL ToolBox::WillUsePopupMode() const +sal_Bool ToolBox::WillUsePopupMode() const { return mpData->mbWillUsePopupMode; } -void ToolBox::WillUsePopupMode( BOOL b ) +void ToolBox::WillUsePopupMode( sal_Bool b ) { mpData->mbWillUsePopupMode = b; } diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index b20a82d1dc7b..5a5379da2ffa 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -34,14 +34,12 @@ #include "vcl/salinst.hxx" #include "vcl/salgtype.hxx" #include "vcl/salgdi.hxx" -#include "vcl/salctrlhandle.hxx" #include "vcl/unohelp.hxx" #include "tools/time.hxx" #include "tools/debug.hxx" #include "tools/rc.h" #include "vcl/svdata.hxx" -#include "vcl/windata.hxx" #include "vcl/dbggui.hxx" #include "vcl/outfont.hxx" #include "vcl/outdev.h" @@ -65,6 +63,7 @@ #include "unotools/fontcfg.hxx" #include "vcl/sysdata.hxx" #include "vcl/sallayout.hxx" +#include "vcl/salctype.hxx" #include "vcl/button.hxx" // Button::GetStandardText #include "vcl/taskpanelist.hxx" #include "com/sun/star/awt/XWindowPeer.hpp" @@ -87,7 +86,6 @@ #include "vcl/unowrap.hxx" #include "vcl/dndlcon.hxx" #include "vcl/dndevdis.hxx" -#include "vcl/impbmpconv.hxx" #include "unotools/confignode.hxx" #include "vcl/gdimtf.hxx" #include <sal/macros.h> @@ -114,12 +112,12 @@ DBG_NAME( Window ) // ======================================================================= -#define IMPL_PAINT_PAINT ((USHORT)0x0001) -#define IMPL_PAINT_PAINTALL ((USHORT)0x0002) -#define IMPL_PAINT_PAINTALLCHILDS ((USHORT)0x0004) -#define IMPL_PAINT_PAINTCHILDS ((USHORT)0x0008) -#define IMPL_PAINT_ERASE ((USHORT)0x0010) -#define IMPL_PAINT_CHECKRTL ((USHORT)0x0020) +#define IMPL_PAINT_PAINT ((sal_uInt16)0x0001) +#define IMPL_PAINT_PAINTALL ((sal_uInt16)0x0002) +#define IMPL_PAINT_PAINTALLCHILDS ((sal_uInt16)0x0004) +#define IMPL_PAINT_PAINTCHILDS ((sal_uInt16)0x0008) +#define IMPL_PAINT_ERASE ((sal_uInt16)0x0010) +#define IMPL_PAINT_CHECKRTL ((sal_uInt16)0x0020) // ----------------------------------------------------------------------- @@ -134,25 +132,21 @@ struct ImplCalcToTopData Region* mpInvalidateRegion; }; -struct ImplAccessibleInfos +ImplAccessibleInfos::ImplAccessibleInfos() { - USHORT nAccessibleRole; - String* pAccessibleName; - String* pAccessibleDescription; - - ImplAccessibleInfos() - { - nAccessibleRole = 0xFFFF; - pAccessibleName = NULL; - pAccessibleDescription = NULL; - } + nAccessibleRole = 0xFFFF; + pAccessibleName = NULL; + pAccessibleDescription = NULL; + pLabeledByWindow = NULL; + pLabelForWindow = NULL; + pMemberOfWindow = NULL; +} - ~ImplAccessibleInfos() - { - delete pAccessibleName; - delete pAccessibleDescription; - } -}; +ImplAccessibleInfos::~ImplAccessibleInfos() +{ + delete pAccessibleName; + delete pAccessibleDescription; +} // ----------------------------------------------------------------------- @@ -268,29 +262,53 @@ bool Window::ImplCheckUIFont( const Font& rFont ) if( ImplGetSVData()->maGDIData.mbNativeFontConfig ) return true; + // create a text string using the localized text of important buttons String aTestText; - aTestText.Append( Button::GetStandardText( BUTTON_OK ) ); - aTestText.Append( Button::GetStandardText( BUTTON_CANCEL ) ); - aTestText.Append( Button::GetStandardText( BUTTON_YES ) ); - aTestText.Append( Button::GetStandardText( BUTTON_NO ) ); - aTestText.Append( Button::GetStandardText( BUTTON_RETRY ) ); - aTestText.Append( Button::GetStandardText( BUTTON_HELP ) ); - aTestText.Append( Button::GetStandardText( BUTTON_CLOSE ) ); - aTestText.Append( Button::GetStandardText( BUTTON_MORE ) ); - aTestText.Append( Button::GetStandardText( BUTTON_LESS ) ); - aTestText.Append( Button::GetStandardText( BUTTON_ABORT ) ); + static const StandardButtonType aTestButtons[] = + { + BUTTON_OK, BUTTON_CANCEL, BUTTON_CLOSE, BUTTON_ABORT, + BUTTON_YES, BUTTON_NO, BUTTON_MORE, BUTTON_IGNORE, + BUTTON_RETRY, BUTTON_HELP + }; + + const int nTestButtonCount = sizeof(aTestButtons)/sizeof(*aTestButtons); + for( int n = 0; n < nTestButtonCount; ++n ) + { + String aButtonStr = Button::GetStandardText( aTestButtons[n] ); + // #i115432# ignore mnemonic+accelerator part of each string + // TODO: use a string filtering method when it becomes available + const int nLen = aButtonStr.Len(); + bool bInside = false; + for( int i = 0; i < nLen; ++i ) { + const sal_Unicode c = aButtonStr.GetChar( i ); + if( (c == '(')) + bInside = true; + if( (c == ')')) + bInside = false; + if( (c == '~') + || (c == '(') || (c == ')') + || ((c >= 'A') && (c <= 'Z') && bInside) ) + aButtonStr.SetChar( i, ' ' ); + } + // append sanitized button text to test string + aTestText.Append( aButtonStr ); + } - return HasGlyphs( rFont, aTestText ) >= aTestText.Len(); + const int nFirstChar = HasGlyphs( rFont, aTestText ); + const bool bUIFontOk = (nFirstChar >= aTestText.Len()); + return bUIFontOk; } // ----------------------------------------------------------------------- -void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl ) +void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, sal_Bool bCallHdl ) { StyleSettings aTmpSt( rSettings.GetStyleSettings() ); - aTmpSt.SetHighContrastMode( FALSE ); + aTmpSt.SetHighContrastMode( sal_False ); rSettings.SetStyleSettings( aTmpSt ); ImplGetFrame()->UpdateSettings( rSettings ); + // reset default border width for layouters + ImplGetSVData()->maAppData.mnDefaultLayoutBorder = -1; // Verify availability of the configured UI font, otherwise choose "Andale Sans UI" String aUserInterfaceFont; @@ -490,7 +508,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl ) || rSettings.GetStyleSettings().GetWindowColor().IsDark() ) { aStyleSettings = rSettings.GetStyleSettings(); - aStyleSettings.SetHighContrastMode( TRUE ); + aStyleSettings.SetHighContrastMode( sal_True ); aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST ); rSettings.SetStyleSettings( aStyleSettings ); } @@ -500,7 +518,7 @@ void Window::ImplUpdateGlobalSettings( AllSettings& rSettings, BOOL bCallHdl ) static const char* pEnvHC = getenv( "SAL_FORCE_HC" ); if( pEnvHC && *pEnvHC ) { - aStyleSettings.SetHighContrastMode( TRUE ); + aStyleSettings.SetHighContrastMode( sal_True ); aStyleSettings.SetSymbolsStyle( STYLE_SYMBOLS_HICONTRAST ); rSettings.SetStyleSettings( aStyleSettings ); } @@ -595,6 +613,7 @@ void Window::ImplInitWindowData( WindowType nType ) mpWindowImpl->mpDlgCtrlDownWindow = NULL; // window for dialog control mpWindowImpl->mpFirstDel = NULL; // Dtor notification list mpWindowImpl->mpUserData = NULL; // user data + mpWindowImpl->mpExtImpl = NULL; // extended implementation data mpWindowImpl->mpCursor = NULL; // cursor mpWindowImpl->mpControlFont = NULL; // font propertie mpWindowImpl->mpVCLXWindow = NULL; @@ -608,8 +627,6 @@ void Window::ImplInitWindowData( WindowType nType ) mpWindowImpl->mnX = 0; // X-Position to Parent mpWindowImpl->mnY = 0; // Y-Position to Parent mpWindowImpl->mnAbsScreenX = 0; // absolute X-position on screen, used for RTL window positioning - mpWindowImpl->mnHelpId = 0; // help id - mpWindowImpl->mnUniqId = 0; // unique id mpWindowImpl->mpChildClipRegion = NULL; // Child-Clip-Region when ClipChildren mpWindowImpl->mpPaintRegion = NULL; // Paint-ClipRegion mpWindowImpl->mnStyle = 0; // style (init in ImplInitWindow) @@ -625,83 +642,83 @@ void Window::ImplInitWindowData( WindowType nType ) mpWindowImpl->mnDlgCtrlFlags = 0; // DialogControl-Flags mpWindowImpl->mnLockCount = 0; // LockCount mpWindowImpl->meAlwaysInputMode = AlwaysInputNone; // neither AlwaysEnableInput nor AlwaysDisableInput called - mpWindowImpl->mbFrame = FALSE; // TRUE: Window is a frame window - mpWindowImpl->mbBorderWin = FALSE; // TRUE: Window is a border window - mpWindowImpl->mbOverlapWin = FALSE; // TRUE: Window is a overlap window - mpWindowImpl->mbSysWin = FALSE; // TRUE: SystemWindow is the base class - mpWindowImpl->mbDialog = FALSE; // TRUE: Dialog is the base class - mpWindowImpl->mbDockWin = FALSE; // TRUE: DockingWindow is the base class - mpWindowImpl->mbFloatWin = FALSE; // TRUE: FloatingWindow is the base class - mpWindowImpl->mbPushButton = FALSE; // TRUE: PushButton is the base class - mpWindowImpl->mbToolBox = FALSE; // TRUE: ToolBox is the base class - mpWindowImpl->mbMenuFloatingWindow= FALSE; // TRUE: MenuFloatingWindow is the base class - mpWindowImpl->mbToolbarFloatingWindow= FALSE; // TRUE: ImplPopupFloatWin is the base class, used for subtoolbars - mpWindowImpl->mbSplitter = FALSE; // TRUE: Splitter is the base class - mpWindowImpl->mbVisible = FALSE; // TRUE: Show( true ) called - mpWindowImpl->mbOverlapVisible = FALSE; // TRUE: Hide called for visible window from ImplHideAllOverlapWindow() - mpWindowImpl->mbDisabled = FALSE; // TRUE: Enable( FALSE ) called - mpWindowImpl->mbInputDisabled = FALSE; // TRUE: EnableInput( FALSE ) called - mpWindowImpl->mbDropDisabled = FALSE; // TRUE: Drop is enabled - mpWindowImpl->mbNoUpdate = FALSE; // TRUE: SetUpdateMode( FALSE ) called - mpWindowImpl->mbNoParentUpdate = FALSE; // TRUE: SetParentUpdateMode( FALSE ) called - mpWindowImpl->mbActive = FALSE; // TRUE: Window Active - mpWindowImpl->mbParentActive = FALSE; // TRUE: OverlapActive from Parent - mpWindowImpl->mbReallyVisible = FALSE; // TRUE: this and all parents to an overlaped window are visible - mpWindowImpl->mbReallyShown = FALSE; // TRUE: this and all parents to an overlaped window are shown - mpWindowImpl->mbInInitShow = FALSE; // TRUE: we are in InitShow - mpWindowImpl->mbChildNotify = FALSE; // TRUE: ChildNotify - mpWindowImpl->mbChildPtrOverwrite = FALSE; // TRUE: PointerStyle overwrites Child-Pointer - mpWindowImpl->mbNoPtrVisible = FALSE; // TRUE: ShowPointer( FALSE ) called - mpWindowImpl->mbMouseMove = FALSE; // TRUE: BaseMouseMove called - mpWindowImpl->mbPaintFrame = FALSE; // TRUE: Paint is visible, but not painted - mpWindowImpl->mbInPaint = FALSE; // TRUE: Inside PaintHdl - mpWindowImpl->mbMouseButtonDown = FALSE; // TRUE: BaseMouseButtonDown called - mpWindowImpl->mbMouseButtonUp = FALSE; // TRUE: BaseMouseButtonUp called - mpWindowImpl->mbKeyInput = FALSE; // TRUE: BaseKeyInput called - mpWindowImpl->mbKeyUp = FALSE; // TRUE: BaseKeyUp called - mpWindowImpl->mbCommand = FALSE; // TRUE: BaseCommand called - mpWindowImpl->mbDefPos = TRUE; // TRUE: Position is not Set - mpWindowImpl->mbDefSize = TRUE; // TRUE: Size is not Set - mpWindowImpl->mbCallMove = TRUE; // TRUE: Move must be called by Show - mpWindowImpl->mbCallResize = TRUE; // TRUE: Resize must be called by Show - mpWindowImpl->mbWaitSystemResize = TRUE; // TRUE: Wait for System-Resize - mpWindowImpl->mbInitWinClipRegion = TRUE; // TRUE: Calc Window Clip Region - mpWindowImpl->mbInitChildRegion = FALSE; // TRUE: InitChildClipRegion - mpWindowImpl->mbWinRegion = FALSE; // TRUE: Window Region - mpWindowImpl->mbClipChildren = FALSE; // TRUE: Child-Fenster muessen evt. geclippt werden - mpWindowImpl->mbClipSiblings = FALSE; // TRUE: Nebeneinanderliegende Child-Fenster muessen evt. geclippt werden - mpWindowImpl->mbChildTransparent = FALSE; // TRUE: Child-Fenster duerfen transparent einschalten (inkl. Parent-CLIPCHILDREN) - mpWindowImpl->mbPaintTransparent = FALSE; // TRUE: Paints muessen auf Parent ausgeloest werden - mpWindowImpl->mbMouseTransparent = FALSE; // TRUE: Window is transparent for Mouse - mpWindowImpl->mbDlgCtrlStart = FALSE; // TRUE: Ab hier eigenes Dialog-Control - mpWindowImpl->mbFocusVisible = FALSE; // TRUE: Focus Visible - mpWindowImpl->mbUseNativeFocus = FALSE; - mpWindowImpl->mbNativeFocusVisible= FALSE; // TRUE: native Focus Visible - mpWindowImpl->mbInShowFocus = FALSE; // prevent recursion - mpWindowImpl->mbInHideFocus = FALSE; // prevent recursion - mpWindowImpl->mbTrackVisible = FALSE; // TRUE: Tracking Visible - mpWindowImpl->mbControlForeground = FALSE; // TRUE: Foreground-Property set - mpWindowImpl->mbControlBackground = FALSE; // TRUE: Background-Property set - mpWindowImpl->mbAlwaysOnTop = FALSE; // TRUE: immer vor allen anderen normalen Fenstern sichtbar - mpWindowImpl->mbCompoundControl = FALSE; // TRUE: Zusammengesetztes Control => Listener... - mpWindowImpl->mbCompoundControlHasFocus = FALSE; // TRUE: Zusammengesetztes Control hat irgendwo den Focus - mpWindowImpl->mbPaintDisabled = FALSE; // TRUE: Paint soll nicht ausgefuehrt werden - mpWindowImpl->mbAllResize = FALSE; // TRUE: Auch ResizeEvents mit 0,0 schicken - mpWindowImpl->mbInDtor = FALSE; // TRUE: Wir befinden uns im Window-Dtor - mpWindowImpl->mbExtTextInput = FALSE; // TRUE: ExtTextInput-Mode is active - mpWindowImpl->mbInFocusHdl = FALSE; // TRUE: Innerhalb vom GetFocus-Handler - mpWindowImpl->mbCreatedWithToolkit = FALSE; - mpWindowImpl->mbSuppressAccessibilityEvents = FALSE; // TRUE: do not send any accessibility events - mpWindowImpl->mbDrawSelectionBackground = FALSE; // TRUE: draws transparent window background to indicate (toolbox) selection - mpWindowImpl->mbIsInTaskPaneList = FALSE; // TRUE: window was added to the taskpanelist in the topmost system window + mpWindowImpl->mbFrame = sal_False; // sal_True: Window is a frame window + mpWindowImpl->mbBorderWin = sal_False; // sal_True: Window is a border window + mpWindowImpl->mbOverlapWin = sal_False; // sal_True: Window is a overlap window + mpWindowImpl->mbSysWin = sal_False; // sal_True: SystemWindow is the base class + mpWindowImpl->mbDialog = sal_False; // sal_True: Dialog is the base class + mpWindowImpl->mbDockWin = sal_False; // sal_True: DockingWindow is the base class + mpWindowImpl->mbFloatWin = sal_False; // sal_True: FloatingWindow is the base class + mpWindowImpl->mbPushButton = sal_False; // sal_True: PushButton is the base class + mpWindowImpl->mbToolBox = sal_False; // sal_True: ToolBox is the base class + mpWindowImpl->mbMenuFloatingWindow= sal_False; // sal_True: MenuFloatingWindow is the base class + mpWindowImpl->mbToolbarFloatingWindow= sal_False; // sal_True: ImplPopupFloatWin is the base class, used for subtoolbars + mpWindowImpl->mbSplitter = sal_False; // sal_True: Splitter is the base class + mpWindowImpl->mbVisible = sal_False; // sal_True: Show( sal_True ) called + mpWindowImpl->mbOverlapVisible = sal_False; // sal_True: Hide called for visible window from ImplHideAllOverlapWindow() + mpWindowImpl->mbDisabled = sal_False; // sal_True: Enable( sal_False ) called + mpWindowImpl->mbInputDisabled = sal_False; // sal_True: EnableInput( sal_False ) called + mpWindowImpl->mbDropDisabled = sal_False; // sal_True: Drop is enabled + mpWindowImpl->mbNoUpdate = sal_False; // sal_True: SetUpdateMode( sal_False ) called + mpWindowImpl->mbNoParentUpdate = sal_False; // sal_True: SetParentUpdateMode( sal_False ) called + mpWindowImpl->mbActive = sal_False; // sal_True: Window Active + mpWindowImpl->mbParentActive = sal_False; // sal_True: OverlapActive from Parent + mpWindowImpl->mbReallyVisible = sal_False; // sal_True: this and all parents to an overlaped window are visible + mpWindowImpl->mbReallyShown = sal_False; // sal_True: this and all parents to an overlaped window are shown + mpWindowImpl->mbInInitShow = sal_False; // sal_True: we are in InitShow + mpWindowImpl->mbChildNotify = sal_False; // sal_True: ChildNotify + mpWindowImpl->mbChildPtrOverwrite = sal_False; // sal_True: PointerStyle overwrites Child-Pointer + mpWindowImpl->mbNoPtrVisible = sal_False; // sal_True: ShowPointer( sal_False ) called + mpWindowImpl->mbMouseMove = sal_False; // sal_True: BaseMouseMove called + mpWindowImpl->mbPaintFrame = sal_False; // sal_True: Paint is visible, but not painted + mpWindowImpl->mbInPaint = sal_False; // sal_True: Inside PaintHdl + mpWindowImpl->mbMouseButtonDown = sal_False; // sal_True: BaseMouseButtonDown called + mpWindowImpl->mbMouseButtonUp = sal_False; // sal_True: BaseMouseButtonUp called + mpWindowImpl->mbKeyInput = sal_False; // sal_True: BaseKeyInput called + mpWindowImpl->mbKeyUp = sal_False; // sal_True: BaseKeyUp called + mpWindowImpl->mbCommand = sal_False; // sal_True: BaseCommand called + mpWindowImpl->mbDefPos = sal_True; // sal_True: Position is not Set + mpWindowImpl->mbDefSize = sal_True; // sal_True: Size is not Set + mpWindowImpl->mbCallMove = sal_True; // sal_True: Move must be called by Show + mpWindowImpl->mbCallResize = sal_True; // sal_True: Resize must be called by Show + mpWindowImpl->mbWaitSystemResize = sal_True; // sal_True: Wait for System-Resize + mpWindowImpl->mbInitWinClipRegion = sal_True; // sal_True: Calc Window Clip Region + mpWindowImpl->mbInitChildRegion = sal_False; // sal_True: InitChildClipRegion + mpWindowImpl->mbWinRegion = sal_False; // sal_True: Window Region + mpWindowImpl->mbClipChildren = sal_False; // sal_True: Child-Fenster muessen evt. geclippt werden + mpWindowImpl->mbClipSiblings = sal_False; // sal_True: Nebeneinanderliegende Child-Fenster muessen evt. geclippt werden + mpWindowImpl->mbChildTransparent = sal_False; // sal_True: Child-Fenster duerfen transparent einschalten (inkl. Parent-CLIPCHILDREN) + mpWindowImpl->mbPaintTransparent = sal_False; // sal_True: Paints muessen auf Parent ausgeloest werden + mpWindowImpl->mbMouseTransparent = sal_False; // sal_True: Window is transparent for Mouse + mpWindowImpl->mbDlgCtrlStart = sal_False; // sal_True: Ab hier eigenes Dialog-Control + mpWindowImpl->mbFocusVisible = sal_False; // sal_True: Focus Visible + mpWindowImpl->mbUseNativeFocus = sal_False; + mpWindowImpl->mbNativeFocusVisible= sal_False; // sal_True: native Focus Visible + mpWindowImpl->mbInShowFocus = sal_False; // prevent recursion + mpWindowImpl->mbInHideFocus = sal_False; // prevent recursion + mpWindowImpl->mbTrackVisible = sal_False; // sal_True: Tracking Visible + mpWindowImpl->mbControlForeground = sal_False; // sal_True: Foreground-Property set + mpWindowImpl->mbControlBackground = sal_False; // sal_True: Background-Property set + mpWindowImpl->mbAlwaysOnTop = sal_False; // sal_True: immer vor allen anderen normalen Fenstern sichtbar + mpWindowImpl->mbCompoundControl = sal_False; // sal_True: Zusammengesetztes Control => Listener... + mpWindowImpl->mbCompoundControlHasFocus = sal_False; // sal_True: Zusammengesetztes Control hat irgendwo den Focus + mpWindowImpl->mbPaintDisabled = sal_False; // sal_True: Paint soll nicht ausgefuehrt werden + mpWindowImpl->mbAllResize = sal_False; // sal_True: Auch ResizeEvents mit 0,0 schicken + mpWindowImpl->mbInDtor = sal_False; // sal_True: Wir befinden uns im Window-Dtor + mpWindowImpl->mbExtTextInput = sal_False; // sal_True: ExtTextInput-Mode is active + mpWindowImpl->mbInFocusHdl = sal_False; // sal_True: Innerhalb vom GetFocus-Handler + mpWindowImpl->mbCreatedWithToolkit = sal_False; + mpWindowImpl->mbSuppressAccessibilityEvents = sal_False; // sal_True: do not send any accessibility events + mpWindowImpl->mbDrawSelectionBackground = sal_False; // sal_True: draws transparent window background to indicate (toolbox) selection + mpWindowImpl->mbIsInTaskPaneList = sal_False; // sal_True: window was added to the taskpanelist in the topmost system window mpWindowImpl->mnNativeBackground = 0; // initialize later, depends on type - mpWindowImpl->mbCallHandlersDuringInputDisabled = FALSE; // TRUE: call event handlers even if input is disabled - mpWindowImpl->mbDisableAccessibleLabelForRelation = FALSE; // TRUE: do not set LabelFor relation on accessible objects - mpWindowImpl->mbDisableAccessibleLabeledByRelation = FALSE; // TRUE: do not set LabeledBy relation on accessible objects - mpWindowImpl->mbHelpTextDynamic = FALSE; // TRUE: append help id in HELP_DEBUG case - mpWindowImpl->mbFakeFocusSet = FALSE; // TRUE: pretend as if the window has focus. + mpWindowImpl->mbCallHandlersDuringInputDisabled = sal_False; // sal_True: call event handlers even if input is disabled + mpWindowImpl->mbDisableAccessibleLabelForRelation = sal_False; // sal_True: do not set LabelFor relation on accessible objects + mpWindowImpl->mbDisableAccessibleLabeledByRelation = sal_False; // sal_True: do not set LabeledBy relation on accessible objects + mpWindowImpl->mbHelpTextDynamic = sal_False; // sal_True: append help id in HELP_DEBUG case + mpWindowImpl->mbFakeFocusSet = sal_False; // sal_True: pretend as if the window has focus. - mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // TRUE: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active + mbEnableRTL = Application::GetSettings().GetLayoutRTL(); // sal_True: this outdev will be mirrored if RTL window layout (UI mirroring) is globally active } // ----------------------------------------------------------------------- @@ -728,7 +745,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste if ( !mpWindowImpl->mbFrame && !mpWindowImpl->mbBorderWin && !mpWindowImpl->mpBorderWindow && (nStyle & (WB_BORDER | WB_SYSTEMCHILDWINDOW) ) ) { - USHORT nBorderTypeStyle = 0; + sal_uInt16 nBorderTypeStyle = 0; if( (nStyle & WB_SYSTEMCHILDWINDOW) ) { // handle WB_SYSTEMCHILDWINDOW @@ -746,8 +763,8 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste } else if( !mpWindowImpl->mbFrame && ! pParent ) { - mpWindowImpl->mbOverlapWin = TRUE; - mpWindowImpl->mbFrame = TRUE; + mpWindowImpl->mbOverlapWin = sal_True; + mpWindowImpl->mbFrame = sal_True; } // insert window in list @@ -762,7 +779,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste mpWindowImpl->mpOverlapData->mpSaveBackRgn = NULL; mpWindowImpl->mpOverlapData->mpNextBackWin = NULL; mpWindowImpl->mpOverlapData->mnSaveBackSize = 0; - mpWindowImpl->mpOverlapData->mbSaveBack = FALSE; + mpWindowImpl->mpOverlapData->mbSaveBack = sal_False; mpWindowImpl->mpOverlapData->mnTopLevel = 1; } @@ -773,7 +790,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste if ( mpWindowImpl->mbFrame ) { // create frame - ULONG nFrameStyle = 0; + sal_uLong nFrameStyle = 0; if ( nStyle & WB_MOVEABLE ) nFrameStyle |= SAL_FRAME_STYLE_MOVEABLE; @@ -879,21 +896,21 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste mpWindowImpl->mpFrameData->mnMouseCode = 0; mpWindowImpl->mpFrameData->mnMouseMode = 0; mpWindowImpl->mpFrameData->meMapUnit = MAP_PIXEL; - mpWindowImpl->mpFrameData->mbHasFocus = FALSE; - mpWindowImpl->mpFrameData->mbInMouseMove = FALSE; - mpWindowImpl->mpFrameData->mbMouseIn = FALSE; - mpWindowImpl->mpFrameData->mbStartDragCalled = FALSE; - mpWindowImpl->mpFrameData->mbNeedSysWindow = FALSE; - mpWindowImpl->mpFrameData->mbMinimized = FALSE; - mpWindowImpl->mpFrameData->mbStartFocusState = FALSE; - mpWindowImpl->mpFrameData->mbInSysObjFocusHdl = FALSE; - mpWindowImpl->mpFrameData->mbInSysObjToTopHdl = FALSE; - mpWindowImpl->mpFrameData->mbSysObjFocus = FALSE; + mpWindowImpl->mpFrameData->mbHasFocus = sal_False; + mpWindowImpl->mpFrameData->mbInMouseMove = sal_False; + mpWindowImpl->mpFrameData->mbMouseIn = sal_False; + mpWindowImpl->mpFrameData->mbStartDragCalled = sal_False; + mpWindowImpl->mpFrameData->mbNeedSysWindow = sal_False; + mpWindowImpl->mpFrameData->mbMinimized = sal_False; + mpWindowImpl->mpFrameData->mbStartFocusState = sal_False; + mpWindowImpl->mpFrameData->mbInSysObjFocusHdl = sal_False; + mpWindowImpl->mpFrameData->mbInSysObjToTopHdl = sal_False; + mpWindowImpl->mpFrameData->mbSysObjFocus = sal_False; mpWindowImpl->mpFrameData->maPaintTimer.SetTimeout( 30 ); mpWindowImpl->mpFrameData->maPaintTimer.SetTimeoutHdl( LINK( this, Window, ImplHandlePaintHdl ) ); mpWindowImpl->mpFrameData->maResizeTimer.SetTimeout( 50 ); mpWindowImpl->mpFrameData->maResizeTimer.SetTimeoutHdl( LINK( this, Window, ImplHandleResizeTimerHdl ) ); - mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = FALSE; + mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_False; if ( pRealParent && IsTopWindow() ) { @@ -938,7 +955,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste // side effect: ImplUpdateGlobalSettings does an ImplGetFrame()->UpdateSettings ImplUpdateGlobalSettings( *pSVData->maAppData.mpSettings ); OutputDevice::SetSettings( *pSVData->maAppData.mpSettings ); - pSVData->maAppData.mbSettingsInit = TRUE; + pSVData->maAppData.mbSettingsInit = sal_True; } // If we create a Window with default size, query this @@ -964,7 +981,7 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste } const StyleSettings& rStyleSettings = maSettings.GetStyleSettings(); - USHORT nScreenZoom = rStyleSettings.GetScreenZoom(); + sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom(); mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100; mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100; maFont = rStyleSettings.GetAppFont(); @@ -1025,7 +1042,7 @@ void Window::ImplInsertWindow( Window* pParent ) mpWindowImpl->mpFrameData = pFrameParent->mpWindowImpl->mpFrameData; mpWindowImpl->mpFrame = pFrameParent->mpWindowImpl->mpFrame; mpWindowImpl->mpFrameWindow = pFrameParent; - mpWindowImpl->mbFrame = FALSE; + mpWindowImpl->mbFrame = sal_False; // search overlap window and insert window in list if ( ImplIsOverlapWindow() ) @@ -1064,7 +1081,7 @@ void Window::ImplInsertWindow( Window* pParent ) // ----------------------------------------------------------------------- -void Window::ImplRemoveWindow( BOOL bRemoveFrameData ) +void Window::ImplRemoveWindow( sal_Bool bRemoveFrameData ) { // Fenster aus den Listen austragen if ( !mpWindowImpl->mbFrame ) @@ -1117,7 +1134,7 @@ void Window::ImplRemoveWindow( BOOL bRemoveFrameData ) void Window::ImplCallResize() { - mpWindowImpl->mbCallResize = FALSE; + mpWindowImpl->mbCallResize = sal_False; if( GetBackground().IsGradient() ) Invalidate(); @@ -1127,13 +1144,15 @@ void Window::ImplCallResize() // #88419# Most classes don't call the base class in Resize() and Move(), // => Call ImpleResize/Move instead of Resize/Move directly... ImplCallEventListeners( VCLEVENT_WINDOW_RESIZE ); + + ImplExtResize(); } // ----------------------------------------------------------------------- void Window::ImplCallMove() { - mpWindowImpl->mbCallMove = FALSE; + mpWindowImpl->mbCallMove = sal_False; if( mpWindowImpl->mbFrame ) { @@ -1175,20 +1194,14 @@ void Window::ImplCallMove() // ----------------------------------------------------------------------- -static ULONG ImplAutoHelpID( ResMgr* pResMgr ) +static rtl::OString ImplAutoHelpID( ResMgr* pResMgr ) { - if ( !Application::IsAutoHelpIdEnabled() ) - return 0; + rtl::OString aRet; - ULONG nHID = 0; + if( pResMgr && Application::IsAutoHelpIdEnabled() ) + aRet = pResMgr->GetAutoHelpId(); - DBG_ASSERT( pResMgr, "No res mgr for auto help id" ); - if( ! pResMgr ) - return 0; - - nHID = pResMgr->GetAutoHelpId(); - - return nHID; + return aRet; } // ----------------------------------------------------------------------- @@ -1208,25 +1221,26 @@ WinBits Window::ImplInitRes( const ResId& rResId ) void Window::ImplLoadRes( const ResId& rResId ) { - // newer move this line after IncrementRes - char* pRes = (char*)GetClassRes(); - pRes += 12; - sal_uInt32 nHelpId = (sal_uInt32)GetLongRes( (void*)pRes ); - if ( !nHelpId ) - nHelpId = ImplAutoHelpID( rResId.GetResMgr() ); - SetHelpId( nHelpId ); + sal_uLong nObjMask = ReadLongRes(); - ULONG 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 + rtl::OString aHelpId = ImplAutoHelpID( rResId.GetResMgr() ); // ResourceStyle - ULONG nRSStyle = ReadLongRes(); + sal_uLong nRSStyle = ReadLongRes(); // WinBits ReadLongRes(); - // HelpId - ReadLongRes(); - BOOL bPos = FALSE; - BOOL bSize = FALSE; + if( nObjMask & WINDOW_HELPID ) + aHelpId = ReadByteStringRes(); + + SetHelpId( aHelpId ); + + sal_Bool bPos = sal_False; + sal_Bool bSize = sal_False; Point aPos; Size aSize; @@ -1235,7 +1249,7 @@ void Window::ImplLoadRes( const ResId& rResId ) // Groessenangabe aus der Resource verwenden MapUnit ePosMap = MAP_PIXEL; - bPos = TRUE; + bPos = sal_True; if ( nObjMask & WINDOW_XYMAPMODE ) ePosMap = (MapUnit)ReadLongRes(); @@ -1250,7 +1264,7 @@ void Window::ImplLoadRes( const ResId& rResId ) // Groessenangabe aus der Resource verwenden MapUnit eSizeMap = MAP_PIXEL; - bSize = TRUE; + bSize = sal_True; if ( nObjMask & WINDOW_WHMAPMODE ) eSizeMap = (MapUnit)ReadLongRes(); @@ -1276,14 +1290,14 @@ void Window::ImplLoadRes( const ResId& rResId ) SetSizePixel( aSize ); if ( nRSStyle & RSWND_DISABLED ) - Enable( FALSE ); + Enable( sal_False ); if ( nObjMask & WINDOW_TEXT ) SetText( ReadStringRes() ); if ( nObjMask & WINDOW_HELPTEXT ) { SetHelpText( ReadStringRes() ); - mpWindowImpl->mbHelpTextDynamic = TRUE; + mpWindowImpl->mbHelpTextDynamic = sal_True; } if ( nObjMask & WINDOW_QUICKTEXT ) SetQuickHelpText( ReadStringRes() ); @@ -1293,11 +1307,11 @@ void Window::ImplLoadRes( const ResId& rResId ) SetData( (void*)nRes ); } if ( nObjMask & WINDOW_UNIQUEID ) - SetUniqueId( (ULONG)ReadLongRes() ); + SetUniqueId( ReadByteStringRes() ); if ( nObjMask & WINDOW_BORDER_STYLE ) { - USHORT nBorderStyle = (USHORT)ReadLongRes(); + sal_uInt16 nBorderStyle = (sal_uInt16)ReadLongRes(); SetBorderStyle( nBorderStyle ); } } @@ -1318,11 +1332,9 @@ ImplWinData* Window::ImplGetWinData() const mpWindowImpl->mpWinData->mpFocusRect = NULL; mpWindowImpl->mpWinData->mpTrackRect = NULL; mpWindowImpl->mpWinData->mnTrackFlags = 0; - mpWindowImpl->mpWinData->mnIsTopWindow = (USHORT) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow()) - mpWindowImpl->mpWinData->mbMouseOver = FALSE; - mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? FALSE : TRUE; // TRUE: try to draw this control with native theme API - mpWindowImpl->mpWinData->mpSmartHelpId = NULL; - mpWindowImpl->mpWinData->mpSmartUniqueId = NULL; + mpWindowImpl->mpWinData->mnIsTopWindow = (sal_uInt16) ~0; // not initialized yet, 0/1 will indicate TopWindow (see IsTopWindow()) + mpWindowImpl->mpWinData->mbMouseOver = sal_False; + mpWindowImpl->mpWinData->mbEnableNativeWidget = (pNoNWF && *pNoNWF) ? sal_False : sal_True; // sal_True: try to draw this control with native theme API } return mpWindowImpl->mpWinData; @@ -1333,7 +1345,7 @@ ImplWinData* Window::ImplGetWinData() const SalGraphics* Window::ImplGetFrameGraphics() const { if ( mpWindowImpl->mpFrameWindow->mpGraphics ) - mpWindowImpl->mpFrameWindow->mbInitClipRegion = TRUE; + mpWindowImpl->mpFrameWindow->mbInitClipRegion = sal_True; else mpWindowImpl->mpFrameWindow->ImplGetGraphics(); mpWindowImpl->mpFrameWindow->mpGraphics->ResetClipRegion(); @@ -1363,7 +1375,7 @@ Window* Window::ImplFindWindow( const Point& rFramePos ) if ( !mpWindowImpl->mbVisible ) return NULL; - USHORT nHitTest = ImplHitTest( rFramePos ); + sal_uInt16 nHitTest = ImplHitTest( rFramePos ); if ( nHitTest & WINDOW_HITTEST_INSIDE ) { // und danach gehen wir noch alle Child-Fenster durch @@ -1387,7 +1399,7 @@ Window* Window::ImplFindWindow( const Point& rFramePos ) // ----------------------------------------------------------------------- -USHORT Window::ImplHitTest( const Point& rFramePos ) +sal_uInt16 Window::ImplHitTest( const Point& rFramePos ) { Point aFramePos( rFramePos ); if( ImplIsAntiparallel() ) @@ -1407,7 +1419,7 @@ USHORT Window::ImplHitTest( const Point& rFramePos ) return 0; } - USHORT nHitTest = WINDOW_HITTEST_INSIDE; + sal_uInt16 nHitTest = WINDOW_HITTEST_INSIDE; if ( mpWindowImpl->mbMouseTransparent ) nHitTest |= WINDOW_HITTEST_TRANSPARENT; return nHitTest; @@ -1415,22 +1427,22 @@ USHORT Window::ImplHitTest( const Point& rFramePos ) // ----------------------------------------------------------------------- -BOOL Window::ImplIsRealParentPath( const Window* pWindow ) const +sal_Bool Window::ImplIsRealParentPath( const Window* pWindow ) const { pWindow = pWindow->GetParent(); while ( pWindow ) { if ( pWindow == this ) - return TRUE; + return sal_True; pWindow = pWindow->GetParent(); } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Window::ImplIsChild( const Window* pWindow, BOOL bSystemWindow ) const +sal_Bool Window::ImplIsChild( const Window* pWindow, sal_Bool bSystemWindow ) const { do { @@ -1440,19 +1452,19 @@ BOOL Window::ImplIsChild( const Window* pWindow, BOOL bSystemWindow ) const pWindow = pWindow->ImplGetParent(); if ( pWindow == this ) - return TRUE; + return sal_True; } while ( pWindow ); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Window::ImplIsWindowOrChild( const Window* pWindow, BOOL bSystemWindow ) const +sal_Bool Window::ImplIsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow ) const { if ( this == pWindow ) - return TRUE; + return sal_True; return ImplIsChild( pWindow, bSystemWindow ); } @@ -1482,15 +1494,15 @@ int Window::ImplTestMousePointerSet() { // Wenn Mouse gecaptured ist, dann soll MousePointer umgeschaltet werden if ( IsMouseCaptured() ) - return TRUE; + return sal_True; // Wenn sich Mouse ueber dem Fenster befindet, dann soll MousePointer // umgeschaltet werden Rectangle aClientRect( Point( 0, 0 ), GetOutputSizePixel() ); if ( aClientRect.IsInside( GetPointerPosPixel() ) ) - return TRUE; + return sal_True; - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -1498,7 +1510,7 @@ int Window::ImplTestMousePointerSet() PointerStyle Window::ImplGetMousePointer() const { PointerStyle ePointerStyle; - BOOL bWait = FALSE; + sal_Bool bWait = sal_False; if ( IsEnabled() && IsInputEnabled() && ! IsInModalMode() ) ePointerStyle = GetPointer().GetStyle(); @@ -1518,7 +1530,7 @@ PointerStyle Window::ImplGetMousePointer() const if ( pWindow->mpWindowImpl->mnWaitCount ) { ePointerStyle = POINTER_WAIT; - bWait = TRUE; + bWait = sal_True; } else { @@ -1541,11 +1553,11 @@ PointerStyle Window::ImplGetMousePointer() const void Window::ImplResetReallyVisible() { - BOOL bBecameReallyInvisible = mpWindowImpl->mbReallyVisible; + sal_Bool bBecameReallyInvisible = mpWindowImpl->mbReallyVisible; - mbDevOutput = FALSE; - mpWindowImpl->mbReallyVisible = FALSE; - mpWindowImpl->mbReallyShown = FALSE; + mbDevOutput = sal_False; + mpWindowImpl->mbReallyVisible = sal_False; + mpWindowImpl->mbReallyShown = sal_False; // the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge. // For this, the data member of the event must not be NULL. @@ -1582,11 +1594,11 @@ void Window::ImplSetReallyVisible() if( !mpWindowImpl->mbReallyShown ) ImplCallInitShow(); - BOOL bBecameReallyVisible = !mpWindowImpl->mbReallyVisible; + sal_Bool bBecameReallyVisible = !mpWindowImpl->mbReallyVisible; - mbDevOutput = TRUE; - mpWindowImpl->mbReallyVisible = TRUE; - mpWindowImpl->mbReallyShown = TRUE; + mbDevOutput = sal_True; + mpWindowImpl->mbReallyVisible = sal_True; + mpWindowImpl->mbReallyShown = sal_True; // the SHOW/HIDE events serve as indicators to send child creation/destroy events to the access bridge. // For this, the data member of the event must not be NULL. @@ -1618,10 +1630,10 @@ void Window::ImplSetReallyVisible() void Window::ImplCallInitShow() { - mpWindowImpl->mbReallyShown = TRUE; - mpWindowImpl->mbInInitShow = TRUE; + mpWindowImpl->mbReallyShown = sal_True; + mpWindowImpl->mbInInitShow = sal_True; StateChanged( STATE_CHANGE_INITSHOW ); - mpWindowImpl->mbInInitShow = FALSE; + mpWindowImpl->mbInInitShow = sal_False; Window* pWindow = mpWindowImpl->mpFirstOverlap; while ( pWindow ) @@ -1677,7 +1689,7 @@ void Window::ImplInitResolutionSettings() if ( mpWindowImpl->mbFrame ) { const StyleSettings& rStyleSettings = maSettings.GetStyleSettings(); - USHORT nScreenZoom = rStyleSettings.GetScreenZoom(); + sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom(); mnDPIX = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100; mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100; SetPointFont( rStyleSettings.GetAppFont() ); @@ -1703,7 +1715,7 @@ void Window::ImplInitResolutionSettings() void Window::ImplPointToLogic( Font& rFont ) const { Size aSize = rFont.GetSize(); - USHORT nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom(); + sal_uInt16 nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom(); if ( aSize.Width() ) { @@ -1730,7 +1742,7 @@ void Window::ImplPointToLogic( Font& rFont ) const void Window::ImplLogicToPoint( Font& rFont ) const { Size aSize = rFont.GetSize(); - USHORT nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom(); + sal_uInt16 nScreenFontZoom = maSettings.GetStyleSettings().GetScreenFontZoom(); if ( IsMapModeEnabled() ) aSize = LogicToPixel( aSize ); @@ -1754,9 +1766,9 @@ void Window::ImplLogicToPoint( Font& rFont ) const // ----------------------------------------------------------------------- -BOOL Window::ImplSysObjClip( const Region* pOldRegion ) +sal_Bool Window::ImplSysObjClip( const Region* pOldRegion ) { - BOOL bUpdate = TRUE; + sal_Bool bUpdate = sal_True; if ( mpWindowImpl->mpSysObj ) { @@ -1781,7 +1793,7 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion ) Region aRegion = *pWinChildClipRegion; Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ); Region aWinRectRegion( aWinRect ); - USHORT nClipFlags = mpWindowImpl->mpSysObj->GetClipRegionType(); + sal_uInt16 nClipFlags = mpWindowImpl->mpSysObj->GetClipRegionType(); if ( aRegion == aWinRectRegion ) mpWindowImpl->mpSysObj->ResetClipRegion(); @@ -1800,9 +1812,9 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion ) long nY; long nWidth; long nHeight; - ULONG nRectCount; + sal_uLong nRectCount; ImplRegionInfo aInfo; - BOOL bRegionRect; + sal_Bool bRegionRect; nRectCount = aRegion.GetRectCount(); mpWindowImpl->mpSysObj->BeginSetClipRegion( nRectCount ); @@ -1816,7 +1828,7 @@ BOOL Window::ImplSysObjClip( const Region* pOldRegion ) } } else - bVisibleState = FALSE; + bVisibleState = sal_False; } // Visible-Status updaten @@ -1880,31 +1892,31 @@ void Window::ImplUpdateSysObjClip() // ----------------------------------------------------------------------- -BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller ) +sal_Bool Window::ImplSetClipFlagChilds( sal_Bool bSysObjOnlySmaller ) { - BOOL bUpdate = TRUE; + sal_Bool bUpdate = sal_True; if ( mpWindowImpl->mpSysObj ) { Region* pOldRegion = NULL; if ( bSysObjOnlySmaller && !mpWindowImpl->mbInitWinClipRegion ) pOldRegion = new Region( mpWindowImpl->maWinClipRegion ); - mbInitClipRegion = TRUE; - mpWindowImpl->mbInitWinClipRegion = TRUE; + mbInitClipRegion = sal_True; + mpWindowImpl->mbInitWinClipRegion = sal_True; Window* pWindow = mpWindowImpl->mpFirstChild; while ( pWindow ) { if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) ) - bUpdate = FALSE; + bUpdate = sal_False; pWindow = pWindow->mpWindowImpl->mpNext; } if ( !ImplSysObjClip( pOldRegion ) ) { - mbInitClipRegion = TRUE; - mpWindowImpl->mbInitWinClipRegion = TRUE; - bUpdate = FALSE; + mbInitClipRegion = sal_True; + mpWindowImpl->mbInitWinClipRegion = sal_True; + bUpdate = sal_False; } if ( pOldRegion ) @@ -1912,14 +1924,14 @@ BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller ) } else { - mbInitClipRegion = TRUE; - mpWindowImpl->mbInitWinClipRegion = TRUE; + mbInitClipRegion = sal_True; + mpWindowImpl->mbInitWinClipRegion = sal_True; Window* pWindow = mpWindowImpl->mpFirstChild; while ( pWindow ) { if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) ) - bUpdate = FALSE; + bUpdate = sal_False; pWindow = pWindow->mpWindowImpl->mpNext; } } @@ -1928,15 +1940,15 @@ BOOL Window::ImplSetClipFlagChilds( BOOL bSysObjOnlySmaller ) // ----------------------------------------------------------------------- -BOOL Window::ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller ) +sal_Bool Window::ImplSetClipFlagOverlapWindows( sal_Bool bSysObjOnlySmaller ) { - BOOL bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller ); + sal_Bool bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller ); Window* pWindow = mpWindowImpl->mpFirstOverlap; while ( pWindow ) { if ( !pWindow->ImplSetClipFlagOverlapWindows( bSysObjOnlySmaller ) ) - bUpdate = FALSE; + bUpdate = sal_False; pWindow = pWindow->mpWindowImpl->mpNext; } @@ -1945,18 +1957,18 @@ BOOL Window::ImplSetClipFlagOverlapWindows( BOOL bSysObjOnlySmaller ) // ----------------------------------------------------------------------- -BOOL Window::ImplSetClipFlag( BOOL bSysObjOnlySmaller ) +sal_Bool Window::ImplSetClipFlag( sal_Bool bSysObjOnlySmaller ) { if ( !ImplIsOverlapWindow() ) { - BOOL bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller ); + sal_Bool bUpdate = ImplSetClipFlagChilds( bSysObjOnlySmaller ); Window* pParent = ImplGetParent(); if ( pParent && ((pParent->GetStyle() & WB_CLIPCHILDREN) || (mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP)) ) { - pParent->mbInitClipRegion = TRUE; - pParent->mpWindowImpl->mbInitChildRegion = TRUE; + pParent->mbInitClipRegion = sal_True; + pParent->mpWindowImpl->mbInitChildRegion = sal_True; } // Schwestern muessen ihre ClipRegion auch neu berechnen @@ -1966,7 +1978,7 @@ BOOL Window::ImplSetClipFlag( BOOL bSysObjOnlySmaller ) while ( pWindow ) { if ( !pWindow->ImplSetClipFlagChilds( bSysObjOnlySmaller ) ) - bUpdate = FALSE; + bUpdate = sal_False; pWindow = pWindow->mpWindowImpl->mpNext; } } @@ -2046,7 +2058,7 @@ void Window::ImplExcludeOverlapWindows2( Region& rRegion ) // ----------------------------------------------------------------------- -void Window::ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps ) +void Window::ImplClipBoundaries( Region& rRegion, sal_Bool bThis, sal_Bool bOverlaps ) { if ( bThis ) ImplIntersectWindowClipRegion( rRegion ); @@ -2081,21 +2093,21 @@ void Window::ImplClipBoundaries( Region& rRegion, BOOL bThis, BOOL bOverlaps ) // ----------------------------------------------------------------------- -BOOL Window::ImplClipChilds( Region& rRegion ) +sal_Bool Window::ImplClipChilds( Region& rRegion ) { - BOOL bOtherClip = FALSE; + sal_Bool bOtherClip = sal_False; Window* pWindow = mpWindowImpl->mpFirstChild; while ( pWindow ) { if ( pWindow->mpWindowImpl->mbReallyVisible ) { // ParentClipMode-Flags auswerten - USHORT nClipMode = pWindow->GetParentClipMode(); + sal_uInt16 nClipMode = pWindow->GetParentClipMode(); if ( !(nClipMode & PARENTCLIPMODE_NOCLIP) && ((nClipMode & PARENTCLIPMODE_CLIP) || (GetStyle() & WB_CLIPCHILDREN)) ) pWindow->ImplExcludeWindowRegion( rRegion ); else - bOtherClip = TRUE; + bOtherClip = sal_True; } pWindow = pWindow->mpWindowImpl->mpNext; @@ -2149,13 +2161,13 @@ void Window::ImplInitWinClipRegion() ImplClipSiblings( mpWindowImpl->maWinClipRegion ); // Clip Parent Boundaries - ImplClipBoundaries( mpWindowImpl->maWinClipRegion, FALSE, TRUE ); + ImplClipBoundaries( mpWindowImpl->maWinClipRegion, sal_False, sal_True ); // Clip Children if ( (GetStyle() & WB_CLIPCHILDREN) || mpWindowImpl->mbClipChildren ) - mpWindowImpl->mbInitChildRegion = TRUE; + mpWindowImpl->mbInitChildRegion = sal_True; - mpWindowImpl->mbInitWinClipRegion = FALSE; + mpWindowImpl->mbInitWinClipRegion = sal_False; } // ----------------------------------------------------------------------- @@ -2180,7 +2192,7 @@ void Window::ImplInitWinChildClipRegion() ImplClipChilds( *mpWindowImpl->mpChildClipRegion ); } - mpWindowImpl->mbInitChildRegion = FALSE; + mpWindowImpl->mbInitChildRegion = sal_False; } // ----------------------------------------------------------------------- @@ -2261,7 +2273,7 @@ void Window::ImplCalcOverlapRegionOverlaps( const Region& rInterRegion, Region& // ----------------------------------------------------------------------- void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegion, - BOOL bChilds, BOOL bParent, BOOL bSiblings ) + sal_Bool bChilds, sal_Bool bParent, sal_Bool bSiblings ) { Region aRegion( rSourceRect ); if ( mpWindowImpl->mbWinRegion ) @@ -2333,13 +2345,13 @@ void Window::ImplCalcOverlapRegion( const Rectangle& rSourceRect, Region& rRegio // ----------------------------------------------------------------------- -void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags ) +void Window::ImplCallPaint( const Region* pRegion, sal_uInt16 nPaintFlags ) { // call PrePaint. PrePaint may add to the invalidate region as well as // other parameters used below. PrePaint(); - mpWindowImpl->mbPaintFrame = FALSE; + mpWindowImpl->mbPaintFrame = sal_False; if ( nPaintFlags & IMPL_PAINT_PAINTALLCHILDS ) mpWindowImpl->mnPaintFlags |= IMPL_PAINT_PAINT | IMPL_PAINT_PAINTALLCHILDS | (nPaintFlags & IMPL_PAINT_PAINTALL); @@ -2393,8 +2405,8 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags ) if ( mpWindowImpl->mpCursor ) mpWindowImpl->mpCursor->ImplHide(); - mbInitClipRegion = TRUE; - mpWindowImpl->mbInPaint = TRUE; + mbInitClipRegion = sal_True; + mpWindowImpl->mbInPaint = sal_True; // Paint-Region zuruecksetzen Region aPaintRegion( mpWindowImpl->maInvalidateRegion ); @@ -2434,11 +2446,11 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags ) if ( mpWindowImpl->mbFocusVisible ) ImplInvertFocus( *(mpWindowImpl->mpWinData->mpFocusRect) ); } - mpWindowImpl->mbInPaint = FALSE; - mbInitClipRegion = TRUE; + mpWindowImpl->mbInPaint = sal_False; + mbInitClipRegion = sal_True; mpWindowImpl->mpPaintRegion = NULL; if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplShow( FALSE ); + mpWindowImpl->mpCursor->ImplShow( sal_False ); } } else @@ -2464,7 +2476,7 @@ void Window::ImplCallPaint( const Region* pRegion, USHORT nPaintFlags ) // #98943# draw toolbox selection if( !aSelectionRect.IsEmpty() ) - DrawSelectionBackground( aSelectionRect, 3, FALSE, TRUE, FALSE ); + DrawSelectionBackground( aSelectionRect, 3, sal_False, sal_True, sal_False ); if ( pChildRegion ) delete pChildRegion; @@ -2531,14 +2543,14 @@ IMPL_LINK( Window, ImplHandleResizeTimerHdl, void*, EMPTYARG ) // ----------------------------------------------------------------------- -void Window::ImplInvalidateFrameRegion( const Region* pRegion, USHORT nFlags ) +void Window::ImplInvalidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags ) { // PAINTCHILDS bei allen Parent-Fenster bis zum ersten OverlapWindow // setzen if ( !ImplIsOverlapWindow() ) { Window* pTempWindow = this; - USHORT nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0; + sal_uInt16 nTranspPaint = IsPaintTransparent() ? IMPL_PAINT_PAINT : 0; do { pTempWindow = pTempWindow->ImplGetParent(); @@ -2596,7 +2608,7 @@ void Window::ImplInvalidateOverlapFrameRegion( const Region& rRegion ) { Region aRegion = rRegion; - ImplClipBoundaries( aRegion, TRUE, TRUE ); + ImplClipBoundaries( aRegion, sal_True, sal_True ); if ( !aRegion.IsEmpty() ) ImplInvalidateFrameRegion( &aRegion, INVALIDATE_CHILDREN ); @@ -2626,7 +2638,7 @@ void Window::ImplInvalidateParentFrameRegion( Region& rRegion ) // ----------------------------------------------------------------------- -void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags ) +void Window::ImplInvalidate( const Region* pRegion, sal_uInt16 nFlags ) { // Hintergrund-Sicherung zuruecksetzen @@ -2634,7 +2646,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags ) ImplInvalidateAllOverlapBackgrounds(); // Feststellen, was neu ausgegeben werden muss - BOOL bInvalidateAll = !pRegion; + sal_Bool bInvalidateAll = !pRegion; // Transparent-Invalidate beruecksichtigen Window* pOpaqueWindow = this; @@ -2647,7 +2659,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags ) { pOpaqueWindow = pTempWindow; nFlags |= INVALIDATE_CHILDREN; - bInvalidateAll = FALSE; + bInvalidateAll = sal_False; break; } @@ -2659,7 +2671,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags ) } // Region zusammenbauen - USHORT nOrgFlags = nFlags; + sal_uInt16 nOrgFlags = nFlags; if ( !(nFlags & (INVALIDATE_CHILDREN | INVALIDATE_NOCHILDREN)) ) { if ( GetStyle() & WB_CLIPCHILDREN ) @@ -2668,7 +2680,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags ) nFlags |= INVALIDATE_CHILDREN; } if ( (nFlags & INVALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild ) - bInvalidateAll = FALSE; + bInvalidateAll = sal_False; if ( bInvalidateAll ) ImplInvalidateFrameRegion( NULL, nFlags ); else @@ -2687,7 +2699,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags ) else aRegion.Intersect( *pRegion ); } - ImplClipBoundaries( aRegion, TRUE, TRUE ); + ImplClipBoundaries( aRegion, sal_True, sal_True ); if ( nFlags & INVALIDATE_NOCHILDREN ) { nFlags &= ~INVALIDATE_CHILDREN; @@ -2714,7 +2726,7 @@ void Window::ImplInvalidate( const Region* pRegion, USHORT nFlags ) void Window::ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, - BOOL bChilds ) + sal_Bool bChilds ) { if ( (mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINT | IMPL_PAINT_PAINTALL)) == IMPL_PAINT_PAINT ) { @@ -2729,7 +2741,7 @@ void Window::ImplMoveInvalidateRegion( const Rectangle& rRect, Window* pWindow = mpWindowImpl->mpFirstChild; while ( pWindow ) { - pWindow->ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, TRUE ); + pWindow->ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, sal_True ); pWindow = pWindow->mpWindowImpl->mpNext; } } @@ -2739,7 +2751,7 @@ void Window::ImplMoveInvalidateRegion( const Rectangle& rRect, void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, - BOOL bChilds ) + sal_Bool bChilds ) { // Paint-Region auch verschieben, wenn noch Paints anstehen ImplMoveInvalidateRegion( rRect, nHorzScroll, nVertScroll, bChilds ); @@ -2767,7 +2779,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect, if ( !aPaintAllRegion.IsEmpty() ) { aPaintAllRegion.Move( nHorzScroll, nVertScroll ); - USHORT nPaintFlags = 0; + sal_uInt16 nPaintFlags = 0; if ( bChilds ) mpWindowImpl->mnPaintFlags |= INVALIDATE_CHILDREN; ImplInvalidateFrameRegion( &aPaintAllRegion, nPaintFlags ); @@ -2777,7 +2789,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect, // ----------------------------------------------------------------------- -void Window::ImplValidateFrameRegion( const Region* pRegion, USHORT nFlags ) +void Window::ImplValidateFrameRegion( const Region* pRegion, sal_uInt16 nFlags ) { if ( !pRegion ) mpWindowImpl->maInvalidateRegion.SetEmpty(); @@ -2822,11 +2834,11 @@ void Window::ImplValidateFrameRegion( const Region* pRegion, USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::ImplValidate( const Region* pRegion, USHORT nFlags ) +void Window::ImplValidate( const Region* pRegion, sal_uInt16 nFlags ) { // Region zusammenbauen - BOOL bValidateAll = !pRegion; - USHORT nOrgFlags = nFlags; + sal_Bool bValidateAll = !pRegion; + sal_uInt16 nOrgFlags = nFlags; if ( !(nFlags & (VALIDATE_CHILDREN | VALIDATE_NOCHILDREN)) ) { if ( GetStyle() & WB_CLIPCHILDREN ) @@ -2835,7 +2847,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags ) nFlags |= VALIDATE_CHILDREN; } if ( (nFlags & VALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild ) - bValidateAll = FALSE; + bValidateAll = sal_False; if ( bValidateAll ) ImplValidateFrameRegion( NULL, nFlags ); else @@ -2844,7 +2856,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags ) Region aRegion( aRect ); if ( pRegion ) aRegion.Intersect( *pRegion ); - ImplClipBoundaries( aRegion, TRUE, TRUE ); + ImplClipBoundaries( aRegion, sal_True, sal_True ); if ( nFlags & VALIDATE_NOCHILDREN ) { nFlags &= ~VALIDATE_CHILDREN; @@ -2864,7 +2876,7 @@ void Window::ImplValidate( const Region* pRegion, USHORT nFlags ) // ----------------------------------------------------------------------- void Window::ImplScroll( const Rectangle& rRect, - long nHorzScroll, long nVertScroll, USHORT nFlags ) + long nHorzScroll, long nVertScroll, sal_uInt16 nFlags ) { if ( !IsDeviceOutputNecessary() ) return; @@ -2882,7 +2894,7 @@ void Window::ImplScroll( const Rectangle& rRect, if ( mpWindowImpl->mpCursor ) mpWindowImpl->mpCursor->ImplHide(); - USHORT nOrgFlags = nFlags; + sal_uInt16 nOrgFlags = nFlags; if ( !(nFlags & (SCROLL_CHILDREN | SCROLL_NOCHILDREN)) ) { if ( GetStyle() & WB_CLIPCHILDREN ) @@ -2892,14 +2904,14 @@ void Window::ImplScroll( const Rectangle& rRect, } Region aInvalidateRegion; - BOOL bScrollChilds = (nFlags & SCROLL_CHILDREN) != 0; - BOOL bErase = (nFlags & SCROLL_NOERASE) == 0; + sal_Bool bScrollChilds = (nFlags & SCROLL_CHILDREN) != 0; + sal_Bool bErase = (nFlags & SCROLL_NOERASE) == 0; if ( !mpWindowImpl->mpFirstChild ) - bScrollChilds = FALSE; + bScrollChilds = sal_False; // --- RTL --- check if this window requires special action - BOOL bReMirror = ( ImplIsAntiparallel() ); + sal_Bool bReMirror = ( ImplIsAntiparallel() ); Rectangle aRectMirror( rRect ); if( bReMirror ) @@ -2914,7 +2926,7 @@ void Window::ImplScroll( const Rectangle& rRect, if ( !(nFlags & SCROLL_NOINVALIDATE) ) { - ImplCalcOverlapRegion( aRectMirror, aInvalidateRegion, !bScrollChilds, TRUE, FALSE ); + ImplCalcOverlapRegion( aRectMirror, aInvalidateRegion, !bScrollChilds, sal_True, sal_False ); // --- RTL --- // if the scrolling on the device is performed in the opposite direction @@ -2924,7 +2936,7 @@ void Window::ImplScroll( const Rectangle& rRect, if ( !aInvalidateRegion.IsEmpty() ) { aInvalidateRegion.Move( bReMirror ? -nHorzScroll : nHorzScroll, nVertScroll ); - bErase = TRUE; + bErase = sal_True; } if ( !(nFlags & SCROLL_NOWINDOWINVALIDATE) ) { @@ -2946,7 +2958,7 @@ void Window::ImplScroll( const Rectangle& rRect, aRegion.Exclude( aInvalidateRegion ); - ImplClipBoundaries( aRegion, FALSE, TRUE ); + ImplClipBoundaries( aRegion, sal_False, sal_True ); if ( !bScrollChilds ) { if ( nOrgFlags & SCROLL_NOCHILDREN ) @@ -2997,7 +3009,7 @@ void Window::ImplScroll( const Rectangle& rRect, // so it has to be re-mirrored before calling the Paint-handler mpWindowImpl->mnPaintFlags |= IMPL_PAINT_CHECKRTL; - USHORT nPaintFlags = INVALIDATE_CHILDREN; + sal_uInt16 nPaintFlags = INVALIDATE_CHILDREN; if ( !bErase ) nPaintFlags |= INVALIDATE_NOERASE; if ( !bScrollChilds ) @@ -3027,24 +3039,24 @@ void Window::ImplScroll( const Rectangle& rRect, Update(); if ( mpWindowImpl->mpCursor ) - mpWindowImpl->mpCursor->ImplShow( FALSE ); + mpWindowImpl->mpCursor->ImplShow( sal_False ); } // ----------------------------------------------------------------------- -void Window::ImplUpdateAll( BOOL bOverlapWindows ) +void Window::ImplUpdateAll( sal_Bool bOverlapWindows ) { if ( !mpWindowImpl->mbReallyVisible ) return; - BOOL bFlush = FALSE; + sal_Bool bFlush = sal_False; if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame ) { Point aPoint( 0, 0 ); Region aRegion( Rectangle( aPoint, Size( mnOutWidth, mnOutHeight ) ) ); ImplInvalidateOverlapFrameRegion( aRegion ); if ( mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) ) - bFlush = TRUE; + bFlush = sal_True; } // Ein Update wirkt immer auf das OverlapWindow, damit bei spaeteren @@ -3103,9 +3115,9 @@ void Window::ImplUpdateWindowPtr() // ----------------------------------------------------------------------- -void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame ) +void Window::ImplUpdateOverlapWindowPtr( sal_Bool bNewFrame ) { - BOOL bVisible = IsVisible(); + sal_Bool bVisible = IsVisible(); Show( false ); ImplRemoveWindow( bNewFrame ); Window* pRealParent = mpWindowImpl->mpRealParent; @@ -3132,9 +3144,9 @@ void Window::ImplUpdateOverlapWindowPtr( BOOL bNewFrame ) // ----------------------------------------------------------------------- -BOOL Window::ImplUpdatePos() +sal_Bool Window::ImplUpdatePos() { - BOOL bSysChild = FALSE; + sal_Bool bSysChild = sal_False; if ( ImplIsOverlapWindow() ) { @@ -3153,12 +3165,12 @@ BOOL Window::ImplUpdatePos() while ( pChild ) { if ( pChild->ImplUpdatePos() ) - bSysChild = TRUE; + bSysChild = sal_True; pChild = pChild->mpWindowImpl->mpNext; } if ( mpWindowImpl->mpSysObj ) - bSysChild = TRUE; + bSysChild = sal_True; return bSysChild; } @@ -3180,11 +3192,11 @@ void Window::ImplUpdateSysObjPos() // ----------------------------------------------------------------------- void Window::ImplPosSizeWindow( long nX, long nY, - long nWidth, long nHeight, USHORT nFlags ) + long nWidth, long nHeight, sal_uInt16 nFlags ) { - BOOL bNewPos = FALSE; - BOOL bNewSize = FALSE; - BOOL bCopyBits = FALSE; + sal_Bool bNewPos = sal_False; + sal_Bool bNewSize = sal_False; + sal_Bool bCopyBits = sal_False; long nOldOutOffX = mnOutOffX; long nOldOutOffY = mnOutOffY; long nOldOutWidth = mnOutWidth; @@ -3206,17 +3218,17 @@ void Window::ImplPosSizeWindow( long nX, long nY, if ( mnOutWidth && mnOutHeight && !mpWindowImpl->mbPaintTransparent && !mpWindowImpl->mbInitWinClipRegion && !mpWindowImpl->maWinClipRegion.IsEmpty() && !HasPaintEvent() ) - bCopyBits = TRUE; + bCopyBits = sal_True; } - BOOL bnXRecycled = FALSE; // avoid duplicate mirroring in RTL case + sal_Bool bnXRecycled = sal_False; // avoid duplicate mirroring in RTL case if ( nFlags & WINDOW_POSSIZE_WIDTH ) { if(!( nFlags & WINDOW_POSSIZE_X )) { nX = mpWindowImpl->mnX; nFlags |= WINDOW_POSSIZE_X; - bnXRecycled = TRUE; // we're using a mnX which was already mirrored in RTL case + bnXRecycled = sal_True; // we're using a mnX which was already mirrored in RTL case } if ( nWidth < 0 ) @@ -3224,8 +3236,8 @@ void Window::ImplPosSizeWindow( long nX, long nY, if ( nWidth != mnOutWidth ) { mnOutWidth = nWidth; - bNewSize = TRUE; - bCopyBits = FALSE; + bNewSize = sal_True; + bCopyBits = sal_False; } } if ( nFlags & WINDOW_POSSIZE_HEIGHT ) @@ -3235,8 +3247,8 @@ void Window::ImplPosSizeWindow( long nX, long nY, if ( nHeight != mnOutHeight ) { mnOutHeight = nHeight; - bNewSize = TRUE; - bCopyBits = FALSE; + bNewSize = sal_True; + bCopyBits = sal_False; } } @@ -3286,12 +3298,12 @@ void Window::ImplPosSizeWindow( long nX, long nY, pOverlapRegion = new Region(); ImplCalcOverlapRegion( Rectangle( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ), - *pOverlapRegion, FALSE, TRUE, TRUE ); + *pOverlapRegion, sal_False, sal_True, sal_True ); } mpWindowImpl->mnX = nX; mpWindowImpl->maPos.X() = nOrgX; mpWindowImpl->mnAbsScreenX = aPtDev.X(); // --- RTL --- (store real screen pos) - bNewPos = TRUE; + bNewPos = sal_True; } } if ( nFlags & WINDOW_POSSIZE_Y ) @@ -3304,11 +3316,11 @@ void Window::ImplPosSizeWindow( long nX, long nY, pOverlapRegion = new Region(); ImplCalcOverlapRegion( Rectangle( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) ), - *pOverlapRegion, FALSE, TRUE, TRUE ); + *pOverlapRegion, sal_False, sal_True, sal_True ); } mpWindowImpl->mnY = nY; mpWindowImpl->maPos.Y() = nY; - bNewPos = TRUE; + bNewPos = sal_True; } } @@ -3324,7 +3336,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, */ if ( bNewPos || bNewSize ) { - BOOL bUpdateSysObjPos = FALSE; + sal_Bool bUpdateSysObjPos = sal_False; if ( bNewPos ) bUpdateSysObjPos = ImplUpdatePos(); @@ -3351,7 +3363,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, } else { - mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = TRUE; + mpWindowImpl->mpClientWindow->mpWindowImpl->mbCallMove = sal_True; } } } @@ -3377,12 +3389,12 @@ void Window::ImplPosSizeWindow( long nX, long nY, else { if ( bNewPos ) - mpWindowImpl->mbCallMove = TRUE; + mpWindowImpl->mbCallMove = sal_True; if ( bNewSize ) - mpWindowImpl->mbCallResize = TRUE; + mpWindowImpl->mbCallResize = sal_True; } - BOOL bUpdateSysObjClip = FALSE; + sal_Bool bUpdateSysObjClip = sal_False; if ( IsReallyVisible() ) { if ( bNewPos || bNewSize ) @@ -3393,7 +3405,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, if ( mpWindowImpl->mpFrameData->mpFirstBackWin ) ImplInvalidateAllOverlapBackgrounds(); // Clip-Flag neu setzen - bUpdateSysObjClip = !ImplSetClipFlag( TRUE ); + bUpdateSysObjClip = !ImplSetClipFlag( sal_True ); } // Fensterinhalt invalidieren ? @@ -3401,8 +3413,8 @@ void Window::ImplPosSizeWindow( long nX, long nY, { if ( bNewPos ) { - BOOL bInvalidate = FALSE; - BOOL bParentPaint = TRUE; + sal_Bool bInvalidate = sal_False; + sal_Bool bParentPaint = sal_True; if ( !ImplIsOverlapWindow() ) bParentPaint = mpWindowImpl->mpParent->IsPaintEnabled(); if ( bCopyBits && bParentPaint && !HasPaintEvent() ) @@ -3412,7 +3424,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, Size( mnOutWidth, mnOutHeight ) ) ); if ( mpWindowImpl->mbWinRegion ) aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) ); - ImplClipBoundaries( aRegion, FALSE, TRUE ); + ImplClipBoundaries( aRegion, sal_False, sal_True ); if ( !pOverlapRegion->IsEmpty() ) { pOverlapRegion->Move( mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY ); @@ -3424,7 +3436,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, ImplMoveAllInvalidateRegions( Rectangle( Point( nOldOutOffX, nOldOutOffY ), Size( nOldOutWidth, nOldOutHeight ) ), mnOutOffX-nOldOutOffX, mnOutOffY-nOldOutOffY, - TRUE ); + sal_True ); SalGraphics* pGraphics = ImplGetFrameGraphics(); if ( pGraphics ) { @@ -3437,10 +3449,10 @@ void Window::ImplPosSizeWindow( long nX, long nY, SAL_COPYAREA_WINDOWINVALIDATE, this ); } else - bInvalidate = TRUE; + bInvalidate = sal_True; } else - bInvalidate = TRUE; + bInvalidate = sal_True; if ( !bInvalidate ) { if ( !pOverlapRegion->IsEmpty() ) @@ -3448,10 +3460,10 @@ void Window::ImplPosSizeWindow( long nX, long nY, } } else - bInvalidate = TRUE; + bInvalidate = sal_True; } else - bInvalidate = TRUE; + bInvalidate = sal_True; if ( bInvalidate ) ImplInvalidateFrameRegion( NULL, INVALIDATE_CHILDREN ); } @@ -3463,7 +3475,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, aRegion.Exclude( *pOldRegion ); if ( mpWindowImpl->mbWinRegion ) aRegion.Intersect( ImplPixelToDevicePixel( mpWindowImpl->maWinRegion ) ); - ImplClipBoundaries( aRegion, FALSE, TRUE ); + ImplClipBoundaries( aRegion, sal_False, sal_True ); if ( !aRegion.IsEmpty() ) ImplInvalidateFrameRegion( &aRegion, INVALIDATE_CHILDREN ); } @@ -3476,7 +3488,7 @@ void Window::ImplPosSizeWindow( long nX, long nY, Region aRegion( *pOldRegion ); if ( !mpWindowImpl->mbPaintTransparent ) ImplExcludeWindowRegion( aRegion ); - ImplClipBoundaries( aRegion, FALSE, TRUE ); + ImplClipBoundaries( aRegion, sal_False, sal_True ); if ( !aRegion.IsEmpty() && !mpWindowImpl->mpBorderWindow ) ImplInvalidateParentFrameRegion( aRegion ); } @@ -3567,7 +3579,7 @@ void Window::ImplCalcChildOverlapToTop( ImplCalcToTopData* pPrevData ) // ----------------------------------------------------------------------- -void Window::ImplToTop( USHORT nFlags ) +void Window::ImplToTop( sal_uInt16 nFlags ) { DBG_ASSERT( ImplIsOverlapWindow(), "Window::ImplToTop(): Is not a OverlapWindow" ); @@ -3584,7 +3596,7 @@ void Window::ImplToTop( USHORT nFlags ) // do not bring floating windows on the client to top if( !ImplGetClientWindow() || !(ImplGetClientWindow()->GetStyle() & WB_SYSTEMFLOATWIN) ) { - USHORT nSysFlags = 0; + sal_uInt16 nSysFlags = 0; if ( nFlags & TOTOP_RESTOREWHENMIN ) nSysFlags |= SAL_FRAME_TOTOP_RESTOREWHENMIN; if ( nFlags & TOTOP_FOREGROUNDTASK ) @@ -3607,7 +3619,7 @@ void Window::ImplToTop( USHORT nFlags ) mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpLastOverlap = mpWindowImpl->mpPrev; // AlwaysOnTop beruecksichtigen - BOOL bOnTop = IsAlwaysOnTopEnabled(); + sal_Bool bOnTop = IsAlwaysOnTopEnabled(); Window* pNextWin = mpWindowImpl->mpOverlapWindow->mpWindowImpl->mpFirstOverlap; if ( !bOnTop ) { @@ -3620,7 +3632,7 @@ void Window::ImplToTop( USHORT nFlags ) } // TopLevel abpruefen - BYTE nTopLevel = mpWindowImpl->mpOverlapData->mnTopLevel; + sal_uInt8 nTopLevel = mpWindowImpl->mpOverlapData->mnTopLevel; while ( pNextWin ) { if ( (bOnTop != pNextWin->IsAlwaysOnTopEnabled()) || @@ -3661,7 +3673,7 @@ void Window::ImplToTop( USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::ImplStartToTop( USHORT nFlags ) +void Window::ImplStartToTop( sal_uInt16 nFlags ) { ImplCalcToTopData aStartData; ImplCalcToTopData* pCurData; @@ -3716,7 +3728,7 @@ void Window::ImplStartToTop( USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible ) +void Window::ImplFocusToTop( sal_uInt16 nFlags, sal_Bool bReallyVisible ) { // Soll Focus auch geholt werden? if ( !(nFlags & TOTOP_NOGRABFOCUS) ) @@ -3735,7 +3747,7 @@ void Window::ImplFocusToTop( USHORT nFlags, BOOL bReallyVisible ) pFocusWindow = pFocusWindow->ImplGetParent(); } if ( (pFocusWindow->mpWindowImpl->mnActivateMode & ACTIVATE_MODE_GRABFOCUS) && - !pFocusWindow->HasChildPathFocus( TRUE ) ) + !pFocusWindow->HasChildPathFocus( sal_True ) ) pFocusWindow->GrabFocus(); } @@ -3753,7 +3765,7 @@ void Window::ImplShowAllOverlaps() if ( pOverlapWindow->mpWindowImpl->mbOverlapVisible ) { pOverlapWindow->Show( true, SHOW_NOACTIVATE ); - pOverlapWindow->mpWindowImpl->mbOverlapVisible = FALSE; + pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_False; } pOverlapWindow = pOverlapWindow->mpWindowImpl->mpNext; @@ -3769,7 +3781,7 @@ void Window::ImplHideAllOverlaps() { if ( pOverlapWindow->IsVisible() ) { - pOverlapWindow->mpWindowImpl->mbOverlapVisible = TRUE; + pOverlapWindow->mpWindowImpl->mbOverlapVisible = sal_True; pOverlapWindow->Show( false ); } @@ -3779,24 +3791,24 @@ void Window::ImplHideAllOverlaps() // ----------------------------------------------------------------------- -void Window::ImplCallMouseMove( USHORT nMouseCode, BOOL bModChanged ) +void Window::ImplCallMouseMove( sal_uInt16 nMouseCode, sal_Bool bModChanged ) { if ( mpWindowImpl->mpFrameData->mbMouseIn && mpWindowImpl->mpFrameWindow->mpWindowImpl->mbReallyVisible ) { - ULONG nTime = Time::GetSystemTicks(); + sal_uLong nTime = Time::GetSystemTicks(); long nX = mpWindowImpl->mpFrameData->mnLastMouseX; long nY = mpWindowImpl->mpFrameData->mnLastMouseY; - USHORT nCode = nMouseCode; - USHORT nMode = mpWindowImpl->mpFrameData->mnMouseMode; - BOOL bLeave; + sal_uInt16 nCode = nMouseCode; + sal_uInt16 nMode = mpWindowImpl->mpFrameData->mnMouseMode; + sal_Bool bLeave; // Auf MouseLeave testen if ( ((nX < 0) || (nY < 0) || (nX >= mpWindowImpl->mpFrameWindow->mnOutWidth) || (nY >= mpWindowImpl->mpFrameWindow->mnOutHeight)) && !ImplGetSVData()->maWinData.mpCaptureWin ) - bLeave = TRUE; + bLeave = sal_True; else - bLeave = FALSE; + bLeave = sal_False; nMode |= MOUSE_SYNTHETIC; if ( bModChanged ) nMode |= MOUSE_MODIFIERCHANGED; @@ -3843,8 +3855,8 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow, Window* pNewRealWindow; Window* pOldRealWindow; Window* pLastRealWindow; - BOOL bCallActivate = TRUE; - BOOL bCallDeactivate = TRUE; + sal_Bool bCallActivate = sal_True; + sal_Bool bCallDeactivate = sal_True; pOldRealWindow = pOldOverlapWindow->ImplGetWindow(); pNewRealWindow = pNewOverlapWindow->ImplGetWindow(); @@ -3855,7 +3867,7 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow, !pNewRealWindow->GetActivateMode() ) { pSVData->maWinData.mpLastDeacWin = pOldOverlapWindow; - bCallDeactivate = FALSE; + bCallDeactivate = sal_False; } } else if ( (pNewRealWindow->GetType() != WINDOW_FLOATINGWINDOW) || @@ -3864,15 +3876,15 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow, if ( pSVData->maWinData.mpLastDeacWin ) { if ( pSVData->maWinData.mpLastDeacWin == pNewOverlapWindow ) - bCallActivate = FALSE; + bCallActivate = sal_False; else { pLastRealWindow = pSVData->maWinData.mpLastDeacWin->ImplGetWindow(); - pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = FALSE; + pSVData->maWinData.mpLastDeacWin->mpWindowImpl->mbActive = sal_False; pSVData->maWinData.mpLastDeacWin->Deactivate(); if ( pLastRealWindow != pSVData->maWinData.mpLastDeacWin ) { - pLastRealWindow->mpWindowImpl->mbActive = TRUE; + pLastRealWindow->mpWindowImpl->mbActive = sal_True; pLastRealWindow->Activate(); } } @@ -3884,14 +3896,14 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow, { if( pOldOverlapWindow->mpWindowImpl->mbActive ) { - pOldOverlapWindow->mpWindowImpl->mbActive = FALSE; + pOldOverlapWindow->mpWindowImpl->mbActive = sal_False; pOldOverlapWindow->Deactivate(); } if ( pOldRealWindow != pOldOverlapWindow ) { if( pOldRealWindow->mpWindowImpl->mbActive ) { - pOldRealWindow->mpWindowImpl->mbActive = FALSE; + pOldRealWindow->mpWindowImpl->mbActive = sal_False; pOldRealWindow->Deactivate(); } } @@ -3900,14 +3912,14 @@ void Window::ImplCallFocusChangeActivate( Window* pNewOverlapWindow, { if( ! pNewOverlapWindow->mpWindowImpl->mbActive ) { - pNewOverlapWindow->mpWindowImpl->mbActive = TRUE; + pNewOverlapWindow->mpWindowImpl->mbActive = sal_True; pNewOverlapWindow->Activate(); } if ( pNewRealWindow != pNewOverlapWindow ) { if( ! pNewRealWindow->mpWindowImpl->mbActive ) { - pNewRealWindow->mpWindowImpl->mbActive = TRUE; + pNewRealWindow->mpWindowImpl->mbActive = sal_True; pNewRealWindow->Activate(); } } @@ -3929,7 +3941,7 @@ static bool IsWindowFocused(const WindowImpl& rWinImpl) } // ----------------------------------------------------------------------- -void Window::ImplGrabFocus( USHORT nFlags ) +void Window::ImplGrabFocus( sal_uInt16 nFlags ) { // #143570# no focus for destructing windows if( mpWindowImpl->mbInDtor ) @@ -3987,13 +3999,13 @@ void Window::ImplGrabFocus( USHORT nFlags ) // which is done using ToTop ImplSVData* pSVData = ImplGetSVData(); - BOOL bAsyncFocusWaiting = FALSE; + sal_Bool bAsyncFocusWaiting = sal_False; Window *pFrame = pSVData->maWinData.mpFirstFrame; while( pFrame ) { if( pFrame != mpWindowImpl->mpFrameWindow && pFrame->mpWindowImpl->mpFrameData->mnFocusId ) { - bAsyncFocusWaiting = TRUE; + bAsyncFocusWaiting = sal_True; break; } pFrame = pFrame->mpWindowImpl->mpFrameData->mpNextFrame; @@ -4001,7 +4013,7 @@ void Window::ImplGrabFocus( USHORT nFlags ) bool bHasFocus = IsWindowFocused(*mpWindowImpl); - BOOL bMustNotGrabFocus = FALSE; + sal_Bool bMustNotGrabFocus = sal_False; // #100242#, check parent hierarchy if some floater prohibits grab focus Window *pParent = this; @@ -4011,7 +4023,7 @@ void Window::ImplGrabFocus( USHORT nFlags ) // otherwise we cannot set the focus in a floating toolbox if( ( (pParent->mpWindowImpl->mbFloatWin && ((FloatingWindow*)pParent)->GrabsFocus()) || ( pParent->GetStyle() & WB_SYSTEMFLOATWIN ) ) && !( pParent->GetStyle() & WB_MOVEABLE ) ) { - bMustNotGrabFocus = TRUE; + bMustNotGrabFocus = sal_True; break; } pParent = pParent->mpWindowImpl->mpParent; @@ -4072,11 +4084,11 @@ void Window::ImplGrabFocus( USHORT nFlags ) { Window* pNewOverlapWindow = ImplGetFirstOverlapWindow(); Window* pNewRealWindow = pNewOverlapWindow->ImplGetWindow(); - pNewOverlapWindow->mpWindowImpl->mbActive = TRUE; + pNewOverlapWindow->mpWindowImpl->mbActive = sal_True; pNewOverlapWindow->Activate(); if ( pNewRealWindow != pNewOverlapWindow ) { - pNewRealWindow->mpWindowImpl->mbActive = TRUE; + pNewRealWindow->mpWindowImpl->mbActive = sal_True; pNewRealWindow->Activate(); } } @@ -4106,7 +4118,7 @@ void Window::ImplGrabFocus( USHORT nFlags ) { if ( mpWindowImpl->mpCursor ) mpWindowImpl->mpCursor->ImplShow(); - mpWindowImpl->mbInFocusHdl = TRUE; + mpWindowImpl->mbInFocusHdl = sal_True; mpWindowImpl->mnGetFocusFlags = nFlags; // if we're changing focus due to closing a popup floating window // notify the new focus window so it can restore the inner focus @@ -4123,7 +4135,7 @@ void Window::ImplGrabFocus( USHORT nFlags ) if( !aDogTag.IsDelete() ) { mpWindowImpl->mnGetFocusFlags = 0; - mpWindowImpl->mbInFocusHdl = FALSE; + mpWindowImpl->mbInFocusHdl = sal_False; } } } @@ -4243,6 +4255,8 @@ namespace Window::~Window() { + ImplFreeExtWindowImpl(); + vcl::LazyDeletor<Window>::Undelete( this ); DBG_DTOR( Window, ImplDbgCheckWindow ); @@ -4254,7 +4268,7 @@ Window::~Window() // Dispose of the canvas implementation (which, currently, has an // own wrapper window as a child to this one. - Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas ); + uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas ); if( xCanvas.is() ) { uno::Reference < lang::XComponent > xCanvasComponent( xCanvas, @@ -4263,7 +4277,7 @@ Window::~Window() xCanvasComponent->dispose(); } - mpWindowImpl->mbInDtor = TRUE; + mpWindowImpl->mbInDtor = sal_True; ImplCallEventListeners( VCLEVENT_OBJECT_DYING ); @@ -4299,12 +4313,12 @@ Window::~Window() // deregister drop target listener if( mpWindowImpl->mpFrameData->mxDropTargetListener.is() ) { - Reference< XDragGestureRecognizer > xDragGestureRecognizer = - Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY); + uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer = + uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY); if( xDragGestureRecognizer.is() ) { xDragGestureRecognizer->removeDragGestureListener( - Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY)); + uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY)); } mpWindowImpl->mpFrameData->mxDropTarget->removeDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener ); @@ -4312,7 +4326,7 @@ Window::~Window() } // shutdown drag and drop for this frame window - Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY ); + uno::Reference< XComponent > xComponent( mpWindowImpl->mpFrameData->mxDropTarget, UNO_QUERY ); // DNDEventDispatcher does not hold a reference of the DropTarget, // so it's ok if it does not support XComponent @@ -4326,7 +4340,7 @@ Window::~Window() } } - UnoWrapperBase* pWrapper = Application::GetUnoWrapper( FALSE ); + UnoWrapperBase* pWrapper = Application::GetUnoWrapper( sal_False ); if ( pWrapper ) pWrapper->WindowDestroyed( this ); @@ -4362,16 +4376,16 @@ Window::~Window() pSVData->maWinData.mpDefDialogParent = NULL; #ifdef DBG_UTIL - if ( TRUE ) // always perform these tests in non-pro versions + if ( sal_True ) // always perform these tests in non-pro versions { ByteString aErrorStr; - BOOL bError = FALSE; + sal_Bool bError = sal_False; Window* pTempWin = mpWindowImpl->mpFrameData->mpFirstOverlap; while ( pTempWin ) { if ( ImplIsRealParentPath( pTempWin ) ) { - bError = TRUE; + bError = sal_True; lcl_appendWindowInfo( aErrorStr, *pTempWin ); } pTempWin = pTempWin->mpWindowImpl->mpNextOverlap; @@ -4386,13 +4400,13 @@ Window::~Window() GetpApp()->Abort( String( aTempStr, RTL_TEXTENCODING_UTF8 ) ); // abort in non-pro version, this must be fixed! } - bError = FALSE; + bError = sal_False; pTempWin = pSVData->maWinData.mpFirstFrame; while ( pTempWin ) { if ( ImplIsRealParentPath( pTempWin ) ) { - bError = TRUE; + bError = sal_True; lcl_appendWindowInfo( aErrorStr, *pTempWin ); } pTempWin = pTempWin->mpWindowImpl->mpFrameData->mpNextFrame; @@ -4499,11 +4513,11 @@ Window::~Window() } // check if the focus window is our child - BOOL bHasFocussedChild = FALSE; + sal_Bool bHasFocussedChild = sal_False; if( pSVData->maWinData.mpFocusWin && ImplIsRealParentPath( pSVData->maWinData.mpFocusWin ) ) { // #122232#, this must not happen and is an application bug ! but we try some cleanup to hopefully avoid crashes, see below - bHasFocussedChild = TRUE; + bHasFocussedChild = sal_True; #ifdef DBG_UTIL ByteString aTempStr( "Window (" ); aTempStr += ByteString( GetText(), RTL_TEXTENCODING_UTF8 ); @@ -4589,18 +4603,18 @@ Window::~Window() ImplDelData* pDelData = mpWindowImpl->mpFirstDel; while ( pDelData ) { - pDelData->mbDel = TRUE; + pDelData->mbDel = sal_True; pDelData->mpWindow = NULL; // #112873# pDel is not associated with a Window anymore pDelData = pDelData->mpNext; } // Fenster aus den Listen austragen - ImplRemoveWindow( TRUE ); + ImplRemoveWindow( sal_True ); // de-register as "top window child" at our parent, if necessary if ( mpWindowImpl->mbFrame ) { - BOOL bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 ); + sal_Bool bIsTopWindow = mpWindowImpl->mpWinData && ( mpWindowImpl->mpWinData->mnIsTopWindow == 1 ); if ( mpWindowImpl->mpRealParent && bIsTopWindow ) { ImplWinData* pParentWinData = mpWindowImpl->mpRealParent->ImplGetWinData(); @@ -4626,10 +4640,6 @@ Window::~Window() delete mpWindowImpl->mpWinData->mpFocusRect; if ( mpWindowImpl->mpWinData->mpTrackRect ) delete mpWindowImpl->mpWinData->mpTrackRect; - if ( mpWindowImpl->mpWinData->mpSmartHelpId ) - delete mpWindowImpl->mpWinData->mpSmartHelpId; - if ( mpWindowImpl->mpWinData->mpSmartUniqueId ) - delete mpWindowImpl->mpWinData->mpSmartUniqueId; delete mpWindowImpl->mpWinData; } @@ -4683,17 +4693,24 @@ void Window::doLazyDelete() vcl::LazyDeletor<Window>::Delete( this ); } -USHORT Window::GetIndicatorState() const +sal_uInt16 Window::GetIndicatorState() const { return mpWindowImpl->mpFrame->GetIndicatorState().mnState; } -void Window::SimulateKeyPress( USHORT nKeyCode ) const +void Window::SimulateKeyPress( sal_uInt16 nKeyCode ) const { mpWindowImpl->mpFrame->SimulateKeyPress(nKeyCode); } // ----------------------------------------------------------------------- +void Window::InterceptChildWindowKeyDown( sal_Bool bIntercept ) +{ + if( mpWindowImpl->mpSysObj ) + mpWindowImpl->mpSysObj->InterceptChildWindowKeyDown( bIntercept ); +} + +// ----------------------------------------------------------------------- void Window::MouseMove( const MouseEvent& rMEvt ) { @@ -4703,7 +4720,7 @@ void Window::MouseMove( const MouseEvent& rMEvt ) NotifyEvent aNEvt( EVENT_MOUSEMOVE, this, &rMEvt ); if ( !Notify( aNEvt ) ) - mpWindowImpl->mbMouseMove = TRUE; + mpWindowImpl->mbMouseMove = sal_True; } // ----------------------------------------------------------------------- @@ -4716,7 +4733,7 @@ void Window::MouseButtonDown( const MouseEvent& rMEvt ) NotifyEvent aNEvt( EVENT_MOUSEBUTTONDOWN, this, &rMEvt ); if ( !Notify( aNEvt ) ) - mpWindowImpl->mbMouseButtonDown = TRUE; + mpWindowImpl->mbMouseButtonDown = sal_True; } // ----------------------------------------------------------------------- @@ -4729,7 +4746,7 @@ void Window::MouseButtonUp( const MouseEvent& rMEvt ) NotifyEvent aNEvt( EVENT_MOUSEBUTTONUP, this, &rMEvt ); if ( !Notify( aNEvt ) ) - mpWindowImpl->mbMouseButtonUp = TRUE; + mpWindowImpl->mbMouseButtonUp = sal_True; } // ----------------------------------------------------------------------- @@ -4742,7 +4759,7 @@ void Window::KeyInput( const KeyEvent& rKEvt ) NotifyEvent aNEvt( EVENT_KEYINPUT, this, &rKEvt ); if ( !Notify( aNEvt ) ) - mpWindowImpl->mbKeyInput = TRUE; + mpWindowImpl->mbKeyInput = sal_True; } // ----------------------------------------------------------------------- @@ -4755,7 +4772,7 @@ void Window::KeyUp( const KeyEvent& rKEvt ) NotifyEvent aNEvt( EVENT_KEYUP, this, &rKEvt ); if ( !Notify( aNEvt ) ) - mpWindowImpl->mbKeyUp = TRUE; + mpWindowImpl->mbKeyUp = sal_True; } // ----------------------------------------------------------------------- @@ -4777,7 +4794,13 @@ void Window::Paint( const Rectangle& rRect ) // ----------------------------------------------------------------------- -void Window::Draw( OutputDevice*, const Point&, const Size&, ULONG ) +void Window::PostPaint() +{ +} + +// ----------------------------------------------------------------------- + +void Window::Draw( OutputDevice*, const Point&, const Size&, sal_uLong ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); } @@ -4881,29 +4904,18 @@ void Window::RequestHelp( const HelpEvent& rHEvt ) } else { - SmartId aSmartId = GetSmartHelpId(); - - ULONG nNumHelpId = 0; - String aStrHelpId; - if( aSmartId.HasString() ) - aStrHelpId = aSmartId.GetStr(); - if( aSmartId.HasNumeric() ) - nNumHelpId = aSmartId.GetNum(); - - if ( !nNumHelpId && aStrHelpId.Len() == 0 && ImplGetParent() ) + String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); + if ( aStrHelpId.Len() == 0 && ImplGetParent() ) ImplGetParent()->RequestHelp( rHEvt ); else { - if ( !nNumHelpId && aStrHelpId.Len() == 0 ) - nNumHelpId = OOO_HELP_INDEX; - Help* pHelp = Application::GetHelp(); if ( pHelp ) { if( aStrHelpId.Len() > 0 ) pHelp->Start( aStrHelpId, this ); else - pHelp->Start( nNumHelpId, this ); + pHelp->Start( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( OOO_HELP_INDEX ) ), this ); } } } @@ -4921,7 +4933,7 @@ void Window::Command( const CommandEvent& rCEvt ) NotifyEvent aNEvt( EVENT_COMMAND, this, &rCEvt ); if ( !Notify( aNEvt ) ) - mpWindowImpl->mbCommand = TRUE; + mpWindowImpl->mbCommand = sal_True; } // ----------------------------------------------------------------------- @@ -4937,7 +4949,7 @@ void Window::Tracking( const TrackingEvent& rTEvt ) // ----------------------------------------------------------------------- -void Window::UserEvent( ULONG, void* ) +void Window::UserEvent( sal_uLong, void* ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); } @@ -5065,7 +5077,7 @@ long Window::PreNotify( NotifyEvent& rNEvt ) DBG_CHKTHIS( Window, ImplDbgCheckWindow ); } - long bDone = FALSE; + long bDone = sal_False; if ( mpWindowImpl->mpParent && !ImplIsOverlapWindow() ) bDone = mpWindowImpl->mpParent->PreNotify( rNEvt ); @@ -5073,11 +5085,11 @@ long Window::PreNotify( NotifyEvent& rNEvt ) { if( rNEvt.GetType() == EVENT_GETFOCUS ) { - BOOL bCompoundFocusChanged = FALSE; + sal_Bool bCompoundFocusChanged = sal_False; if ( mpWindowImpl->mbCompoundControl && !mpWindowImpl->mbCompoundControlHasFocus && HasChildPathFocus() ) { - mpWindowImpl->mbCompoundControlHasFocus = TRUE; - bCompoundFocusChanged = TRUE; + mpWindowImpl->mbCompoundControlHasFocus = sal_True; + bCompoundFocusChanged = sal_True; } if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) ) @@ -5085,11 +5097,11 @@ long Window::PreNotify( NotifyEvent& rNEvt ) } else if( rNEvt.GetType() == EVENT_LOSEFOCUS ) { - BOOL bCompoundFocusChanged = FALSE; + sal_Bool bCompoundFocusChanged = sal_False; if ( mpWindowImpl->mbCompoundControl && mpWindowImpl->mbCompoundControlHasFocus && !HasChildPathFocus() ) { - mpWindowImpl->mbCompoundControlHasFocus = FALSE ; - bCompoundFocusChanged = TRUE; + mpWindowImpl->mbCompoundControlHasFocus = sal_False ; + bCompoundFocusChanged = sal_True; } if ( bCompoundFocusChanged || ( rNEvt.GetWindow() == this ) ) @@ -5112,7 +5124,7 @@ long Window::Notify( NotifyEvent& rNEvt ) DBG_CHKTHIS( Window, ImplDbgCheckWindow ); } - long nRet = FALSE; + long nRet = sal_False; // check for docking window // but do nothing if window is docked and locked @@ -5122,27 +5134,27 @@ long Window::Notify( NotifyEvent& rNEvt ) if ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) { const MouseEvent* pMEvt = rNEvt.GetMouseEvent(); - BOOL bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() ); + sal_Bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() ); if ( pMEvt->IsLeft() ) { if ( pMEvt->IsMod1() && (pMEvt->GetClicks() == 2) ) { // ctrl double click toggles floating mode pWrapper->SetFloatingMode( !pWrapper->IsFloatingMode() ); - return TRUE; + return sal_True; } else if ( pMEvt->GetClicks() == 1 && bHit) { // allow start docking during mouse move pWrapper->ImplEnableStartDocking(); - return TRUE; + return sal_True; } } } else if ( rNEvt.GetType() == EVENT_MOUSEMOVE ) { const MouseEvent* pMEvt = rNEvt.GetMouseEvent(); - BOOL bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() ); + sal_Bool bHit = pWrapper->GetDragArea().IsInside( pMEvt->GetPosPixel() ); if ( pMEvt->IsLeft() ) { // check if a single click initiated this sequence ( ImplStartDockingEnabled() ) @@ -5159,7 +5171,7 @@ long Window::Notify( NotifyEvent& rNEvt ) } pWrapper->ImplStartDocking( aPos ); } - return TRUE; + return sal_True; } } else if( rNEvt.GetType() == EVENT_KEYINPUT ) @@ -5177,7 +5189,7 @@ long Window::Notify( NotifyEvent& rNEvt ) */ if( pWrapper->IsFloatingMode() ) ToTop( TOTOP_GRABFOCUSONLY ); - return TRUE; + return sal_True; } } } @@ -5200,7 +5212,7 @@ long Window::Notify( NotifyEvent& rNEvt ) if ( (rNEvt.GetWindow() == this) && (rNEvt.GetType() == EVENT_GETFOCUS) && !(GetStyle() & WB_TABSTOP) && !(mpWindowImpl->mnDlgCtrlFlags & WINDOW_DLGCTRL_WANTFOCUS) ) { - USHORT n = 0; + sal_uInt16 n = 0; Window* pFirstChild = ImplGetDlgWindow( n, DLGWINDOW_FIRST ); if ( pFirstChild ) pFirstChild->ImplControlFocus(); @@ -5219,7 +5231,7 @@ long Window::Notify( NotifyEvent& rNEvt ) // ----------------------------------------------------------------------- -void Window::ImplCallEventListeners( ULONG nEvent, void* pData ) +void Window::ImplCallEventListeners( sal_uLong nEvent, void* pData ) { // The implementation was moved to CallEventListeners(), // because derived classes in svtools must be able to @@ -5232,7 +5244,7 @@ void Window::ImplCallEventListeners( ULONG nEvent, void* pData ) // ----------------------------------------------------------------------- -void Window::CallEventListeners( ULONG nEvent, void* pData ) +void Window::CallEventListeners( sal_uLong nEvent, void* pData ) { VclWindowEvent aEvent( this, nEvent, pData ); @@ -5302,25 +5314,25 @@ void Window::RemoveChildEventListener( const Link& rEventListener ) // ----------------------------------------------------------------------- -ULONG Window::PostUserEvent( ULONG nEvent, void* pEventData ) +sal_uLong Window::PostUserEvent( sal_uLong nEvent, void* pEventData ) { - ULONG nEventId; + sal_uLong nEventId; PostUserEvent( nEventId, nEvent, pEventData ); return nEventId; } // ----------------------------------------------------------------------- -ULONG Window::PostUserEvent( const Link& rLink, void* pCaller ) +sal_uLong Window::PostUserEvent( const Link& rLink, void* pCaller ) { - ULONG nEventId; + sal_uLong nEventId; PostUserEvent( nEventId, rLink, pCaller ); return nEventId; } // ----------------------------------------------------------------------- -BOOL Window::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData ) +sal_Bool Window::PostUserEvent( sal_uLong& rEventId, sal_uLong nEvent, void* pEventData ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5329,23 +5341,23 @@ BOOL Window::PostUserEvent( ULONG& rEventId, ULONG nEvent, void* pEventData ) pSVEvent->mpData = pEventData; pSVEvent->mpLink = NULL; pSVEvent->mpWindow = this; - pSVEvent->mbCall = TRUE; + pSVEvent->mbCall = sal_True; ImplAddDel( &(pSVEvent->maDelData) ); - rEventId = (ULONG)pSVEvent; + rEventId = (sal_uLong)pSVEvent; if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) ) - return TRUE; + return sal_True; else { rEventId = 0; ImplRemoveDel( &(pSVEvent->maDelData) ); delete pSVEvent; - return FALSE; + return sal_False; } } // ----------------------------------------------------------------------- -BOOL Window::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller ) +sal_Bool Window::PostUserEvent( sal_uLong& rEventId, const Link& rLink, void* pCaller ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5354,23 +5366,23 @@ BOOL Window::PostUserEvent( ULONG& rEventId, const Link& rLink, void* pCaller ) pSVEvent->mpData = pCaller; pSVEvent->mpLink = new Link( rLink ); pSVEvent->mpWindow = this; - pSVEvent->mbCall = TRUE; + pSVEvent->mbCall = sal_True; ImplAddDel( &(pSVEvent->maDelData) ); - rEventId = (ULONG)pSVEvent; + rEventId = (sal_uLong)pSVEvent; if ( mpWindowImpl->mpFrame->PostEvent( pSVEvent ) ) - return TRUE; + return sal_True; else { rEventId = 0; ImplRemoveDel( &(pSVEvent->maDelData) ); delete pSVEvent; - return FALSE; + return sal_False; } } // ----------------------------------------------------------------------- -void Window::RemoveUserEvent( ULONG nUserEvent ) +void Window::RemoveUserEvent( sal_uLong nUserEvent ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5387,14 +5399,14 @@ void Window::RemoveUserEvent( ULONG nUserEvent ) pSVEvent->mpWindow = NULL; } - pSVEvent->mbCall = FALSE; + pSVEvent->mbCall = sal_False; } // ----------------------------------------------------------------------- IMPL_LINK( Window, ImplAsyncStateChangedHdl, void*, pState ) { - StateChanged( (StateChangedType)(ULONG)pState ); + StateChanged( (StateChangedType)(sal_uLong)pState ); return 0; } @@ -5404,28 +5416,28 @@ void Window::PostStateChanged( StateChangedType nState ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - PostUserEvent( LINK( this, Window, ImplAsyncStateChangedHdl ), (void*)(ULONG)nState ); + PostUserEvent( LINK( this, Window, ImplAsyncStateChangedHdl ), (void*)(sal_uLong)nState ); } // ----------------------------------------------------------------------- -BOOL Window::IsLocked( BOOL bChilds ) const +sal_Bool Window::IsLocked( sal_Bool bChilds ) const { if ( mpWindowImpl->mnLockCount != 0 ) - return TRUE; + return sal_True; if ( bChilds || mpWindowImpl->mbChildNotify ) { Window* pChild = mpWindowImpl->mpFirstChild; while ( pChild ) { - if ( pChild->IsLocked( TRUE ) ) - return TRUE; + if ( pChild->IsLocked( sal_True ) ) + return sal_True; pChild = pChild->mpWindowImpl->mpNext; } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -5483,7 +5495,7 @@ SystemWindow* Window::GetSystemWindow() const // ----------------------------------------------------------------------- -void Window::SetBorderStyle( USHORT nBorderStyle ) +void Window::SetBorderStyle( sal_uInt16 nBorderStyle ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5526,7 +5538,7 @@ void Window::SetBorderStyle( USHORT nBorderStyle ) // ----------------------------------------------------------------------- -USHORT Window::GetBorderStyle() const +sal_uInt16 Window::GetBorderStyle() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5574,7 +5586,7 @@ long Window::CalcTitleWidth() const // ----------------------------------------------------------------------- -void Window::EnableClipSiblings( BOOL bClipSiblings ) +void Window::EnableClipSiblings( sal_Bool bClipSiblings ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5586,7 +5598,7 @@ void Window::EnableClipSiblings( BOOL bClipSiblings ) // ----------------------------------------------------------------------- -void Window::SetMouseTransparent( BOOL bTransparent ) +void Window::SetMouseTransparent( sal_Bool bTransparent ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5601,7 +5613,7 @@ void Window::SetMouseTransparent( BOOL bTransparent ) // ----------------------------------------------------------------------- -void Window::SetPaintTransparent( BOOL bTransparent ) +void Window::SetPaintTransparent( sal_Bool bTransparent ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5628,7 +5640,7 @@ void Window::SetInputContext( const InputContext& rInputContext ) // ----------------------------------------------------------------------- -void Window::EndExtTextInput( USHORT nFlags ) +void Window::EndExtTextInput( sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5686,24 +5698,24 @@ long Window::GetCursorExtTextInputWidth() const // ----------------------------------------------------------------------- void Window::SetSettings( const AllSettings& rSettings ) { - SetSettings( rSettings, FALSE ); + SetSettings( rSettings, sal_False ); } -void Window::SetSettings( const AllSettings& rSettings, BOOL bChild ) +void Window::SetSettings( const AllSettings& rSettings, sal_Bool bChild ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); if ( mpWindowImpl->mpBorderWindow ) { - mpWindowImpl->mpBorderWindow->SetSettings( rSettings, FALSE ); + mpWindowImpl->mpBorderWindow->SetSettings( rSettings, sal_False ); if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, TRUE ); + ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->SetSettings( rSettings, sal_True ); } AllSettings aOldSettings = maSettings; OutputDevice::SetSettings( rSettings ); - ULONG nChangeFlags = aOldSettings.GetChangeFlags( rSettings ); + sal_uLong nChangeFlags = aOldSettings.GetChangeFlags( rSettings ); // AppFont-Aufloesung und DPI-Aufloesung neu berechnen ImplInitResolutionSettings(); @@ -5727,20 +5739,20 @@ void Window::SetSettings( const AllSettings& rSettings, BOOL bChild ) // ----------------------------------------------------------------------- -void Window::UpdateSettings( const AllSettings& rSettings, BOOL bChild ) +void Window::UpdateSettings( const AllSettings& rSettings, sal_Bool bChild ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); if ( mpWindowImpl->mpBorderWindow ) { - mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, FALSE ); + mpWindowImpl->mpBorderWindow->UpdateSettings( rSettings, sal_False ); if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, TRUE ); + ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->UpdateSettings( rSettings, sal_True ); } AllSettings aOldSettings = maSettings; - ULONG nChangeFlags = maSettings.Update( maSettings.GetWindowUpdate(), rSettings ); + sal_uLong nChangeFlags = maSettings.Update( maSettings.GetWindowUpdate(), rSettings ); nChangeFlags |= SETTINGS_IN_UPDATE_SETTINGS; // Set this flag so the receiver of the data changed // event can distinguish between the changing of global // setting and a local change ( with SetSettings ) @@ -5830,7 +5842,7 @@ Font Window::GetPointFont() const // ----------------------------------------------------------------------- -void Window::SetParentClipMode( USHORT nMode ) +void Window::SetParentClipMode( sal_uInt16 nMode ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5842,14 +5854,14 @@ void Window::SetParentClipMode( USHORT nMode ) { mpWindowImpl->mnParentClipMode = nMode; if ( nMode & PARENTCLIPMODE_CLIP ) - mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = TRUE; + mpWindowImpl->mpParent->mpWindowImpl->mbClipChildren = sal_True; } } } // ----------------------------------------------------------------------- -USHORT Window::GetParentClipMode() const +sal_uInt16 Window::GetParentClipMode() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5870,7 +5882,7 @@ void Window::SetWindowRegionPixel() else if( mpWindowImpl->mbFrame ) { mpWindowImpl->maWinRegion = Region( REGION_NULL); - mpWindowImpl->mbWinRegion = FALSE; + mpWindowImpl->mbWinRegion = sal_False; mpWindowImpl->mpFrame->ResetClipRegion(); } else @@ -5878,7 +5890,7 @@ void Window::SetWindowRegionPixel() if ( mpWindowImpl->mbWinRegion ) { mpWindowImpl->maWinRegion = Region( REGION_NULL ); - mpWindowImpl->mbWinRegion = FALSE; + mpWindowImpl->mbWinRegion = sal_False; ImplSetClipFlag(); if ( IsReallyVisible() ) @@ -5917,9 +5929,9 @@ void Window::SetWindowRegionPixel( const Region& rRegion ) long nY; long nWidth; long nHeight; - ULONG nRectCount; + sal_uLong nRectCount; ImplRegionInfo aInfo; - BOOL bRegionRect; + sal_Bool bRegionRect; nRectCount = mpWindowImpl->maWinRegion.GetRectCount(); mpWindowImpl->mpFrame->BeginSetClipRegion( nRectCount ); @@ -5944,14 +5956,14 @@ void Window::SetWindowRegionPixel( const Region& rRegion ) if ( mpWindowImpl->mbWinRegion ) { mpWindowImpl->maWinRegion = Region( REGION_NULL ); - mpWindowImpl->mbWinRegion = FALSE; + mpWindowImpl->mbWinRegion = sal_False; ImplSetClipFlag(); } } else { mpWindowImpl->maWinRegion = rRegion; - mpWindowImpl->mbWinRegion = TRUE; + mpWindowImpl->mbWinRegion = sal_True; ImplSetClipFlag(); } @@ -5983,7 +5995,7 @@ const Region& Window::GetWindowRegionPixel() const // ----------------------------------------------------------------------- -BOOL Window::IsWindowRegionPixel() const +sal_Bool Window::IsWindowRegionPixel() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -5995,7 +6007,7 @@ BOOL Window::IsWindowRegionPixel() const // ----------------------------------------------------------------------- -Region Window::GetWindowClipRegionPixel( USHORT nFlags ) const +Region Window::GetWindowClipRegionPixel( sal_uInt16 nFlags ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -6066,7 +6078,7 @@ void Window::ExpandPaintClipRegion( const Region& rRegion ) if( ! aDevPixRegion.IsEmpty() ) { mpWindowImpl->mpPaintRegion->Union( aDevPixRegion ); - mbInitClipRegion = TRUE; + mbInitClipRegion = sal_True; } } } @@ -6101,13 +6113,13 @@ void Window::SetParent( Window* pNewParent ) // check if the taskpanelist would change and move the window pointer accordingly SystemWindow *pSysWin = ImplGetLastSystemWindow(this); SystemWindow *pNewSysWin = NULL; - BOOL bChangeTaskPaneList = FALSE; + sal_Bool bChangeTaskPaneList = sal_False; if( pSysWin && pSysWin->ImplIsInTaskPaneList( this ) ) { pNewSysWin = ImplGetLastSystemWindow( pNewParent ); if( pNewSysWin && pNewSysWin != pSysWin ) { - bChangeTaskPaneList = TRUE; + bChangeTaskPaneList = sal_True; pSysWin->GetTaskPaneList()->RemoveWindow( this ); } } @@ -6136,7 +6148,7 @@ void Window::SetParent( Window* pNewParent ) if ( mpWindowImpl->mbFrame ) mpWindowImpl->mpFrame->SetParent( pNewParent->mpWindowImpl->mpFrame ); - BOOL bVisible = IsVisible(); + sal_Bool bVisible = IsVisible(); Show( false, SHOW_NOFOCUSCHANGE ); // Testen, ob sich das Overlap-Window aendert @@ -6154,9 +6166,9 @@ void Window::SetParent( Window* pNewParent ) } // Fenster in der Hirachie umsetzen - BOOL bFocusOverlapWin = HasChildPathFocus( TRUE ); - BOOL bFocusWin = HasChildPathFocus(); - BOOL bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow; + sal_Bool bFocusOverlapWin = HasChildPathFocus( sal_True ); + sal_Bool bFocusWin = HasChildPathFocus(); + sal_Bool bNewFrame = pNewParent->mpWindowImpl->mpFrameWindow != mpWindowImpl->mpFrameWindow; if ( bNewFrame ) { if ( mpWindowImpl->mpFrameData->mpFocusWin ) @@ -6178,7 +6190,7 @@ void Window::SetParent( Window* pNewParent ) ImplRemoveWindow( bNewFrame ); ImplInsertWindow( pNewParent ); if ( mpWindowImpl->mnParentClipMode & PARENTCLIPMODE_CLIP ) - pNewParent->mpWindowImpl->mbClipChildren = TRUE; + pNewParent->mpWindowImpl->mbClipChildren = sal_True; ImplUpdateWindowPtr(); if ( ImplUpdatePos() ) ImplUpdateSysObjPos(); @@ -6217,7 +6229,7 @@ void Window::SetParent( Window* pNewParent ) } // Activate-Status beim naechsten Overlap-Window updaten - if ( HasChildPathFocus( TRUE ) ) + if ( HasChildPathFocus( sal_True ) ) ImplCallFocusChangeActivate( pNewOverlapWindow, pOldOverlapWindow ); } @@ -6258,7 +6270,7 @@ void Window::SetParent( Window* pNewParent ) // ----------------------------------------------------------------------- -void Window::Show( BOOL bVisible, USHORT nFlags ) +void Window::Show( sal_Bool bVisible, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -6267,7 +6279,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) ImplDelData aDogTag( this ); - BOOL bRealVisibilityChanged = FALSE; + sal_Bool bRealVisibilityChanged = sal_False; mpWindowImpl->mbVisible = (bVisible != 0); if ( !bVisible ) @@ -6280,14 +6292,14 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) { bool bOldUpdate = mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate; if ( mpWindowImpl->mbNoParentUpdate ) - mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = TRUE; + mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = sal_True; mpWindowImpl->mpBorderWindow->Show( false, nFlags ); mpWindowImpl->mpBorderWindow->mpWindowImpl->mbNoParentUpdate = bOldUpdate; } else if ( mpWindowImpl->mbFrame ) { - mpWindowImpl->mbSuppressAccessibilityEvents = TRUE; - mpWindowImpl->mpFrame->Show( FALSE, FALSE ); + mpWindowImpl->mbSuppressAccessibilityEvents = sal_True; + mpWindowImpl->mpFrame->Show( sal_False, sal_False ); } StateChanged( STATE_CHANGE_VISIBLE ); @@ -6295,12 +6307,12 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) if ( mpWindowImpl->mbReallyVisible ) { Region aInvRegion( REGION_EMPTY ); - BOOL bSaveBack = FALSE; + sal_Bool bSaveBack = sal_False; if ( ImplIsOverlapWindow() && !mpWindowImpl->mbFrame ) { if ( ImplRestoreOverlapBackground( aInvRegion ) ) - bSaveBack = TRUE; + bSaveBack = sal_True; } if ( !bSaveBack ) @@ -6395,7 +6407,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) if ( ImplIsOverlapWindow() && !(nFlags & SHOW_NOACTIVATE) ) { ImplStartToTop(( nFlags & SHOW_FOREGROUNDTASK ) ? TOTOP_FOREGROUNDTASK : 0 ); - ImplFocusToTop( 0, FALSE ); + ImplFocusToTop( 0, sal_False ); } // Hintergrund sichern @@ -6410,7 +6422,7 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) if ( !mpWindowImpl->mbFrame ) { - USHORT nInvalidateFlags = INVALIDATE_CHILDREN; + sal_uInt16 nInvalidateFlags = INVALIDATE_CHILDREN; if( ! IsPaintTransparent() ) nInvalidateFlags |= INVALIDATE_NOTRANSPARENT; ImplInvalidate( NULL, nInvalidateFlags ); @@ -6437,11 +6449,11 @@ void Window::Show( BOOL bVisible, USHORT nFlags ) } //DBG_ASSERT( !mpWindowImpl->mbSuppressAccessibilityEvents, "Window::Show() - Frame reactivated"); - mpWindowImpl->mbSuppressAccessibilityEvents = FALSE; + mpWindowImpl->mbSuppressAccessibilityEvents = sal_False; - mpWindowImpl->mbPaintFrame = TRUE; - BOOL bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? TRUE : FALSE; - mpWindowImpl->mpFrame->Show( TRUE, bNoActivate ); + mpWindowImpl->mbPaintFrame = sal_True; + sal_Bool bNoActivate = (nFlags & (SHOW_NOACTIVATE|SHOW_NOFOCUSCHANGE)) ? sal_True : sal_False; + mpWindowImpl->mpFrame->Show( sal_True, bNoActivate ); if( aDogTag.IsDelete() ) return; @@ -6562,10 +6574,10 @@ void Window::Enable( bool bEnable, bool bChild ) if ( mpWindowImpl->mpBorderWindow ) { - mpWindowImpl->mpBorderWindow->Enable( bEnable, FALSE ); + mpWindowImpl->mpBorderWindow->Enable( bEnable, sal_False ); if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, TRUE ); + ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->Enable( bEnable, sal_True ); } // #i56102# restore app focus win in case the @@ -6607,7 +6619,7 @@ void Window::Enable( bool bEnable, bool bChild ) void Window::SetCallHandlersOnInputDisabled( bool bCall ) { - mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? TRUE : FALSE; + mpWindowImpl->mbCallHandlersDuringInputDisabled = bCall ? sal_True : sal_False; Window* pChild = mpWindowImpl->mpFirstChild; while ( pChild ) @@ -6626,17 +6638,17 @@ bool Window::IsCallHandlersOnInputDisabled() const // ----------------------------------------------------------------------- -void Window::EnableInput( BOOL bEnable, BOOL bChild ) +void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - BOOL bNotify = (bEnable != mpWindowImpl->mbInputDisabled); + sal_Bool bNotify = (bEnable != mpWindowImpl->mbInputDisabled); if ( mpWindowImpl->mpBorderWindow ) { - mpWindowImpl->mpBorderWindow->EnableInput( bEnable, FALSE ); + mpWindowImpl->mpBorderWindow->EnableInput( bEnable, sal_False ); if ( (mpWindowImpl->mpBorderWindow->GetType() == WINDOW_BORDERWINDOW) && ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow ) - ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, TRUE ); + ((ImplBorderWindow*)mpWindowImpl->mpBorderWindow)->mpMenuBarWindow->EnableInput( bEnable, sal_True ); } if ( (! bEnable && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled) || @@ -6694,7 +6706,7 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild ) // ----------------------------------------------------------------------- -void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin, +void Window::EnableInput( sal_Bool bEnable, sal_Bool bChild, sal_Bool bSysWin, const Window* pExcludeWindow ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -6710,11 +6722,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin, while ( pSysWin ) { // Is Window in the path from this window - if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, TRUE ) ) + if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pSysWin, sal_True ) ) { // Is Window not in the exclude window path or not the // exclude window, than change the status - if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, TRUE ) ) + if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pSysWin, sal_True ) ) pSysWin->EnableInput( bEnable, bChild ); } pSysWin = pSysWin->mpWindowImpl->mpNextOverlap; @@ -6727,11 +6739,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin, if( pFrameWin->ImplIsFloatingWindow() ) { // Is Window in the path from this window - if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, TRUE ) ) + if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( pFrameWin, sal_True ) ) { // Is Window not in the exclude window path or not the // exclude window, than change the status - if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, TRUE ) ) + if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( pFrameWin, sal_True ) ) pFrameWin->EnableInput( bEnable, bChild ); } } @@ -6746,11 +6758,11 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin, while( p != rList.end() ) { // Is Window in the path from this window - if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), TRUE ) ) + if ( ImplGetFirstOverlapWindow()->ImplIsWindowOrChild( (*p), sal_True ) ) { // Is Window not in the exclude window path or not the // exclude window, than change the status - if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), TRUE ) ) + if ( !pExcludeWindow || !pExcludeWindow->ImplIsWindowOrChild( (*p), sal_True ) ) (*p)->EnableInput( bEnable, bChild ); } p++; @@ -6761,19 +6773,19 @@ void Window::EnableInput( BOOL bEnable, BOOL bChild, BOOL bSysWin, // ----------------------------------------------------------------------- -void Window::AlwaysEnableInput( BOOL bAlways, BOOL bChild ) +void Window::AlwaysEnableInput( sal_Bool bAlways, sal_Bool bChild ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); if ( mpWindowImpl->mpBorderWindow ) - mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, FALSE ); + mpWindowImpl->mpBorderWindow->AlwaysEnableInput( bAlways, sal_False ); if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputEnabled ) { mpWindowImpl->meAlwaysInputMode = AlwaysInputEnabled; if ( bAlways ) - EnableInput( TRUE, FALSE ); + EnableInput( sal_True, sal_False ); } else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled ) { @@ -6793,19 +6805,19 @@ void Window::AlwaysEnableInput( BOOL bAlways, BOOL bChild ) // ----------------------------------------------------------------------- -void Window::AlwaysDisableInput( BOOL bAlways, BOOL bChild ) +void Window::AlwaysDisableInput( sal_Bool bAlways, sal_Bool bChild ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); if ( mpWindowImpl->mpBorderWindow ) - mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, FALSE ); + mpWindowImpl->mpBorderWindow->AlwaysDisableInput( bAlways, sal_False ); if( bAlways && mpWindowImpl->meAlwaysInputMode != AlwaysInputDisabled ) { mpWindowImpl->meAlwaysInputMode = AlwaysInputDisabled; if ( bAlways ) - EnableInput( FALSE, FALSE ); + EnableInput( sal_False, sal_False ); } else if( ! bAlways && mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled ) { @@ -6825,7 +6837,7 @@ void Window::AlwaysDisableInput( BOOL bAlways, BOOL bChild ) // ----------------------------------------------------------------------- -void Window::SetActivateMode( USHORT nMode ) +void Window::SetActivateMode( sal_uInt16 nMode ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -6840,9 +6852,9 @@ void Window::SetActivateMode( USHORT nMode ) if ( mpWindowImpl->mnActivateMode ) { if ( (mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW)) && - !HasChildPathFocus( TRUE ) ) + !HasChildPathFocus( sal_True ) ) { - mpWindowImpl->mbActive = FALSE; + mpWindowImpl->mbActive = sal_False; Deactivate(); } } @@ -6850,7 +6862,7 @@ void Window::SetActivateMode( USHORT nMode ) { if ( !mpWindowImpl->mbActive || (GetType() == WINDOW_BORDERWINDOW) ) { - mpWindowImpl->mbActive = TRUE; + mpWindowImpl->mbActive = sal_True; Activate(); } } @@ -6859,7 +6871,7 @@ void Window::SetActivateMode( USHORT nMode ) // ----------------------------------------------------------------------- -void Window::ToTop( USHORT nFlags ) +void Window::ToTop( sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -6869,7 +6881,7 @@ void Window::ToTop( USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::SetZOrder( Window* pRefWindow, USHORT nFlags ) +void Window::SetZOrder( Window* pRefWindow, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -6987,7 +6999,7 @@ void Window::SetZOrder( Window* pRefWindow, USHORT nFlags ) if ( mpWindowImpl->mbInitWinClipRegion || !mpWindowImpl->maWinClipRegion.IsEmpty() ) { - BOOL bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion; + sal_Bool bInitWinClipRegion = mpWindowImpl->mbInitWinClipRegion; ImplSetClipFlag(); // Wenn ClipRegion noch nicht initalisiert wurde, dann @@ -7046,7 +7058,7 @@ void Window::SetZOrder( Window* pRefWindow, USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::EnableAlwaysOnTop( BOOL bEnable ) +void Window::EnableAlwaysOnTop( sal_Bool bEnable ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7064,16 +7076,16 @@ void Window::EnableAlwaysOnTop( BOOL bEnable ) // ----------------------------------------------------------------------- void Window::SetPosSizePixel( long nX, long nY, - long nWidth, long nHeight, USHORT nFlags ) + long nWidth, long nHeight, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - BOOL bHasValidSize = !mpWindowImpl->mbDefSize; + sal_Bool bHasValidSize = !mpWindowImpl->mbDefSize; if ( nFlags & WINDOW_POSSIZE_POS ) - mpWindowImpl->mbDefPos = FALSE; + mpWindowImpl->mbDefPos = sal_False; if ( nFlags & WINDOW_POSSIZE_SIZE ) - mpWindowImpl->mbDefSize = FALSE; + mpWindowImpl->mbDefSize = sal_False; // Oberstes BorderWindow ist das Window, welches positioniert werden soll Window* pWindow = this; @@ -7093,7 +7105,7 @@ void Window::SetPosSizePixel( long nX, long nY, nHeight = pWindow->mnOutHeight; - USHORT nSysFlags=0; + sal_uInt16 nSysFlags=0; if( nFlags & WINDOW_POSSIZE_WIDTH ) nSysFlags |= SAL_FRAME_POSSIZE_WIDTH; if( nFlags & WINDOW_POSSIZE_HEIGHT ) @@ -7307,18 +7319,18 @@ Rectangle Window::ImplOutputToUnmirroredAbsoluteScreenPixel( const Rectangle &rR Rectangle Window::GetWindowExtentsRelative( Window *pRelativeWindow ) const { // with decoration - return ImplGetWindowExtentsRelative( pRelativeWindow, FALSE ); + return ImplGetWindowExtentsRelative( pRelativeWindow, sal_False ); } Rectangle Window::GetClientWindowExtentsRelative( Window *pRelativeWindow ) const { // without decoration - return ImplGetWindowExtentsRelative( pRelativeWindow, TRUE ); + return ImplGetWindowExtentsRelative( pRelativeWindow, sal_True ); } // ----------------------------------------------------------------------- -Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bClientOnly ) const +Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, sal_Bool bClientOnly ) const { SalFrameGeometry g = mpWindowImpl->mpFrame->GetGeometry(); // make sure we use the extent of our border window, @@ -7348,7 +7360,7 @@ Rectangle Window::ImplGetWindowExtentsRelative( Window *pRelativeWindow, BOOL bC // ----------------------------------------------------------------------- -void Window::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags ) +void Window::Scroll( long nHorzScroll, long nVertScroll, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7360,7 +7372,7 @@ void Window::Scroll( long nHorzScroll, long nVertScroll, USHORT nFlags ) // ----------------------------------------------------------------------- void Window::Scroll( long nHorzScroll, long nVertScroll, - const Rectangle& rRect, USHORT nFlags ) + const Rectangle& rRect, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7372,7 +7384,7 @@ void Window::Scroll( long nHorzScroll, long nVertScroll, // ----------------------------------------------------------------------- -void Window::Invalidate( USHORT nFlags ) +void Window::Invalidate( sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7384,7 +7396,7 @@ void Window::Invalidate( USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::Invalidate( const Rectangle& rRect, USHORT nFlags ) +void Window::Invalidate( const Rectangle& rRect, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7401,7 +7413,7 @@ void Window::Invalidate( const Rectangle& rRect, USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::Invalidate( const Region& rRegion, USHORT nFlags ) +void Window::Invalidate( const Region& rRegion, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7420,7 +7432,7 @@ void Window::Invalidate( const Region& rRegion, USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::Validate( USHORT nFlags ) +void Window::Validate( sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7432,7 +7444,7 @@ void Window::Validate( USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::Validate( const Rectangle& rRect, USHORT nFlags ) +void Window::Validate( const Rectangle& rRect, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7449,7 +7461,7 @@ void Window::Validate( const Rectangle& rRect, USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::Validate( const Region& rRegion, USHORT nFlags ) +void Window::Validate( const Region& rRegion, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7468,18 +7480,18 @@ void Window::Validate( const Region& rRegion, USHORT nFlags ) // ----------------------------------------------------------------------- -BOOL Window::HasPaintEvent() const +sal_Bool Window::HasPaintEvent() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); if ( !mpWindowImpl->mbReallyVisible ) - return FALSE; + return sal_False; if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame ) - return TRUE; + return sal_True; if ( mpWindowImpl->mnPaintFlags & IMPL_PAINT_PAINT ) - return TRUE; + return sal_True; if ( !ImplIsOverlapWindow() ) { @@ -7488,12 +7500,12 @@ BOOL Window::HasPaintEvent() const { pTempWindow = pTempWindow->ImplGetParent(); if ( pTempWindow->mpWindowImpl->mnPaintFlags & (IMPL_PAINT_PAINTCHILDS | IMPL_PAINT_PAINTALLCHILDS) ) - return TRUE; + return sal_True; } while ( !pTempWindow->ImplIsOverlapWindow() ); } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -7511,14 +7523,14 @@ void Window::Update() if ( !mpWindowImpl->mbReallyVisible ) return; - BOOL bFlush = FALSE; + sal_Bool bFlush = sal_False; if ( mpWindowImpl->mpFrameWindow->mpWindowImpl->mbPaintFrame ) { Point aPoint( 0, 0 ); Region aRegion( Rectangle( aPoint, Size( mnOutWidth, mnOutHeight ) ) ); ImplInvalidateOverlapFrameRegion( aRegion ); if ( mpWindowImpl->mbFrame || (mpWindowImpl->mpBorderWindow && mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) ) - bFlush = TRUE; + bFlush = sal_True; } // Zuerst muessen wir alle Fenster ueberspringen, die Paint-Transparent @@ -7587,7 +7599,7 @@ void Window::Sync() // ----------------------------------------------------------------------- -void Window::SetUpdateMode( BOOL bUpdate ) +void Window::SetUpdateMode( sal_Bool bUpdate ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7606,7 +7618,7 @@ void Window::GrabFocus() // ----------------------------------------------------------------------- -BOOL Window::HasFocus() const +sal_Bool Window::HasFocus() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7648,7 +7660,7 @@ void Window::SetFakeFocus( bool bFocus ) // ----------------------------------------------------------------------- -BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const +sal_Bool Window::HasChildPathFocus( sal_Bool bSystemWindow ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7664,7 +7676,7 @@ BOOL Window::HasChildPathFocus( BOOL bSystemWindow ) const Window* pFocusWin = ImplGetSVData()->maWinData.mpFocusWin; if ( pFocusWin ) return ImplIsWindowOrChild( pFocusWin, bSystemWindow ); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -7685,7 +7697,7 @@ void Window::CaptureMouse() if ( pSVData->maWinData.mpCaptureWin != this ) { pSVData->maWinData.mpCaptureWin = this; - mpWindowImpl->mpFrame->CaptureMouse( TRUE ); + mpWindowImpl->mpFrame->CaptureMouse( sal_True ); } } @@ -7703,14 +7715,14 @@ void Window::ReleaseMouse() if ( pSVData->maWinData.mpCaptureWin == this ) { pSVData->maWinData.mpCaptureWin = NULL; - mpWindowImpl->mpFrame->CaptureMouse( FALSE ); + mpWindowImpl->mpFrame->CaptureMouse( sal_False ); ImplGenerateMouseMove(); } } // ----------------------------------------------------------------------- -BOOL Window::IsMouseCaptured() const +sal_Bool Window::IsMouseCaptured() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7735,7 +7747,7 @@ void Window::SetPointer( const Pointer& rPointer ) // ----------------------------------------------------------------------- -void Window::EnableChildPointerOverwrite( BOOL bOverwrite ) +void Window::EnableChildPointerOverwrite( sal_Bool bOverwrite ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7805,7 +7817,7 @@ Point Window::GetLastPointerPosPixel() // ----------------------------------------------------------------------- -void Window::ShowPointer( BOOL bVisible ) +void Window::ShowPointer( sal_Bool bVisible ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -7844,7 +7856,7 @@ Window::PointerState Window::GetPointerState() // ----------------------------------------------------------------------- -BOOL Window::IsMouseOver() +sal_Bool Window::IsMouseOver() { return ImplGetWinData()->mbMouseOver; } @@ -7922,7 +7934,7 @@ void Window::SetText( const XubString& rStr ) // name change. if ( IsReallyVisible() ) { - Window* pWindow = GetLabelFor(); + Window* pWindow = GetAccessibleRelationLabelFor(); if ( pWindow && pWindow != this ) pWindow->ImplCallEventListeners( VCLEVENT_WINDOW_FRAMETITLECHANGED, &oldTitle ); } @@ -7982,32 +7994,22 @@ const XubString& Window::GetHelpText() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - SmartId aSmartId = GetSmartHelpId(); - - ULONG nNumHelpId = 0; - String aStrHelpId; - if( aSmartId.HasString() ) - aStrHelpId = aSmartId.GetStr(); - if( aSmartId.HasNumeric() ) - nNumHelpId = aSmartId.GetNum(); + String aStrHelpId( rtl::OStringToOUString( GetHelpId(), RTL_TEXTENCODING_UTF8 ) ); bool bStrHelpId = (aStrHelpId.Len() > 0); - if ( !mpWindowImpl->maHelpText.Len() && (nNumHelpId || bStrHelpId) ) + if ( !mpWindowImpl->maHelpText.Len() && bStrHelpId ) { if ( !IsDialog() && (mpWindowImpl->mnType != WINDOW_TABPAGE) && (mpWindowImpl->mnType != WINDOW_FLOATINGWINDOW) ) { Help* pHelp = Application::GetHelp(); if ( pHelp ) { - if( bStrHelpId ) - ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this ); - else - ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( nNumHelpId, this ); - mpWindowImpl->mbHelpTextDynamic = FALSE; + ((Window*)this)->mpWindowImpl->maHelpText = pHelp->GetHelpText( aStrHelpId, this ); + mpWindowImpl->mbHelpTextDynamic = sal_False; } } } - else if( mpWindowImpl->mbHelpTextDynamic && (nNumHelpId || bStrHelpId) ) + else if( mpWindowImpl->mbHelpTextDynamic && bStrHelpId ) { static const char* pEnv = getenv( "HELP_DEBUG" ); if( pEnv && *pEnv ) @@ -8015,13 +8017,10 @@ const XubString& Window::GetHelpText() const rtl::OUStringBuffer aTxt( 64+mpWindowImpl->maHelpText.Len() ); aTxt.append( mpWindowImpl->maHelpText ); aTxt.appendAscii( "\n------------------\n" ); - if( bStrHelpId ) - aTxt.append( rtl::OUString( aStrHelpId ) ); - else - aTxt.append( sal_Int32( nNumHelpId ) ); + aTxt.append( rtl::OUString( aStrHelpId ) ); mpWindowImpl->maHelpText = aTxt.makeStringAndClear(); } - mpWindowImpl->mbHelpTextDynamic = FALSE; + mpWindowImpl->mbHelpTextDynamic = sal_False; } return mpWindowImpl->maHelpText; @@ -8039,11 +8038,11 @@ Window* Window::FindWindow( const Point& rPos ) const // ----------------------------------------------------------------------- -USHORT Window::GetChildCount() const +sal_uInt16 Window::GetChildCount() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - USHORT nChildCount = 0; + sal_uInt16 nChildCount = 0; Window* pChild = mpWindowImpl->mpFirstChild; while ( pChild ) { @@ -8056,11 +8055,11 @@ USHORT Window::GetChildCount() const // ----------------------------------------------------------------------- -Window* Window::GetChild( USHORT nChild ) const +Window* Window::GetChild( sal_uInt16 nChild ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - USHORT nChildCount = 0; + sal_uInt16 nChildCount = 0; Window* pChild = mpWindowImpl->mpFirstChild; while ( pChild ) { @@ -8075,7 +8074,7 @@ Window* Window::GetChild( USHORT nChild ) const // ----------------------------------------------------------------------- -Window* Window::GetWindow( USHORT nType ) const +Window* Window::GetWindow( sal_uInt16 nType ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -8167,7 +8166,7 @@ Window* Window::GetWindow( USHORT nType ) const // ----------------------------------------------------------------------- -BOOL Window::IsChild( const Window* pWindow, BOOL bSystemWindow ) const +sal_Bool Window::IsChild( const Window* pWindow, sal_Bool bSystemWindow ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); DBG_CHKOBJ( pWindow, Window, ImplDbgCheckWindow ); @@ -8180,22 +8179,22 @@ BOOL Window::IsChild( const Window* pWindow, BOOL bSystemWindow ) const pWindow = pWindow->ImplGetParent(); if ( pWindow == this ) - return TRUE; + return sal_True; } while ( pWindow ); - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -BOOL Window::IsWindowOrChild( const Window* pWindow, BOOL bSystemWindow ) const +sal_Bool Window::IsWindowOrChild( const Window* pWindow, sal_Bool bSystemWindow ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); DBG_CHKOBJ( pWindow, Window, ImplDbgCheckWindow ); if ( this == pWindow ) - return TRUE; + return sal_True; return ImplIsChild( pWindow, bSystemWindow ); } @@ -8234,7 +8233,7 @@ void Window::SetWindowPeer( ::com::sun::star::uno::Reference< ::com::sun::star:: // ----------------------------------------------------------------------- -::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( BOOL bCreate ) +::com::sun::star::uno::Reference< ::com::sun::star::awt::XWindowPeer > Window::GetComponentInterface( sal_Bool bCreate ) { if ( !mpWindowImpl->mxWindowPeer.is() && bCreate ) { @@ -8331,7 +8330,7 @@ void Window::ImplStartDnd() // ----------------------------------------------------------------------- -Reference< XDropTarget > Window::GetDropTarget() +uno::Reference< XDropTarget > Window::GetDropTarget() { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -8344,7 +8343,7 @@ Reference< XDropTarget > Window::GetDropTarget() if( ! mpWindowImpl->mpFrameData->mxDropTarget.is() ) { // initialization is done in GetDragSource - Reference< XDragSource > xDragSource = GetDragSource(); + uno::Reference< XDragSource > xDragSource = GetDragSource(); } if( mpWindowImpl->mpFrameData->mxDropTarget.is() ) @@ -8360,16 +8359,16 @@ Reference< XDropTarget > Window::GetDropTarget() mpWindowImpl->mpFrameData->mxDropTarget->addDropTargetListener( mpWindowImpl->mpFrameData->mxDropTargetListener ); // register also as drag gesture listener if directly supported by drag source - Reference< XDragGestureRecognizer > xDragGestureRecognizer = - Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY); + uno::Reference< XDragGestureRecognizer > xDragGestureRecognizer = + uno::Reference< XDragGestureRecognizer > (mpWindowImpl->mpFrameData->mxDragSource, UNO_QUERY); if( xDragGestureRecognizer.is() ) { xDragGestureRecognizer->addDragGestureListener( - Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY)); + uno::Reference< XDragGestureListener > (mpWindowImpl->mpFrameData->mxDropTargetListener, UNO_QUERY)); } else - mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = TRUE; + mpWindowImpl->mpFrameData->mbInternalDragGestureRecognizer = sal_True; } @@ -8388,12 +8387,12 @@ Reference< XDropTarget > Window::GetDropTarget() } // this object is located in the same process, so there will be no runtime exception - return Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY ); + return uno::Reference< XDropTarget > ( mpWindowImpl->mxDNDListenerContainer, UNO_QUERY ); } // ----------------------------------------------------------------------- -Reference< XDragSource > Window::GetDragSource() +uno::Reference< XDragSource > Window::GetDragSource() { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -8403,7 +8402,7 @@ Reference< XDragSource > Window::GetDragSource() { try { - Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); + uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); if ( xFactory.is() ) { const SystemEnvData * pEnvData = GetSystemData(); @@ -8437,10 +8436,10 @@ Reference< XDragSource > Window::GetDragSource() aDropTargetAL[ 2 ] = makeAny( vcl::createBmpConverter() ); #endif if( aDragSourceSN.getLength() ) - mpWindowImpl->mpFrameData->mxDragSource = Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxDragSource = uno::Reference< XDragSource > ( xFactory->createInstanceWithArguments( aDragSourceSN, aDragSourceAL ), UNO_QUERY ); if( aDropTargetSN.getLength() ) - mpWindowImpl->mpFrameData->mxDropTarget = Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxDropTarget = uno::Reference< XDropTarget > ( xFactory->createInstanceWithArguments( aDropTargetSN, aDropTargetAL ), UNO_QUERY ); } } } @@ -8457,12 +8456,12 @@ Reference< XDragSource > Window::GetDragSource() return mpWindowImpl->mpFrameData->mxDragSource; } - return Reference< XDragSource > (); + return uno::Reference< XDragSource > (); } // ----------------------------------------------------------------------- -void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Reference< XDropTarget > &xDropTarget ) +void Window::GetDragSourceDropTarget(uno::Reference< XDragSource >& xDragSource, uno::Reference< XDropTarget > &xDropTarget ) // only for RVP transmission { if( mpWindowImpl->mpFrameData ) @@ -8480,14 +8479,14 @@ void Window::GetDragSourceDropTarget(Reference< XDragSource >& xDragSource, Refe // ----------------------------------------------------------------------- -Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer() +uno::Reference< XDragGestureRecognizer > Window::GetDragGestureRecognizer() { - return Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY ); + return uno::Reference< XDragGestureRecognizer > ( GetDropTarget(), UNO_QUERY ); } // ----------------------------------------------------------------------- -Reference< XClipboard > Window::GetClipboard() +uno::Reference< XClipboard > Window::GetClipboard() { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -8497,19 +8496,19 @@ Reference< XClipboard > Window::GetClipboard() { try { - Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); + uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); if( xFactory.is() ) { - mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboardExt")) ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboardExt")) ), UNO_QUERY ); if( !mpWindowImpl->mpFrameData->mxClipboard.is() ) - mpWindowImpl->mpFrameData->mxClipboard = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")) ), UNO_QUERY ); + mpWindowImpl->mpFrameData->mxClipboard = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")) ), UNO_QUERY ); #if defined(UNX) && !defined(QUARTZ) // unix clipboard needs to be initialized if( mpWindowImpl->mpFrameData->mxClipboard.is() ) { - Reference< XInitialization > xInit = Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY ); + uno::Reference< XInitialization > xInit = uno::Reference< XInitialization >( mpWindowImpl->mpFrameData->mxClipboard, UNO_QUERY ); if( xInit.is() ) { @@ -8541,7 +8540,7 @@ Reference< XClipboard > Window::GetClipboard() // ----------------------------------------------------------------------- -Reference< XClipboard > Window::GetPrimarySelection() +uno::Reference< XClipboard > Window::GetPrimarySelection() { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -8551,7 +8550,7 @@ Reference< XClipboard > Window::GetPrimarySelection() { try { - Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); + uno::Reference< XMultiServiceFactory > xFactory( vcl::unohelper::GetMultiServiceFactory() ); if( xFactory.is() ) { @@ -8561,16 +8560,16 @@ Reference< XClipboard > Window::GetPrimarySelection() aArgumentList[ 1 ] = makeAny( OUString(RTL_CONSTASCII_USTRINGPARAM("PRIMARY")) ); aArgumentList[ 2 ] = makeAny( vcl::createBmpConverter() ); - mpWindowImpl->mpFrameData->mxSelection = Reference< XClipboard >( xFactory->createInstanceWithArguments( + mpWindowImpl->mpFrameData->mxSelection = uno::Reference< XClipboard >( xFactory->createInstanceWithArguments( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.SystemClipboard")), aArgumentList ), UNO_QUERY ); # else - static Reference< XClipboard > s_xSelection; + static uno::Reference< XClipboard > s_xSelection; if ( !s_xSelection.is() ) - s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboardExt")) ), UNO_QUERY ); + s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboardExt")) ), UNO_QUERY ); if ( !s_xSelection.is() ) - s_xSelection = Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")) ), UNO_QUERY ); + s_xSelection = uno::Reference< XClipboard >( xFactory->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.datatransfer.clipboard.GenericClipboard")) ), UNO_QUERY ); mpWindowImpl->mpFrameData->mxSelection = s_xSelection; # endif @@ -8595,7 +8594,7 @@ Reference< XClipboard > Window::GetPrimarySelection() // Accessibility // ----------------------------------------------------------------------- -::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::GetAccessible( BOOL bCreate ) +::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::GetAccessible( sal_Bool bCreate ) { // do not optimize hierarchy for the top level border win (ie, when there is no parent) /* // do not optimize accessible hierarchy at all to better reflect real VCL hierarchy @@ -8615,7 +8614,7 @@ Reference< XClipboard > Window::GetPrimarySelection() ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > Window::CreateAccessible() { - ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( GetComponentInterface( TRUE ), ::com::sun::star::uno::UNO_QUERY ); + ::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > xAcc( GetComponentInterface( sal_True ), ::com::sun::star::uno::UNO_QUERY ); return xAcc; } @@ -8625,46 +8624,46 @@ void Window::SetAccessible( ::com::sun::star::uno::Reference< ::com::sun::star:: } // skip all border windows that are no top level frames -BOOL Window::ImplIsAccessibleCandidate() const +sal_Bool Window::ImplIsAccessibleCandidate() const { if( !mpWindowImpl->mbBorderWin ) - return TRUE; + return sal_True; else // #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menues!) are closeable if( mpWindowImpl->mbFrame && mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; } -BOOL Window::ImplIsAccessibleNativeFrame() const +sal_Bool Window::ImplIsAccessibleNativeFrame() const { if( mpWindowImpl->mbFrame ) // #101741 do not check for WB_CLOSEABLE because undecorated floaters (like menues!) are closeable if( (mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE)) ) - return TRUE; + return sal_True; else - return FALSE; + return sal_False; else - return FALSE; + return sal_False; } -USHORT Window::ImplGetAccessibleCandidateChildWindowCount( USHORT nFirstWindowType ) const +sal_uInt16 Window::ImplGetAccessibleCandidateChildWindowCount( sal_uInt16 nFirstWindowType ) const { - USHORT nChildren = 0; + sal_uInt16 nChildren = 0; Window* pChild = GetWindow( nFirstWindowType ); while ( pChild ) { if( pChild->ImplIsAccessibleCandidate() ) nChildren++; else - nChildren = sal::static_int_cast<USHORT>(nChildren + pChild->ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD )); + nChildren = sal::static_int_cast<sal_uInt16>(nChildren + pChild->ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD )); pChild = pChild->mpWindowImpl->mpNext; } return nChildren; } -Window* Window::ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCount, USHORT nFirstWindowType, BOOL bTopLevel ) const +Window* Window::ImplGetAccessibleCandidateChild( sal_uInt16 nChild, sal_uInt16& rChildCount, sal_uInt16 nFirstWindowType, sal_Bool bTopLevel ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -8677,7 +8676,7 @@ Window* Window::ImplGetAccessibleCandidateChild( USHORT nChild, USHORT& rChildCo Window *pTmpChild = pChild; if( !pChild->ImplIsAccessibleCandidate() ) - pTmpChild = pChild->ImplGetAccessibleCandidateChild( nChild, rChildCount, WINDOW_FIRSTCHILD, FALSE ); + pTmpChild = pChild->ImplGetAccessibleCandidateChild( nChild, rChildCount, WINDOW_FIRSTCHILD, sal_False ); if ( nChild == rChildCount ) return pTmpChild; @@ -8730,9 +8729,9 @@ Window* Window::GetAccessibleParentWindow() const } /* -USHORT Window::GetAccessibleChildWindowCount() +sal_uInt16 Window::GetAccessibleChildWindowCount() { - USHORT nChildren = ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD ); + sal_uInt16 nChildren = ImplGetAccessibleCandidateChildWindowCount( WINDOW_FIRSTCHILD ); // Search also for SystemWindows. Window* pOverlap = GetWindow( WINDOW_OVERLAP ); @@ -8742,9 +8741,9 @@ USHORT Window::GetAccessibleChildWindowCount() } */ -USHORT Window::GetAccessibleChildWindowCount() +sal_uInt16 Window::GetAccessibleChildWindowCount() { - USHORT nChildren = 0; + sal_uInt16 nChildren = 0; Window* pChild = mpWindowImpl->mpFirstChild; while( pChild ) { @@ -8790,21 +8789,21 @@ USHORT Window::GetAccessibleChildWindowCount() } /* -Window* Window::GetAccessibleChildWindow( USHORT n ) +Window* Window::GetAccessibleChildWindow( sal_uInt16 n ) { - USHORT nChildCount; // will be set in ImplGetAccessibleCandidateChild(...) - Window* pChild = ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTCHILD, TRUE ); + sal_uInt16 nChildCount; // will be set in ImplGetAccessibleCandidateChild(...) + Window* pChild = ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTCHILD, sal_True ); if ( !pChild && ( n >= nChildCount ) ) { Window* pOverlap = GetWindow( WINDOW_OVERLAP ); - pChild = pOverlap->ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTOVERLAP, FALSE ); + pChild = pOverlap->ImplGetAccessibleCandidateChild( n, nChildCount, WINDOW_FIRSTOVERLAP, sal_False ); } return pChild; } */ -Window* Window::GetAccessibleChildWindow( USHORT n ) +Window* Window::GetAccessibleChildWindow( sal_uInt16 n ) { // report the menubarwindow as a the first child of THE workwindow if( GetType() == WINDOW_WORKWINDOW && ((WorkWindow *) this)->GetMenuBar() ) @@ -8820,7 +8819,7 @@ Window* Window::GetAccessibleChildWindow( USHORT n ) } // transform n to child number including invisible children - USHORT nChildren = n; + sal_uInt16 nChildren = n; Window* pChild = mpWindowImpl->mpFirstChild; while( pChild ) { @@ -8868,7 +8867,7 @@ Window* Window::GetAccessibleChildWindow( USHORT n ) } -void Window::SetAccessibleRole( USHORT nRole ) +void Window::SetAccessibleRole( sal_uInt16 nRole ) { if ( !mpWindowImpl->mpAccessibleInfos ) mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos; @@ -8877,11 +8876,11 @@ void Window::SetAccessibleRole( USHORT nRole ) mpWindowImpl->mpAccessibleInfos->nAccessibleRole = nRole; } -USHORT Window::GetAccessibleRole() const +sal_uInt16 Window::GetAccessibleRole() const { using namespace ::com::sun::star; - USHORT nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF; + sal_uInt16 nRole = mpWindowImpl->mpAccessibleInfos ? mpWindowImpl->mpAccessibleInfos->nAccessibleRole : 0xFFFF; if ( nRole == 0xFFFF ) { switch ( GetType() ) @@ -8983,6 +8982,7 @@ USHORT Window::GetAccessibleRole() const case WINDOW_HELPTEXTWINDOW: nRole = accessibility::AccessibleRole::TOOL_TIP; break; + case WINDOW_RULER: nRole = accessibility::AccessibleRole::RULER; break; case WINDOW_WINDOW: case WINDOW_CONTROL: case WINDOW_BORDERWINDOW: @@ -9009,7 +9009,7 @@ void Window::SetAccessibleName( const String& rName ) if ( !mpWindowImpl->mpAccessibleInfos ) mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos; - DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName, "AccessibleName already set!" ); + DBG_ASSERT( !mpWindowImpl->mpAccessibleInfos->pAccessibleName || !rName.Len(), "AccessibleName already set!" ); delete mpWindowImpl->mpAccessibleInfos->pAccessibleName; mpWindowImpl->mpAccessibleInfos->pAccessibleName = new String( rName ); } @@ -9050,9 +9050,9 @@ String Window::GetAccessibleName() const case WINDOW_LISTBOX: case WINDOW_MULTILISTBOX: case WINDOW_TREELISTBOX: - + case WINDOW_METRICBOX: { - Window *pLabel = GetLabeledBy(); + Window *pLabel = GetAccessibleRelationLabeledBy(); if ( pLabel && pLabel != this ) aAccessibleName = pLabel->GetText(); } @@ -9111,7 +9111,28 @@ String Window::GetAccessibleDescription() const return aAccessibleDescription; } -BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath ) +void Window::SetAccessibleRelationLabeledBy( Window* pLabeledBy ) +{ + if ( !mpWindowImpl->mpAccessibleInfos ) + mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos; + mpWindowImpl->mpAccessibleInfos->pLabeledByWindow = pLabeledBy; +} + +void Window::SetAccessibleRelationLabelFor( Window* pLabelFor ) +{ + if ( !mpWindowImpl->mpAccessibleInfos ) + mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos; + mpWindowImpl->mpAccessibleInfos->pLabelForWindow = pLabelFor; +} + +void Window::SetAccessibleRelationMemberOf( Window* pMemberOfWin ) +{ + if ( !mpWindowImpl->mpAccessibleInfos ) + mpWindowImpl->mpAccessibleInfos = new ImplAccessibleInfos; + mpWindowImpl->mpAccessibleInfos->pMemberOfWindow = pMemberOfWin; +} + +sal_Bool Window::IsAccessibilityEventsSuppressed( sal_Bool bTraverseParentPath ) { if( !bTraverseParentPath ) return mpWindowImpl->mbSuppressAccessibilityEvents; @@ -9121,14 +9142,19 @@ BOOL Window::IsAccessibilityEventsSuppressed( BOOL bTraverseParentPath ) while ( pParent && pParent->mpWindowImpl) { if( pParent->mpWindowImpl->mbSuppressAccessibilityEvents ) - return TRUE; + return sal_True; else pParent = pParent->mpWindowImpl->mpParent; // do not use GetParent() to find borderwindows that are frames } - return FALSE; + return sal_False; } } +void Window::SetAccessibilityEventsSuppressed(sal_Bool bSuppressed) +{ + mpWindowImpl->mbSuppressAccessibilityEvents = bSuppressed; +} + void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& rRect ) { if( ! mpOutDevData ) @@ -9145,9 +9171,9 @@ void Window::RecordLayoutData( vcl::ControlLayoutData* pLayout, const Rectangle& // returns background color used in this control // false: could not determine color -BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol ) +sal_Bool Window::ImplGetCurrentBackgroundColor( Color& rCol ) { - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; switch ( GetType() ) { @@ -9165,7 +9191,7 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol ) if( !aWall.IsGradient() && !aWall.IsBitmap() ) rCol = aWall.GetColor(); else - bRet = FALSE; + bRet = sal_False; } else rCol = GetSettings().GetStyleSettings().GetFaceColor(); @@ -9174,21 +9200,21 @@ BOOL Window::ImplGetCurrentBackgroundColor( Color& rCol ) return bRet; } -void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly ) +void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly ) { DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, NULL, NULL ); } -void Window::DrawSelectionBackground( const Rectangle& rRect, USHORT highlight, BOOL bChecked, BOOL bDrawBorder, BOOL bDrawExtBorderOnly, Color* pSelectionTextColor ) +void Window::DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, sal_Bool bChecked, sal_Bool bDrawBorder, sal_Bool bDrawExtBorderOnly, Color* pSelectionTextColor ) { DrawSelectionBackground( rRect, highlight, bChecked, bDrawBorder, bDrawExtBorderOnly, 0, pSelectionTextColor, NULL ); } void Window::DrawSelectionBackground( const Rectangle& rRect, - USHORT highlight, - BOOL bChecked, - BOOL bDrawBorder, - BOOL bDrawExtBorderOnly, + sal_uInt16 highlight, + sal_Bool bChecked, + sal_Bool bDrawBorder, + sal_Bool bDrawExtBorderOnly, long nCornerRadius, Color* pSelectionTextColor, Color* pPaintColor @@ -9206,8 +9232,8 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, Color aSelectionBorderCol( pPaintColor ? *pPaintColor : rStyles.GetHighlightColor() ); Color aSelectionFillCol( aSelectionBorderCol ); - BOOL bDark = rStyles.GetFaceColor().IsDark(); - BOOL bBright = ( rStyles.GetFaceColor() == Color( COL_WHITE ) ); + sal_Bool bDark = rStyles.GetFaceColor().IsDark(); + sal_Bool bBright = ( rStyles.GetFaceColor() == Color( COL_WHITE ) ); int c1 = aSelectionBorderCol.GetLuminance(); int c2 = GetDisplayBackground().GetColor().GetLuminance(); @@ -9215,7 +9241,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, if( !bDark && !bBright && abs( c2-c1 ) < (pPaintColor ? 40 : 75) ) { // constrast too low - USHORT h,s,b; + sal_uInt16 h,s,b; aSelectionFillCol.RGBtoHSB( h, s, b ); if( b > 50 ) b -= 40; else b += 40; @@ -9247,13 +9273,13 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, else SetLineColor(); - USHORT nPercent = 0; + sal_uInt16 nPercent = 0; if( !highlight ) { if( bDark ) aSelectionFillCol = COL_BLACK; else - nPercent = bRoundEdges ? 90 : 80; // just checked (light) + nPercent = 80; // just checked (light) } else { @@ -9268,7 +9294,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, nPercent = 0; } else - nPercent = bRoundEdges ? 50 : 20; // selected, pressed or checked ( very dark ) + nPercent = bRoundEdges ? 40 : 20; // selected, pressed or checked ( very dark ) } else if( bChecked || highlight == 1 ) { @@ -9281,7 +9307,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, nPercent = 0; } else - nPercent = bRoundEdges ? 70 : 35; // selected, pressed or checked ( very dark ) + nPercent = bRoundEdges ? 60 : 35; // selected, pressed or checked ( very dark ) } else { @@ -9297,7 +9323,7 @@ void Window::DrawSelectionBackground( const Rectangle& rRect, nPercent = 0; } else - nPercent = bRoundEdges ? 80 : 70; // selected ( dark ) + nPercent = 70; // selected ( dark ) } } @@ -9367,7 +9393,7 @@ Window* Window::GetPreferredKeyInputWindow() } -BOOL Window::IsScrollable() const +sal_Bool Window::IsScrollable() const { // check for scrollbars Window *pChild = mpWindowImpl->mpFirstChild; @@ -9381,24 +9407,24 @@ BOOL Window::IsScrollable() const return false; } -BOOL Window::IsTopWindow() const +sal_Bool Window::IsTopWindow() const { if ( mpWindowImpl->mbInDtor ) - return FALSE; + return sal_False; // topwindows must be frames or they must have a borderwindow which is a frame if( !mpWindowImpl->mbFrame && (!mpWindowImpl->mpBorderWindow || (mpWindowImpl->mpBorderWindow && !mpWindowImpl->mpBorderWindow->mpWindowImpl->mbFrame) ) ) - return FALSE; + return sal_False; ImplGetWinData(); - if( mpWindowImpl->mpWinData->mnIsTopWindow == (USHORT)~0) // still uninitialized + if( mpWindowImpl->mpWinData->mnIsTopWindow == (sal_uInt16)~0) // still uninitialized { // #113722#, cache result of expensive queryInterface call Window *pThisWin = (Window*)this; - Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY ); + uno::Reference< XTopWindow > xTopWindow( pThisWin->GetComponentInterface(), UNO_QUERY ); pThisWin->mpWindowImpl->mpWinData->mnIsTopWindow = xTopWindow.is() ? 1 : 0; } - return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? TRUE : FALSE; + return mpWindowImpl->mpWinData->mnIsTopWindow == 1 ? sal_True : sal_False; } void Window::ImplMirrorFramePos( Point &pt ) const @@ -9407,7 +9433,7 @@ void Window::ImplMirrorFramePos( Point &pt ) const } // frame based modal counter (dialogs are not modal to the whole application anymore) -BOOL Window::IsInModalMode() const +sal_Bool Window::IsInModalMode() const { return (mpWindowImpl->mpFrameWindow->mpWindowImpl->mpFrameData->mnModalMode != 0); } @@ -9439,16 +9465,16 @@ void Window::ImplDecModalCount() pFrameWindow = pParent ? pParent->mpWindowImpl->mpFrameWindow : NULL; } } -BOOL Window::ImplIsInTaskPaneList() +sal_Bool Window::ImplIsInTaskPaneList() { return mpWindowImpl->mbIsInTaskPaneList; } -void Window::ImplIsInTaskPaneList( BOOL mbIsInTaskList ) +void Window::ImplIsInTaskPaneList( sal_Bool mbIsInTaskList ) { mpWindowImpl->mbIsInTaskPaneList = mbIsInTaskList; } -void Window::ImplNotifyIconifiedState( BOOL bIconified ) +void Window::ImplNotifyIconifiedState( sal_Bool bIconified ) { mpWindowImpl->mpFrameWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE ); // #109206# notify client window as well to have toolkit topwindow listeners notified @@ -9456,15 +9482,15 @@ void Window::ImplNotifyIconifiedState( BOOL bIconified ) mpWindowImpl->mpFrameWindow->mpWindowImpl->mpClientWindow->ImplCallEventListeners( bIconified ? VCLEVENT_WINDOW_MINIMIZE : VCLEVENT_WINDOW_NORMALIZE ); } -BOOL Window::HasActiveChildFrame() +sal_Bool Window::HasActiveChildFrame() { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; Window *pFrameWin = ImplGetSVData()->maWinData.mpFirstFrame; while( pFrameWin ) { if( pFrameWin != mpWindowImpl->mpFrameWindow ) { - BOOL bDecorated = FALSE; + sal_Bool bDecorated = sal_False; Window *pChildFrame = pFrameWin->ImplGetWindow(); // #i15285# unfortunately WB_MOVEABLE is the same as WB_TABSTOP which can // be removed for ToolBoxes to influence the keyboard accessibility @@ -9476,9 +9502,9 @@ BOOL Window::HasActiveChildFrame() if( bDecorated || (pFrameWin->mpWindowImpl->mnStyle & (WB_MOVEABLE | WB_SIZEABLE) ) ) if( pChildFrame && pChildFrame->IsVisible() && pChildFrame->IsActive() ) { - if( ImplIsChild( pChildFrame, TRUE ) ) + if( ImplIsChild( pChildFrame, sal_True ) ) { - bRet = TRUE; + bRet = sal_True; break; } } @@ -9493,11 +9519,11 @@ LanguageType Window::GetInputLanguage() const return mpWindowImpl->mpFrame->GetInputLanguage(); } -void Window::EnableNativeWidget( BOOL bEnable ) +void Window::EnableNativeWidget( sal_Bool bEnable ) { static const char* pNoNWF = getenv( "SAL_NO_NWF" ); if( pNoNWF && *pNoNWF ) - bEnable = FALSE; + bEnable = sal_False; if( bEnable != ImplGetWinData()->mbEnableNativeWidget ) { @@ -9522,7 +9548,7 @@ void Window::EnableNativeWidget( BOOL bEnable ) } } -BOOL Window::IsNativeWidgetEnabled() const +sal_Bool Window::IsNativeWidgetEnabled() const { return ImplGetWinData()->mbEnableNativeWidget; } @@ -9531,12 +9557,12 @@ BOOL Window::IsNativeWidgetEnabled() const #include <salframe.h> #endif -Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize, +uno::Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSize, bool bFullscreen, bool bSpriteCanvas ) const { // try to retrieve hard reference from weak member - Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas ); + uno::Reference< rendering::XCanvas > xCanvas( mpWindowImpl->mxCanvas ); // canvas still valid? Then we're done. if( xCanvas.is() ) @@ -9575,21 +9601,24 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi aArg[ 2 ] = makeAny( ::com::sun::star::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ) ); aArg[ 3 ] = makeAny( mpWindowImpl->mbAlwaysOnTop ? sal_True : sal_False ); - aArg[ 4 ] = makeAny( Reference< awt::XWindow >( + aArg[ 4 ] = makeAny( uno::Reference< awt::XWindow >( const_cast<Window*>(this)->GetComponentInterface(), uno::UNO_QUERY )); - Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); + uno::Reference< XMultiServiceFactory > xFactory = vcl::unohelper::GetMultiServiceFactory(); // Create canvas instance with window handle // ========================================= if ( xFactory.is() ) { - static Reference<lang::XMultiServiceFactory> xCanvasFactory( - xFactory->createInstance( - OUString( RTL_CONSTASCII_USTRINGPARAM( - "com.sun.star." - "rendering.CanvasFactory") ) ), UNO_QUERY ); + static ::vcl::DeleteUnoReferenceOnDeinit<lang::XMultiServiceFactory> xStaticCanvasFactory( + uno::Reference<lang::XMultiServiceFactory>( + xFactory->createInstance( + OUString( RTL_CONSTASCII_USTRINGPARAM( + "com.sun.star.rendering.CanvasFactory") ) ), + UNO_QUERY )); + uno::Reference<lang::XMultiServiceFactory> xCanvasFactory(xStaticCanvasFactory.get()); + if(xCanvasFactory.is()) { #ifdef WNT @@ -9635,37 +9664,37 @@ Reference< rendering::XCanvas > Window::ImplGetCanvas( const Size& rFullscreenSi return xCanvas; } -Reference< rendering::XCanvas > Window::GetCanvas() const +uno::Reference< rendering::XCanvas > Window::GetCanvas() const { return ImplGetCanvas( Size(), false, false ); } -Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const +uno::Reference< rendering::XSpriteCanvas > Window::GetSpriteCanvas() const { - Reference< rendering::XSpriteCanvas > xSpriteCanvas( + uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas( ImplGetCanvas( Size(), false, true ), uno::UNO_QUERY ); return xSpriteCanvas; } -Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const +uno::Reference< ::com::sun::star::rendering::XSpriteCanvas > Window::GetFullscreenSpriteCanvas( const Size& rFullscreenSize ) const { - Reference< rendering::XSpriteCanvas > xSpriteCanvas( + uno::Reference< rendering::XSpriteCanvas > xSpriteCanvas( ImplGetCanvas( rFullscreenSize, true, true ), uno::UNO_QUERY ); return xSpriteCanvas; } void Window::ImplPaintToDevice( OutputDevice* i_pTargetOutDev, const Point& i_rPos ) { - BOOL bRVisible = mpWindowImpl->mbReallyVisible; + sal_Bool bRVisible = mpWindowImpl->mbReallyVisible; mpWindowImpl->mbReallyVisible = mpWindowImpl->mbVisible; - BOOL bDevOutput = mbDevOutput; - mbDevOutput = TRUE; + sal_Bool bDevOutput = mbDevOutput; + mbDevOutput = sal_True; long nOldDPIX = ImplGetDPIX(); long nOldDPIY = ImplGetDPIY(); mnDPIX = i_pTargetOutDev->ImplGetDPIX(); mnDPIY = i_pTargetOutDev->ImplGetDPIY(); - BOOL bOutput = IsOutputEnabled(); + sal_Bool bOutput = IsOutputEnabled(); EnableOutput(); DBG_ASSERT( GetMapMode().GetMapUnit() == MAP_PIXEL, "MapMode must be PIXEL based" ); @@ -9795,8 +9824,8 @@ void Window::PaintToDevice( OutputDevice* pDev, const Point& rPos, const Size& / Hide(); } - BOOL bVisible = mpWindowImpl->mbVisible; - mpWindowImpl->mbVisible = TRUE; + sal_Bool bVisible = mpWindowImpl->mbVisible; + mpWindowImpl->mbVisible = sal_True; if( mpWindowImpl->mpBorderWindow ) mpWindowImpl->mpBorderWindow->ImplPaintToDevice( pDev, rPos ); diff --git a/vcl/source/window/window2.cxx b/vcl/source/window/window2.cxx index e183e54fad83..e98d51d252c9 100644 --- a/vcl/source/window/window2.cxx +++ b/vcl/source/window/window2.cxx @@ -71,7 +71,7 @@ struct ImplFocusDelData : public ImplDelData // ======================================================================= -BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const +sal_Bool Window::ImplIsWindowInFront( const Window* pTestWindow ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); DBG_CHKOBJ( pTestWindow, Window, ImplDbgCheckWindow ); @@ -81,11 +81,11 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const const Window* pTempWindow = pTestWindow; const Window* pThisWindow = ImplGetFirstOverlapWindow(); if ( pTempWindow == pThisWindow ) - return FALSE; + return sal_False; do { if ( pTempWindow == pThisWindow ) - return TRUE; + return sal_True; if ( pTempWindow->mpWindowImpl->mbFrame ) break; pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; @@ -95,7 +95,7 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const do { if ( pTempWindow == pTestWindow ) - return FALSE; + return sal_False; if ( pTempWindow->mpWindowImpl->mbFrame ) break; pTempWindow = pTempWindow->mpWindowImpl->mpOverlapWindow; @@ -105,8 +105,8 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const // Fenster auf gleiche Ebene bringen if ( pThisWindow->mpWindowImpl->mpOverlapWindow != pTestWindow->mpWindowImpl->mpOverlapWindow ) { - USHORT nThisLevel = 0; - USHORT nTestLevel = 0; + sal_uInt16 nThisLevel = 0; + sal_uInt16 nTestLevel = 0; pTempWindow = pThisWindow; do { @@ -153,12 +153,12 @@ BOOL Window::ImplIsWindowInFront( const Window* pTestWindow ) const do { if ( pTempWindow == pThisWindow ) - return TRUE; + return sal_True; pTempWindow = pTempWindow->mpWindowImpl->mpNext; } while ( pTempWindow ); - return FALSE; + return sal_False; } // ======================================================================= @@ -169,7 +169,7 @@ void Window::ImplSaveOverlapBackground() if ( !mpWindowImpl->mbFrame ) { - ULONG nSaveBackSize = mnOutWidth*mnOutHeight; + sal_uLong nSaveBackSize = mnOutWidth*mnOutHeight; if ( nSaveBackSize <= IMPL_MAXSAVEBACKSIZE ) { if ( nSaveBackSize+mpWindowImpl->mpFrameData->mnAllSaveBackSize <= IMPL_MAXALLSAVEBACKSIZE ) @@ -204,7 +204,7 @@ void Window::ImplSaveOverlapBackground() // ----------------------------------------------------------------------- -BOOL Window::ImplRestoreOverlapBackground( Region& rInvRegion ) +sal_Bool Window::ImplRestoreOverlapBackground( Region& rInvRegion ) { if ( mpWindowImpl->mpOverlapData->mpSaveBackDev ) { @@ -234,10 +234,10 @@ BOOL Window::ImplRestoreOverlapBackground( Region& rInvRegion ) ImplDeleteOverlapBackground(); } - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -306,7 +306,7 @@ void Window::ImplInvalidateAllOverlapBackgrounds() // ======================================================================= -Bitmap Window::SnapShot( BOOL bBorder ) const +Bitmap Window::SnapShot( sal_Bool bBorder ) const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -348,7 +348,7 @@ void Window::ShowFocus( const Rectangle& rRect ) if( mpWindowImpl->mbInShowFocus ) return; - mpWindowImpl->mbInShowFocus = TRUE; + mpWindowImpl->mbInShowFocus = sal_True; ImplWinData* pWinData = ImplGetWinData(); @@ -362,7 +362,7 @@ void Window::ShowFocus( const Rectangle& rRect ) { if ( *(pWinData->mpFocusRect) == rRect ) { - mpWindowImpl->mbInShowFocus = FALSE; + mpWindowImpl->mbInShowFocus = sal_False; return; } @@ -375,18 +375,18 @@ void Window::ShowFocus( const Rectangle& rRect ) pWinData->mpFocusRect = new Rectangle( rRect ); else *(pWinData->mpFocusRect) = rRect; - mpWindowImpl->mbFocusVisible = TRUE; + mpWindowImpl->mbFocusVisible = sal_True; } else { if( ! mpWindowImpl->mbNativeFocusVisible ) { - mpWindowImpl->mbNativeFocusVisible = TRUE; + mpWindowImpl->mbNativeFocusVisible = sal_True; if ( !mpWindowImpl->mbInPaint ) Invalidate(); } } - mpWindowImpl->mbInShowFocus = FALSE; + mpWindowImpl->mbInShowFocus = sal_False; } // ----------------------------------------------------------------------- @@ -397,7 +397,7 @@ void Window::HideFocus() if( mpWindowImpl->mbInHideFocus ) return; - mpWindowImpl->mbInHideFocus = TRUE; + mpWindowImpl->mbInHideFocus = sal_True; // native themeing can suggest not to use focus rects if( ! ( mpWindowImpl->mbUseNativeFocus && @@ -405,29 +405,29 @@ void Window::HideFocus() { if ( !mpWindowImpl->mbFocusVisible ) { - mpWindowImpl->mbInHideFocus = FALSE; + mpWindowImpl->mbInHideFocus = sal_False; return; } if ( !mpWindowImpl->mbInPaint ) ImplInvertFocus( *(ImplGetWinData()->mpFocusRect) ); - mpWindowImpl->mbFocusVisible = FALSE; + mpWindowImpl->mbFocusVisible = sal_False; } else { if( mpWindowImpl->mbNativeFocusVisible ) { - mpWindowImpl->mbNativeFocusVisible = FALSE; + mpWindowImpl->mbNativeFocusVisible = sal_False; if ( !mpWindowImpl->mbInPaint ) Invalidate(); } } - mpWindowImpl->mbInHideFocus = FALSE; + mpWindowImpl->mbInHideFocus = sal_False; } // ----------------------------------------------------------------------- -void Window::Invert( const Rectangle& rRect, USHORT nFlags ) +void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -463,14 +463,14 @@ void Window::Invert( const Rectangle& rRect, USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::Invert( const Polygon& rPoly, USHORT nFlags ) +void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); if ( !IsDeviceOutputNecessary() ) return; - USHORT nPoints = rPoly.GetSize(); + sal_uInt16 nPoints = rPoly.GetSize(); if ( nPoints < 2 ) return; @@ -501,7 +501,7 @@ void Window::Invert( const Polygon& rPoly, USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::ShowTracking( const Rectangle& rRect, USHORT nFlags ) +void Window::ShowTracking( const Rectangle& rRect, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -526,7 +526,7 @@ void Window::ShowTracking( const Rectangle& rRect, USHORT nFlags ) else *(pWinData->mpTrackRect) = rRect; pWinData->mnTrackFlags = nFlags; - mpWindowImpl->mbTrackVisible = TRUE; + mpWindowImpl->mbTrackVisible = sal_True; } // ----------------------------------------------------------------------- @@ -540,13 +540,13 @@ void Window::HideTracking() ImplWinData* pWinData = ImplGetWinData(); if ( !mpWindowImpl->mbInPaint || !(pWinData->mnTrackFlags & SHOWTRACK_WINDOW) ) InvertTracking( *(pWinData->mpTrackRect), pWinData->mnTrackFlags ); - mpWindowImpl->mbTrackVisible = FALSE; + mpWindowImpl->mbTrackVisible = sal_False; } } // ----------------------------------------------------------------------- -void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags ) +void Window::InvertTracking( const Rectangle& rRect, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -587,12 +587,12 @@ void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags ) Point aPoint( mnOutOffX, mnOutOffY ); Region aRegion( Rectangle( aPoint, Size( mnOutWidth, mnOutHeight ) ) ); - ImplClipBoundaries( aRegion, FALSE, FALSE ); + ImplClipBoundaries( aRegion, sal_False, sal_False ); ImplSelectClipRegion( aRegion, pGraphics ); } } - USHORT nStyle = nFlags & SHOWTRACK_STYLE; + sal_uInt16 nStyle = nFlags & SHOWTRACK_STYLE; if ( nStyle == SHOWTRACK_OBJECT ) pGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), SAL_INVERT_TRACKFRAME, this ); else if ( nStyle == SHOWTRACK_SPLIT ) @@ -611,11 +611,11 @@ void Window::InvertTracking( const Rectangle& rRect, USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags ) +void Window::InvertTracking( const Polygon& rPoly, sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - USHORT nPoints = rPoly.GetSize(); + sal_uInt16 nPoints = rPoly.GetSize(); if ( nPoints < 2 ) return; @@ -653,7 +653,7 @@ void Window::InvertTracking( const Polygon& rPoly, USHORT nFlags ) Point aPoint( mnOutOffX, mnOutOffY ); Region aRegion( Rectangle( aPoint, Size( mnOutWidth, mnOutHeight ) ) ); - ImplClipBoundaries( aRegion, FALSE, FALSE ); + ImplClipBoundaries( aRegion, sal_False, sal_False ); ImplSelectClipRegion( aRegion, pGraphics ); } } @@ -690,7 +690,7 @@ IMPL_LINK( Window, ImplTrackTimerHdl, Timer*, pTimer ) // ----------------------------------------------------------------------- -void Window::StartTracking( USHORT nFlags ) +void Window::StartTracking( sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -721,7 +721,7 @@ void Window::StartTracking( USHORT nFlags ) // ----------------------------------------------------------------------- -void Window::EndTracking( USHORT nFlags ) +void Window::EndTracking( sal_uInt16 nFlags ) { ImplSVData* pSVData = ImplGetSVData(); @@ -764,7 +764,7 @@ void Window::EndTracking( USHORT nFlags ) // ----------------------------------------------------------------------- -BOOL Window::IsTracking() const +sal_Bool Window::IsTracking() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -773,7 +773,7 @@ BOOL Window::IsTracking() const // ----------------------------------------------------------------------- -void Window::StartAutoScroll( USHORT nFlags ) +void Window::StartAutoScroll( sal_uInt16 nFlags ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -810,7 +810,7 @@ void Window::EndAutoScroll() // ----------------------------------------------------------------------- -BOOL Window::IsAutoScroll() const +sal_Bool Window::IsAutoScroll() const { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); @@ -836,13 +836,13 @@ void Window::SaveBackground( const Point& rPos, const Size& rSize, { const Region aOldClip( rSaveDevice.GetClipRegion() ); const Point aPixOffset( rSaveDevice.LogicToPixel( rDestOff ) ); - const BOOL bMap = rSaveDevice.IsMapModeEnabled(); + const sal_Bool bMap = rSaveDevice.IsMapModeEnabled(); // move clip region to have the same distance to DestOffset aClip.Move( aPixOffset.X() - aPixPos.X(), aPixOffset.Y() - aPixPos.Y() ); // set pixel clip region - rSaveDevice.EnableMapMode( FALSE ); + rSaveDevice.EnableMapMode( sal_False ); rSaveDevice.SetClipRegion( aClip ); rSaveDevice.EnableMapMode( bMap ); rSaveDevice.DrawOutDev( rDestOff, rSize, rPos, rSize, *this ); @@ -871,13 +871,13 @@ sal_uIntPtr Window::SaveFocus() // ----------------------------------------------------------------------- -BOOL Window::EndSaveFocus( sal_uIntPtr nSaveId, BOOL bRestore ) +sal_Bool Window::EndSaveFocus( sal_uIntPtr nSaveId, sal_Bool bRestore ) { if ( !nSaveId ) - return FALSE; + return sal_False; else { - BOOL bOK = TRUE; + sal_Bool bOK = sal_True; ImplFocusDelData* pDelData = (ImplFocusDelData*)(void*)nSaveId; if ( !pDelData->IsDelete() ) { @@ -940,7 +940,7 @@ void Window::SetZoomedPointFont( const Font& rFont ) long nFontDiff = Abs( GetFont().GetSize().Height()-aMetric.GetSize().Height() ); if ( (aMetric.GetType() == TYPE_RASTER) && (nFontDiff >= 2) ) { - USHORT nType; + sal_uInt16 nType; if ( aMetric.GetPitch() == PITCH_FIXED ) nType = DEFAULTFONT_FIXED; else @@ -1033,7 +1033,7 @@ void Window::SetControlForeground() if ( mpWindowImpl->mbControlForeground ) { mpWindowImpl->maControlForeground = Color( COL_TRANSPARENT ); - mpWindowImpl->mbControlForeground = FALSE; + mpWindowImpl->mbControlForeground = sal_False; StateChanged( STATE_CHANGE_CONTROLFOREGROUND ); } } @@ -1049,7 +1049,7 @@ void Window::SetControlForeground( const Color& rColor ) if ( mpWindowImpl->mbControlForeground ) { mpWindowImpl->maControlForeground = Color( COL_TRANSPARENT ); - mpWindowImpl->mbControlForeground = FALSE; + mpWindowImpl->mbControlForeground = sal_False; StateChanged( STATE_CHANGE_CONTROLFOREGROUND ); } } @@ -1058,7 +1058,7 @@ void Window::SetControlForeground( const Color& rColor ) if ( mpWindowImpl->maControlForeground != rColor ) { mpWindowImpl->maControlForeground = rColor; - mpWindowImpl->mbControlForeground = TRUE; + mpWindowImpl->mbControlForeground = sal_True; StateChanged( STATE_CHANGE_CONTROLFOREGROUND ); } } @@ -1073,7 +1073,7 @@ void Window::SetControlBackground() if ( mpWindowImpl->mbControlBackground ) { mpWindowImpl->maControlBackground = Color( COL_TRANSPARENT ); - mpWindowImpl->mbControlBackground = FALSE; + mpWindowImpl->mbControlBackground = sal_False; StateChanged( STATE_CHANGE_CONTROLBACKGROUND ); } } @@ -1089,7 +1089,7 @@ void Window::SetControlBackground( const Color& rColor ) if ( mpWindowImpl->mbControlBackground ) { mpWindowImpl->maControlBackground = Color( COL_TRANSPARENT ); - mpWindowImpl->mbControlBackground = FALSE; + mpWindowImpl->mbControlBackground = sal_False; StateChanged( STATE_CHANGE_CONTROLBACKGROUND ); } } @@ -1098,7 +1098,7 @@ void Window::SetControlBackground( const Color& rColor ) if ( mpWindowImpl->maControlBackground != rColor ) { mpWindowImpl->maControlBackground = rColor; - mpWindowImpl->mbControlBackground = TRUE; + mpWindowImpl->mbControlBackground = sal_True; StateChanged( STATE_CHANGE_CONTROLBACKGROUND ); } } @@ -1162,12 +1162,12 @@ long Window::GetDrawPixel( OutputDevice* pDev, long nPixels ) const // ----------------------------------------------------------------------- -BOOL Window::HandleScrollCommand( const CommandEvent& rCmd, +sal_Bool Window::HandleScrollCommand( const CommandEvent& rCmd, ScrollBar* pHScrl, ScrollBar* pVScrl ) { DBG_CHKTHIS( Window, ImplDbgCheckWindow ); - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; if ( pHScrl || pVScrl ) { @@ -1175,7 +1175,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd, { case COMMAND_STARTAUTOSCROLL: { - USHORT nFlags = 0; + sal_uInt16 nFlags = 0; if ( pHScrl ) { if ( (pHScrl->GetVisibleSize() < pHScrl->GetRangeMax()) && @@ -1192,7 +1192,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd, if ( nFlags ) { StartAutoScroll( nFlags ); - bRet = TRUE; + bRet = sal_True; } } break; @@ -1203,7 +1203,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd, if ( pData && (COMMAND_WHEEL_SCROLL == pData->GetMode()) ) { - ULONG nScrollLines = pData->GetScrollLines(); + sal_uLong nScrollLines = pData->GetScrollLines(); long nLines; if ( nScrollLines == COMMAND_WHEEL_PAGESCROLL ) { @@ -1220,7 +1220,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd, 0L, pData->IsHorz() ? pHScrl : pVScrl, nLines ); - bRet = TRUE; + bRet = sal_True; } } } @@ -1233,7 +1233,7 @@ BOOL Window::HandleScrollCommand( const CommandEvent& rCmd, { ImplHandleScroll( pHScrl, pData->GetDeltaX(), pVScrl, pData->GetDeltaY() ); - bRet = TRUE; + bRet = sal_True; } } break; @@ -1303,7 +1303,7 @@ DockingManager* Window::GetDockingManager() return ImplGetDockingManager(); } -void Window::EnableDocking( BOOL bEnable ) +void Window::EnableDocking( sal_Bool bEnable ) { // update list of dockable windows if( bEnable ) @@ -1327,115 +1327,31 @@ Window* Window::ImplGetTopmostFrameWindow() return pTopmostParent->mpWindowImpl->mpFrameWindow; } -// making these Methods out of line to be able to change them lateron without complete rebuild -// TODO: Set the SmartId in here and remove mpWindowImpl->mnHelpId -void Window::SetHelpId( ULONG nHelpId ) +void Window::SetHelpId( const rtl::OString& rHelpId ) { - SetSmartHelpId(SmartId(nHelpId)); + mpWindowImpl->maHelpId = rHelpId; } -ULONG Window::GetHelpId() const +const rtl::OString& Window::GetHelpId() const { - return mpWindowImpl->mnHelpId; + return mpWindowImpl->maHelpId; } -void Window::SetSmartHelpId( const SmartId& aId, SmartIdUpdateMode aMode ) +void Window::SetUniqueId( const rtl::OString& rUniqueId ) { - // create SmartId if required - if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) ) - { - if ( !ImplGetWinData()->mpSmartHelpId ) - ImplGetWinData()->mpSmartHelpId = new SmartId(); - } - - // if we have a SmartId (eather from earlier call or just created) fill with new values - if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId ) - ImplGetWinData()->mpSmartHelpId->UpdateId( aId, aMode ); - - if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) ) - { - mpWindowImpl->mnHelpId = aId.GetNum(); - } -} - -SmartId Window::GetSmartHelpId() const -{ - if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId ) - { - if ( mpWindowImpl->mnHelpId || mpWindowImpl->mpWinData->mpSmartHelpId->HasNumeric() ) - mpWindowImpl->mpWinData->mpSmartHelpId->UpdateId( SmartId( mpWindowImpl->mnHelpId ), SMART_SET_NUM ); - return *mpWindowImpl->mpWinData->mpSmartHelpId; - } - else - { - if ( mpWindowImpl->mnHelpId ) - return SmartId( mpWindowImpl->mnHelpId ); - else - return SmartId(); - } -} - - -// making these Methods out of line to be able to change them lateron without complete rebuild -// TODO: Set the SmartId in here and remove mpWindowImpl->mnUniqId -void Window::SetUniqueId( ULONG nUniqueId ) { mpWindowImpl->mnUniqId = nUniqueId; } -ULONG Window::GetUniqueId() const { return mpWindowImpl->mnUniqId; } - - -void Window::SetSmartUniqueId( const SmartId& aId, SmartIdUpdateMode aMode ) -{ - // create SmartId if required - if ( (aMode == SMART_SET_STR) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasString() ) ) - { - if ( !ImplGetWinData()->mpSmartUniqueId ) - ImplGetWinData()->mpSmartUniqueId = new SmartId(); - } - - // if we have a SmartId (eather from earlier call or just created) fill with new values - if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId ) - ImplGetWinData()->mpSmartUniqueId->UpdateId( aId, aMode ); - - if ( (aMode == SMART_SET_NUM) || (aMode == SMART_SET_ALL) || ( (aMode == SMART_SET_SMART) && aId.HasNumeric() ) ) - mpWindowImpl->mnUniqId = aId.GetNum(); + mpWindowImpl->maUniqId = rUniqueId; } -SmartId Window::GetSmartUniqueId() const +const rtl::OString& Window::GetUniqueId() const { - if ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId ) - { - if ( mpWindowImpl->mnUniqId || mpWindowImpl->mpWinData->mpSmartUniqueId->HasNumeric() ) - mpWindowImpl->mpWinData->mpSmartUniqueId->UpdateId( SmartId( mpWindowImpl->mnUniqId ), SMART_SET_NUM ); - return *mpWindowImpl->mpWinData->mpSmartUniqueId; - } - else - { - if ( mpWindowImpl->mnUniqId ) - return SmartId( mpWindowImpl->mnUniqId ); - else - return SmartId(); - } + return mpWindowImpl->maUniqId; } -SmartId Window::GetSmartUniqueOrHelpId() const +const rtl::OString& Window::GetUniqueOrHelpId() const { - if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartHelpId ) || mpWindowImpl->mnHelpId ) - { - if ( ( mpWindowImpl->mpWinData && mpWindowImpl->mpWinData->mpSmartUniqueId ) || mpWindowImpl->mnUniqId ) - { - SmartId aTemp = GetSmartHelpId(); - aTemp.UpdateId( GetSmartUniqueId() ); - return aTemp; - } - else - return GetSmartHelpId(); - } - else - return GetSmartUniqueId(); + return mpWindowImpl->maUniqId.getLength() ? mpWindowImpl->maUniqId : mpWindowImpl->maHelpId; } - - - // --------- old inline methods --------------- Window* Window::ImplGetWindow() @@ -1492,47 +1408,47 @@ Window* Window::ImplGetFrameWindow() const return mpWindowImpl->mpFrameWindow; } -BOOL Window::ImplIsDockingWindow() const +sal_Bool Window::ImplIsDockingWindow() const { return mpWindowImpl->mbDockWin; } -BOOL Window::ImplIsFloatingWindow() const +sal_Bool Window::ImplIsFloatingWindow() const { return mpWindowImpl->mbFloatWin; } -BOOL Window::ImplIsToolbox() const +sal_Bool Window::ImplIsToolbox() const { return mpWindowImpl->mbToolBox; } -BOOL Window::ImplIsSplitter() const +sal_Bool Window::ImplIsSplitter() const { return mpWindowImpl->mbSplitter; } -BOOL Window::ImplIsPushButton() const +sal_Bool Window::ImplIsPushButton() const { return mpWindowImpl->mbPushButton; } -BOOL Window::ImplIsOverlapWindow() const +sal_Bool Window::ImplIsOverlapWindow() const { return mpWindowImpl->mbOverlapWin; } -void Window::ImplSetActive( BOOL bActive ) +void Window::ImplSetActive( sal_Bool bActive ) { mpWindowImpl->mbActive = bActive; } -BOOL Window::ImplIsMouseTransparent() const +sal_Bool Window::ImplIsMouseTransparent() const { return mpWindowImpl->mbMouseTransparent; } -void Window::ImplSetMouseTransparent( BOOL bTransparent ) +void Window::ImplSetMouseTransparent( sal_Bool bTransparent ) { mpWindowImpl->mbMouseTransparent = bTransparent; } @@ -1563,7 +1479,7 @@ void Window::ImplFrameToOutput( Rectangle& rRect ) rRect.Bottom()-=mnOutOffY; } -void Window::SetCompoundControl( BOOL bCompound ) +void Window::SetCompoundControl( sal_Bool bCompound ) { mpWindowImpl->mbCompoundControl = bCompound; } @@ -1607,77 +1523,77 @@ WindowType Window::GetType() const { return mpWindowImpl->mnType; } -BOOL Window::IsSystemWindow() const +sal_Bool Window::IsSystemWindow() const { return mpWindowImpl->mbSysWin; } -BOOL Window::IsDialog() const +sal_Bool Window::IsDialog() const { return mpWindowImpl->mbDialog; } -BOOL Window::IsMenuFloatingWindow() const +sal_Bool Window::IsMenuFloatingWindow() const { return mpWindowImpl->mbMenuFloatingWindow; } -BOOL Window::IsToolbarFloatingWindow() const +sal_Bool Window::IsToolbarFloatingWindow() const { return mpWindowImpl->mbToolbarFloatingWindow; } -void Window::EnableAllResize( BOOL bEnable ) +void Window::EnableAllResize( sal_Bool bEnable ) { mpWindowImpl->mbAllResize = bEnable; } -BOOL Window::IsAllResizeEnabled() const +sal_Bool Window::IsAllResizeEnabled() const { return mpWindowImpl->mbAllResize; } -BOOL Window::IsClipSiblingsEnabled() const +sal_Bool Window::IsClipSiblingsEnabled() const { return mpWindowImpl->mbClipSiblings; } -void Window::EnableChildTransparentMode( BOOL bEnable ) +void Window::EnableChildTransparentMode( sal_Bool bEnable ) { mpWindowImpl->mbChildTransparent = bEnable; } -BOOL Window::IsChildTransparentModeEnabled() const +sal_Bool Window::IsChildTransparentModeEnabled() const { return mpWindowImpl->mbChildTransparent; } -BOOL Window::IsMouseTransparent() const +sal_Bool Window::IsMouseTransparent() const { return mpWindowImpl->mbMouseTransparent; } -BOOL Window::IsPaintTransparent() const +sal_Bool Window::IsPaintTransparent() const { return mpWindowImpl->mbPaintTransparent; } -void Window::SetDialogControlStart( BOOL bStart ) +void Window::SetDialogControlStart( sal_Bool bStart ) { mpWindowImpl->mbDlgCtrlStart = bStart; } -BOOL Window::IsDialogControlStart() const +sal_Bool Window::IsDialogControlStart() const { return mpWindowImpl->mbDlgCtrlStart; } -void Window::SetDialogControlFlags( USHORT nFlags ) +void Window::SetDialogControlFlags( sal_uInt16 nFlags ) { mpWindowImpl->mnDlgCtrlFlags = nFlags; } -USHORT Window::GetDialogControlFlags() const +sal_uInt16 Window::GetDialogControlFlags() const { return mpWindowImpl->mnDlgCtrlFlags; } @@ -1687,22 +1603,22 @@ const InputContext& Window::GetInputContext() const return mpWindowImpl->maInputContext; } -BOOL Window::IsExtTextInput() const +sal_Bool Window::IsExtTextInput() const { return mpWindowImpl->mbExtTextInput; } -void Window::EnableChildNotify( BOOL bEnable ) +void Window::EnableChildNotify( sal_Bool bEnable ) { mpWindowImpl->mbChildNotify = bEnable; } -BOOL Window::IsChildNotify() const +sal_Bool Window::IsChildNotify() const { return mpWindowImpl->mbChildNotify; } -BOOL Window::IsControlFont() const +sal_Bool Window::IsControlFont() const { return (mpWindowImpl->mpControlFont != 0); } @@ -1712,7 +1628,7 @@ Color Window::GetControlForeground() const return mpWindowImpl->maControlForeground; } -BOOL Window::IsControlForeground() const +sal_Bool Window::IsControlForeground() const { return mpWindowImpl->mbControlForeground; } @@ -1722,12 +1638,12 @@ Color Window::GetControlBackground() const return mpWindowImpl->maControlBackground; } -BOOL Window::IsControlBackground() const +sal_Bool Window::IsControlBackground() const { return mpWindowImpl->mbControlBackground; } -BOOL Window::IsInPaint() const +sal_Bool Window::IsInPaint() const { return mpWindowImpl->mbInPaint; } @@ -1737,128 +1653,128 @@ Window* Window::GetParent() const return mpWindowImpl->mpRealParent; } -BOOL Window::IsVisible() const +sal_Bool Window::IsVisible() const { return mpWindowImpl->mbVisible; } -BOOL Window::IsReallyVisible() const +sal_Bool Window::IsReallyVisible() const { return mpWindowImpl->mbReallyVisible; } -BOOL Window::IsParentPathVisible() const +sal_Bool Window::IsParentPathVisible() const { return mpWindowImpl->mbReallyVisible; } -BOOL Window::IsReallyShown() const +sal_Bool Window::IsReallyShown() const { return mpWindowImpl->mbReallyShown; } -BOOL Window::IsInInitShow() const +sal_Bool Window::IsInInitShow() const { return mpWindowImpl->mbInInitShow; } -BOOL Window::IsEnabled() const +sal_Bool Window::IsEnabled() const { return !mpWindowImpl->mbDisabled; } -BOOL Window::IsInputEnabled() const +sal_Bool Window::IsInputEnabled() const { return !mpWindowImpl->mbInputDisabled; } -BOOL Window::IsAlwaysEnableInput() const +sal_Bool Window::IsAlwaysEnableInput() const { return mpWindowImpl->meAlwaysInputMode == AlwaysInputEnabled; } -BOOL Window::IsAlwaysDisableInput() const +sal_Bool Window::IsAlwaysDisableInput() const { return mpWindowImpl->meAlwaysInputMode == AlwaysInputDisabled; } -USHORT Window::GetActivateMode() const +sal_uInt16 Window::GetActivateMode() const { return mpWindowImpl->mnActivateMode; } -BOOL Window::IsAlwaysOnTopEnabled() const +sal_Bool Window::IsAlwaysOnTopEnabled() const { return mpWindowImpl->mbAlwaysOnTop; } -BOOL Window::IsDefaultPos() const +sal_Bool Window::IsDefaultPos() const { return mpWindowImpl->mbDefPos; } -BOOL Window::IsDefaultSize() const +sal_Bool Window::IsDefaultSize() const { return mpWindowImpl->mbDefSize; } -void Window::EnablePaint( BOOL bEnable ) +void Window::EnablePaint( sal_Bool bEnable ) { mpWindowImpl->mbPaintDisabled = !bEnable; } -BOOL Window::IsPaintEnabled() const +sal_Bool Window::IsPaintEnabled() const { return !mpWindowImpl->mbPaintDisabled; } -BOOL Window::IsUpdateMode() const +sal_Bool Window::IsUpdateMode() const { return !mpWindowImpl->mbNoUpdate; } -void Window::SetParentUpdateMode( BOOL bUpdate ) +void Window::SetParentUpdateMode( sal_Bool bUpdate ) { mpWindowImpl->mbNoParentUpdate = !bUpdate; } -BOOL Window::IsParentUpdateMode() const +sal_Bool Window::IsParentUpdateMode() const { return !mpWindowImpl->mbNoParentUpdate; } -BOOL Window::IsActive() const +sal_Bool Window::IsActive() const { return mpWindowImpl->mbActive; } -USHORT Window::GetGetFocusFlags() const +sal_uInt16 Window::GetGetFocusFlags() const { return mpWindowImpl->mnGetFocusFlags; } -BOOL Window::IsCompoundControl() const +sal_Bool Window::IsCompoundControl() const { return mpWindowImpl->mbCompoundControl; } -BOOL Window::HasCompoundControlFocus() const +sal_Bool Window::HasCompoundControlFocus() const { return mpWindowImpl->mbCompoundControlHasFocus; } -BOOL Window::IsChildPointerOverwrite() const +sal_Bool Window::IsChildPointerOverwrite() const { return mpWindowImpl->mbChildPtrOverwrite; } -BOOL Window::IsPointerVisible() const +sal_Bool Window::IsPointerVisible() const { return !mpWindowImpl->mbNoPtrVisible; } -BOOL Window::IsWait() const +sal_Bool Window::IsWait() const { return (mpWindowImpl->mnWaitCount != 0); } @@ -1873,7 +1789,7 @@ const Fraction& Window::GetZoom() const return mpWindowImpl->maZoom; } -BOOL Window::IsZoom() const +sal_Bool Window::IsZoom() const { return mpWindowImpl->maZoom.GetNumerator() != mpWindowImpl->maZoom.GetDenominator(); } @@ -1881,7 +1797,7 @@ BOOL Window::IsZoom() const void Window::SetHelpText( const XubString& rHelpText ) { mpWindowImpl->maHelpText = rHelpText; - mpWindowImpl->mbHelpTextDynamic = TRUE; + mpWindowImpl->mbHelpTextDynamic = sal_True; } void Window::SetQuickHelpText( const XubString& rHelpText ) @@ -1904,12 +1820,12 @@ void* Window::GetData() const return mpWindowImpl->mpUserData; } -BOOL Window::IsCreatedWithToolkit() const +sal_Bool Window::IsCreatedWithToolkit() const { return mpWindowImpl->mbCreatedWithToolkit; } -void Window::SetCreatedWithToolkit( BOOL b ) +void Window::SetCreatedWithToolkit( sal_Bool b ) { mpWindowImpl->mbCreatedWithToolkit = b; diff --git a/vcl/source/window/window4.cxx b/vcl/source/window/window4.cxx new file mode 100644 index 000000000000..577a573c2015 --- /dev/null +++ b/vcl/source/window/window4.cxx @@ -0,0 +1,224 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_vcl.hxx" + +#include "vcl/window.hxx" +#include "vcl/window.h" +#include "vcl/svdata.hxx" +#include "vcl/arrange.hxx" + +#include "com/sun/star/beans/PropertyValue.hpp" + +#include <map> +#include <vector> + +using namespace com::sun::star; + +namespace vcl +{ + struct ExtWindowImpl + { + ExtWindowImpl() + : mbOwnedByParent( false ) + {} + ~ExtWindowImpl() + {} + + boost::shared_ptr< WindowArranger > mxLayout; + bool mbOwnedByParent; + rtl::OUString maIdentifier; + }; +} + +void Window::ImplDeleteOwnedChildren() +{ + Window* pChild = mpWindowImpl->mpFirstChild; + while ( pChild ) + { + Window* pDeleteCandidate = pChild; + pChild = pChild->mpWindowImpl->mpNext; + vcl::ExtWindowImpl* pDelImpl = pDeleteCandidate->ImplGetExtWindowImpl(); + if( pDelImpl && pDelImpl->mbOwnedByParent ) + delete pDeleteCandidate; + } +} + +void Window::ImplFreeExtWindowImpl() +{ + ImplDeleteOwnedChildren(); + if( mpWindowImpl ) + { + delete mpWindowImpl->mpExtImpl; + mpWindowImpl->mpExtImpl = NULL; + } +} + +vcl::ExtWindowImpl* Window::ImplGetExtWindowImpl() const +{ + vcl::ExtWindowImpl* pImpl = NULL; + if( mpWindowImpl ) + { + if( ! mpWindowImpl->mpExtImpl && ! mpWindowImpl->mbInDtor ) + mpWindowImpl->mpExtImpl = new vcl::ExtWindowImpl(); + pImpl = mpWindowImpl->mpExtImpl; + } + return pImpl; +} + +void Window::ImplExtResize() +{ + if( mpWindowImpl && mpWindowImpl->mpExtImpl ) + { + if( mpWindowImpl->mpExtImpl->mxLayout.get() ) + mpWindowImpl->mpExtImpl->mxLayout->setManagedArea( Rectangle( Point( 0, 0 ), GetSizePixel() ) ); + } +} + +boost::shared_ptr< vcl::WindowArranger > Window::getLayout() +{ + boost::shared_ptr< vcl::WindowArranger > xRet; + vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl(); + if( pImpl ) + { + if( ! pImpl->mxLayout.get() ) + { + pImpl->mxLayout.reset( new vcl::LabelColumn() ); + pImpl->mxLayout->setParentWindow( this ); + pImpl->mxLayout->setOuterBorder( -1 ); + } + xRet = pImpl->mxLayout; + } + + return xRet; +} + +void Window::addWindow( Window* i_pWin, bool i_bTakeOwnership ) +{ + vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl(); + if( pImpl && i_pWin ) + { + vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl(); + if( pChildImpl ) + { + i_pWin->SetParent( this ); + pChildImpl->mbOwnedByParent = i_bTakeOwnership; + } + } +} + +Window* Window::removeWindow( Window* i_pWin, Window* i_pNewParent ) +{ + Window* pRet = NULL; + if( i_pWin ) + { + vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl(); + if( pImpl ) + { + vcl::ExtWindowImpl* pChildImpl = i_pWin->ImplGetExtWindowImpl(); + if( pChildImpl ) + { + if( ! i_pNewParent ) + pChildImpl->mbOwnedByParent = false; + i_pWin->SetParent( i_pNewParent ); + pRet = i_pWin; + } + } + } + return pRet; +} + +Window* Window::findWindow( const rtl::OUString& i_rIdentifier ) const +{ + if( getIdentifier() == i_rIdentifier ) + return const_cast<Window*>(this); + + Window* pChild = mpWindowImpl->mpFirstChild; + while ( pChild ) + { + Window* pResult = pChild->findWindow( i_rIdentifier ); + if( pResult ) + return pResult; + pChild = pChild->mpWindowImpl->mpNext; + } + + return NULL; +} + +const rtl::OUString& Window::getIdentifier() const +{ + static rtl::OUString aEmptyStr; + + return (mpWindowImpl && mpWindowImpl->mpExtImpl) ? mpWindowImpl->mpExtImpl->maIdentifier : aEmptyStr; +} + +void Window::setIdentifier( const rtl::OUString& i_rIdentifier ) +{ + vcl::ExtWindowImpl* pImpl = ImplGetExtWindowImpl(); + if( pImpl ) + pImpl->maIdentifier = i_rIdentifier; +} + +void Window::setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps ) +{ + const beans::PropertyValue* pVals = i_rProps.getConstArray(); + for( sal_Int32 i = 0; i < i_rProps.getLength(); i++ ) + { + if( pVals[i].Name.equalsAscii( "Enabled" ) ) + { + sal_Bool bVal = sal_True; + if( pVals[i].Value >>= bVal ) + Enable( bVal ); + } + else if( pVals[i].Name.equalsAscii( "Visible" ) ) + { + sal_Bool bVal = sal_True; + if( pVals[i].Value >>= bVal ) + Show( bVal ); + } + else if( pVals[i].Name.equalsAscii( "Text" ) ) + { + rtl::OUString aText; + if( pVals[i].Value >>= aText ) + SetText( aText ); + } + } +} + +uno::Sequence< beans::PropertyValue > Window::getProperties() const +{ + uno::Sequence< beans::PropertyValue > aProps( 3 ); + aProps[0].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Enabled" ) ); + aProps[0].Value = uno::makeAny( sal_Bool( IsEnabled() ) ); + aProps[1].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Visible" ) ); + aProps[1].Value = uno::makeAny( sal_Bool( IsVisible() ) ); + aProps[2].Name = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Text" ) ); + aProps[2].Value = uno::makeAny( rtl::OUString( GetText() ) ); + + return aProps; +} + diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx index a7d09cb6dd20..2892bcb00c38 100644 --- a/vcl/source/window/winproc.cxx +++ b/vcl/source/window/winproc.cxx @@ -38,7 +38,6 @@ #include <unotools/localedatawrapper.hxx> #include <vcl/svdata.hxx> #include <vcl/dbggui.hxx> -#include <vcl/windata.hxx> #include <vcl/timer.hxx> #include <vcl/event.hxx> #include <vcl/sound.hxx> @@ -129,9 +128,9 @@ long ImplCallEvent( NotifyEvent& rEvt ) // ======================================================================= -static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos, - USHORT nCode, USHORT nSVEvent, - BOOL bMouseLeave ) +static sal_Bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos, + sal_uInt16 nCode, sal_uInt16 nSVEvent, + sal_Bool bMouseLeave ) { ImplSVData* pSVData = ImplGetSVData(); @@ -142,21 +141,21 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos, * #93895# since floats are system windows, coordinates have * to be converted to float relative for the hittest */ - USHORT nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE; + sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE; FloatingWindow* pFloat = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, nHitTest ); FloatingWindow* pLastLevelFloat; - ULONG nPopupFlags; + sal_uLong nPopupFlags; if ( nSVEvent == EVENT_MOUSEMOVE ) { if ( bMouseLeave ) - return TRUE; + return sal_True; if ( !pFloat || (nHitTest & IMPL_FLOATWIN_HITTEST_RECT) ) { if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp ) ImplDestroyHelpWindow( true ); pChild->ImplGetFrame()->SetPointer( POINTER_ARROW ); - return TRUE; + return sal_True; } } else @@ -172,15 +171,15 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos, pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); // Erstmal ausgebaut als Hack fuer Bug 53378 // if ( nPopupFlags & FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK ) -// return FALSE; +// return sal_False; // else - return TRUE; + return sal_True; } else if ( nHitTest & IMPL_FLOATWIN_HITTEST_RECT ) { if ( !(pFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE) ) pFloat->ImplSetMouseDown(); - return TRUE; + return sal_True; } } else @@ -191,7 +190,7 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos, { if ( pFloat->ImplIsMouseDown() ) pFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL ); - return TRUE; + return sal_True; } } else @@ -201,7 +200,7 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos, if ( !(nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) ) { pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); - return TRUE; + return sal_True; } } } @@ -216,21 +215,21 @@ static BOOL ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos, { if ( (nPopupFlags & FLOATWIN_POPUPMODE_NOMOUSEUPCLOSE) && (nSVEvent == EVENT_MOUSEBUTTONUP) ) - return TRUE; + return sal_True; pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); if ( nPopupFlags & FLOATWIN_POPUPMODE_PATHMOUSECANCELCLICK ) - return FALSE; + return sal_False; else - return TRUE; + return sal_True; } else - return TRUE; + return sal_True; } } } } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -242,7 +241,7 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos ) !( pSVData->maHelpData.mpHelpWin->IsWindowOrChild( pChild ) || pChild->IsWindowOrChild( pSVData->maHelpData.mpHelpWin ) ) ) { - USHORT nHelpMode = 0; + sal_uInt16 nHelpMode = 0; if ( pSVData->maHelpData.mbQuickHelp ) nHelpMode = HELPMODE_QUICK; if ( pSVData->maHelpData.mbBalloonHelp ) @@ -252,9 +251,9 @@ static void ImplHandleMouseHelpRequest( Window* pChild, const Point& rMousePos ) if ( pChild->IsInputEnabled() && ! pChild->IsInModalMode() ) { HelpEvent aHelpEvent( rMousePos, nHelpMode ); - pSVData->maHelpData.mbRequestingHelp = TRUE; + pSVData->maHelpData.mbRequestingHelp = sal_True; pChild->RequestHelp( aHelpEvent ); - pSVData->maHelpData.mbRequestingHelp = FALSE; + pSVData->maHelpData.mbRequestingHelp = sal_False; } // #104172# do not kill keyboard activated tooltips else if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp) @@ -278,8 +277,8 @@ static void ImplSetMousePointer( Window* pChild ) // ----------------------------------------------------------------------- -static BOOL ImplCallCommand( Window* pChild, USHORT nEvt, void* pData = NULL, - BOOL bMouse = FALSE, Point* pPos = NULL ) +static sal_Bool ImplCallCommand( Window* pChild, sal_uInt16 nEvt, void* pData = NULL, + sal_Bool bMouse = sal_False, Point* pPos = NULL ) { Point aPos; if ( pPos ) @@ -299,24 +298,24 @@ static BOOL ImplCallCommand( Window* pChild, USHORT nEvt, void* pData = NULL, CommandEvent aCEvt( aPos, nEvt, bMouse, pData ); NotifyEvent aNCmdEvt( EVENT_COMMAND, pChild, &aCEvt ); ImplDelData aDelData( pChild ); - BOOL bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0); + sal_Bool bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0); if ( aDelData.IsDelete() ) - return FALSE; + return sal_False; if ( !bPreNotify ) { - pChild->ImplGetWindowImpl()->mbCommand = FALSE; + pChild->ImplGetWindowImpl()->mbCommand = sal_False; pChild->Command( aCEvt ); if( aDelData.IsDelete() ) - return FALSE; + return sal_False; pChild->ImplNotifyKeyMouseCommandEventListeners( aNCmdEvt ); if ( aDelData.IsDelete() ) - return FALSE; + return sal_False; if ( pChild->ImplGetWindowImpl()->mbCommand ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -339,24 +338,24 @@ static long ContextMenuEventLink( void* pCEvent, void* ) if( ! pEv->aDelData.IsDelete() ) { pEv->pWindow->ImplRemoveDel( &pEv->aDelData ); - ImplCallCommand( pEv->pWindow, COMMAND_CONTEXTMENU, NULL, TRUE, &pEv->aChildPos ); + ImplCallCommand( pEv->pWindow, COMMAND_CONTEXTMENU, NULL, sal_True, &pEv->aChildPos ); } delete pEv; return 0; } -long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, - long nX, long nY, ULONG nMsgTime, - USHORT nCode, USHORT nMode ) +long ImplHandleMouseEvent( Window* pWindow, sal_uInt16 nSVEvent, sal_Bool bMouseLeave, + long nX, long nY, sal_uLong nMsgTime, + sal_uInt16 nCode, sal_uInt16 nMode ) { ImplSVData* pSVData = ImplGetSVData(); Point aMousePos( nX, nY ); Window* pChild; long nRet; - USHORT nClicks; + sal_uInt16 nClicks; ImplFrameData* pWinFrameData = pWindow->ImplGetFrameData(); - USHORT nOldCode = pWinFrameData->mnMouseCode; + sal_uInt16 nOldCode = pWinFrameData->mnMouseCode; // we need a mousemove event, befor we get a mousebuttondown or a // mousebuttonup event @@ -379,7 +378,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, if ( (pWinFrameData->mnLastMouseX != nX) || (pWinFrameData->mnLastMouseY != nY) ) { - ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, FALSE, nX, nY, nMsgTime, nCode, nMode ); + ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False, nX, nY, nMsgTime, nCode, nMode ); } } @@ -392,7 +391,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, pWinFrameData->mnMouseMode = nMode & ~(MOUSE_SYNTHETIC | MOUSE_MODIFIERCHANGED); if ( bMouseLeave ) { - pWinFrameData->mbMouseIn = FALSE; + pWinFrameData->mbMouseIn = sal_False; if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp ) { ImplDelData aDelData( pWindow ); @@ -404,7 +403,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, } } else - pWinFrameData->mbMouseIn = TRUE; + pWinFrameData->mbMouseIn = sal_True; DBG_ASSERT( !pSVData->maWinData.mpTrackWin || (pSVData->maWinData.mpTrackWin == pSVData->maWinData.mpCaptureWin), @@ -557,7 +556,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, !(((nMouseY-nDragH) <= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY) && ((nMouseY+nDragH) >= pMouseDownWin->ImplGetFrameData()->mnFirstMouseY)) ) { - pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = TRUE; + pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = sal_True; // Check if drag source provides it's own recognizer if( pMouseDownWin->ImplGetFrameData()->mbInternalDragGestureRecognizer ) @@ -588,7 +587,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, nClicks, sal_False ); - ULONG nCount = Application::ReleaseSolarMutex(); + sal_uLong nCount = Application::ReleaseSolarMutex(); // FIXME: where do I get Action from ? ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::dnd::XDragSource > xDragSource = pMouseDownWin->GetDragSource(); @@ -606,7 +605,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, } } else - pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = TRUE; + pMouseDownWin->ImplGetFrameData()->mbStartDragCalled = sal_True; } // test for mouseleave and mouseenter @@ -620,8 +619,8 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, NotifyEvent aNLeaveEvt( EVENT_MOUSEMOVE, pMouseMoveWin, &aMLeaveEvt ); ImplDelData aDelData; ImplDelData aDelData2; - pWinFrameData->mbInMouseMove = TRUE; - pMouseMoveWin->ImplGetWinData()->mbMouseOver = FALSE; + pWinFrameData->mbInMouseMove = sal_True; + pMouseMoveWin->ImplGetWinData()->mbMouseOver = sal_False; pMouseMoveWin->ImplAddDel( &aDelData ); // Durch MouseLeave kann auch dieses Fenster zerstoert // werden @@ -636,7 +635,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, } pWinFrameData->mpMouseMoveWin = NULL; - pWinFrameData->mbInMouseMove = FALSE; + pWinFrameData->mbInMouseMove = sal_False; if ( pChild ) { @@ -654,7 +653,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, } pWinFrameData->mpMouseMoveWin = pChild; if( pChild ) - pChild->ImplGetWinData()->mbMouseOver = TRUE; + pChild->ImplGetWinData()->mbMouseOver = sal_True; // MouseLeave if ( !pChild ) @@ -666,7 +665,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, if ( nSVEvent == EVENT_MOUSEBUTTONDOWN ) { const MouseSettings& rMSettings = pChild->GetSettings().GetMouseSettings(); - ULONG nDblClkTime = rMSettings.GetDoubleClickTime(); + sal_uLong nDblClkTime = rMSettings.GetDoubleClickTime(); long nDblClkW = rMSettings.GetDoubleClickWidth(); long nDblClkH = rMSettings.GetDoubleClickHeight(); //long nMouseX = nX; @@ -683,7 +682,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, ((nMouseY+nDblClkH) >= pChild->ImplGetFrameData()->mnFirstMouseY) ) { pChild->ImplGetFrameData()->mnClickCount++; - pChild->ImplGetFrameData()->mbStartDragCalled = TRUE; + pChild->ImplGetFrameData()->mbStartDragCalled = sal_True; } else { @@ -722,7 +721,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, if ( !aDelData.IsDelete() ) { pChild->ImplRemoveDel( &aDelData ); - pChild->ImplGetFrameData()->mbStartDragCalled = TRUE; + pChild->ImplGetFrameData()->mbStartDragCalled = sal_True; } return 1; } @@ -731,15 +730,15 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, } // call handler - BOOL bDrag = FALSE; - BOOL bCallHelpRequest = TRUE; + sal_Bool bDrag = sal_False; + sal_Bool bCallHelpRequest = sal_True; DBG_ASSERT( pChild, "ImplHandleMouseEvent: pChild is NULL" ); ImplDelData aDelData; NotifyEvent aNEvt( nSVEvent, pChild, &aMEvt ); pChild->ImplAddDel( &aDelData ); if ( nSVEvent == EVENT_MOUSEMOVE ) - pChild->ImplGetFrameData()->mbInMouseMove = TRUE; + pChild->ImplGetFrameData()->mbInMouseMove = sal_True; // bring window into foreground on mouseclick if ( nSVEvent == EVENT_MOUSEBUTTONDOWN ) @@ -769,7 +768,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, (pSVData->maWinData.mnTrackFlags & STARTTRACK_SCROLLREPEAT) ) pSVData->maWinData.mpTrackTimer->Start(); } - bCallHelpRequest = FALSE; + bCallHelpRequest = sal_False; nRet = 1; } else @@ -780,16 +779,16 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, pChild->ToTop( TOTOP_NOGRABFOCUS ); if( aDelData.IsDelete() ) - bCallHelpRequest = FALSE; + bCallHelpRequest = sal_False; else { // if the MouseMove handler changes the help window's visibility // the HelpRequest handler should not be called anymore Window* pOldHelpTextWin = pSVData->maHelpData.mpHelpWin; - pChild->ImplGetWindowImpl()->mbMouseMove = FALSE; + pChild->ImplGetWindowImpl()->mbMouseMove = sal_False; pChild->MouseMove( aMEvt ); if ( pOldHelpTextWin != pSVData->maHelpData.mpHelpWin ) - bCallHelpRequest = FALSE; + bCallHelpRequest = sal_False; } } } @@ -800,7 +799,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, nRet = 1; else { - pChild->ImplGetWindowImpl()->mbMouseButtonDown = FALSE; + pChild->ImplGetWindowImpl()->mbMouseButtonDown = sal_False; pChild->MouseButtonDown( aMEvt ); } } @@ -813,7 +812,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, } else { - pChild->ImplGetWindowImpl()->mbMouseButtonUp = FALSE; + pChild->ImplGetWindowImpl()->mbMouseButtonUp = sal_False; pChild->MouseButtonUp( aMEvt ); } } @@ -828,7 +827,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, if ( nSVEvent == EVENT_MOUSEMOVE ) - pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = FALSE; + pChild->ImplGetWindowImpl()->mpFrameData->mbInMouseMove = sal_False; if ( nSVEvent == EVENT_MOUSEMOVE ) { @@ -866,11 +865,11 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, if ( /*(nRet == 0) &&*/ (nClicks == 1) && (nSVEvent == EVENT_MOUSEBUTTONDOWN) && (nCode == MOUSE_MIDDLE) ) { - USHORT nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction(); + sal_uInt16 nMiddleAction = pChild->GetSettings().GetMouseSettings().GetMiddleButtonAction(); if ( nMiddleAction == MOUSE_MIDDLE_AUTOSCROLL ) - nRet = !ImplCallCommand( pChild, COMMAND_STARTAUTOSCROLL, NULL, TRUE, &aChildPos ); + nRet = !ImplCallCommand( pChild, COMMAND_STARTAUTOSCROLL, NULL, sal_True, &aChildPos ); else if ( nMiddleAction == MOUSE_MIDDLE_PASTESELECTION ) - nRet = !ImplCallCommand( pChild, COMMAND_PASTESELECTION, NULL, TRUE, &aChildPos ); + nRet = !ImplCallCommand( pChild, COMMAND_PASTESELECTION, NULL, sal_True, &aChildPos ); } else { @@ -879,7 +878,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, if ( (nCode == rMSettings.GetContextMenuCode()) && (nClicks == rMSettings.GetContextMenuClicks()) ) { - BOOL bContextMenu; + sal_Bool bContextMenu; if ( rMSettings.GetContextMenuDown() ) bContextMenu = (nSVEvent == EVENT_MOUSEBUTTONDOWN); else @@ -903,7 +902,7 @@ long ImplHandleMouseEvent( Window* pWindow, USHORT nSVEvent, BOOL bMouseLeave, Application::PostUserEvent( Link( pEv, ContextMenuEventLink ) ); } else - nRet = ! ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, TRUE, &aChildPos ); + nRet = ! ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, sal_True, &aChildPos ); } } } @@ -958,20 +957,20 @@ static Window* ImplGetKeyInputWindow( Window* pWindow ) // ----------------------------------------------------------------------- -static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, - USHORT nKeyCode, USHORT nCharCode, USHORT nRepeat, BOOL bForward ) +static long ImplHandleKey( Window* pWindow, sal_uInt16 nSVEvent, + sal_uInt16 nKeyCode, sal_uInt16 nCharCode, sal_uInt16 nRepeat, sal_Bool bForward ) { ImplSVData* pSVData = ImplGetSVData(); KeyCode aKeyCode( nKeyCode, nKeyCode ); - USHORT nEvCode = aKeyCode.GetCode(); + sal_uInt16 nEvCode = aKeyCode.GetCode(); // allow application key listeners to remove the key event - // but make sure we're not forwarding external KeyEvents, (ie where bForward is FALSE) + // but make sure we're not forwarding external KeyEvents, (ie where bForward is sal_False) // becasue those are coming back from the listener itself and MUST be processed KeyEvent aKeyEvent( (xub_Unicode)nCharCode, aKeyCode, nRepeat ); if( bForward ) { - USHORT nVCLEvent; + sal_uInt16 nVCLEvent; switch( nSVEvent ) { case EVENT_KEYINPUT: @@ -994,11 +993,11 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, if( Application::GetSettings().GetMiscSettings().GetEnableLocalizedDecimalSep() ) { String aSep( pWindow->GetSettings().GetLocaleDataWrapper().getNumDecimalSep() ); - nCharCode = (USHORT) aSep.GetChar(0); + nCharCode = (sal_uInt16) aSep.GetChar(0); } } - BOOL bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1(); + sal_Bool bCtrlF6 = (aKeyCode.GetCode() == KEY_F6) && aKeyCode.IsMod1(); // determine last input time pSVData->maAppData.mnLastInputTime = Time::GetSystemTicks(); @@ -1034,7 +1033,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, if ( pSVData->maWinData.mpTrackWin ) { - USHORT nOrigCode = aKeyCode.GetCode(); + sal_uInt16 nOrigCode = aKeyCode.GetCode(); if ( (nOrigCode == KEY_ESCAPE) && !(pSVData->maWinData.mnTrackFlags & STARTTRACK_NOKEYCANCEL) ) { @@ -1044,7 +1043,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat(); if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) ) { - USHORT nEscCode = aKeyCode.GetCode(); + sal_uInt16 nEscCode = aKeyCode.GetCode(); if ( nEscCode == KEY_ESCAPE ) pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); @@ -1067,7 +1066,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat(); if ( !(pLastLevelFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOKEYCLOSE) ) { - USHORT nCode = aKeyCode.GetCode(); + sal_uInt16 nCode = aKeyCode.GetCode(); if ( (nCode == KEY_ESCAPE) || bCtrlF6) { @@ -1102,19 +1101,19 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, KeyEvent aKeyEvt( (xub_Unicode)nCharCode, aKeyCode, nRepeat ); NotifyEvent aNotifyEvt( nSVEvent, pChild, &aKeyEvt ); - BOOL bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0); + sal_Bool bKeyPreNotify = (ImplCallPreNotify( aNotifyEvt ) != 0); long nRet = 1; if ( !bKeyPreNotify && !aDelData.IsDelete() ) { if ( nSVEvent == EVENT_KEYINPUT ) { - pChild->ImplGetWindowImpl()->mbKeyInput = FALSE; + pChild->ImplGetWindowImpl()->mbKeyInput = sal_False; pChild->KeyInput( aKeyEvt ); } else { - pChild->ImplGetWindowImpl()->mbKeyUp = FALSE; + pChild->ImplGetWindowImpl()->mbKeyUp = sal_False; pChild->KeyUp( aKeyEvt ); } // #82968# @@ -1131,10 +1130,10 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, { if ( !bKeyPreNotify && pChild->ImplGetWindowImpl()->mbKeyInput ) { - USHORT nCode = aKeyCode.GetCode(); + sal_uInt16 nCode = aKeyCode.GetCode(); // #101999# is focus in or below toolbox - BOOL bToolboxFocus=FALSE; + sal_Bool bToolboxFocus=sal_False; if( (nCode == KEY_F1) && aKeyCode.IsShift() ) { Window *pWin = pWindow->ImplGetWindowImpl()->mpFrameData->mpFocusWin; @@ -1142,7 +1141,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, { if( pWin->ImplGetWindowImpl()->mbToolBox ) { - bToolboxFocus = TRUE; + bToolboxFocus = sal_True; break; } else @@ -1152,7 +1151,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, // ContextMenu if ( (nCode == KEY_CONTEXTMENU) || ((nCode == KEY_F10) && aKeyCode.IsShift() && !aKeyCode.IsMod1() && !aKeyCode.IsMod2() ) ) - nRet = !ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, FALSE ); + nRet = !ImplCallCommand( pChild, COMMAND_CONTEXTMENU, NULL, sal_False ); else if ( ( (nCode == KEY_F2) && aKeyCode.IsShift() ) || ( (nCode == KEY_F1) && aKeyCode.IsMod1() ) || // #101999# no active help when focus in toolbox, simulate BallonHelp instead ( (nCode == KEY_F1) && aKeyCode.IsShift() && bToolboxFocus ) ) @@ -1165,10 +1164,10 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, aPos = pChild->OutputToScreenPixel( aPos ); HelpEvent aHelpEvent( aPos, HELPMODE_BALLOON ); - aHelpEvent.SetKeyboardActivated( TRUE ); - pSVData->maHelpData.mbSetKeyboardHelp = TRUE; + aHelpEvent.SetKeyboardActivated( sal_True ); + pSVData->maHelpData.mbSetKeyboardHelp = sal_True; pChild->RequestHelp( aHelpEvent ); - pSVData->maHelpData.mbSetKeyboardHelp = FALSE; + pSVData->maHelpData.mbSetKeyboardHelp = sal_False; } else if ( (nCode == KEY_F1) || (nCode == KEY_HELP) ) { @@ -1215,7 +1214,7 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, ImplDelData aChildDelData( pChild ); KeyEvent aKEvt( (xub_Unicode)nCharCode, aKeyCode, nRepeat ); NotifyEvent aNEvt( nSVEvent, pChild, &aKEvt ); - BOOL bPreNotify = (ImplCallPreNotify( aNEvt ) != 0); + sal_Bool bPreNotify = (ImplCallPreNotify( aNEvt ) != 0); if ( aChildDelData.IsDelete() ) return 1; @@ -1223,12 +1222,12 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, { if ( nSVEvent == EVENT_KEYINPUT ) { - pChild->ImplGetWindowImpl()->mbKeyInput = FALSE; + pChild->ImplGetWindowImpl()->mbKeyInput = sal_False; pChild->KeyInput( aKEvt ); } else { - pChild->ImplGetWindowImpl()->mbKeyUp = FALSE; + pChild->ImplGetWindowImpl()->mbKeyUp = sal_False; pChild->KeyUp( aKEvt ); } // #82968# @@ -1249,8 +1248,8 @@ static long ImplHandleKey( Window* pWindow, USHORT nSVEvent, static long ImplHandleExtTextInput( Window* pWindow, const XubString& rText, - const USHORT* pTextAttr, - ULONG nCursorPos, USHORT nCursorFlags ) + const sal_uInt16* pTextAttr, + sal_uLong nCursorPos, sal_uInt16 nCursorFlags ) { ImplSVData* pSVData = ImplGetSVData(); Window* pChild = NULL; @@ -1275,7 +1274,7 @@ static long ImplHandleExtTextInput( Window* pWindow, ImplWinData* pWinData = pChild->ImplGetWinData(); if ( !pChild->ImplGetWindowImpl()->mbExtTextInput ) { - pChild->ImplGetWindowImpl()->mbExtTextInput = TRUE; + pChild->ImplGetWindowImpl()->mbExtTextInput = sal_True; if ( !pWinData->mpExtOldText ) pWinData->mpExtOldText = new UniString; else @@ -1294,7 +1293,7 @@ static long ImplHandleExtTextInput( Window* pWindow, return 0; // Test for changes - BOOL bOnlyCursor = FALSE; + sal_Bool bOnlyCursor = sal_False; xub_StrLen nMinLen = Min( pWinData->mpExtOldText->Len(), rText.Len() ); xub_StrLen nDeltaStart = 0; while ( nDeltaStart < nMinLen ) @@ -1323,7 +1322,7 @@ static long ImplHandleExtTextInput( Window* pWindow, } if ( (nDeltaStart >= nMinLen) && (pWinData->mpExtOldText->Len() == rText.Len()) ) - bOnlyCursor = TRUE; + bOnlyCursor = sal_True; // Call Event and store the information CommandExtTextInputData aData( rText, pTextAttr, @@ -1338,8 +1337,8 @@ static long ImplHandleExtTextInput( Window* pWindow, } if ( pTextAttr ) { - pWinData->mpExtOldAttrAry = new USHORT[rText.Len()]; - memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( USHORT ) ); + pWinData->mpExtOldAttrAry = new sal_uInt16[rText.Len()]; + memcpy( pWinData->mpExtOldAttrAry, pTextAttr, rText.Len()*sizeof( sal_uInt16 ) ); } return !ImplCallCommand( pChild, COMMAND_EXTTEXTINPUT, &aData ); } @@ -1354,7 +1353,7 @@ static long ImplHandleEndExtTextInput( Window* /* pWindow */ ) if ( pChild ) { - pChild->ImplGetWindowImpl()->mbExtTextInput = FALSE; + pChild->ImplGetWindowImpl()->mbExtTextInput = sal_False; pSVData->maWinData.mpExtTextInputWin = NULL; ImplWinData* pWinData = pChild->ImplGetWinData(); if ( pWinData->mpExtOldText ) @@ -1431,26 +1430,26 @@ static long ImplHandleInputContextChange( Window* pWindow, LanguageType eNewLang // ----------------------------------------------------------------------- -static BOOL ImplCallWheelCommand( Window* pWindow, const Point& rPos, +static sal_Bool ImplCallWheelCommand( Window* pWindow, const Point& rPos, const CommandWheelData* pWheelData ) { Point aCmdMousePos = pWindow->ImplFrameToOutput( rPos ); - CommandEvent aCEvt( aCmdMousePos, COMMAND_WHEEL, TRUE, pWheelData ); + CommandEvent aCEvt( aCmdMousePos, COMMAND_WHEEL, sal_True, pWheelData ); NotifyEvent aNCmdEvt( EVENT_COMMAND, pWindow, &aCEvt ); ImplDelData aDelData( pWindow ); - BOOL bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0); + sal_Bool bPreNotify = (ImplCallPreNotify( aNCmdEvt ) != 0); if ( aDelData.IsDelete() ) - return FALSE; + return sal_False; if ( !bPreNotify ) { - pWindow->ImplGetWindowImpl()->mbCommand = FALSE; + pWindow->ImplGetWindowImpl()->mbCommand = sal_False; pWindow->Command( aCEvt ); if ( aDelData.IsDelete() ) - return FALSE; + return sal_False; if ( pWindow->ImplGetWindowImpl()->mbCommand ) - return TRUE; + return sal_True; } - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- @@ -1467,8 +1466,8 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv if( aDogTag.IsDelete() ) return 0; - USHORT nMode; - USHORT nCode = rEvt.mnCode; + sal_uInt16 nMode; + sal_uInt16 nCode = rEvt.mnCode; bool bHorz = rEvt.mbHorz; bool bPixel = rEvt.mbDeltaIsPixel; if ( nCode & KEY_MOD1 ) @@ -1485,7 +1484,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv CommandWheelData aWheelData( rEvt.mnDelta, rEvt.mnNotchDelta, rEvt.mnScrollLines, nMode, nCode, bHorz, bPixel ); Point aMousePos( rEvt.mnX, rEvt.mnY ); - BOOL bRet = TRUE; + sal_Bool bRet = sal_True; // first check any floating window ( eg. drop down listboxes) bool bIsFloat = false; @@ -1493,7 +1492,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv if ( pSVData->maWinData.mpFirstFloat && !pSVData->maWinData.mpCaptureWin && !pSVData->maWinData.mpFirstFloat->ImplIsFloatPopupModeWindow( pWindow ) ) { - USHORT nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE; + sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE; pMouseWindow = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pWindow, aMousePos, nHitTest ); } // then try the window directly beneath the mouse @@ -1547,7 +1546,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv FloatingWindow* pLastLevelFloat = pSVData->maWinData.mpFirstFloat->ImplFindLastLevelFloat(); if( pLastLevelFloat ) { - ULONG nPopupFlags = pLastLevelFloat->GetPopupModeFlags(); + sal_uLong nPopupFlags = pLastLevelFloat->GetPopupModeFlags(); if ( nPopupFlags & FLOATWIN_POPUPMODE_ALLMOUSEBUTTONCLOSE ) { pLastLevelFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); @@ -1559,7 +1558,7 @@ static long ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv } // ----------------------------------------------------------------------- -#define IMPL_PAINT_CHECKRTL ((USHORT)0x0020) +#define IMPL_PAINT_CHECKRTL ((sal_uInt16)0x0020) static void ImplHandlePaint( Window* pWindow, const Rectangle& rBoundRect, bool bImmediateUpdate ) { @@ -1598,7 +1597,7 @@ static void KillOwnPopups( Window* pWindow ) ImplSVData* pSVData = ImplGetSVData(); Window *pParent = pWindow->ImplGetWindowImpl()->mpFrameWindow; Window *pChild = pSVData->maWinData.mpFirstFloat; - if ( pChild && pParent->ImplIsWindowOrChild( pChild, TRUE ) ) + if ( pChild && pParent->ImplIsWindowOrChild( pChild, sal_True ) ) { if ( !(pSVData->maWinData.mpFirstFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOAPPFOCUSCLOSE) ) pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); @@ -1625,7 +1624,7 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight ) { pWindow->mnOutWidth = nNewWidth; pWindow->mnOutHeight = nNewHeight; - pWindow->ImplGetWindowImpl()->mbWaitSystemResize = FALSE; + pWindow->ImplGetWindowImpl()->mbWaitSystemResize = sal_False; if ( pWindow->IsReallyVisible() ) pWindow->ImplSetClipFlag(); if ( pWindow->IsVisible() || pWindow->ImplGetWindow()->ImplGetWindowImpl()->mbAllResize || @@ -1656,13 +1655,13 @@ void ImplHandleResize( Window* pWindow, long nNewWidth, long nNewHeight ) pWindow->ImplCallResize(); // otherwise menues cannot be positioned } else - pWindow->ImplGetWindowImpl()->mbCallResize = TRUE; + pWindow->ImplGetWindowImpl()->mbCallResize = sal_True; } } pWindow->ImplGetWindowImpl()->mpFrameData->mbNeedSysWindow = (nNewWidth < IMPL_MIN_NEEDSYSWIN) || (nNewHeight < IMPL_MIN_NEEDSYSWIN); - BOOL bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0); + sal_Bool bMinimized = (nNewWidth <= 0) || (nNewHeight <= 0); if( bMinimized != pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized ) pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplNotifyIconifiedState( bMinimized ); pWindow->ImplGetWindowImpl()->mpFrameData->mbMinimized = bMinimized; @@ -1688,7 +1687,7 @@ static void ImplHandleMove( Window* pWindow ) if ( pWindow->IsVisible() ) pWindow->ImplCallMove(); else - pWindow->ImplGetWindowImpl()->mbCallMove = TRUE; // make sure the framepos will be updated on the next Show() + pWindow->ImplGetWindowImpl()->mbCallMove = sal_True; // make sure the framepos will be updated on the next Show() if ( pWindow->ImplGetWindowImpl()->mbFrame && pWindow->ImplGetWindowImpl()->mpClientWindow ) pWindow->ImplGetWindowImpl()->mpClientWindow->ImplCallMove(); // notify client to update geometry @@ -1705,7 +1704,7 @@ static void ImplHandleMoveResize( Window* pWindow, long nNewWidth, long nNewHeig // ----------------------------------------------------------------------- -static void ImplActivateFloatingWindows( Window* pWindow, BOOL bActive ) +static void ImplActivateFloatingWindows( Window* pWindow, sal_Bool bActive ) { // Zuerst alle ueberlappenden Fenster ueberpruefen Window* pTempWindow = pWindow->ImplGetWindowImpl()->mpFirstOverlap; @@ -1733,7 +1732,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG ) // Wenn Status erhalten geblieben ist, weil wir den Focus in der // zwischenzeit schon wiederbekommen haben, brauchen wir auch // nichts machen - BOOL bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus; + sal_Bool bHasFocus = ImplGetWindowImpl()->mpFrameData->mbHasFocus || ImplGetWindowImpl()->mpFrameData->mbSysObjFocus; // Dann die zeitverzoegerten Funktionen ausfuehren if ( bHasFocus ) @@ -1744,21 +1743,21 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG ) if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin ) { - BOOL bHandled = FALSE; + sal_Bool bHandled = sal_False; if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInputEnabled() && ! ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsInModalMode() ) { if ( ImplGetWindowImpl()->mpFrameData->mpFocusWin->IsEnabled() ) { ImplGetWindowImpl()->mpFrameData->mpFocusWin->GrabFocus(); - bHandled = TRUE; + bHandled = sal_True; } else if( ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplHasDlgCtrl() ) { // #109094# if the focus is restored to a disabled dialog control (was disabled meanwhile) // try to move it to the next control ImplGetWindowImpl()->mpFrameData->mpFocusWin->ImplDlgCtrlNextWindow(); - bHandled = TRUE; + bHandled = sal_True; } } if ( !bHandled ) @@ -1799,11 +1798,11 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG ) Window* pOldOverlapWindow = pOldFocusWindow->ImplGetFirstOverlapWindow(); Window* pOldRealWindow = pOldOverlapWindow->ImplGetWindow(); - pOldOverlapWindow->ImplGetWindowImpl()->mbActive = FALSE; + pOldOverlapWindow->ImplGetWindowImpl()->mbActive = sal_False; pOldOverlapWindow->Deactivate(); if ( pOldRealWindow != pOldOverlapWindow ) { - pOldRealWindow->ImplGetWindowImpl()->mbActive = FALSE; + pOldRealWindow->ImplGetWindowImpl()->mbActive = sal_False; pOldRealWindow->Deactivate(); } } @@ -1839,7 +1838,7 @@ IMPL_LINK( Window, ImplAsyncFocusHdl, void*, EMPTYARG ) static void ImplHandleGetFocus( Window* pWindow ) { - pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = TRUE; + pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = sal_True; // Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern // nicht alles flackert, wenn diese den Focus bekommen @@ -1883,7 +1882,7 @@ static void ImplHandleLoseFocus( Window* pWindow ) pSVData->maWinData.mpFirstFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL | FLOATWIN_POPUPMODEEND_CLOSEALL ); } - pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = FALSE; + pWindow->ImplGetWindowImpl()->mpFrameData->mbHasFocus = sal_False; // Focus-Events zeitverzoegert ausfuehren, damit bei SystemChildFenstern // nicht alles flackert, wenn diese den Focus bekommen @@ -2004,9 +2003,9 @@ static void ImplHandleUserEvent( ImplSVEvent* pSVEvent ) // ======================================================================= -static USHORT ImplGetMouseMoveMode( SalMouseEvent* pEvent ) +static sal_uInt16 ImplGetMouseMoveMode( SalMouseEvent* pEvent ) { - USHORT nMode = 0; + sal_uInt16 nMode = 0; if ( !pEvent->mnCode ) nMode |= MOUSE_SIMPLEMOVE; if ( (pEvent->mnCode & MOUSE_LEFT) && !(pEvent->mnCode & KEY_MOD1) ) @@ -2018,9 +2017,9 @@ static USHORT ImplGetMouseMoveMode( SalMouseEvent* pEvent ) // ----------------------------------------------------------------------- -static USHORT ImplGetMouseButtonMode( SalMouseEvent* pEvent ) +static sal_uInt16 ImplGetMouseButtonMode( SalMouseEvent* pEvent ) { - USHORT nMode = 0; + sal_uInt16 nMode = 0; if ( pEvent->mnButton == MOUSE_LEFT ) nMode |= MOUSE_SIMPLECLICK; if ( (pEvent->mnButton == MOUSE_LEFT) && !(pEvent->mnCode & (MOUSE_MIDDLE | MOUSE_RIGHT)) ) @@ -2038,7 +2037,7 @@ static USHORT ImplGetMouseButtonMode( SalMouseEvent* pEvent ) inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent ) { - return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, TRUE, + return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_True, pEvent->mnX, pEvent->mnY, pEvent->mnTime, pEvent->mnCode, ImplGetMouseMoveMode( pEvent ) ); @@ -2048,7 +2047,7 @@ inline long ImplHandleSalMouseLeave( Window* pWindow, SalMouseEvent* pEvent ) inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent ) { - return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, FALSE, + return ImplHandleMouseEvent( pWindow, EVENT_MOUSEMOVE, sal_False, pEvent->mnX, pEvent->mnY, pEvent->mnTime, pEvent->mnCode, ImplGetMouseMoveMode( pEvent ) ); @@ -2058,7 +2057,7 @@ inline long ImplHandleSalMouseMove( Window* pWindow, SalMouseEvent* pEvent ) inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent ) { - return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, FALSE, + return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONDOWN, sal_False, pEvent->mnX, pEvent->mnY, pEvent->mnTime, #ifdef MACOSX @@ -2073,7 +2072,7 @@ inline long ImplHandleSalMouseButtonDown( Window* pWindow, SalMouseEvent* pEvent inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent ) { - return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, FALSE, + return ImplHandleMouseEvent( pWindow, EVENT_MOUSEBUTTONUP, sal_False, pEvent->mnX, pEvent->mnY, pEvent->mnTime, #ifdef MACOSX @@ -2088,12 +2087,12 @@ inline long ImplHandleSalMouseButtonUp( Window* pWindow, SalMouseEvent* pEvent ) static long ImplHandleSalMouseActivate( Window* /*pWindow*/, SalMouseActivateEvent* /*pEvent*/ ) { - return FALSE; + return sal_False; } // ----------------------------------------------------------------------- -static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, USHORT nEvent ) +static long ImplHandleMenuEvent( Window* pWindow, SalMenuEvent* pEvent, sal_uInt16 nEvent ) { // Find SystemWindow and its Menubar and let it dispatch the command long nRet = 0; @@ -2143,11 +2142,11 @@ static void ImplHandleSalKeyMod( Window* pWindow, SalKeyModEvent* pEvent ) if ( pTrackWin ) pWindow = pTrackWin; #ifdef MACOSX - USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3); + sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2 | KEY_MOD3); #else - USHORT nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2); + sal_uInt16 nOldCode = pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & (KEY_SHIFT | KEY_MOD1 | KEY_MOD2); #endif - USHORT nNewCode = pEvent->mnCode; + sal_uInt16 nNewCode = pEvent->mnCode; if ( nOldCode != nNewCode ) { #ifdef MACOSX @@ -2155,7 +2154,7 @@ static void ImplHandleSalKeyMod( Window* pWindow, SalKeyModEvent* pEvent ) #else nNewCode |= pWindow->ImplGetWindowImpl()->mpFrameData->mnMouseCode & ~(KEY_SHIFT | KEY_MOD1 | KEY_MOD2); #endif - pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, TRUE ); + pWindow->ImplGetWindowImpl()->mpFrameWindow->ImplCallMouseMove( nNewCode, sal_True ); } // #105224# send commandevent to allow special treatment of Ctrl-LeftShift/Ctrl-RightShift etc. @@ -2187,7 +2186,7 @@ static void ImplHandleInputLanguageChange( Window* pWindow ) // ----------------------------------------------------------------------- -static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent ) +static void ImplHandleSalSettings( Window* pWindow, sal_uInt16 nEvent ) { // Application Notification werden nur fuer das erste Window ausgeloest ImplSVData* pSVData = ImplGetSVData(); @@ -2207,7 +2206,7 @@ static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent ) } else { - USHORT nType; + sal_uInt16 nType; switch ( nEvent ) { case SALEVENT_VOLUMECHANGED: @@ -2221,7 +2220,7 @@ static void ImplHandleSalSettings( Window* pWindow, USHORT nEvent ) nType = DATACHANGED_DISPLAY; break; case SALEVENT_FONTCHANGED: - OutputDevice::ImplUpdateAllFontData( TRUE ); + OutputDevice::ImplUpdateAllFontData( sal_True ); nType = DATACHANGED_FONTS; break; case SALEVENT_DATETIMECHANGED: @@ -2271,7 +2270,7 @@ static void ImplHandleSalExtTextInputPos( Window* pWindow, SalExtTextInputPosEve static long ImplHandleShowDialog( Window* pWindow, int nDialogId ) { if( ! pWindow ) - return FALSE; + return sal_False; if( pWindow->GetType() == WINDOW_BORDERWINDOW ) { @@ -2335,8 +2334,8 @@ static void ImplHandleSalSurroundingTextRequest( Window *pWindow, // ----------------------------------------------------------------------- static void ImplHandleSurroundingTextSelectionChange( Window *pWindow, - ULONG nStart, - ULONG nEnd ) + sal_uLong nStart, + sal_uLong nEnd ) { Window* pChild = ImplGetKeyInputWindow( pWindow ); if( pChild ) @@ -2358,7 +2357,7 @@ static void ImplHandleStartReconversion( Window *pWindow ) // ----------------------------------------------------------------------- long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/, - USHORT nEvent, const void* pEvent ) + sal_uInt16 nEvent, const void* pEvent ) { DBG_TESTSOLARMUTEX(); @@ -2433,28 +2432,28 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/, { SalKeyEvent* pKeyEvt = (SalKeyEvent*)pEvent; nRet = ImplHandleKey( pWindow, EVENT_KEYINPUT, - pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, TRUE ); + pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, sal_True ); } break; case SALEVENT_EXTERNALKEYINPUT: { KeyEvent* pKeyEvt = (KeyEvent*) pEvent; nRet = ImplHandleKey( pWindow, EVENT_KEYINPUT, - pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), FALSE ); + pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), sal_False ); } break; case SALEVENT_KEYUP: { SalKeyEvent* pKeyEvt = (SalKeyEvent*)pEvent; nRet = ImplHandleKey( pWindow, EVENT_KEYUP, - pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, TRUE ); + pKeyEvt->mnCode, pKeyEvt->mnCharCode, pKeyEvt->mnRepeat, sal_True ); } break; case SALEVENT_EXTERNALKEYUP: { KeyEvent* pKeyEvt = (KeyEvent*) pEvent; nRet = ImplHandleKey( pWindow, EVENT_KEYUP, - pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), FALSE ); + pKeyEvt->GetKeyCode().GetFullCode(), pKeyEvt->GetCharCode(), pKeyEvt->GetRepeat(), sal_False ); } break; case SALEVENT_KEYMODCHANGE: @@ -2541,15 +2540,15 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/, { // Message-Schleife beenden Application::Quit(); - return FALSE; + return sal_False; } else { bInQueryExit = false; - return TRUE; + return sal_True; } } - return FALSE; + return sal_False; } case SALEVENT_SETTINGSCHANGED: @@ -2605,7 +2604,7 @@ long ImplWindowFrameProc( Window* pWindow, SalFrame* /*pFrame*/, break; #ifdef DBG_UTIL default: - OSL_TRACE( "ImplWindowFrameProc(): unknown event (%lu)", (ULONG)nEvent ); + OSL_TRACE( "ImplWindowFrameProc(): unknown event (%lu)", (sal_uLong)nEvent ); break; #endif } diff --git a/vcl/source/window/wpropset.cxx b/vcl/source/window/wpropset.cxx new file mode 100644 index 000000000000..fcb0c560291e --- /dev/null +++ b/vcl/source/window/wpropset.cxx @@ -0,0 +1,346 @@ +/************************************************************************* + * + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * Copyright 2000, 2010 Oracle and/or its affiliates. + * + * OpenOffice.org - a multi-platform office productivity suite + * + * This file is part of OpenOffice.org. + * + * OpenOffice.org is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License version 3 + * only, as published by the Free Software Foundation. + * + * OpenOffice.org is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License version 3 for more details + * (a copy is included in the LICENSE file that accompanied this code). + * + * You should have received a copy of the GNU Lesser General Public License + * version 3 along with OpenOffice.org. If not, see + * <http://www.openoffice.org/license.html> + * for a copy of the LGPLv3 License. + * + ************************************************************************/ + +#include "precompiled_vcl.hxx" + +#include "vcl/wpropset.hxx" +#include "vcl/window.hxx" +#include "vcl/vclevent.hxx" +#include "vcl/svdata.hxx" + +#include "com/sun/star/lang/XMultiServiceFactory.hpp" +#include "com/sun/star/beans/PropertyValue.hpp" +#include "com/sun/star/beans/PropertyAttribute.hpp" +#include "com/sun/star/beans/XPropertySet.hpp" +#include "com/sun/star/beans/XPropertyContainer.hpp" +#include "com/sun/star/beans/XPropertyAccess.hpp" + +#include "cppuhelper/basemutex.hxx" +#include "cppuhelper/compbase1.hxx" + +#include <map> + +using namespace vcl; +using namespace com::sun::star; + +/* + +TODO: +- release solarmutex during outside UNO calls +- in ChildEventListener protect against reentry by using PostUserEvent + +*/ + +class vcl::WindowPropertySetListener : + public cppu::BaseMutex, + public cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >, + private boost::noncopyable +{ + WindowPropertySet* mpParent; + bool mbSuspended; +public: + WindowPropertySetListener( WindowPropertySet* pParent ) + : cppu::WeakComponentImplHelper1< com::sun::star::beans::XPropertyChangeListener >( m_aMutex ) + , mpParent( pParent ) + , mbSuspended( false ) + {} + + virtual ~WindowPropertySetListener() + { + } + + using cppu::WeakComponentImplHelperBase::disposing; + virtual void SAL_CALL disposing( const lang::EventObject& ) throw() + { + } + + virtual void SAL_CALL propertyChange( const beans::PropertyChangeEvent& i_rEvent ) throw() + { + if( ! mbSuspended ) + mpParent->propertyChange( i_rEvent ); + } + + void suspend( bool i_bSuspended ) + { + mbSuspended = i_bSuspended; + } +}; + +class vcl::WindowPropertySetData +{ +public: + + struct PropertyMapEntry + { + Window* mpWindow; + boost::shared_ptr<WindowArranger> mpLayout; + uno::Sequence< beans::PropertyValue > maSavedValues; + + PropertyMapEntry( Window* i_pWindow = NULL, + const boost::shared_ptr<WindowArranger>& i_pLayout = boost::shared_ptr<WindowArranger>() ) + : mpWindow( i_pWindow ) + , mpLayout( i_pLayout ) + {} + + uno::Sequence< beans::PropertyValue > getProperties() const + { + if( mpWindow ) + return mpWindow->getProperties(); + else if( mpLayout.get() ) + return mpLayout->getProperties(); + return uno::Sequence< beans::PropertyValue >(); + } + + void setProperties( const uno::Sequence< beans::PropertyValue >& i_rProps ) const + { + if( mpWindow ) + mpWindow->setProperties( i_rProps ); + else if( mpLayout.get() ) + mpLayout->setProperties( i_rProps ); + } + }; + + Window* mpTopWindow; + bool mbOwner; + std::map< rtl::OUString, PropertyMapEntry > maProperties; + uno::Reference< beans::XPropertySet > mxPropSet; + uno::Reference< beans::XPropertyAccess > mxPropSetAccess; + uno::Reference< beans::XPropertyChangeListener > mxListener; + vcl::WindowPropertySetListener* mpListener; + + WindowPropertySetData() + : mpTopWindow( NULL ) + , mbOwner( false ) + , mpListener( NULL ) + {} + + ~WindowPropertySetData() + { + // release layouters, possibly interface properties before destroying + // the involved parent to be on the safe side + maProperties.clear(); + if( mbOwner ) + delete mpTopWindow; + } +}; + +static rtl::OUString getIdentifiedPropertyName( const rtl::OUString& i_rIdentifier, const rtl::OUString& i_rName ) +{ + rtl::OUStringBuffer aBuf( i_rIdentifier.getLength() + 1 + i_rName.getLength() ); + aBuf.append( i_rIdentifier ); + aBuf.append( sal_Unicode( '#' ) ); + aBuf.append( i_rName ); + return aBuf.makeStringAndClear(); +} + +static void spliceIdentifiedPropertyName( const rtl::OUString& i_rIdentifiedPropName, + rtl::OUString& o_rIdentifier, + rtl::OUString& o_rPropName ) +{ + sal_Int32 nIndex = 0; + o_rIdentifier = i_rIdentifiedPropName.getToken( 0, sal_Unicode( '#' ), nIndex ); + if( nIndex != -1 ) + o_rPropName = i_rIdentifiedPropName.copy( nIndex ); + else + o_rPropName = rtl::OUString(); +} + +WindowPropertySet::WindowPropertySet( Window* i_pTopWindow, bool i_bTakeOwnership ) +: mpImpl( new vcl::WindowPropertySetData ) +{ + mpImpl->mpTopWindow = i_pTopWindow; + mpImpl->mbOwner = i_bTakeOwnership; + + mpImpl->mpTopWindow->AddChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) ); + + mpImpl->mxPropSet = uno::Reference< beans::XPropertySet >( + ImplGetSVData()->maAppData.mxMSF->createInstance( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.beans.PropertyBag" ) ) ), + uno::UNO_QUERY ); + OSL_ENSURE( mpImpl->mxPropSet.is(), "could not create instance of com.sun.star.beans.PropertyBag" ); + mpImpl->mxPropSetAccess = uno::Reference< beans::XPropertyAccess >( mpImpl->mxPropSet, uno::UNO_QUERY ); + OSL_ENSURE( mpImpl->mxPropSet.is(), "could not query XPropertyAccess interface" ); + if( ! mpImpl->mxPropSetAccess.is() ) + mpImpl->mxPropSet.clear(); + + addWindowToSet( i_pTopWindow ); + + setupProperties(); + + if( mpImpl->mxPropSet.is() ) + { + mpImpl->mxListener.set( mpImpl->mpListener = new WindowPropertySetListener( this ) ); + } +} + +WindowPropertySet::~WindowPropertySet() +{ + mpImpl->mpTopWindow->RemoveChildEventListener( LINK( this, WindowPropertySet, ChildEventListener ) ); + + delete mpImpl; + mpImpl = NULL; +} + +uno::Reference< beans::XPropertySet > WindowPropertySet::getPropertySet() const +{ + return mpImpl->mxPropSet; +} + +void WindowPropertySet::addLayoutToSet( const boost::shared_ptr< WindowArranger >& i_pLayout ) +{ + if( i_pLayout.get() ) + { + if( i_pLayout->getIdentifier().getLength() ) + { + WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pLayout->getIdentifier() ]; + OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted layout has duplicate name" ); + rEntry.mpWindow = NULL; + rEntry.mpLayout = i_pLayout; + rEntry.maSavedValues = i_pLayout->getProperties(); + } + // insert child layouts + size_t nChildren = i_pLayout->countElements(); + for( size_t i = 0; i < nChildren; i++ ) + addLayoutToSet( i_pLayout->getChild( i ) ); + } +} + +void WindowPropertySet::addWindowToSet( Window* i_pWindow ) +{ + if( i_pWindow->getIdentifier().getLength() ) // no name, no properties + { + WindowPropertySetData::PropertyMapEntry& rEntry = mpImpl->maProperties[ i_pWindow->getIdentifier() ]; + OSL_ENSURE( rEntry.mpWindow == 0 && rEntry.mpLayout.get() == 0, "inserted window has duplicate name" ); + rEntry.mpWindow = i_pWindow; + rEntry.mpLayout.reset(); + rEntry.maSavedValues = i_pWindow->getProperties(); + } + addLayoutToSet( i_pWindow->getLayout() ); + + Window* pWin = i_pWindow->GetWindow( WINDOW_FIRSTCHILD ); + while( pWin ) + { + addWindowToSet( pWin ); + pWin = pWin->GetWindow( WINDOW_NEXT ); + } +} + +void WindowPropertySet::setupProperties() +{ + uno::Reference< beans::XPropertyContainer > xCont( mpImpl->mxPropSet, uno::UNO_QUERY ); + OSL_ENSURE( xCont.is(), "could not get XPropertyContainer interface" ); + if( ! xCont.is() ) + return; + + for( std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it + = mpImpl->maProperties.begin(); it != mpImpl->maProperties.end(); ++it ) + { + uno::Sequence< beans::PropertyValue > aOutsideValues( it->second.maSavedValues ); + beans::PropertyValue* pVal = aOutsideValues.getArray(); + for( sal_Int32 i = 0; i < aOutsideValues.getLength(); i++ ) + { + pVal[i].Name = getIdentifiedPropertyName( it->first, pVal[i].Name ); + xCont->addProperty( pVal[i].Name, + beans::PropertyAttribute::BOUND | beans:: PropertyAttribute::CONSTRAINED, + pVal[i].Value + ); + } + } +} + +void WindowPropertySet::propertyChange( const beans::PropertyChangeEvent& i_rEvent ) +{ + rtl::OUString aIdentifier, aProperty; + spliceIdentifiedPropertyName( i_rEvent.PropertyName, aIdentifier, aProperty ); + std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it = + mpImpl->maProperties.find( aIdentifier ); + if( it != mpImpl->maProperties.end() ) + { + uno::Sequence< beans::PropertyValue > aSet( 1 ); + aSet[0].Name = aProperty; + aSet[0].Value = i_rEvent.NewValue; + it->second.setProperties( aSet ); + } +} + +IMPL_LINK( vcl::WindowPropertySet, ChildEventListener, VclWindowEvent*, pEvent ) +{ + // find window in our properties + std::map< rtl::OUString, WindowPropertySetData::PropertyMapEntry >::iterator it + = mpImpl->maProperties.find( pEvent->GetWindow()->getIdentifier() ); + if( it != mpImpl->maProperties.end() ) // this is valid, some unnamed child may have sent an event + { + sal_uLong nId = pEvent->GetId(); + // check if anything interesting happened + if( + // general windowy things + nId == VCLEVENT_WINDOW_SHOW || + nId == VCLEVENT_WINDOW_HIDE || + nId == VCLEVENT_WINDOW_ENABLED || + nId == VCLEVENT_WINDOW_DISABLED || + // button thingies + nId == VCLEVENT_BUTTON_CLICK || + nId == VCLEVENT_PUSHBUTTON_TOGGLE || + nId == VCLEVENT_RADIOBUTTON_TOGGLE || + nId == VCLEVENT_CHECKBOX_TOGGLE || + // listbox + nId == VCLEVENT_LISTBOX_SELECT || + // edit + nId == VCLEVENT_EDIT_MODIFY + ) + { + WindowPropertySetData::PropertyMapEntry& rEntry = it->second; + // collect changes + uno::Sequence< beans::PropertyValue > aNewProps( rEntry.getProperties() ); + uno::Sequence< beans::PropertyValue > aNewPropsOut( aNewProps ); + + // translate to identified properties + beans::PropertyValue* pValues = aNewPropsOut.getArray(); + for( sal_Int32 i = 0; i < aNewPropsOut.getLength(); i++ ) + pValues[i].Name = getIdentifiedPropertyName( it->first, pValues[i].Name ); + + // broadcast changes + bool bWasVeto = false; + mpImpl->mpListener->suspend( true ); + try + { + mpImpl->mxPropSetAccess->setPropertyValues( aNewPropsOut ); + } + catch( beans::PropertyVetoException& ) + { + bWasVeto = true; + } + mpImpl->mpListener->suspend( false ); + + if( ! bWasVeto ) // changes accepted ? + rEntry.maSavedValues = rEntry.getProperties(); + else // no, reset + rEntry.setProperties( rEntry.maSavedValues ); + } + } + + return 0; +} diff --git a/vcl/source/window/wrkwin.cxx b/vcl/source/window/wrkwin.cxx index 72887ce0f577..38d78fbc9723 100644 --- a/vcl/source/window/wrkwin.cxx +++ b/vcl/source/window/wrkwin.cxx @@ -45,8 +45,8 @@ // ======================================================================= -#define WORKWIN_WINDOWSTATE_FULLSCREEN ((ULONG)0x00010000) -#define WORKWIN_WINDOWSTATE_ALL ((ULONG)0x00FF0000) +#define WORKWIN_WINDOWSTATE_FULLSCREEN ((sal_uLong)0x00010000) +#define WORKWIN_WINDOWSTATE_ALL ((sal_uLong)0x00FF0000) // ======================================================================= @@ -55,17 +55,17 @@ void WorkWindow::ImplInitWorkWindowData() mnIcon = 0; // Should be removed in the next top level update - now in SystemWindow mnPresentationFlags = 0; - mbPresentationMode = FALSE; - mbPresentationVisible = FALSE; - mbPresentationFull = FALSE; - mbFullScreenMode = FALSE; + mbPresentationMode = sal_False; + mbPresentationVisible = sal_False; + mbPresentationFull = sal_False; + mbFullScreenMode = sal_False; } // ----------------------------------------------------------------------- void WorkWindow::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSystemParentData ) { - USHORT nFrameStyle = BORDERWINDOW_STYLE_FRAME; + sal_uInt16 nFrameStyle = BORDERWINDOW_STYLE_FRAME; if ( nStyle & WB_APP ) nFrameStyle |= BORDERWINDOW_STYLE_APP; @@ -138,7 +138,7 @@ WorkWindow::WorkWindow( Window* pParent, const ::com::sun::star::uno::Any& aSyst SystemWindow( WINDOW_WORKWINDOW ) { ImplInitWorkWindowData(); - mbSysChild = TRUE; + mbSysChild = sal_True; ImplInit( pParent, nStyle, aSystemWorkWindowToken ); } @@ -148,7 +148,7 @@ WorkWindow::WorkWindow( SystemParentData* pParent ) : SystemWindow( WINDOW_WORKWINDOW ) { ImplInitWorkWindowData(); - mbSysChild = TRUE; + mbSysChild = sal_True; ImplInit( NULL, 0, pParent ); } @@ -177,7 +177,7 @@ WorkWindow::~WorkWindow() // ----------------------------------------------------------------------- -void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay ) +void WorkWindow::ShowFullScreenMode( sal_Bool bFullScreenMode, sal_Int32 nDisplay ) { if ( !mbFullScreenMode == !bFullScreenMode ) return; @@ -203,34 +203,34 @@ void WorkWindow::ShowFullScreenMode( BOOL bFullScreenMode, sal_Int32 nDisplay ) xCanvasComponent->dispose(); } - mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = TRUE; + mpWindowImpl->mpFrameWindow->mpWindowImpl->mbWaitSystemResize = sal_True; ImplGetFrame()->ShowFullScreen( bFullScreenMode, nDisplay ); } } // ----------------------------------------------------------------------- -void WorkWindow::StartPresentationMode( BOOL bPresentation, USHORT nFlags, sal_Int32 nDisplay ) +void WorkWindow::StartPresentationMode( sal_Bool bPresentation, sal_uInt16 nFlags, sal_Int32 nDisplay ) { if ( !bPresentation == !mbPresentationMode ) return; if ( bPresentation ) { - mbPresentationMode = TRUE; + mbPresentationMode = sal_True; mbPresentationVisible = IsVisible(); mbPresentationFull = mbFullScreenMode; mnPresentationFlags = nFlags; if ( !(mnPresentationFlags & PRESENTATION_NOFULLSCREEN) ) - ShowFullScreenMode( TRUE, nDisplay ); + ShowFullScreenMode( sal_True, nDisplay ); if ( !mbSysChild ) { if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS ) - mpWindowImpl->mpFrame->SetAlwaysOnTop( TRUE ); + mpWindowImpl->mpFrame->SetAlwaysOnTop( sal_True ); if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) ) ToTop(); - mpWindowImpl->mpFrame->StartPresentation( TRUE ); + mpWindowImpl->mpFrame->StartPresentation( sal_True ); } if ( !(mnPresentationFlags & PRESENTATION_NOAUTOSHOW) ) @@ -241,22 +241,22 @@ void WorkWindow::StartPresentationMode( BOOL bPresentation, USHORT nFlags, sal_I Show( mbPresentationVisible ); if ( !mbSysChild ) { - mpWindowImpl->mpFrame->StartPresentation( FALSE ); + mpWindowImpl->mpFrame->StartPresentation( sal_False ); if ( mnPresentationFlags & PRESENTATION_HIDEALLAPPS ) - mpWindowImpl->mpFrame->SetAlwaysOnTop( FALSE ); + mpWindowImpl->mpFrame->SetAlwaysOnTop( sal_False ); } ShowFullScreenMode( mbPresentationFull, nDisplay ); - mbPresentationMode = FALSE; - mbPresentationVisible = FALSE; - mbPresentationFull = FALSE; + mbPresentationMode = sal_False; + mbPresentationVisible = sal_False; + mbPresentationFull = sal_False; mnPresentationFlags = 0; } } // ----------------------------------------------------------------------- -BOOL WorkWindow::IsMinimized() const +sal_Bool WorkWindow::IsMinimized() const { //return mpWindowImpl->mpFrameData->mbMinimized; SalFrameState aState; @@ -266,15 +266,15 @@ BOOL WorkWindow::IsMinimized() const // ----------------------------------------------------------------------- -BOOL WorkWindow::SetPluginParent( SystemParentData* pParent ) +sal_Bool WorkWindow::SetPluginParent( SystemParentData* pParent ) { DBG_ASSERT( ! mbPresentationMode && ! mbFullScreenMode, "SetPluginParent in fullscreen or presentation mode !" ); bool bWasDnd = Window::ImplStopDnd(); - BOOL bShown = IsVisible(); - Show( FALSE ); - BOOL bRet = mpWindowImpl->mpFrame->SetPluginParent( pParent ); + sal_Bool bShown = IsVisible(); + Show( sal_False ); + sal_Bool bRet = mpWindowImpl->mpFrame->SetPluginParent( pParent ); Show( bShown ); if( bWasDnd ) @@ -283,7 +283,7 @@ BOOL WorkWindow::SetPluginParent( SystemParentData* pParent ) return bRet; } -void WorkWindow::ImplSetFrameState( ULONG aFrameState ) +void WorkWindow::ImplSetFrameState( sal_uLong aFrameState ) { SalFrameState aState; aState.mnMask = SAL_FRAMESTATE_MASK_STATE; @@ -302,9 +302,9 @@ void WorkWindow::Restore() ImplSetFrameState( SAL_FRAMESTATE_NORMAL ); } -BOOL WorkWindow::Close() +sal_Bool WorkWindow::Close() { - BOOL bCanClose = SystemWindow::Close(); + sal_Bool bCanClose = SystemWindow::Close(); // Ist es das Applikationsfenster, dann beende die Applikation if ( bCanClose && ( ImplGetSVData()->maWinData.mpAppWin == this ) ) @@ -313,14 +313,14 @@ BOOL WorkWindow::Close() return bCanClose; } -void WorkWindow::Maximize( BOOL bMaximize ) +void WorkWindow::Maximize( sal_Bool bMaximize ) { ImplSetFrameState( bMaximize ? SAL_FRAMESTATE_MAXIMIZED : SAL_FRAMESTATE_NORMAL ); } -BOOL WorkWindow::IsMaximized() const +sal_Bool WorkWindow::IsMaximized() const { - BOOL bRet = FALSE; + sal_Bool bRet = sal_False; SalFrameState aState; if( mpWindowImpl->mpFrame->GetWindowState( &aState ) ) @@ -328,7 +328,7 @@ BOOL WorkWindow::IsMaximized() const if( aState.mnState & (SAL_FRAMESTATE_MAXIMIZED | SAL_FRAMESTATE_MAXIMIZED_HORZ | SAL_FRAMESTATE_MAXIMIZED_VERT ) ) - bRet = TRUE; + bRet = sal_True; } return bRet; } |