include/svtools/ctrlbox.hxx | 10 ------ svtools/source/control/ctrlbox.cxx | 56 +++---------------------------------- 2 files changed, 6 insertions(+), 60 deletions(-)
New commits: commit 1ebb9355a5ffcefdb14dfd54258aeda97d0369c1 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Nov 7 17:24:57 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Nov 8 09:18:20 2022 +0100 Related: tdf#150273 maPaintCol is unused now Change-Id: I823a2ec24aea47b4b3d005107c8a18fec223e6df Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142398 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index f0427d2d5f1d..d7751c12f53a 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -250,7 +250,6 @@ private: Color nColor1, Color nColor2, Color nColorDist, SvxBorderLineStyle nStyle, BitmapEx& rBmp ); - void UpdatePaintLineColor(); // returns sal_True if maPaintCol has changed DECL_DLLPRIVATE_LINK(ValueSelectHdl, ValueSet*, void); DECL_DLLPRIVATE_LINK(FocusHdl, weld::Widget&, void); DECL_DLLPRIVATE_LINK(ToggleHdl, weld::Toggleable&, void); @@ -259,11 +258,6 @@ private: void UpdateEntries(); sal_Int32 GetStylePos(sal_Int32 nListPos) const; - const Color& GetPaintColor() const - { - return maPaintCol; - } - void UpdatePreview(); SvtLineListBox( const SvtLineListBox& ) = delete; @@ -280,7 +274,6 @@ private: tools::Long m_nWidth; ScopedVclPtr<VirtualDevice> aVirDev; Color aColor; - Color maPaintCol; FieldUnit eSourceUnit; Link<SvtLineListBox&,void> maSelectHdl; }; diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 20fe74bf4bb5..dbfcf84e679f 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1406,7 +1406,6 @@ SvtLineListBox::SvtLineListBox(std::unique_ptr<weld::MenuButton> pControl) , m_nWidth( 5 ) , aVirDev(VclPtr<VirtualDevice>::Create()) , aColor(COL_BLACK) - , maPaintCol(COL_BLACK) { const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); m_xLineSet->SetStyle(WinBits(WB_FLATVALUESET | WB_NO_DIRECTSELECT | WB_TABSTOP)); @@ -1434,8 +1433,6 @@ SvtLineListBox::SvtLineListBox(std::unique_ptr<weld::MenuButton> pControl) aVirDev->SetLineColor(); aVirDev->SetMapMode(MapMode(MapUnit::MapTwip)); - - UpdatePaintLineColor(); } IMPL_LINK_NOARG(SvtLineListBox, FocusHdl, weld::Widget&, void) @@ -1512,21 +1509,8 @@ void SvtLineListBox::InsertEntry( rWidthImpl, nStyle, nMinWidth, pColor1Fn, pColor2Fn, pColorDistFn)); } -void SvtLineListBox::UpdatePaintLineColor() -{ - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - Color aNewCol(rSettings.GetWindowColor().IsDark() ? rSettings.GetLabelTextColor() : aColor); - - bool bRet = aNewCol != maPaintCol; - - if( bRet ) - maPaintCol = aNewCol; -} - void SvtLineListBox::UpdateEntries() { - UpdatePaintLineColor( ); - SvxBorderLineStyle eSelected = GetSelectEntryStyle(); // Remove the old entries commit 1e0b50c17b80146e4840994703369bae904b2207 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Mon Nov 7 17:17:30 2022 +0000 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Nov 8 09:18:05 2022 +0100 Related: tdf#150273 just take the color direct from the current entry no need for the indirection, which is out by one anyway, perhaps from some time that the "none" entry was in the list vs a separate widget as it is now Change-Id: I028e03260f500473b42847ee748d7af8a4791ccd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/142397 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 180fb64bfac6..f0427d2d5f1d 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -263,9 +263,6 @@ private: { return maPaintCol; } - Color GetColorLine1( sal_Int32 nPos ); - Color GetColorLine2( sal_Int32 nPos ); - Color GetColorDist( sal_Int32 nPos ); void UpdatePreview(); diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 4ce41da23721..20fe74bf4bb5 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -1532,8 +1532,10 @@ void SvtLineListBox::UpdateEntries() // Remove the old entries m_xLineSet->Clear(); - // Add the new entries based on the defined width + const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); + Color aFieldColor = rSettings.GetFieldColor(); + // Add the new entries based on the defined width sal_uInt16 n = 0; sal_uInt16 nCount = m_vLineList.size( ); while ( n < nCount ) @@ -1543,9 +1545,9 @@ void SvtLineListBox::UpdateEntries() ImpGetLine( pData->GetLine1ForWidth( m_nWidth ), pData->GetLine2ForWidth( m_nWidth ), pData->GetDistForWidth( m_nWidth ), - GetColorLine1(m_xLineSet->GetItemCount()), - GetColorLine2(m_xLineSet->GetItemCount()), - GetColorDist(m_xLineSet->GetItemCount()), + pData->GetColorLine1(aColor), + pData->GetColorLine2(aColor), + pData->GetColorDist(aColor, aFieldColor), pData->GetStyle(), aBmp ); sal_Int16 nItemId = static_cast<sal_Int16>(pData->GetStyle()) + 1; m_xLineSet->InsertItem(nItemId, Image(aBmp), GetLineStyleName(pData->GetStyle())); @@ -1557,36 +1559,6 @@ void SvtLineListBox::UpdateEntries() m_xLineSet->SetOptimalSize(); } -Color SvtLineListBox::GetColorLine1( sal_Int32 nPos ) -{ - sal_Int32 nStyle = GetStylePos( nPos ); - if (nStyle == -1) - return GetPaintColor( ); - auto& pData = m_vLineList[ nStyle ]; - return pData->GetColorLine1( GetColor( ) ); -} - -Color SvtLineListBox::GetColorLine2( sal_Int32 nPos ) -{ - sal_Int32 nStyle = GetStylePos(nPos); - if (nStyle == -1) - return GetPaintColor( ); - auto& pData = m_vLineList[ nStyle ]; - return pData->GetColorLine2( GetColor( ) ); -} - -Color SvtLineListBox::GetColorDist( sal_Int32 nPos ) -{ - const StyleSettings& rSettings = Application::GetSettings().GetStyleSettings(); - Color rResult = rSettings.GetFieldColor(); - - sal_Int32 nStyle = GetStylePos( nPos ); - if (nStyle == -1) - return rResult; - auto& pData = m_vLineList[ nStyle ]; - return pData->GetColorDist( GetColor( ), rResult ); -} - IMPL_LINK_NOARG(SvtLineListBox, ValueSelectHdl, ValueSet*, void) { maSelectHdl.Call(*this);