summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <quikee@gmail.com>2012-09-20 20:52:04 +0200
committerTomaž Vajngerl <quikee@gmail.com>2012-09-20 21:17:15 +0200
commit3da2a6a58784a3c607ea4e440865478f1a4fe56e (patch)
treece5e8a10b07d3bf9f30de5527d2fa39b899295b7
parentc630a2458e9b9f19fbfa03034c8e3f20232f77df (diff)
fdo#49350 Speedup entry painting for SvTreeListBox
Painting code for entry in SvTreeListBox switches between default and highlight font (which is only the default font with a different colour). This is done using SetFont which assumes that the font changes entry dimensions, which then recalculates everything. This is done for every entry so it is slow if there are a moderate number of entries. Fix here is to call Control::SetFont - we can do this because we know that switching between highlight and default font wont change the font dimensions. On the other hand - this highlighting entries when selected is (at least on linux) already supported by the native widget. Change-Id: I12d32f6f7b43e669442e462ad4dd80cde24b9e74
-rw-r--r--svtools/source/contnr/svtreebx.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/svtools/source/contnr/svtreebx.cxx b/svtools/source/contnr/svtreebx.cxx
index 8e37676503d1..92d91d2e188a 100644
--- a/svtools/source/contnr/svtreebx.cxx
+++ b/svtools/source/contnr/svtreebx.cxx
@@ -1587,7 +1587,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl
if ( !bCurFontIsSel )
{
SetTextColor( aHighlightTextColor );
- SetFont( aHighlightFont );
+ Control::SetFont( aHighlightFont );
bCurFontIsSel = true;
}
}
@@ -1601,7 +1601,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl
{
bCurFontIsSel = false;
SetTextColor( aBackupTextColor );
- SetFont( aBackupFont );
+ Control::SetFont( aBackupFont );
}
}
@@ -1681,7 +1681,7 @@ long SvTreeListBox::PaintEntry1(SvLBoxEntry* pEntry,long nLine,sal_uInt16 nTabFl
if( bCurFontIsSel )
{
SetTextColor( aBackupTextColor );
- SetFont( aBackupFont );
+ Control::SetFont( aBackupFont );
}
sal_uInt16 nFirstDynTabPos;