vcl/source/control/imivctl.hxx | 11 +++++------ vcl/source/control/imivctl1.cxx | 8 ++++---- 2 files changed, 9 insertions(+), 10 deletions(-)
New commits: commit a7dfa664b758c5db6e0131c3fef4b602d222e86e Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Thu Nov 19 17:24:40 2020 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Nov 20 10:39:16 2020 +0100 Clarify that SvxIconChoiceCtrl_Impl::GetPredecessorGrid returns GridId Change-Id: Iddd781b1acfb3d0fd8352cb50566fbebea4b3024 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106217 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/vcl/source/control/imivctl.hxx b/vcl/source/control/imivctl.hxx index 35cba0ebced9..b242ef91da7f 100644 --- a/vcl/source/control/imivctl.hxx +++ b/vcl/source/control/imivctl.hxx @@ -99,6 +99,10 @@ struct LocalFocus }; +typedef sal_uLong GridId; + +#define GRID_NOT_FOUND (GridId(ULONG_MAX)) + // Implementation-class of IconChoiceCtrl @@ -210,7 +214,7 @@ class SvxIconChoiceCtrl_Impl tools::Rectangle CalcMaxTextRect( const SvxIconChoiceCtrlEntry* pEntry ) const; void ClipAtVirtOutRect( tools::Rectangle& rRect ) const; - sal_uLong GetPredecessorGrid( const Point& rDocPos) const; + GridId GetPredecessorGrid( const Point& rDocPos) const; void InitPredecessors(); void ClearPredecessors(); @@ -462,11 +466,6 @@ public: SvxIconChoiceCtrlEntry* GoPageUpDown( SvxIconChoiceCtrlEntry*, bool bDown ); }; - -typedef sal_uLong GridId; - -#define GRID_NOT_FOUND (GridId(ULONG_MAX)) - class IcnGridMap_Impl { tools::Rectangle _aLastOccupiedGrid; diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx index 8bcd8f912e1e..4f4ae02cdfaa 100644 --- a/vcl/source/control/imivctl1.cxx +++ b/vcl/source/control/imivctl1.cxx @@ -2729,7 +2729,7 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho Point aPos( rPosTopLeft ); //TopLeft tools::Rectangle aCenterRect( CalcBmpRect( pEntry, &aPos )); Point aNewPos( aCenterRect.Center() ); - sal_uLong nGrid = GetPredecessorGrid( aNewPos ); + GridId nGrid = GetPredecessorGrid( aNewPos ); size_t nCount = maEntries.size(); if( nGrid == GRID_NOT_FOUND ) return nullptr; @@ -2740,13 +2740,13 @@ SvxIconChoiceCtrlEntry* SvxIconChoiceCtrl_Impl::FindEntryPredecessor( SvxIconCho SvxIconChoiceCtrlEntry* pCur = pHead; // Grid 0 // TODO: go through list from the end if nGrid > nCount/2 - for( sal_uLong nCur = 0; nCur < nGrid; nCur++ ) + for( GridId nCur = 0; nCur < nGrid; nCur++ ) pCur = pCur->pflink; return pCur; } -sal_uLong SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const +GridId SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const { Point aPos( rPos ); aPos.AdjustX( -(LROFFS_WINBORDER) ); @@ -2759,7 +2759,7 @@ sal_uLong SvxIconChoiceCtrl_Impl::GetPredecessorGrid( const Point& rPos) const nGridX = nMaxCol; tools::Long nGridY = aPos.Y() / nGridDY; tools::Long nGridsX = aOutputSize.Width() / nGridDX; - sal_uLong nGrid = (nGridY * nGridsX) + nGridX; + GridId nGrid = (nGridY * nGridsX) + nGridX; tools::Long nMiddle = (nGridX * nGridDX) + (nGridDX / 2); if( rPos.X() < nMiddle ) { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits