40 sal_uInt16
nCount = rList.size();
44 sal_uInt16 nCurPos = 0;
51 nCurValue = rRect.
Top();
53 nCurValue = rRect.
Left();
56 nPrevValue = nCurValue;
74 for(
size_t nCur = 0; nCur <
nCount; nCur++ )
84 nY = sal::static_int_cast< short >(
nRows - 1);
86 nX = sal::static_int_cast< short >(
nCols - 1);
90 rColEntry.insert( rColEntry.begin() + nIns, pEntry );
94 rRowEntry.insert( rRowEntry.begin() + nIns, pEntry );
115 bool bDown,
bool bSimple )
118 IconChoiceMap::iterator mapIt =
xColumns->find( nCol );
122 const sal_uInt16
nCount = rList.size();
130 SvxIconChoiceCtrlEntryPtrVec::const_iterator it = std::find( rList.begin(), rList.end(),
pCurEntry );
132 assert(it != rList.end());
133 if (it == rList.end())
138 while( ++it != rList.end() )
142 if( rRect.
Top() > rRefRect.
Top() )
149 SvxIconChoiceCtrlEntryPtrVec::const_reverse_iterator it2(it);
150 while (it2 != rList.rend())
154 if( rRect.
Top() < rRefRect.
Top() )
163 std::swap(nTop, nBottom);
167 for( sal_uInt16 nCur = 0; nCur <
nCount; nCur++ )
172 sal_uInt16 nY = pEntry->
nY;
173 if( nY >= nTop && nY <= nBottom )
179 if( nDistance && nDistance < nMinDistance )
181 nMinDistance = nDistance;
191 bool bRight,
bool bSimple )
194 IconChoiceMap::iterator mapIt =
xRows->find( nRow );
195 if ( mapIt ==
xRows->end() )
198 const sal_uInt16
nCount = rList.size();
206 SvxIconChoiceCtrlEntryPtrVec::const_iterator it = std::find( rList.begin(), rList.end(),
pCurEntry );
208 assert(it != rList.end());
209 if (it == rList.end())
214 while( ++it != rList.end() )
218 if( rRect.
Left() > rRefRect.
Left() )
225 SvxIconChoiceCtrlEntryPtrVec::const_reverse_iterator it2(it);
226 while (it2 != rList.rend())
230 if( rRect.
Left() < rRefRect.
Left() )
239 std::swap(nRight, nLeft);
243 for( sal_uInt16 nCur = 0; nCur <
nCount; nCur++ )
248 sal_uInt16 nX = pEntry->
nX;
249 if( nX >= nLeft && nX <= nRight )
255 if( nDistance && nDistance < nMinDistance )
257 nMinDistance = nDistance;
289 sal_uInt16 nY = pCtrlEntry->
nY;
290 sal_uInt16 nX = pCtrlEntry->
nX;
296 nY, nX, sal::static_int_cast< sal_uInt16 >(
nCols-1),
true,
true );
298 pResult =
SearchRow( nY, 0, nX,
false,
true );
316 sal_uInt16 nRowMin = nY;
317 sal_uInt16 nRowMax = nY;
325 if( nRowMax < (
nRows-1))
328 }
while( nCurCol != nLastCol );
343 nNewPos += nEntriesInView;
349 nNewPos -= nEntriesInView;
353 if(
nPos != nNewPos )
381 if( nErr > nPrevErr )
387 if( pPrev != pStart )
399 else if( !bDown &&
nPos > 0 )
407 sal_uInt16 nY = pCtrlEntry->
nY;
408 sal_uInt16 nX = pCtrlEntry->
nX;
415 nX, nY, sal::static_int_cast< sal_uInt16 >(
nRows-1),
true,
true );
417 pResult =
SearchCol( nX, 0, nY,
false,
true );
435 sal_uInt16 nColMin = nX;
436 sal_uInt16 nColMax = nX;
444 if( nColMax < (
nCols-1))
447 }
while( nCurRow != nLastRow );
468 SAL_INFO(
"vcl",
"SetDeltas:Bad height");
473 SAL_INFO(
"vcl",
"SetDeltas:Bad width");
478 : _pView(pView), _nGridCols(0), _nGridRows(0)
499 size_t nNewCellCount =
static_cast<size_t>(nNewGridRows) * nNewGridCols;
500 bool* pNewGridMap =
new bool[nNewCellCount];
502 memcpy(pNewGridMap,
_pGridMap.get(), nOldCellCount *
sizeof(
bool));
503 memset(pNewGridMap + nOldCellCount, 0, (nNewCellCount-nOldCellCount) *
sizeof(
bool));
523 memset(
_pGridMap.get(), 0, nCellCount *
sizeof(
bool));
526 for(
size_t nCur=0; nCur <
nCount; nCur++ )
568 rDX =
static_cast<sal_uInt16
>(nDX);
569 rDY =
static_cast<sal_uInt16
>(nDY);
599 GridId nId =
GetGrid(
static_cast<sal_uInt16
>(nX),
static_cast<sal_uInt16
>(nY) );
607 sal_uInt16 nGridX, nGridY;
621 bool bExpanded =
false;
631 return static_cast<GridId>(nCur);
667 if( ndx < 0 ) ndx *= -1;
669 if( ndy < 0 ) ndy *= -1;
670 return static_cast<sal_uLong>(ndx * ndy);
678 sal_uInt16 nCols, nRows;
sal_uInt16 GetSortListPos(SvxIconChoiceCtrlEntryPtrVec &rList, tools::Long nValue, bool bVertical)
SvxIconChoiceCtrlEntry * pCurEntry
SvxIconChoiceCtrlEntry * GoPageUpDown(SvxIconChoiceCtrlEntry *, bool bDown)
SvxIconChoiceCtrlEntry * SearchCol(sal_uInt16 nCol, sal_uInt16 nTop, sal_uInt16 nBottom, bool bDown, bool bSimple)
SvxIconChoiceCtrl_Impl * pView
SvxIconChoiceCtrlEntry * SearchRow(sal_uInt16 nRow, sal_uInt16 nLeft, sal_uInt16 nRight, bool bRight, bool bSimple)
std::unique_ptr< IconChoiceMap > xRows
SvxIconChoiceCtrlEntry * GoLeftRight(SvxIconChoiceCtrlEntry *, bool bRight)
std::unique_ptr< IconChoiceMap > xColumns
SvxIconChoiceCtrlEntry * GoUpDown(SvxIconChoiceCtrlEntry *, bool bDown)
IcnCursor_Impl(SvxIconChoiceCtrl_Impl *pOwner)
static sal_uLong GetGridCount(const Size &rSizePixel, sal_uInt16 nGridWidth, sal_uInt16 nGridHeight)
void OccupyGrid(GridId nId)
void OccupyGrids(const SvxIconChoiceCtrlEntry *)
IcnGridMap_Impl(SvxIconChoiceCtrl_Impl *pView)
GridId GetGrid(const Point &rDocPos)
tools::Rectangle GetGridRect(GridId)
GridId GetUnoccupiedGrid()
void GetGridCoord(GridId, sal_uInt16 &rGridX, sal_uInt16 &rGridY)
SvxIconChoiceCtrl_Impl * _pView
tools::Rectangle _aLastOccupiedGrid
std::unique_ptr< bool[]> _pGridMap
void GetMinMapSize(sal_uInt16 &rDX, sal_uInt16 &rDY) const
constexpr tools::Long Y() const
constexpr tools::Long X() const
constexpr tools::Long Height() const
constexpr tools::Long Width() const
VclPtr< SvtIconChoiceCtrl > pView
tools::Long nMaxVirtHeight
const tools::Rectangle & GetEntryBoundRect(SvxIconChoiceCtrlEntry *)
bool IsAutoArrange() const
void CheckBoundingRects()
tools::Long nVerSBarWidth
tools::Rectangle CalcBmpRect(SvxIconChoiceCtrlEntry *, const Point *pPos=nullptr)
std::vector< std::unique_ptr< SvxIconChoiceCtrlEntry > > maEntries
tools::Long nHorSBarHeight
tools::Long nMaxVirtWidth
static bool IsBoundingRectValid(const tools::Rectangle &rRect)
sal_Int32 GetEntryListPos(SvxIconChoiceCtrlEntry const *) const
Size GetOutputSizePixel() const
#define DBG_ASSERT(sCon, aError)
#define DEFAULT_MAX_VIRT_WIDTH
#define DEFAULT_MAX_VIRT_HEIGHT
std::vector< SvxIconChoiceCtrlEntry * > SvxIconChoiceCtrlEntryPtrVec
std::map< sal_uInt16, SvxIconChoiceCtrlEntryPtrVec > IconChoiceMap
#define SAL_INFO(area, stream)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)