tdf#161853 vcl: Drop SvtIconChoiceCtrl::GetEntryText

Just call `SvxIconChoiceCtrlEntry::GetText` directly
instead of having an extra level of indirection to
get the same result.

Change-Id: I6a299f5de4e7979044ade11e5441260383ce0b87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169834
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx
index 0f331a8..29ea93d 100644
--- a/include/vcl/toolkit/ivctrl.hxx
+++ b/include/vcl/toolkit/ivctrl.hxx
@@ -182,8 +182,6 @@ class UNLESS_MERGELIBS_MORE(VCL_DLLPUBLIC) SvtIconChoiceCtrl final : public Cont
    virtual void        DataChanged( const DataChangedEvent& rDCEvt ) override;
    virtual void        RequestHelp( const HelpEvent& rHEvt ) override;

    static OUString     GetEntryText( SvxIconChoiceCtrlEntry const * pEntry );

    virtual void        FillLayoutData() const override;

    void                CallImplEventListeners(VclEventId nEvent, void* pData);
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 9d0cedf..97d38a3 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -1362,9 +1362,7 @@ void SvxIconChoiceCtrl_Impl::PaintItem(const tools::Rectangle& rRect,
{
    if (eItem == IcnViewFieldType::Text)
    {
        OUString aText = SvtIconChoiceCtrl::GetEntryText(pEntry);

        rRenderContext.DrawText(rRect, aText, nCurTextDrawFlags);
        rRenderContext.DrawText(rRect, pEntry->GetText(), nCurTextDrawFlags);

        if (pEntry->IsFocused())
            DrawFocusRect(rRenderContext, pEntry);
@@ -1582,7 +1580,7 @@ tools::Rectangle SvxIconChoiceCtrl_Impl::CalcTextRect( SvxIconChoiceCtrlEntry* p
    if( pEntryPos )
        aBound.SetPos( *pEntryPos );

    const OUString aEntryText = SvtIconChoiceCtrl::GetEntryText(pEntry);
    const OUString aEntryText = pEntry->GetText();
    tools::Rectangle aTextRect = pView->GetTextRect( aMaxTextRect, aEntryText, nCurTextDrawFlags );

    Size aTextSize( aTextRect.GetSize() );
@@ -2758,7 +2756,7 @@ bool SvxIconChoiceCtrl_Impl::RequestHelp( const HelpEvent& rHEvt )

    OUString sQuickHelpText = pEntry->GetQuickHelpText();
    tools::Rectangle aTextRect(CalcTextRect(pEntry, nullptr));
    OUString aEntryText( SvtIconChoiceCtrl::GetEntryText( pEntry ) );
    const OUString aEntryText = pEntry->GetText();
    if ( ( !aTextRect.Contains( aPos ) || aEntryText.isEmpty() ) && sQuickHelpText.isEmpty() )
        return false;

diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index bf3cb1c..f8e0985 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -125,11 +125,6 @@ void SvtIconChoiceCtrl::RemoveEntry(sal_Int32 nIndex)
    _pImpl->RemoveEntry(nIndex);
}

OUString SvtIconChoiceCtrl::GetEntryText( SvxIconChoiceCtrlEntry const * pEntry )
{
    return pEntry->GetText();
}

void SvtIconChoiceCtrl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
{
    _pImpl->Paint(rRenderContext, rRect);