--- svx/source/tbxctrls/tbcontrl.cxx +++ svx/source/tbxctrls/tbcontrl.cxx @@ -1008,6 +1008,10 @@ #define WB_NO_DIRECTSELECT ((WinBits)0x04000000) #endif +#define PALETTE_X 10 +#define PALETTE_Y 10 +#define PALETTE_SIZE (PALETTE_X * PALETTE_Y) + SvxColorWindow_Impl::SvxColorWindow_Impl( USHORT nId, USHORT nSlotId, const String& rWndTitle, SfxBindings& rBindings ) : @@ -1021,7 +1025,7 @@ SfxObjectShell* pDocSh = SfxObjectShell::Current(); const SfxPoolItem* pItem = NULL; XColorTable* pColorTable = NULL; - const Size aSize12( 12, 12 ); + const Size aSize12( 13, 13 ); if ( pDocSh ) if ( 0 != ( pItem = pDocSh->GetItem( SID_COLOR_TABLE ) ) ) @@ -1051,8 +1055,8 @@ Color aColWhite( COL_WHITE ); String aStrWhite( SVX_RES(RID_SVXITEMS_COLOR_WHITE) ); - if ( nCount > 80 ) - // bei mehr als 80 Farben ScrollBar anzeigen + if ( nCount > PALETTE_SIZE ) + // bei mehr als Max Farben ScrollBar anzeigen aColorSet.SetStyle( aColorSet.GetStyle() | WB_VSCROLL ); for ( i = 0; i < nCount; i++ ) @@ -1061,17 +1065,17 @@ aColorSet.InsertItem( i+1, pEntry->GetColor(), pEntry->GetName() ); } - while ( i < 80 ) + while ( i < PALETTE_SIZE ) { - // bei weniger als 80 Farben, mit Weiss auff"ullen + // bei weniger als Max Farben, mit Weiss auff"ullen aColorSet.InsertItem( i+1, aColWhite, aStrWhite ); i++; } } aColorSet.SetSelectHdl( LINK( this, SvxColorWindow_Impl, SelectHdl ) ); - aColorSet.SetColCount( 8 ); - aColorSet.SetLineCount( 10 ); + aColorSet.SetColCount( PALETTE_X ); + aColorSet.SetLineCount( PALETTE_Y ); lcl_CalcSizeValueSet( *this, aColorSet, aSize12 ); @@ -1163,7 +1167,7 @@ // ScrollBar an oder aus WinBits nBits = aColorSet.GetStyle(); - if ( nCount > 80 ) + if ( nCount > PALETTE_SIZE ) nBits &= ~WB_VSCROLL; else nBits |= WB_VSCROLL; @@ -1176,7 +1180,7 @@ aColorSet.SetItemText ( i + 1, pEntry->GetName() ); } - while ( i < 80 ) + while ( i < PALETTE_SIZE ) { aColorSet.SetItemColor( i + 1, aColWhite ); aColorSet.SetItemText ( i + 1, aStrWhite );