62 void SetStyleLeft(
const Style& rStyle) { maLeft = rStyle; }
63 void SetStyleRight(
const Style& rStyle) { maRight = rStyle; }
64 void SetStyleTop(
const Style& rStyle) { maTop = rStyle; }
65 void SetStyleBottom(
const Style& rStyle) { maBottom = rStyle; }
66 void SetStyleTLBR(
const Style& rStyle) { maTLBR = rStyle; }
67 void SetStyleBLTR(
const Style& rStyle) { maBLTR = rStyle; }
69 const Style& GetStyleLeft()
const {
return maLeft; }
71 const Style& GetStyleTop()
const {
return maTop; }
73 const Style& GetStyleTLBR()
const {
return maTLBR; }
74 const Style& GetStyleBLTR()
const {
return maBLTR; }
76 bool IsMerged()
const {
return mbMergeOrig || mbOverlapX ||
mbOverlapY; }
77 bool IsRotated()
const {
return mfOrientation != 0.0; }
81 basegfx::B2DHomMatrix CreateCoordinateSystem(
const Array& rArray,
size_t nCol,
size_t nRow,
bool bExpandMerged)
const;
112 aOrigin.setX(aOrigin.getX() + (fSkew * 0.5));
117 aOrigin.setX(aOrigin.getX() + fSkew);
145 void Cell::MirrorSelfX()
155 static void lclRecalcCoordVec( std::vector<tools::Long>& rCoords,
const std::vector<tools::Long>& rSizes )
157 DBG_ASSERT( rCoords.size() == rSizes.size() + 1,
"lclRecalcCoordVec - inconsistent vectors" );
158 auto aCIt = rCoords.begin();
159 for(
const auto& rSize : rSizes )
161 *(aCIt + 1) = *aCIt + rSize;
166 static void lclSetMergedRange( CellVec& rCells,
size_t nWidth,
size_t nFirstCol,
size_t nFirstRow,
size_t nLastCol,
size_t nLastRow )
168 for(
size_t nCol = nFirstCol; nCol <= nLastCol; ++nCol )
170 for(
size_t nRow = nFirstRow; nRow <= nLastRow; ++nRow )
172 Cell& rCell = rCells[ nRow * nWidth + nCol ];
173 rCell.mbMergeOrig =
false;
174 rCell.mbOverlapX = nCol > nFirstCol;
175 rCell.mbOverlapY = nRow > nFirstRow;
178 rCells[ nFirstRow * nWidth + nFirstCol ].mbMergeOrig =
true;
202 explicit ArrayImpl(
size_t nWidth,
size_t nHeight );
205 {
return (nCol < mnWidth) && (nRow < mnHeight); }
207 {
return nRow * mnWidth + nCol; }
209 const Cell& GetCell(
size_t nCol,
size_t nRow )
const;
210 Cell& GetCellAcc(
size_t nCol,
size_t nRow );
212 size_t GetMergedFirstCol(
size_t nCol,
size_t nRow )
const;
213 size_t GetMergedFirstRow(
size_t nCol,
size_t nRow )
const;
214 size_t GetMergedLastCol(
size_t nCol,
size_t nRow )
const;
215 size_t GetMergedLastRow(
size_t nCol,
size_t nRow )
const;
217 const Cell& GetMergedOriginCell(
size_t nCol,
size_t nRow )
const;
219 bool IsMergedOverlappedLeft(
size_t nCol,
size_t nRow )
const;
220 bool IsMergedOverlappedRight(
size_t nCol,
size_t nRow )
const;
221 bool IsMergedOverlappedTop(
size_t nCol,
size_t nRow )
const;
222 bool IsMergedOverlappedBottom(
size_t nCol,
size_t nRow )
const;
224 bool IsInClipRange(
size_t nCol,
size_t nRow )
const;
225 bool IsColInClipRange(
size_t nCol )
const;
226 bool IsRowInClipRange(
size_t nRow )
const;
228 size_t GetMirrorCol(
size_t nCol )
const {
return mnWidth - nCol - 1; }
233 bool HasCellRotation()
const;
236 ArrayImpl::ArrayImpl(
size_t nWidth,
size_t nHeight ) :
241 mnLastClipCol( nWidth - 1 ),
242 mnLastClipRow( nHeight - 1 ),
243 mbXCoordsDirty( false ),
244 mbYCoordsDirty( false ),
245 mbMayHaveCellRotation( false )
268 size_t nFirstCol = nCol;
275 size_t nFirstRow = nRow;
282 size_t nLastCol = nCol + 1;
289 size_t nLastRow = nRow + 1;
302 return rCell.mbOverlapX || (rCell.mnAddLeft > 0);
307 return GetCell( nCol + 1, nRow ).mbOverlapX || (
GetCell( nCol, nRow ).mnAddRight > 0);
313 return rCell.mbOverlapY || (rCell.mnAddTop > 0);
318 return GetCell( nCol, nRow + 1 ).mbOverlapY || (
GetCell( nCol, nRow ).mnAddBottom > 0);
359 for (
const auto& aCell :
maCells)
361 if (aCell.IsRotated())
372 class MergedCellIterator
375 explicit MergedCellIterator(
const Array& rArray,
size_t nCol,
size_t nRow );
378 size_t Col()
const {
return mnCol; }
379 size_t Row()
const {
return mnRow; }
394 MergedCellIterator::MergedCellIterator(
const Array& rArray,
size_t nCol,
size_t nRow )
396 DBG_ASSERT( rArray.IsMerged( nCol, nRow ),
"svx::frame::MergedCellIterator::MergedCellIterator - not in merged range" );
402 MergedCellIterator& MergedCellIterator::operator++()
404 DBG_ASSERT( Is(),
"svx::frame::MergedCellIterator::operator++() - already invalid" );
414 #define DBG_FRAME_CHECK( cond, funcname, error ) DBG_ASSERT( cond, "svx::frame::Array::" funcname " - " error )
415 #define DBG_FRAME_CHECK_COL( col, funcname ) DBG_FRAME_CHECK( (col) < GetColCount(), funcname, "invalid column index" )
416 #define DBG_FRAME_CHECK_ROW( row, funcname ) DBG_FRAME_CHECK( (row) < GetRowCount(), funcname, "invalid row index" )
417 #define DBG_FRAME_CHECK_COLROW( col, row, funcname ) DBG_FRAME_CHECK( ((col) < GetColCount()) && ((row) < GetRowCount()), funcname, "invalid cell index" )
418 #define DBG_FRAME_CHECK_COL_1( col, funcname ) DBG_FRAME_CHECK( (col) <= GetColCount(), funcname, "invalid column index" )
419 #define DBG_FRAME_CHECK_ROW_1( row, funcname ) DBG_FRAME_CHECK( (row) <= GetRowCount(), funcname, "invalid row index" )
422 #define CELL( col, row ) mxImpl->GetCell( col, row )
423 #define CELLACC( col, row ) mxImpl->GetCellAcc( col, row )
424 #define ORIGCELL( col, row ) mxImpl->GetMergedOriginCell( col, row )
454 return mxImpl->maCells.size();
461 nCol =
mxImpl->GetMirrorCol(nCol);
462 return mxImpl->GetIndex( nCol, nRow );
469 CELLACC( nCol, nRow ).SetStyleLeft(rStyle);
475 CELLACC( nCol, nRow ).SetStyleRight(rStyle);
481 CELLACC( nCol, nRow ).SetStyleTop(rStyle);
487 CELLACC( nCol, nRow ).SetStyleBottom(rStyle);
493 CELLACC( nCol, nRow ).SetStyleTLBR(rStyle);
499 CELLACC( nCol, nRow ).SetStyleBLTR(rStyle);
506 rCell.SetStyleTLBR(rTLBR);
507 rCell.SetStyleBLTR(rBLTR);
513 for(
size_t nRow = 0; nRow <
mxImpl->mnHeight; ++nRow )
520 for(
size_t nRow = 0; nRow <
mxImpl->mnHeight; ++nRow )
527 for(
size_t nCol = 0; nCol <
mxImpl->mnWidth; ++nCol )
534 for(
size_t nCol = 0; nCol <
mxImpl->mnWidth; ++nCol )
542 rTarget.meRotMode = eRotMode;
543 rTarget.mfOrientation = fOrientation;
545 if (!
mxImpl->mbMayHaveCellRotation)
549 mxImpl->mbMayHaveCellRotation = rTarget.IsRotated();
555 if (!
mxImpl->mbMayHaveCellRotation)
561 return mxImpl->HasCellRotation();
567 if( !
mxImpl->IsRowInClipRange( nRow ) ||
mxImpl->IsMergedOverlappedLeft( nCol, nRow ) )
568 return OBJ_STYLE_NONE;
570 if( nCol ==
mxImpl->mnFirstClipCol )
571 return ORIGCELL( nCol, nRow ).GetStyleLeft();
573 if( nCol ==
mxImpl->mnLastClipCol + 1 )
574 return ORIGCELL( nCol - 1, nRow ).GetStyleRight();
576 if( !
mxImpl->IsColInClipRange( nCol ) )
577 return OBJ_STYLE_NONE;
579 return std::max(
ORIGCELL( nCol, nRow ).GetStyleLeft(),
ORIGCELL( nCol - 1, nRow ).GetStyleRight() );
585 if( !
mxImpl->IsRowInClipRange( nRow ) ||
mxImpl->IsMergedOverlappedRight( nCol, nRow ) )
586 return OBJ_STYLE_NONE;
588 if( nCol + 1 ==
mxImpl->mnFirstClipCol )
589 return ORIGCELL( nCol + 1, nRow ).GetStyleLeft();
591 if( nCol ==
mxImpl->mnLastClipCol )
592 return ORIGCELL( nCol, nRow ).GetStyleRight();
594 if( !
mxImpl->IsColInClipRange( nCol ) )
595 return OBJ_STYLE_NONE;
597 return std::max(
ORIGCELL( nCol, nRow ).GetStyleRight(),
ORIGCELL( nCol + 1, nRow ).GetStyleLeft() );
603 if( !
mxImpl->IsColInClipRange( nCol ) ||
mxImpl->IsMergedOverlappedTop( nCol, nRow ) )
604 return OBJ_STYLE_NONE;
606 if( nRow ==
mxImpl->mnFirstClipRow )
607 return ORIGCELL( nCol, nRow ).GetStyleTop();
609 if( nRow ==
mxImpl->mnLastClipRow + 1 )
610 return ORIGCELL( nCol, nRow - 1 ).GetStyleBottom();
612 if( !
mxImpl->IsRowInClipRange( nRow ) )
613 return OBJ_STYLE_NONE;
615 return std::max(
ORIGCELL( nCol, nRow ).GetStyleTop(),
ORIGCELL( nCol, nRow - 1 ).GetStyleBottom() );
621 if( !
mxImpl->IsColInClipRange( nCol ) ||
mxImpl->IsMergedOverlappedBottom( nCol, nRow ) )
622 return OBJ_STYLE_NONE;
624 if( nRow + 1 ==
mxImpl->mnFirstClipRow )
625 return ORIGCELL( nCol, nRow + 1 ).GetStyleTop();
627 if( nRow ==
mxImpl->mnLastClipRow )
628 return ORIGCELL( nCol, nRow ).GetStyleBottom();
630 if( !
mxImpl->IsRowInClipRange( nRow ) )
631 return OBJ_STYLE_NONE;
633 return std::max(
ORIGCELL( nCol, nRow ).GetStyleBottom(),
ORIGCELL( nCol, nRow + 1 ).GetStyleTop() );
638 return CELL( nCol, nRow ).GetStyleTLBR();
643 return CELL( nCol, nRow ).GetStyleBLTR();
649 if( !
mxImpl->IsInClipRange( nCol, nRow ) )
650 return OBJ_STYLE_NONE;
652 size_t nFirstCol =
mxImpl->GetMergedFirstCol( nCol, nRow );
653 size_t nFirstRow =
mxImpl->GetMergedFirstRow( nCol, nRow );
654 return ((nCol == nFirstCol) && (nRow == nFirstRow)) ?
661 if( !
mxImpl->IsInClipRange( nCol, nRow ) )
662 return OBJ_STYLE_NONE;
664 size_t nLastCol =
mxImpl->GetMergedLastCol( nCol, nRow );
665 size_t nLastRow =
mxImpl->GetMergedLastRow( nCol, nRow );
666 return ((nCol == nLastCol) && (nRow == nLastRow)) ?
673 if( !
mxImpl->IsInClipRange( nCol, nRow ) )
674 return OBJ_STYLE_NONE;
676 size_t nFirstCol =
mxImpl->GetMergedFirstCol( nCol, nRow );
677 size_t nLastRow =
mxImpl->GetMergedLastRow( nCol, nRow );
678 return ((nCol == nFirstCol) && (nRow == nLastRow)) ?
685 if( !
mxImpl->IsInClipRange( nCol, nRow ) )
686 return OBJ_STYLE_NONE;
688 size_t nFirstRow =
mxImpl->GetMergedFirstRow( nCol, nRow );
689 size_t nLastCol =
mxImpl->GetMergedLastCol( nCol, nRow );
690 return ((nCol == nLastCol) && (nRow == nFirstRow)) ?
699 #if OSL_DEBUG_LEVEL >= 2
702 for(
size_t nCurrCol = nFirstCol; !bFound && (nCurrCol <= nLastCol); ++nCurrCol )
703 for(
size_t nCurrRow = nFirstRow; !bFound && (nCurrRow <= nLastRow); ++nCurrRow )
704 bFound =
CELL( nCurrCol, nCurrRow ).IsMerged();
705 DBG_FRAME_CHECK( !bFound,
"SetMergedRange",
"overlapping merged ranges" );
708 if(
mxImpl->IsValidPos( nFirstCol, nFirstRow ) &&
mxImpl->IsValidPos( nLastCol, nLastRow ) )
715 DBG_FRAME_CHECK(
mxImpl->GetMergedFirstCol( nCol, nRow ) == 0,
"SetAddMergedLeftSize",
"additional border inside array" );
716 for( MergedCellIterator aIt( *
this, nCol, nRow ); aIt.Is(); ++aIt )
723 DBG_FRAME_CHECK(
mxImpl->GetMergedLastCol( nCol, nRow ) + 1 ==
mxImpl->mnWidth,
"SetAddMergedRightSize",
"additional border inside array" );
724 for( MergedCellIterator aIt( *
this, nCol, nRow ); aIt.Is(); ++aIt )
731 DBG_FRAME_CHECK(
mxImpl->GetMergedFirstRow( nCol, nRow ) == 0,
"SetAddMergedTopSize",
"additional border inside array" );
732 for( MergedCellIterator aIt( *
this, nCol, nRow ); aIt.Is(); ++aIt )
739 DBG_FRAME_CHECK(
mxImpl->GetMergedLastRow( nCol, nRow ) + 1 ==
mxImpl->mnHeight,
"SetAddMergedBottomSize",
"additional border inside array" );
740 for( MergedCellIterator aIt( *
this, nCol, nRow ); aIt.Is(); ++aIt )
747 return CELL( nCol, nRow ).IsMerged();
753 rnFirstCol =
mxImpl->GetMergedFirstCol( nCol, nRow );
754 rnFirstRow =
mxImpl->GetMergedFirstRow( nCol, nRow );
758 size_t& rnLastCol,
size_t& rnLastRow,
size_t nCol,
size_t nRow )
const
761 rnLastCol =
mxImpl->GetMergedLastCol( nCol, nRow );
762 rnLastRow =
mxImpl->GetMergedLastRow( nCol, nRow );
770 mxImpl->mnFirstClipCol = nFirstCol;
771 mxImpl->mnFirstClipRow = nFirstRow;
772 mxImpl->mnLastClipCol = nLastCol;
773 mxImpl->mnLastClipRow = nLastRow;
779 mxImpl->maXCoords[ 0 ] = nXOffset;
780 mxImpl->mbXCoordsDirty =
true;
785 mxImpl->maYCoords[ 0 ] = nYOffset;
786 mxImpl->mbYCoordsDirty =
true;
792 mxImpl->maWidths[ nCol ] = nWidth;
793 mxImpl->mbXCoordsDirty =
true;
799 mxImpl->maHeights[ nRow ] = nHeight;
800 mxImpl->mbYCoordsDirty =
true;
805 std::fill(
mxImpl->maWidths.begin(),
mxImpl->maWidths.end(), nWidth );
806 mxImpl->mbXCoordsDirty =
true;
811 std::fill(
mxImpl->maHeights.begin(),
mxImpl->maHeights.end(), nHeight );
812 mxImpl->mbYCoordsDirty =
true;
818 return mxImpl->GetColPosition( nCol );
824 return mxImpl->GetRowPosition( nRow );
856 const size_t nFirstCol(
mxImpl->GetMergedFirstCol( nCol, nRow ));
857 const size_t nFirstRow(
mxImpl->GetMergedFirstRow( nCol, nRow ));
858 const size_t nLastCol(
mxImpl->GetMergedLastCol( nCol, nRow ));
859 const size_t nLastRow(
mxImpl->GetMergedLastRow( nCol, nRow ));
865 const Cell& rCell =
CELL( nCol, nRow );
867 if( rCell.IsMerged() )
900 for( nRow = 0; nRow <
mxImpl->mnHeight; ++nRow )
902 for( nCol = 0; nCol <
mxImpl->mnWidth; ++nCol )
904 aNewCells.push_back(
CELL(
mxImpl->GetMirrorCol( nCol ), nRow ) );
905 aNewCells.back().MirrorSelfX();
908 for( nRow = 0; nRow <
mxImpl->mnHeight; ++nRow )
910 for( nCol = 0; nCol <
mxImpl->mnWidth; ++nCol )
914 size_t nLastCol =
mxImpl->GetMergedLastCol( nCol, nRow );
915 size_t nLastRow =
mxImpl->GetMergedLastRow( nCol, nRow );
917 mxImpl->GetMirrorCol( nLastCol ), nRow,
918 mxImpl->GetMirrorCol( nCol ), nLastRow );
922 mxImpl->maCells.swap( aNewCells );
924 std::reverse(
mxImpl->maWidths.begin(),
mxImpl->maWidths.end() );
925 mxImpl->mbXCoordsDirty =
true;
939 const Color* pForceColor)
956 rInstance.addSdrConnectStyleData(
true, rStartFromTR, rX - rY,
false);
957 rInstance.addSdrConnectStyleData(
true, rStartLFromT, -rY,
true);
958 rInstance.addSdrConnectStyleData(
true, rStartLFromL, -rX,
true);
959 rInstance.addSdrConnectStyleData(
true, rStartLFromB, rY,
false);
960 rInstance.addSdrConnectStyleData(
true, rStartFromBR, rX + rY,
false);
969 rInstance.addSdrConnectStyleData(
false, rEndFromTL, -rX - rY,
true);
970 rInstance.addSdrConnectStyleData(
false, rEndRFromT, -rY,
true);
971 rInstance.addSdrConnectStyleData(
false, rEndRFromR, rX,
false);
972 rInstance.addSdrConnectStyleData(
false, rEndRFromB, rY,
false);
973 rInstance.addSdrConnectStyleData(
false, rEndFromBL, rY - rX,
true);
986 const Color* pForceColor)
1003 rInstance.addSdrConnectStyleData(
true, rStartFromBR, rX + rY,
false);
1004 rInstance.addSdrConnectStyleData(
true, rStartTFromR, rX,
false);
1005 rInstance.addSdrConnectStyleData(
true, rStartTFromT, -rY,
true);
1006 rInstance.addSdrConnectStyleData(
true, rStartTFromL, -rX,
true);
1007 rInstance.addSdrConnectStyleData(
true, rStartFromBL, rY - rX,
true);
1016 rInstance.addSdrConnectStyleData(
false, rEndFromTR, rX - rY,
false);
1017 rInstance.addSdrConnectStyleData(
false, rEndBFromR, rX,
false);
1018 rInstance.addSdrConnectStyleData(
false, rEndBFromB, rY,
false);
1019 rInstance.addSdrConnectStyleData(
false, rEndBFromL, -rX,
true);
1020 rInstance.addSdrConnectStyleData(
false, rEndFromTL, -rY - rX,
true);
1024 size_t nFirstCol,
size_t nFirstRow,
size_t nLastCol,
size_t nLastRow,
1025 const Color* pForceColor )
const
1046 const size_t nStartRow(nFirstRow > 0 ? nFirstRow - 1 : nFirstRow);
1047 const size_t nEndRow(nLastRow <
GetRowCount() - 1 ? nLastRow + 1 : nLastRow);
1048 const size_t nStartCol(nFirstCol > 0 ? nFirstCol - 1 : nFirstCol);
1049 const size_t nEndCol(nLastCol <
GetColCount() - 1 ? nLastCol + 1 : nLastCol);
1052 std::shared_ptr<drawinglayer::primitive2d::SdrFrameBorderDataVector>
aData(
1053 std::make_shared<drawinglayer::primitive2d::SdrFrameBorderDataVector>());
1057 std::set< size_t > aMergedCells;
1059 for (
size_t nRow(nStartRow); nRow <= nEndRow; ++nRow)
1061 for (
size_t nCol(nStartCol); nCol <= nEndCol; ++nCol)
1065 const Cell& rCell(
CELL(nCol, nRow));
1072 const bool bOverlapX(rCell.mbOverlapX);
1073 const bool bFirstCol(nCol == nFirstCol);
1078 const bool bRotated(rCell.IsRotated());
1083 const bool bSuppressLeft(!bRotated && nCol > nFirstCol &&
CELL(nCol - 1, nRow).
IsRotated());
1084 const bool bSuppressAbove(!bRotated && nRow > nFirstRow &&
CELL(nCol, nRow - 1).
IsRotated());
1089 const bool bOverlapY(rCell.mbOverlapY);
1090 const bool bLastCol(nCol == nLastCol);
1091 const bool bFirstRow(nRow == nFirstRow);
1092 const bool bLastRow(nRow == nLastRow);
1153 bool bContinue(
true);
1155 if(rCell.IsMerged())
1159 const size_t _nMergedFirstCol(
mxImpl->GetMergedFirstCol(nCol, nRow));
1160 const size_t _nMergedFirstRow(
mxImpl->GetMergedFirstRow(nCol, nRow));
1161 const size_t nIndexOfMergedCell(
mxImpl->GetIndex(_nMergedFirstCol, _nMergedFirstRow));
1162 bContinue = (aMergedCells.end() == aMergedCells.find(nIndexOfMergedCell));
1167 aMergedCells.insert(nIndexOfMergedCell);
1171 aCoordinateSystem = rCell.CreateCoordinateSystem(*
this, nCol, nRow,
true);
1183 aData->emplace_back(
1194 rInstance.addSdrConnectStyleData(
true, rTLFromRight, aX,
false);
1195 rInstance.addSdrConnectStyleData(
true, rTLFromBottom, aY,
false);
1201 rInstance.addSdrConnectStyleData(
false, rBRFromBottom, -aY,
true);
1202 rInstance.addSdrConnectStyleData(
false, rBRFromLeft, -aX,
true);
1208 aData->emplace_back(
1219 rInstance.addSdrConnectStyleData(
true, rBLFromTop, -aY,
true);
1220 rInstance.addSdrConnectStyleData(
true, rBLFromBottom, aX,
false);
1226 rInstance.addSdrConnectStyleData(
false, rTRFromLeft, -aX,
true);
1227 rInstance.addSdrConnectStyleData(
false, rTRFromBottom, aY,
false);
1281 #undef DBG_FRAME_CHECK_ROW_1
1282 #undef DBG_FRAME_CHECK_COL_1
1283 #undef DBG_FRAME_CHECK_COLROW
1284 #undef DBG_FRAME_CHECK_ROW
1285 #undef DBG_FRAME_CHECK_COL
1286 #undef DBG_FRAME_CHECK
std::vector< SdrFrameBorderData > SdrFrameBorderDataVector
static void lclSetMergedRange(CellVec &rCells, size_t nWidth, size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow)
void SetAllColWidths(tools::Long nWidth)
Sets the same output width for all columns.
const Cell & GetCell(size_t nCol, size_t nRow) const
void SetCellStyleTLBR(size_t nCol, size_t nRow, const Style &rStyle)
Sets the top-left to bottom-right frame style of the cell (nCol,nRow).
#define DBG_FRAME_CHECK_ROW_1(row, funcname)
bool IsInClipRange(size_t nCol, size_t nRow) const
bool IsMergedOverlappedRight(size_t nCol, size_t nRow) const
tools::Long GetColWidth(size_t nFirstCol, size_t nLastCol) const
Returns the output width of the specified range of columns.
tools::Long GetColPosition(size_t nCol) const
Returns the X output coordinate of the left border of the specified column.
static void lclRecalcCoordVec(std::vector< tools::Long > &rCoords, const std::vector< tools::Long > &rSizes)
basegfx::B2DRange GetCellRange(size_t nCol, size_t nRow, bool bExpandMerged) const
Returns the output range of the cell (nCol,nRow).
void SetAllRowHeights(tools::Long nHeight)
Sets the same output height for all rows.
std::vector< tools::Long > maYCoords
size_t GetRowCount() const
Returns the number of rows in the array.
void SetCellRotation(size_t nCol, size_t nRow, SvxRotateMode eRotMode, double fOrientation)
Sets the rotation parameters of the cell (nCol,nRow).
#define ORIGCELL(col, row)
size_t GetCellIndex(size_t nCol, size_t nRow, bool bRTL) const
Returns the cell index from the cell address (nCol,nRow).
size_t GetMergedFirstRow(size_t nCol, size_t nRow) const
void SetCellStyleTop(size_t nCol, size_t nRow, const Style &rStyle)
Sets the top frame style of the cell (nCol,nRow).
void SetCellStyleBottom(size_t nCol, size_t nRow, const Style &rStyle)
Sets the bottom frame style of the specified cell (nCol,nRow).
#define DBG_FRAME_CHECK_ROW(row, funcname)
bool IsUsed() const
Check if this style is used - this depends on it having any width definition.
Cell & GetCellAcc(size_t nCol, size_t nRow)
const Style & GetCellStyleTL(size_t nCol, size_t nRow) const
Returns the top-left to bottom-right frame style of the cell (nCol,nRow).
void SetYOffset(tools::Long nYOffset)
Sets the Y output coordinate of the top row.
bool mbMayHaveCellRotation
const Style & GetCellStyleTop(size_t nCol, size_t nRow) const
Returns the top frame style of the cell (nCol,nRow).
#define DBG_FRAME_CHECK_COL_1(col, funcname)
B2DTuple getColumn(const B2DHomMatrix &rMatrix, sal_uInt16 nCol)
static void HelperCreateHorizontalEntry(const Array &rArray, const Style &rStyle, size_t col, size_t row, const basegfx::B2DPoint &rOrigin, const basegfx::B2DVector &rX, const basegfx::B2DVector &rY, drawinglayer::primitive2d::SdrFrameBorderDataVector &rData, bool bUpper, const Color *pForceColor)
Array()
Constructs an empty array.
bool IsRowInClipRange(size_t nRow) const
void SetRowStyleTop(size_t nRow, const Style &rStyle)
Sets the top frame style of the specified row.
tools::Long GetRowHeight(size_t nFirstRow, size_t nLastRow) const
Returns the output height of the specified range of rows.
const Style & GetCellStyleBL(size_t nCol, size_t nRow) const
Returns the bottom-left to top-right frame style of the cell (nCol,nRow).
bool IsValidPos(size_t nCol, size_t nRow) const
const Style & GetCellStyleRight(size_t nCol, size_t nRow) const
Returns the right frame style of the cell (nCol,nRow).
constexpr OUStringLiteral aData
void SetCellStyleLeft(size_t nCol, size_t nRow, const Style &rStyle)
Sets the left frame style of the cell (nCol,nRow).
drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveRange(size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow, const Color *pForceColor) const
Draws the part of the specified range, that is inside the clipping range.
void SetCellStyleDiag(size_t nCol, size_t nRow, const Style &rTLBR, const Style &rBLTR)
Sets both diagonal frame styles of the specified cell (nCol,nRow).
void SetAddMergedTopSize(size_t nCol, size_t nRow, tools::Long nAddSize)
Sets an additional top height for the merged range that contains (nCol,nRow).
std::unique_ptr< ArrayImpl > mxImpl
bool IsMergedOverlappedTop(size_t nCol, size_t nRow) const
drawinglayer::primitive2d::Primitive2DContainer CreateB2DPrimitiveArray() const
Draws the part of the array, that is inside the clipping range.
#define DBG_FRAME_CHECK_COL(col, funcname)
#define DBG_ASSERT(sCon, aError)
const Style & GetCellStyleBR(size_t nCol, size_t nRow) const
Returns the top-left to bottom-right frame style of the cell (nCol,nRow).
const Style & GetCellStyleBLTR(size_t nCol, size_t nRow) const
Returns the bottom-left to top-right frame style of the cell (nCol,nRow).
const Style OBJ_STYLE_NONE
void SetColumnStyleRight(size_t nCol, const Style &rStyle)
Sets the right frame style of the specified column.
void SetXOffset(tools::Long nXOffset)
Sets the X output coordinate of the left column.
const Cell & GetMergedOriginCell(size_t nCol, size_t nRow) const
const Style & GetCellStyleBottom(size_t nCol, size_t nRow) const
Returns the top frame style of the cell (nCol,nRow).
tools::Long GetColPosition(size_t nCol) const
virtual void append(const Primitive2DReference &) override
void Initialize(size_t nWidth, size_t nHeight)
Reinitializes the array with the specified size.
std::vector< tools::Long > maWidths
bool IsMerged(size_t nCol, size_t nRow) const
Returns true, if the cell (nCol,nRow) is part of a merged range.
const Style & GetCellStyleTLBR(size_t nCol, size_t nRow) const
Returns the top-left to bottom-right frame style of the cell (nCol,nRow).
#define CELLACC(col, row)
void SetCellStyleBLTR(size_t nCol, size_t nRow, const Style &rStyle)
Sets the bottom-left to top-right frame style of the cell (nCol,nRow).
tools::Long GetRowPosition(size_t nRow) const
Returns the Y output coordinate of the top border of the specified row.
std::vector< tools::Long > maXCoords
void SetColWidth(size_t nCol, tools::Long nWidth)
Sets the output width of the specified column.
const Style & GetCellStyleTR(size_t nCol, size_t nRow) const
Returns the bottom-left to top-right frame style of the cell (nCol,nRow).
css::uno::Reference< css::graphic::XPrimitive2D > Primitive2DReference
void SetMergedRange(size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow)
Inserts a new merged cell range.
bool HasCellRotation() const
bool IsColInClipRange(size_t nCol) const
bool HasCellRotation() const
Check if at least one cell is rotated.
static void HelperCreateVerticalEntry(const Array &rArray, const Style &rStyle, size_t col, size_t row, const basegfx::B2DPoint &rOrigin, const basegfx::B2DVector &rX, const basegfx::B2DVector &rY, drawinglayer::primitive2d::SdrFrameBorderDataVector &rData, bool bLeft, const Color *pForceColor)
bool IsMergedOverlappedBottom(size_t nCol, size_t nRow) const
#define DBG_FRAME_CHECK(cond, funcname, error)
const Style & GetCellStyleLeft(size_t nCol, size_t nRow) const
Returns the left frame style of the cell (nCol,nRow).
size_t GetColCount() const
Returns the number of columns in the array.
std::vector< Cell > CellVec
tools::Long GetHeight() const
Returns the output height of the entire array.
B2DHomMatrix createCoordinateSystemTransform(const B2DPoint &rOrigin, const B2DVector &rX, const B2DVector &rY)
size_t GetIndex(size_t nCol, size_t nRow) const
Contains the widths of primary and secondary line of a frame style.
void SetCellStyleRight(size_t nCol, size_t nRow, const Style &rStyle)
Sets the right frame style of the cell (nCol,nRow).
void SetRowHeight(size_t nRow, tools::Long nHeight)
Sets the output height of the specified row.
tools::Long GetWidth() const
Returns the output width of the entire array.
void SetAddMergedRightSize(size_t nCol, size_t nRow, tools::Long nAddSize)
Sets an additional right width for the merged range that contains (nCol,nRow).
size_t GetMergedFirstCol(size_t nCol, size_t nRow) const
void SetColumnStyleLeft(size_t nCol, const Style &rStyle)
Sets the left frame style of the specified column.
size_t GetCellCount() const
Returns the number of cells in the array.
tools::Long GetRowPosition(size_t nRow) const
void SetAddMergedLeftSize(size_t nCol, size_t nRow, tools::Long nAddSize)
Sets an additional left width for the merged range that contains (nCol,nRow).
void MirrorSelfX()
Mirrors the entire array horizontally.
void GetMergedRange(size_t &rnFirstCol, size_t &rnFirstRow, size_t &rnLastCol, size_t &rnLastRow, size_t nCol, size_t nRow) const
Returns the top-left and bottom-right address of the merged range that contains (nCol,nRow).
Stores frame styles of an array of cells, supports merged ranges.
void SetClipRange(size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow)
Sets a clipping range.
std::vector< tools::Long > maHeights
bool IsRotated(const OUString &rsCommandName, const OUString &rsModuleName)
bool IsMergedOverlappedLeft(size_t nCol, size_t nRow) const
size_t GetMirrorCol(size_t nCol) const
~Array()
Destructs the array.
void GetMergedOrigin(size_t &rnFirstCol, size_t &rnFirstRow, size_t nCol, size_t nRow) const
Returns the address of the top-left cell of the merged range that contains (nCol,nRow).
void SetAddMergedBottomSize(size_t nCol, size_t nRow, tools::Long nAddSize)
Sets an additional bottom height for the merged range that contains (nCol,nRow).
void SetRowStyleBottom(size_t nRow, const Style &rStyle)
Sets the bottom frame style of the specified row.
#define DBG_FRAME_CHECK_COLROW(col, row, funcname)
size_t GetMergedLastRow(size_t nCol, size_t nRow) const
size_t GetMergedLastCol(size_t nCol, size_t nRow) const