remove unused enum value SvTLEntryFlags::IN_USE

Change-Id: Ieb09d4d28cc2084da4660165a96561ee57d2420d
Reviewed-on: https://gerrit.libreoffice.org/64029
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin 2018-11-23 15:14:41 +02:00
parent 4a59a8aba8
commit acfa3917ab
5 changed files with 27 additions and 50 deletions

View File

@ -1072,8 +1072,6 @@ include/vcl/salctype.hxx:41
enum ConvertDataFormat PDF enum ConvertDataFormat PDF
include/vcl/splitwin.hxx:37 include/vcl/splitwin.hxx:37
enum SplitWindowItemFlags Invisible enum SplitWindowItemFlags Invisible
include/vcl/treelistentry.hxx:38
enum SvTLEntryFlags IN_USE
include/vcl/vclenum.hxx:37 include/vcl/vclenum.hxx:37
enum MenuItemBits POPUPSELECT enum MenuItemBits POPUPSELECT
include/vcl/vclenum.hxx:143 include/vcl/vclenum.hxx:143

View File

@ -35,16 +35,15 @@ enum class SvTLEntryFlags
NONE = 0x0000, NONE = 0x0000,
CHILDREN_ON_DEMAND = 0x0001, CHILDREN_ON_DEMAND = 0x0001,
DISABLE_DROP = 0x0002, DISABLE_DROP = 0x0002,
IN_USE = 0x0004,
// is set if RequestingChildren has not set any children // is set if RequestingChildren has not set any children
NO_NODEBMP = 0x0008, NO_NODEBMP = 0x0004,
// entry had or has children // entry had or has children
HAD_CHILDREN = 0x0010, HAD_CHILDREN = 0x0010,
SEMITRANSPARENT = 0x8000, // draw semi-transparent entry bitmaps SEMITRANSPARENT = 0x8000, // draw semi-transparent entry bitmaps
}; };
namespace o3tl namespace o3tl
{ {
template<> struct typed_flags<SvTLEntryFlags> : is_typed_flags<SvTLEntryFlags, 0x801f> {}; template<> struct typed_flags<SvTLEntryFlags> : is_typed_flags<SvTLEntryFlags, 0x8017> {};
} }
class VCL_DLLPUBLIC SvTreeListEntry class VCL_DLLPUBLIC SvTreeListEntry
@ -104,7 +103,6 @@ public:
void SetUserData( void* pPtr ); void SetUserData( void* pPtr );
void EnableChildrenOnDemand( bool bEnable=true ); void EnableChildrenOnDemand( bool bEnable=true );
bool HasChildrenOnDemand() const; bool HasChildrenOnDemand() const;
bool HasInUseEmphasis() const;
SvTLEntryFlags GetFlags() const { return nEntryFlags;} SvTLEntryFlags GetFlags() const { return nEntryFlags;}
void SetFlags( SvTLEntryFlags nFlags ); void SetFlags( SvTLEntryFlags nFlags );

View File

@ -101,7 +101,6 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, long nY,
Color aBackupColor = rRenderContext.GetFillColor(); Color aBackupColor = rRenderContext.GetFillColor();
bool bCurFontIsSel = false; bool bCurFontIsSel = false;
bool bInUse = rEntry.HasInUseEmphasis();
const WinBits nWindowStyle = GetStyle(); const WinBits nWindowStyle = GetStyle();
const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) !=0 && !HasFocus(); const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) !=0 && !HasFocus();
const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings(); const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings();
@ -142,22 +141,19 @@ void IconView::PaintEntry(SvTreeListEntry& rEntry, long nX, long nY,
if (pViewDataEntry->IsHighlighted()) if (pViewDataEntry->IsHighlighted())
{ {
Color aNewWallColor = rSettings.GetHighlightColor(); Color aNewWallColor = rSettings.GetHighlightColor();
if (!bInUse) // if the face color is bright then the deactive color is also bright
// -> so you can't see any deactive selection
if (bHideSelection && !rSettings.GetFaceColor().IsBright()
&& aWallpaper.GetColor().IsBright() != rSettings.GetDeactiveColor().IsBright())
{ {
// if the face color is bright then the deactive color is also bright aNewWallColor = rSettings.GetDeactiveColor();
// -> so you can't see any deactive selection }
if (bHideSelection && !rSettings.GetFaceColor().IsBright() // set font color to highlight
&& aWallpaper.GetColor().IsBright() != rSettings.GetDeactiveColor().IsBright()) if (!bCurFontIsSel)
{ {
aNewWallColor = rSettings.GetDeactiveColor(); rRenderContext.SetTextColor(aHighlightTextColor);
} rRenderContext.SetFont(aHighlightFont);
// set font color to highlight bCurFontIsSel = true;
if (!bCurFontIsSel)
{
rRenderContext.SetTextColor(aHighlightTextColor);
rRenderContext.SetFont(aHighlightFont);
bCurFontIsSel = true;
}
} }
aWallpaper.SetColor(aNewWallColor); aWallpaper.SetColor(aNewWallColor);
} }

View File

@ -2657,7 +2657,6 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
Color aBackupColor = rRenderContext.GetFillColor(); Color aBackupColor = rRenderContext.GetFillColor();
bool bCurFontIsSel = false; bool bCurFontIsSel = false;
bool bInUse = rEntry.HasInUseEmphasis();
// if a ClipRegion was set from outside, we don't have to reset it // if a ClipRegion was set from outside, we don't have to reset it
const WinBits nWindowStyle = GetStyle(); const WinBits nWindowStyle = GetStyle();
const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) !=0 && !HasFocus(); const bool bHideSelection = (nWindowStyle & WB_HIDESELECTION) !=0 && !HasFocus();
@ -2712,37 +2711,29 @@ void SvTreeListBox::PaintEntry1(SvTreeListEntry& rEntry, long nLine, vcl::Render
Wallpaper aWallpaper = rRenderContext.GetBackground(); Wallpaper aWallpaper = rRenderContext.GetBackground();
bool bSelTab = bool(nFlags & SvLBoxTabFlags::SHOW_SELECTION); bool bSelTab = bool(nFlags & SvLBoxTabFlags::SHOW_SELECTION);
SvLBoxItemType nItemType = rItem.GetType();
if (pViewDataEntry->IsHighlighted() && bSelTab) if (pViewDataEntry->IsHighlighted() && bSelTab)
{ {
Color aNewWallColor = rSettings.GetHighlightColor(); Color aNewWallColor = rSettings.GetHighlightColor();
if (!bInUse || nItemType != SvLBoxItemType::ContextBmp) // if the face color is bright then the deactive color is also bright
// -> so you can't see any deactive selection
if (bHideSelection && !rSettings.GetFaceColor().IsBright()
&& aWallpaper.GetColor().IsBright() != rSettings.GetDeactiveColor().IsBright())
{ {
// if the face color is bright then the deactive color is also bright aNewWallColor = rSettings.GetDeactiveColor();
// -> so you can't see any deactive selection }
if (bHideSelection && !rSettings.GetFaceColor().IsBright() // set font color to highlight
&& aWallpaper.GetColor().IsBright() != rSettings.GetDeactiveColor().IsBright()) if (!bCurFontIsSel)
{ {
aNewWallColor = rSettings.GetDeactiveColor(); rRenderContext.SetTextColor(aHighlightTextColor);
} rRenderContext.SetFont(aHighlightFont);
// set font color to highlight bCurFontIsSel = true;
if (!bCurFontIsSel)
{
rRenderContext.SetTextColor(aHighlightTextColor);
rRenderContext.SetFont(aHighlightFont);
bCurFontIsSel = true;
}
} }
aWallpaper.SetColor(aNewWallColor); aWallpaper.SetColor(aNewWallColor);
} }
else // no selection else // no selection
{ {
if (bInUse && nItemType == SvLBoxItemType::ContextBmp) if (bCurFontIsSel || rEntry.GetTextColor())
{
aWallpaper.SetColor(rSettings.GetFieldColor());
}
else if (bCurFontIsSel || rEntry.GetTextColor())
{ {
bCurFontIsSel = false; bCurFontIsSel = false;
if (const auto* pCustomTextColor = rEntry.GetTextColor()) if (const auto* pCustomTextColor = rEntry.GetTextColor())

View File

@ -202,12 +202,6 @@ bool SvTreeListEntry::HasChildrenOnDemand() const
return static_cast<bool>(nEntryFlags & SvTLEntryFlags::CHILDREN_ON_DEMAND); return static_cast<bool>(nEntryFlags & SvTLEntryFlags::CHILDREN_ON_DEMAND);
} }
bool SvTreeListEntry::HasInUseEmphasis() const
{
return static_cast<bool>(nEntryFlags & SvTLEntryFlags::IN_USE);
}
void SvTreeListEntry::SetFlags( SvTLEntryFlags nFlags ) void SvTreeListEntry::SetFlags( SvTLEntryFlags nFlags )
{ {
nEntryFlags = nFlags; nEntryFlags = nFlags;