summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-16 12:14:54 +0000
committerCaolán McNamara <caolanm@redhat.com>2013-01-16 12:27:09 +0000
commit26af997c55106fd067b32caaceedde3f2c10c1dc (patch)
treef18d9b42b8c50cd9d3ec375f9792b73c28da8b47 /svx
parentf1088250485fa91b4131102c5275e73653bc0c2c (diff)
use the theme width for the scrollbar, not a random 16 pixels
Change-Id: Ie823124e8f156099e5b1708afa5b830153fcce3e
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/charmap.cxx11
1 files changed, 5 insertions, 6 deletions
diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx
index 23921c6e8330..b68e2e4d49a8 100644
--- a/svx/source/dialog/charmap.cxx
+++ b/svx/source/dialog/charmap.cxx
@@ -54,8 +54,6 @@ sal_uInt32& SvxShowCharSet::getSelectedChar()
// class SvxShowCharSet ==================================================
-#define SBWIDTH 16
-
SvxShowCharSet::SvxShowCharSet(Window* pParent, const ResId& rResId)
: Control(pParent, rResId)
, m_pAccessible(NULL)
@@ -376,7 +374,7 @@ void SvxShowCharSet::DrawChars_Impl( int n1, int n2 )
Size aOutputSize = GetOutputSizePixel();
if (aVscrollSB.IsVisible())
- aOutputSize.Width() -= SBWIDTH;
+ aOutputSize.Width() -= aVscrollSB.GetOptimalSize().Width();
int i;
for ( i = 1; i < COLUMN_COUNT; ++i )
@@ -523,7 +521,8 @@ void SvxShowCharSet::SetFont( const Font& rFont )
getSelectedChar() = maFontCharMap.GetCharFromIndex( nSelectedIndex );
Size aSize = GetOutputSizePixel();
- aSize.Width() -= SBWIDTH;
+ long nSBWidth = aVscrollSB.GetOptimalSize().Width();
+ aSize.Width() -= nSBWidth;
Font aFont = rFont;
aFont.SetWeight( WEIGHT_LIGHT );
@@ -537,7 +536,7 @@ void SvxShowCharSet::SetFont( const Font& rFont )
nX = aSize.Width() / COLUMN_COUNT;
nY = aSize.Height() / ROW_COUNT;
- aVscrollSB.setPosSizePixel( aSize.Width(), 0, SBWIDTH, aSize.Height() );
+ aVscrollSB.setPosSizePixel( aSize.Width(), 0, nSBWidth, aSize.Height() );
aVscrollSB.SetRangeMin( 0 );
int nLastRow = (maFontCharMap.GetCharCount() - 1 + COLUMN_COUNT) / COLUMN_COUNT;
aVscrollSB.SetRangeMax( nLastRow );
@@ -613,7 +612,7 @@ void SvxShowCharSet::SelectIndex( int nNewIndex, sal_Bool bFocus )
aOldPixel.Move( +1, +1);
Size aOutputSize = GetOutputSizePixel();
if (aVscrollSB.IsVisible())
- aOutputSize.Width() -= SBWIDTH;
+ aOutputSize.Width() -= aVscrollSB.GetOptimalSize().Width();
DrawRect( getGridRectangle(aOldPixel, aOutputSize) );
SetLineColor( aLineCol );
SetFillColor( aFillCol );