summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorJason Hulme <jsnhulme@gmail.com>2013-06-05 12:33:38 -0700
committerMiklos Vajna <vmiklos@suse.cz>2013-06-07 07:42:54 +0000
commit8ac87296c3f5f67d34336bf1eb75d1a6cc81e1c7 (patch)
treed6b9bd9fcf7de011f23ac5ee330458e884b89a30 /svtools
parent803bd5f1f23a1330d8c51942234e3a51671b7048 (diff)
fdo#63866 Hid useless checkboxes
Added functions to SvTreeListBox and SvLBoxButton to allow entries with hidden checkboxes Change-Id: Ia5a1deabea6c01aad5e4010612ac453c669258a6 Reviewed-on: https://gerrit.libreoffice.org/4169 Reviewed-by: Miklos Vajna <vmiklos@suse.cz> Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/contnr/svlbitm.cxx11
-rw-r--r--svtools/source/contnr/treelistbox.cxx11
2 files changed, 20 insertions, 2 deletions
diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx
index bc349048c75e..ca3b3423659d 100644
--- a/svtools/source/contnr/svlbitm.cxx
+++ b/svtools/source/contnr/svlbitm.cxx
@@ -318,6 +318,7 @@ SvLBoxButton::SvLBoxButton( SvTreeListEntry* pEntry, SvLBoxButtonKind eTheKind,
nItemFlags = 0;
SetStateUnchecked();
pData = pBData;
+ isVis = true;
}
SvLBoxButton::SvLBoxButton() : SvLBoxItem()
@@ -389,11 +390,12 @@ void SvLBoxButton::Paint(
else if ( IsStateTristate() )
aControlValue.setTristateVal( BUTTONVALUE_MIXED );
- bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL,
+ if( isVis)
+ bNativeOK = rDev.DrawNativeControl( eCtrlType, PART_ENTIRE_CONTROL,
aCtrlRegion, nState, aControlValue, OUString() );
}
- if( !bNativeOK)
+ if( !bNativeOK && isVis )
rDev.DrawImage( rPos, pData->aBmps[nIndex + nBaseOffs] ,nStyle);
}
@@ -459,6 +461,11 @@ bool SvLBoxButton::CheckModification() const
return eKind == SvLBoxButtonKind_enabledCheckbox;
}
+void SvLBoxButton::SetStateInvisible()
+{
+ isVis = false;
+}
+
// ***************************************************************
// class SvLBoxContextBmp
// ***************************************************************
diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index 1d4611df7d67..10c3c6588933 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -2012,6 +2012,17 @@ void SvTreeListBox::SetCheckButtonState( SvTreeListEntry* pEntry, SvButtonState
}
}
+void SvTreeListBox::SetCheckButtonInvisible( SvTreeListEntry* pEntry)
+{
+ DBG_CHKTHIS(SvTreeListBox,0);
+ if( nTreeFlags & TREEFLAG_CHKBTN )
+ {
+ SvLBoxButton* pItem = (SvLBoxButton*)(pEntry->GetFirstItem(SV_ITEM_ID_LBOXBUTTON));
+ pItem->SetStateInvisible();
+ InvalidateEntry( pEntry );
+ }
+}
+
SvButtonState SvTreeListBox::GetCheckButtonState( SvTreeListEntry* pEntry ) const
{
DBG_CHKTHIS(SvTreeListBox,0);