Kaydet (Commit) 61acb9be authored tarafından Ivan Timofeev's avatar Ivan Timofeev

fdo#47752: first column of checkboxes is too small

Change-Id: I199276a99063d5a125be1f2cd5d71574f078a82e
üst 628cec2a
...@@ -78,6 +78,8 @@ class SVT_DLLPUBLIC SvTreeListBox : public SvLBox ...@@ -78,6 +78,8 @@ class SVT_DLLPUBLIC SvTreeListBox : public SvLBox
short nFocusWidth; short nFocusWidth;
sal_uInt16 aContextBmpMode; sal_uInt16 aContextBmpMode;
long mnCheckboxItemWidth;
#ifdef _SVTREEBX_CXX #ifdef _SVTREEBX_CXX
DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * ); DECL_DLLPRIVATE_LINK( CheckButtonClick, SvLBoxButtonData * );
......
...@@ -88,6 +88,7 @@ void SvTreeListBox::InitTreeView() ...@@ -88,6 +88,7 @@ void SvTreeListBox::InitTreeView()
nFirstSelTab = 0; nFirstSelTab = 0;
nLastSelTab = 0; nLastSelTab = 0;
nFocusWidth = -1; nFocusWidth = -1;
mnCheckboxItemWidth = 0;
Link* pLink = new Link( LINK(this,SvTreeListBox, DefaultCompare) ); Link* pLink = new Link( LINK(this,SvTreeListBox, DefaultCompare) );
pLBoxImpl->m_pLink = pLink; pLBoxImpl->m_pLink = pLink;
...@@ -212,9 +213,11 @@ void SvTreeListBox::SetTabs() ...@@ -212,9 +213,11 @@ void SvTreeListBox::SetTabs()
long nStartPos = TAB_STARTPOS; long nStartPos = TAB_STARTPOS;
long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width(); long nNodeWidthPixel = GetExpandedNodeBmp().GetSizePixel().Width();
// pCheckButtonData->Width() knows nothing about the native checkbox width,
// so we have mnCheckboxItemWidth which becomes valid when something is added.
long nCheckWidth = 0; long nCheckWidth = 0;
if( nTreeFlags & TREEFLAG_CHKBTN ) if( nTreeFlags & TREEFLAG_CHKBTN )
nCheckWidth = pCheckButtonData->aBmps[0].GetSizePixel().Width(); nCheckWidth = mnCheckboxItemWidth;
long nCheckWidthDIV2 = nCheckWidth / 2; long nCheckWidthDIV2 = nCheckWidth / 2;
long nContextWidth = nContextBmpWidthMax; long nContextWidth = nContextBmpWidthMax;
...@@ -519,6 +522,20 @@ void SvTreeListBox::ImpEntryInserted( SvLBoxEntry* pEntry ) ...@@ -519,6 +522,20 @@ void SvTreeListBox::ImpEntryInserted( SvLBoxEntry* pEntry )
} }
} }
SetEntryHeight( (SvLBoxEntry*)pEntry ); SetEntryHeight( (SvLBoxEntry*)pEntry );
if( nTreeFlags & TREEFLAG_CHKBTN )
{
SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
if( pItem )
{
long nWidth = pItem->GetSize(this, pEntry).Width();
if( mnCheckboxItemWidth < nWidth )
{
mnCheckboxItemWidth = nWidth;
nTreeFlags |= TREEFLAG_RECALCTABS;
}
}
}
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment