diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-13 14:38:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-02-14 06:00:14 +0000 |
commit | 8593cd238cd049ecf9036833d5c83aad23082e26 (patch) | |
tree | f94e7da32c2d880828b6207b5b58acb892ee6a08 /svx/source/sidebar/tools | |
parent | 93837254b7085c6632d76244d9ac466503ef47e0 (diff) |
remove unused ValueSetWithTextControl::ControlType enum
since we only ever use the TextText enumerator
Change-Id: Idfb96ad6ea3461e886439df33695be2d8dcebef9
Reviewed-on: https://gerrit.libreoffice.org/34211
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source/sidebar/tools')
-rw-r--r-- | svx/source/sidebar/tools/ValueSetWithTextControl.cxx | 46 |
1 files changed, 8 insertions, 38 deletions
diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx index 1d8f88710c6c..7f1834173f93 100644 --- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx +++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx @@ -32,7 +32,6 @@ namespace svx { namespace sidebar { ValueSetWithTextControl::ValueSetWithTextControl(Window* pParent, WinBits nBits) : ValueSet( pParent, nBits ) - , meControlType( svx::sidebar::ValueSetWithTextControl::ControlType::TextText ) { SetColCount(); } @@ -42,11 +41,6 @@ void ValueSetWithTextControl::AddItem( const OUString& rItemText, const OUString& rItemText2 ) { - if ( meControlType != ControlType::TextText ) - { - return; - } - ValueSetWithTextItem aItem; aItem.maItemText = rItemText; aItem.maItemText2 = rItemText2; @@ -65,7 +59,6 @@ void ValueSetWithTextControl::UserDraw( const UserDrawEvent& rUDEvt ) const sal_uInt16 nItemId = rUDEvt.GetItemId(); const long nRectHeight = aRect.GetHeight(); - const Point aBLPos = aRect.TopLeft(); vcl::Font aFont(OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, MsLangId::getSystemLanguage(), GetDefaultFontFlags::OnlyOne)); { @@ -90,50 +83,27 @@ void ValueSetWithTextControl::UserDraw( const UserDrawEvent& rUDEvt ) pDev->DrawRect(aRect); } - //draw image + text resp. text + text - Image* pImage = nullptr; if ( GetSelectItemId() == nItemId ) { aFont.SetColor( sfx2::sidebar::Theme::GetColor( sfx2::sidebar::Theme::Color_HighlightText ) ); - pImage = &maItems[nItemId-1].maSelectedItemImage; } else { aFont.SetColor( GetSettings().GetStyleSettings().GetFieldTextColor() ); - pImage = &maItems[nItemId-1].maItemImage; } Rectangle aStrRect = aRect; aStrRect.Top() += nRectHeight/4; aStrRect.Bottom() -= nRectHeight/4; - switch ( meControlType ) - { - case ControlType::ImageText: - { - Point aImgStart( - aBLPos.X() + 4, - aBLPos.Y() + ( ( nRectHeight - pImage->GetSizePixel().Height() ) / 2 ) ); - pDev->DrawImage( aImgStart, *pImage ); - - aStrRect.Left() += pImage->GetSizePixel().Width() + 12; - pDev->SetFont(aFont); - pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText, DrawTextFlags::EndEllipsis); - } - break; - case ControlType::TextText: - { - const long nRectWidth = aRect.GetWidth(); - aStrRect.Left() += 8; - aStrRect.Right() -= (nRectWidth*2)/3; - pDev->SetFont(aFont); - pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText, DrawTextFlags::EndEllipsis); - aStrRect.Left() += nRectWidth/3; - aStrRect.Right() += (nRectWidth*2)/3; - pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText2, DrawTextFlags::EndEllipsis); - } - break; - } + const long nRectWidth = aRect.GetWidth(); + aStrRect.Left() += 8; + aStrRect.Right() -= (nRectWidth*2)/3; + pDev->SetFont(aFont); + pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText, DrawTextFlags::EndEllipsis); + aStrRect.Left() += nRectWidth/3; + aStrRect.Right() += (nRectWidth*2)/3; + pDev->DrawText(aStrRect, maItems[nItemId-1].maItemText2, DrawTextFlags::EndEllipsis); } Invalidate( aRect ); |