compilerplugins/clang/unusedenumconstants.readonly.results | 6 - include/svtools/ivctrl.hxx | 12 --- svtools/source/contnr/imivctl.hxx | 4 - svtools/source/contnr/imivctl1.cxx | 42 +++---------- 4 files changed, 15 insertions(+), 49 deletions(-)
New commits: commit 1fb4a211983e120a330ebfe32c23cd617df0bead Author: Noel Grandin <[email protected]> AuthorDate: Mon Nov 26 11:20:26 2018 +0200 Commit: Noel Grandin <[email protected]> CommitDate: Tue Nov 27 13:54:09 2018 +0100 remove unused SvxIconViewFlags enum values Change-Id: I31f810383fb92b2d0dbe9fa9162b77f137154e91 Reviewed-on: https://gerrit.libreoffice.org/64085 Tested-by: Jenkins Reviewed-by: Noel Grandin <[email protected]> diff --git a/compilerplugins/clang/unusedenumconstants.readonly.results b/compilerplugins/clang/unusedenumconstants.readonly.results index e450cd2a73a2..697a01a18bf6 100644 --- a/compilerplugins/clang/unusedenumconstants.readonly.results +++ b/compilerplugins/clang/unusedenumconstants.readonly.results @@ -480,12 +480,6 @@ include/svtools/headbar.hxx:189 enum HeaderBarItemBits BOTTOM include/svtools/headbar.hxx:191 enum HeaderBarItemBits RIGHTIMAGE -include/svtools/ivctrl.hxx:43 - enum SvxIconViewFlags CURSORED -include/svtools/ivctrl.hxx:45 - enum SvxIconViewFlags DROP_TARGET -include/svtools/ivctrl.hxx:46 - enum SvxIconViewFlags BLOCK_EMPHASIS include/svtools/table/tablemodel.hxx:48 enum ColumnAttributeGroup ALL include/svx/EnhancedCustomShapeGeometry.hxx:46 diff --git a/include/svtools/ivctrl.hxx b/include/svtools/ivctrl.hxx index 531cc86bc251..ccdadaf7dee1 100644 --- a/include/svtools/ivctrl.hxx +++ b/include/svtools/ivctrl.hxx @@ -40,15 +40,12 @@ enum class SvxIconViewFlags POS_LOCKED = 0x0001, SELECTED = 0x0002, FOCUSED = 0x0004, - CURSORED = 0x0010, // Border around image - POS_MOVED = 0x0020, // Moved by Drag and Drop, but not logged - DROP_TARGET = 0x0040, // Set in QueryDrop - BLOCK_EMPHASIS = 0x0080, // Do not paint Emphasis - PRED_SET = 0x0400, // Predecessor moved + POS_MOVED = 0x0008, // Moved by Drag and Drop, but not logged + PRED_SET = 0x0010, // Predecessor moved }; namespace o3tl { - template<> struct typed_flags<SvxIconViewFlags> : is_typed_flags<SvxIconViewFlags, 0x04f7> {}; + template<> struct typed_flags<SvxIconViewFlags> : is_typed_flags<SvxIconViewFlags, 0x001f> {}; } enum class SvxIconChoiceCtrlTextMode @@ -129,9 +126,6 @@ public: SvxIconViewFlags GetFlags() const { return nFlags; } bool IsSelected() const { return bool(nFlags & SvxIconViewFlags::SELECTED); } bool IsFocused() const { return bool(nFlags & SvxIconViewFlags::FOCUSED); } - bool IsCursored() const { return bool(nFlags & SvxIconViewFlags::CURSORED); } - bool IsDropTarget() const { return bool(nFlags & SvxIconViewFlags::DROP_TARGET); } - bool IsBlockingEmphasis() const { return bool(nFlags & SvxIconViewFlags::BLOCK_EMPHASIS); } bool IsPosLocked() const { return bool(nFlags & SvxIconViewFlags::POS_LOCKED); } }; diff --git a/svtools/source/contnr/imivctl.hxx b/svtools/source/contnr/imivctl.hxx index cb2c4b47b244..52f73e7b6802 100644 --- a/svtools/source/contnr/imivctl.hxx +++ b/svtools/source/contnr/imivctl.hxx @@ -382,8 +382,8 @@ public: } static bool IsBoundingRectValid( const tools::Rectangle& rRect ) { return ( rRect.Right() != LONG_MAX ); } - void PaintEmphasis(const tools::Rectangle& rRect1, bool bSelected, - bool bDropTarget, bool bCursored, vcl::RenderContext& rRenderContext ); + static void PaintEmphasis(const tools::Rectangle& rRect1, bool bSelected, + vcl::RenderContext& rRenderContext ); void PaintItem(const tools::Rectangle& rRect, IcnViewFieldType eItem, SvxIconChoiceCtrlEntry* pEntry, sal_uInt16 nPaintFlags, vcl::RenderContext& rRenderContext); diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 066562294ce0..2d2269b492e5 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -1414,45 +1414,28 @@ void SvxIconChoiceCtrl_Impl::SetUpdateMode( bool bUpdate ) } } -// priorities of the emphasis: bDropTarget => bCursored => bSelected +// priorities of the emphasis: bSelected void SvxIconChoiceCtrl_Impl::PaintEmphasis(const tools::Rectangle& rTextRect, bool bSelected, - bool bDropTarget, bool bCursored, vcl::RenderContext& rRenderContext) + vcl::RenderContext& rRenderContext) { static Color aTransparent(COL_TRANSPARENT); - const StyleSettings& rSettings = rRenderContext.GetSettings().GetStyleSettings(); Color aOldFillColor(rRenderContext.GetFillColor()); bool bSolidTextRect = false; - if(bDropTarget && (eSelectionMode != SelectionMode::NONE)) + if (!bSelected) { - rRenderContext.SetFillColor(rSettings.GetHighlightColor()); - bSolidTextRect = true; - } - else - { - if (!bSelected || bCursored) - { - const Color& rFillColor = rRenderContext.GetFont().GetFillColor(); - rRenderContext.SetFillColor(rFillColor); - if (rFillColor != aTransparent) - bSolidTextRect = true; - } + const Color& rFillColor = rRenderContext.GetFont().GetFillColor(); + rRenderContext.SetFillColor(rFillColor); + if (rFillColor != aTransparent) + bSolidTextRect = true; } // draw text rectangle if (bSolidTextRect) { - Color aOldLineColor; - if (bCursored) - { - aOldLineColor = rRenderContext.GetLineColor(); - rRenderContext.SetLineColor(COL_GRAY); - } rRenderContext.DrawRect(rTextRect); - if (bCursored) - rRenderContext.SetLineColor(aOldLineColor); } rRenderContext.SetFillColor(aOldFillColor); @@ -1494,17 +1477,13 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po if (eSelectionMode != SelectionMode::NONE) bSelected = pEntry->IsSelected(); - bool bCursored = pEntry->IsCursored(); - bool bDropTarget = pEntry->IsDropTarget(); - bool bNoEmphasis = pEntry->IsBlockingEmphasis(); - rRenderContext.Push(PushFlags::FONT | PushFlags::TEXTCOLOR); OUString aEntryText(SvtIconChoiceCtrl::GetEntryText(pEntry)); tools::Rectangle aTextRect(CalcTextRect(pEntry, &rPos, false, &aEntryText)); tools::Rectangle aBmpRect(CalcBmpRect(pEntry, &rPos)); - bool bShowSelection = ((bSelected && !bCursored) && !bNoEmphasis && (eSelectionMode != SelectionMode::NONE)); + bool bShowSelection = (bSelected && (eSelectionMode != SelectionMode::NONE)); bool bActiveSelection = (0 != (nWinBits & WB_NOHIDESELECTION)) || pView->HasFocus(); @@ -1550,8 +1529,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po nBmpPaintFlags |= PAINTFLAG_HOR_CENTERED; sal_uInt16 nTextPaintFlags = bLargeIconMode ? PAINTFLAG_HOR_CENTERED : PAINTFLAG_VER_CENTERED; - if( !bNoEmphasis ) - PaintEmphasis(aTextRect, bSelected, bDropTarget, bCursored, rRenderContext); + PaintEmphasis(aTextRect, bSelected, rRenderContext); if ( bShowSelection ) vcl::RenderTools::DrawSelectionBackground(rRenderContext, *pView.get(), CalcFocusRect(pEntry), @@ -1563,7 +1541,7 @@ void SvxIconChoiceCtrl_Impl::PaintEntry(SvxIconChoiceCtrlEntry* pEntry, const Po PaintItem(aTextRect, IcnViewFieldType::Text, pEntry, nTextPaintFlags, rRenderContext); // draw highlight frame - if (pEntry == pCurHighlightFrame && !bNoEmphasis) + if (pEntry == pCurHighlightFrame) DrawHighlightFrame(rRenderContext, CalcFocusRect(pEntry)); rRenderContext.Pop(); _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
