diff options
Diffstat (limited to 'svx/source/tbxctrls/colrctrl.cxx')
-rwxr-xr-x[-rw-r--r--] | svx/source/tbxctrls/colrctrl.cxx | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/svx/source/tbxctrls/colrctrl.cxx b/svx/source/tbxctrls/colrctrl.cxx index 8eb3e27a2a10..29b8b3186932 100644..100755 --- a/svx/source/tbxctrls/colrctrl.cxx +++ b/svx/source/tbxctrls/colrctrl.cxx @@ -39,12 +39,12 @@ #include <svx/colrctrl.hxx> #include <svx/svdview.hxx> -#include "drawitem.hxx" +#include "svx/drawitem.hxx" #include <editeng/colritem.hxx> -#include "xattr.hxx" +#include "svx/xattr.hxx" #include <svx/xtable.hxx> #include <svx/dialmgr.hxx> -#include "xexch.hxx" +#include "svx/xexch.hxx" #include <vcl/svapp.hxx> SFX_IMPL_DOCKINGWINDOW( SvxColorChildWindow, SID_COLOR_CONTROL ) @@ -110,8 +110,9 @@ sal_Bool SvxColorValueSetData::WriteObject( SotStorageStreamRef& rxOStm, void*, SvxColorValueSet::SvxColorValueSet( Window* _pParent, WinBits nWinStyle ) : ValueSet( _pParent, nWinStyle ), DragSourceHelper( this ), - bLeft (TRUE) + bLeft (sal_True) { + SetAccessibleName(String( SVX_RES( STR_COLORTABLE ) ) ); } /************************************************************************* @@ -123,8 +124,9 @@ SvxColorValueSet::SvxColorValueSet( Window* _pParent, WinBits nWinStyle ) : SvxColorValueSet::SvxColorValueSet( Window* _pParent, const ResId& rResId ) : ValueSet( _pParent, rResId ), DragSourceHelper( this ), - bLeft (TRUE) + bLeft (sal_True) { + SetAccessibleName(String( SVX_RES( STR_COLORTABLE ) )); } /************************************************************************* @@ -138,12 +140,12 @@ void SvxColorValueSet::MouseButtonDown( const MouseEvent& rMEvt ) // Fuer Mac noch anders handlen ! if( rMEvt.IsLeft() ) { - bLeft = TRUE; + bLeft = sal_True; ValueSet::MouseButtonDown( rMEvt ); } else { - bLeft = FALSE; + bLeft = sal_False; MouseEvent aMEvt( rMEvt.GetPosPixel(), rMEvt.GetClicks(), rMEvt.GetMode(), @@ -166,12 +168,12 @@ void SvxColorValueSet::MouseButtonUp( const MouseEvent& rMEvt ) // Fuer Mac noch anders handlen ! if( rMEvt.IsLeft() ) { - bLeft = TRUE; + bLeft = sal_True; ValueSet::MouseButtonUp( rMEvt ); } else { - bLeft = FALSE; + bLeft = sal_False; MouseEvent aMEvt( rMEvt.GetPosPixel(), rMEvt.GetClicks(), rMEvt.GetMode(), @@ -214,7 +216,7 @@ void SvxColorValueSet::StartDrag( sal_Int8 , const Point& ) void SvxColorValueSet::DoDrag() { SfxObjectShell* pDocSh = SfxObjectShell::Current(); - USHORT nItemId = GetItemId( aDragPosPixel ); + sal_uInt16 nItemId = GetItemId( aDragPosPixel ); if( pDocSh && nItemId ) { @@ -251,7 +253,7 @@ IMPL_STATIC_LINK(SvxColorValueSet, ExecDragHdl, void*, EMPTYARG) \************************************************************************/ SvxColorChildWindow::SvxColorChildWindow( Window* _pParent, - USHORT nId, + sal_uInt16 nId, SfxBindings* pBindings, SfxChildWinInfo* pInfo ) : SfxChildWindow( _pParent, nId ) @@ -332,7 +334,7 @@ SvxColorDockingWindow::SvxColorDockingWindow SetSize(); aColorSet.Show(); - StartListening( *_pBindings, TRUE ); + StartListening( *_pBindings, sal_True ); } @@ -389,7 +391,7 @@ void SvxColorDockingWindow::FillValueSet() Bitmap aBmp( aVD.GetBitmap( Point(), aColorSize ) ); - aColorSet.InsertItem( (USHORT)1, Image(aBmp), SVX_RESSTR( RID_SVXSTR_INVISIBLE ) ); + aColorSet.InsertItem( (sal_uInt16)1, Image(aBmp), SVX_RESSTR( RID_SVXSTR_INVISIBLE ) ); XColorEntry* pEntry; nCount = pColorTable->Count(); @@ -397,7 +399,7 @@ void SvxColorDockingWindow::FillValueSet() for( long i = 0; i < nCount; i++ ) { pEntry = pColorTable->GetColor( i ); - aColorSet.InsertItem( (USHORT)i+2, + aColorSet.InsertItem( (sal_uInt16)i+2, pEntry->GetColor(), pEntry->GetName() ); } } @@ -417,8 +419,8 @@ void SvxColorDockingWindow::SetSize() aSize.Height() -= 4; // Zeilen und Spalten berechnen - nCols = (USHORT) ( aSize.Width() / aItemSize.Width() ); - nLines = (USHORT) ( (float) aSize.Height() / (float) aItemSize.Height() /*+ 0.35*/ ); + nCols = (sal_uInt16) ( aSize.Width() / aItemSize.Width() ); + nLines = (sal_uInt16) ( (float) aSize.Height() / (float) aItemSize.Height() /*+ 0.35*/ ); if( nLines == 0 ) nLines++; @@ -435,7 +437,7 @@ void SvxColorDockingWindow::SetSize() if( nScrollWidth > 0 ) { // Spalten mit ScrollBar berechnen - nCols = (USHORT) ( ( aSize.Width() - nScrollWidth ) / aItemSize.Width() ); + nCols = (sal_uInt16) ( ( aSize.Width() - nScrollWidth ) / aItemSize.Width() ); } aColorSet.SetColCount( nCols ); @@ -456,13 +458,13 @@ void SvxColorDockingWindow::SetSize() |* \************************************************************************/ -BOOL SvxColorDockingWindow::Close() +sal_Bool SvxColorDockingWindow::Close() { - SfxBoolItem aItem( SID_COLOR_CONTROL, FALSE ); + SfxBoolItem aItem( SID_COLOR_CONTROL, sal_False ); GetBindings().GetDispatcher()->Execute( SID_COLOR_CONTROL, SFX_CALLMODE_ASYNCHRON | SFX_CALLMODE_RECORD, &aItem, 0L ); SfxDockingWindow::Close(); - return( TRUE ); + return( sal_True ); } /************************************************************************* @@ -474,7 +476,7 @@ BOOL SvxColorDockingWindow::Close() IMPL_LINK( SvxColorDockingWindow, SelectHdl, void *, EMPTYARG ) { SfxDispatcher* pDispatcher = GetBindings().GetDispatcher(); - USHORT nPos = aColorSet.GetSelectItemId(); + sal_uInt16 nPos = aColorSet.GetSelectItemId(); Color aColor( aColorSet.GetItemColor( nPos ) ); String aStr( aColorSet.GetItemText( nPos ) ); @@ -489,7 +491,7 @@ IMPL_LINK( SvxColorDockingWindow, SelectHdl, void *, EMPTYARG ) } else { - BOOL bDone = FALSE; + sal_Bool bDone = sal_False; // Wenn wir eine DrawView haben und uns im TextEdit-Modus befinden, // wird nicht die Flaechen-, sondern die Textfarbe zugewiesen @@ -502,7 +504,7 @@ IMPL_LINK( SvxColorDockingWindow, SelectHdl, void *, EMPTYARG ) SvxColorItem aTextColorItem( aColor, SID_ATTR_CHAR_COLOR ); pDispatcher->Execute( SID_ATTR_CHAR_COLOR, SFX_CALLMODE_RECORD, &aTextColorItem, 0L ); - bDone = TRUE; + bDone = sal_True; } } if ( !bDone ) @@ -580,8 +582,8 @@ void SvxColorDockingWindow::Resizing( Size& rNewSize ) rNewSize.Height() -= 4; // Spalten und Reihen ermitteln - nCols = (USHORT) ( (float) rNewSize.Width() / (float) aItemSize.Width() + 0.5 ); - nLines = (USHORT) ( (float) rNewSize.Height() / (float) aItemSize.Height() + 0.5 ); + nCols = (sal_uInt16) ( (float) rNewSize.Width() / (float) aItemSize.Width() + 0.5 ); + nLines = (sal_uInt16) ( (float) rNewSize.Height() / (float) aItemSize.Height() + 0.5 ); if( nLines == 0 ) nLines = 1; @@ -598,7 +600,7 @@ void SvxColorDockingWindow::Resizing( Size& rNewSize ) if( nScrollWidth > 0 ) { // Spalten mit ScrollBar berechnen - nCols = (USHORT) ( ( ( (float) rNewSize.Width() - (float) nScrollWidth ) ) + nCols = (sal_uInt16) ( ( ( (float) rNewSize.Width() - (float) nScrollWidth ) ) / (float) aItemSize.Width() + 0.5 ); } if( nCols <= 1 ) @@ -609,7 +611,7 @@ void SvxColorDockingWindow::Resizing( Size& rNewSize ) if( nCount % nCols ) nMaxLines++; - nLines = sal::static_int_cast< USHORT >( + nLines = sal::static_int_cast< sal_uInt16 >( std::min< long >( nLines, nMaxLines ) ); // Groesse des Windows setzen @@ -646,7 +648,7 @@ long SvxColorDockingWindow::Notify( NotifyEvent& rNEvt ) if( ( rNEvt.GetType() == EVENT_KEYINPUT ) ) { KeyEvent aKeyEvt = *rNEvt.GetKeyEvent(); - USHORT nKeyCode = aKeyEvt.GetKeyCode().GetCode(); + sal_uInt16 nKeyCode = aKeyEvt.GetKeyCode().GetCode(); switch( nKeyCode ) { case KEY_ESCAPE: |