summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-07-01 16:24:59 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2024-07-02 10:02:16 +0200
commit01fa9762bcf761e5a1fd9eac6740e6829f21b5b1 (patch)
tree0e4b286d4c0a265c06d0da2edadc0b9f0c501c5a /vcl/source/control
parentf9f0bf9b47a627e13477ac893bcb9436c72a49d5 (diff)
tdf#161853 vcl: Simplify SvxIconChoiceCtrl_Impl::SetEntryTextMode
It never gets called with a null SvxIconChoiceCtrlEntry, so change the param from pointer to reference (also in `SvtIconChoiceCtrl::SetEntryTextMode`), and drop the handling for the never-reached null case. This also makes SvtIconChoiceCtrl::eTextMode become unused, so drop it. Change-Id: I428c47dcbc85568009be3454ffa7a8b977c6d095 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/169836 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/imivctl.hxx3
-rw-r--r--vcl/source/control/imivctl1.cxx29
-rw-r--r--vcl/source/control/ivctrl.cxx4
3 files changed, 12 insertions, 24 deletions
diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx
index 1ff043def5f5..6f6030bab271 100644
--- a/vcl/source/control/imivctl.hxx
+++ b/vcl/source/control/imivctl.hxx
@@ -146,7 +146,6 @@ class SvxIconChoiceCtrl_Impl
LocalFocus aFocus; // Data for focusrect
::vcl::AccessibleFactoryAccess aAccFactory;
- SvxIconChoiceCtrlTextMode eTextMode;
SelectionMode eSelectionMode;
sal_Int32 nSelectionCount;
SvxIconChoiceCtrlPositionMode ePositionMode;
@@ -373,7 +372,7 @@ public:
#ifdef DBG_UTIL
void SetEntryTextMode(
SvxIconChoiceCtrlTextMode,
- SvxIconChoiceCtrlEntry* pEntry
+ SvxIconChoiceCtrlEntry& rEntry
);
#endif
size_t GetEntryCount() const { return maEntries.size(); }
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index 97d38a3c50df..ed52e38a39a4 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -65,7 +65,7 @@ SvxIconChoiceCtrl_Impl::SvxIconChoiceCtrl_Impl(
nFlags(IconChoiceFlags::NONE), nUserEventAdjustScrBars(nullptr),
pCurHighlightFrame(nullptr), bHighlightFramePressed(false), pHead(nullptr), pCursor(nullptr),
pHdlEntry(nullptr),
- pAnchor(nullptr), eTextMode(SvxIconChoiceCtrlTextMode::Short),
+ pAnchor(nullptr),
eSelectionMode(SelectionMode::Multiple), ePositionMode(SvxIconChoiceCtrlPositionMode::Free),
bUpdateMode(true)
{
@@ -979,12 +979,12 @@ bool SvxIconChoiceCtrl_Impl::KeyInput( const KeyEvent& rKEvt )
if( rKEvt.GetKeyCode().IsShift() )
{
if( pCursor )
- pView->SetEntryTextMode( SvxIconChoiceCtrlTextMode::Full, pCursor );
+ pView->SetEntryTextMode(SvxIconChoiceCtrlTextMode::Full, *pCursor);
}
if( rKEvt.GetKeyCode().IsMod1() )
{
if( pCursor )
- pView->SetEntryTextMode( SvxIconChoiceCtrlTextMode::Short, pCursor );
+ pView->SetEntryTextMode(SvxIconChoiceCtrlTextMode::Short, *pCursor);
}
break;
#endif
@@ -2401,25 +2401,14 @@ IMPL_LINK_NOARG(SvxIconChoiceCtrl_Impl, DocRectChangedHdl, Timer *, void)
}
#ifdef DBG_UTIL
-void SvxIconChoiceCtrl_Impl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry )
+void SvxIconChoiceCtrl_Impl::SetEntryTextMode(SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry& rEntry)
{
- if( !pEntry )
+ if (rEntry.eTextMode != eMode)
{
- if( eTextMode != eMode )
- {
- eTextMode = eMode;
- Arrange( true, 0, 0 );
- }
- }
- else
- {
- if( pEntry->eTextMode != eMode )
- {
- pEntry->eTextMode = eMode;
- InvalidateEntry( pEntry );
- pView->Invalidate( GetEntryBoundRect( pEntry ) );
- AdjustVirtSize( pEntry->aRect );
- }
+ rEntry.eTextMode = eMode;
+ InvalidateEntry(&rEntry );
+ pView->Invalidate(GetEntryBoundRect(&rEntry));
+ AdjustVirtSize(rEntry.aRect);
}
}
#endif
diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index f8e09856c92c..2afe55a21258 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -239,9 +239,9 @@ void SvtIconChoiceCtrl::Command(const CommandEvent& rCEvt)
}
#ifdef DBG_UTIL
-void SvtIconChoiceCtrl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry* pEntry )
+void SvtIconChoiceCtrl::SetEntryTextMode( SvxIconChoiceCtrlTextMode eMode, SvxIconChoiceCtrlEntry& rEntry )
{
- _pImpl->SetEntryTextMode( eMode, pEntry );
+ _pImpl->SetEntryTextMode(eMode, rEntry);
}
#endif