diff options
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/framelinkarray.hxx | 58 | ||||
-rw-r--r-- | svx/source/dialog/framelinkarray.cxx | 140 |
2 files changed, 0 insertions, 198 deletions
diff --git a/svx/inc/svx/framelinkarray.hxx b/svx/inc/svx/framelinkarray.hxx index 5b082024ca45..ab952eb6e2b7 100644 --- a/svx/inc/svx/framelinkarray.hxx +++ b/svx/inc/svx/framelinkarray.hxx @@ -104,7 +104,6 @@ struct ArrayImpl size_t GetMergedLastRow( size_t nCol, size_t nRow ) const; const Cell& GetMergedOriginCell( size_t nCol, size_t nRow ) const; - Cell& GetMergedOriginCellAcc( size_t nCol, size_t nRow ); bool IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const; bool IsMergedOverlappedRight( size_t nCol, size_t nRow ) const; @@ -161,9 +160,6 @@ public: /** Constructs an empty array. */ explicit Array(); - /** Constructs an array with the specified width and height. */ - explicit Array( size_t nWidth, size_t nHeight ); - /** Destructs the array. */ ~Array(); @@ -172,9 +168,6 @@ public: /** Reinitializes the array with the specified size. Clears all styles. */ void Initialize( size_t nWidth, size_t nHeight ); - /** Clears all line styles, column widths, row heights, merge data, and the clip range. */ - void Clear(); - /** Returns the number of columns in the array. */ size_t GetColCount() const; @@ -184,12 +177,6 @@ public: /** Returns the number of cells in the array. */ size_t GetCellCount() const; - /** Returns the column index of the specified cell index. */ - size_t GetColFromIndex( size_t nCellIndex ) const; - - /** Returns the row index of the specified cell index. */ - size_t GetRowFromIndex( size_t nCellIndex ) const; - /** Returns the cell index from the cell address (nCol,nRow). */ size_t GetCellIndex( size_t nCol, size_t nRow, bool bRTL = false) const; @@ -318,9 +305,6 @@ public: @precond The range must not intersect other merged ranges. */ void SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow ); - /** Removes the merged cell range that contains (nCol,nRow). */ - void RemoveMergedRange( size_t nCol, size_t nRow ); - /** Sets an additional left width for the merged range that contains (nCol,nRow). @descr Useful to handle merged ranges that are not completely part of the array. @precond The merged range must be at the left border of the array. */ @@ -344,30 +328,15 @@ public: /** Returns true, if the cell (nCol,nRow) is part of a merged range. */ bool IsMerged( size_t nCol, size_t nRow ) const; - /** Returns true, if the cell (nCol,nRow) is the top-left corner of a merged range. */ - bool IsMergedOrigin( size_t nCol, size_t nRow ) const; - - /** Returns true, if the cell (nCol,nRow) is overlapped by a merged range. */ - bool IsMergedOverlapped( size_t nCol, size_t nRow ) const; - /** Returns true, if the left border of the cell (nCol,nRow) is overlapped by a merged range. */ bool IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const; /** Returns true, if the right border of the cell (nCol,nRow) is overlapped by a merged range. */ bool IsMergedOverlappedRight( size_t nCol, size_t nRow ) const; - /** Returns true, if the top border of the cell (nCol,nRow) is overlapped by a merged range. */ - bool IsMergedOverlappedTop( size_t nCol, size_t nRow ) const; - - /** Returns true, if the bottom border of the cell (nCol,nRow) is overlapped by a merged range. */ - bool IsMergedOverlappedBottom( size_t nCol, size_t nRow ) const; - /** Returns the address of the top-left cell of the merged range that contains (nCol,nRow). */ void GetMergedOrigin( size_t& rnFirstCol, size_t& rnFirstRow, size_t nCol, size_t nRow ) const; - /** Returns the range size of the merged range thst contains (nCol,nRow). */ - void GetMergedSize( size_t& rnWidth, size_t& rnHeight, size_t nCol, size_t nRow ) const; - /** Returns the top-left and bottom-right address of the merged range that contains (nCol,nRow). */ void GetMergedRange( size_t& rnFirstCol, size_t& rnFirstRow, size_t& rnLastCol, size_t& rnLastRow, size_t nCol, size_t nRow ) const; @@ -385,12 +354,6 @@ public: clipped too. This array can handle only one clip range at a time. */ void SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow ); - /** Removes the clipping range set with the SetClipRange() function. */ - void RemoveClipRange(); - - /** Returns true, if the cell (bCol,nRow) is inside the current clip range. */ - bool IsInClipRange( size_t nCol, size_t nRow ) const; - /** Returns the rectangle (output coordinates) of the current clipping range. */ Rectangle GetClipRangeRectangle() const; @@ -424,15 +387,9 @@ public: of the bottom array border. */ long GetRowPosition( size_t nRow ) const; - /** Returns the output width of the specified column. */ - long GetColWidth( size_t nCol ) const; - /** Returns the output width of the specified range of columns. */ long GetColWidth( size_t nFirstCol, size_t nLastCol ) const; - /** Returns the output height of the specified row. */ - long GetRowHeight( size_t nRow ) const; - /** Returns the output height of the specified range of rows. */ long GetRowHeight( size_t nFirstRow, size_t nLastRow ) const; @@ -482,9 +439,6 @@ public: Border tab page). Default after construction is OFF. */ void SetUseDiagDoubleClipping( bool bSet ); - /** Returns true, if polygon clipping is used to draw diagonal frame borders. */ - bool GetUseDiagDoubleClipping() const; - // mirroring -------------------------------------------------------------- /** Mirrors the entire array horizontally. @@ -494,20 +448,8 @@ public: true = Swap top-left to bottom-right and bottom-left to top-right frame borders. */ void MirrorSelfX( bool bMirrorStyles, bool bSwapDiag ); - /** Mirrors the entire array vertically. - @param bMirrorStyles - true = Swap primary and secondary line of all horizontal double frame borders. - @param bSwapDiag - true = Swap top-left to bottom-right and bottom-left to top-right frame borders. */ - void MirrorSelfY( bool bMirrorStyles, bool bSwapDiag ); - // drawing ---------------------------------------------------------------- - /** Draws the cell (nCol,nRow), if it is inside the clipping range. - @param pForceColor - If not NULL, only this color will be used to draw all frame borders. */ - void DrawCell( OutputDevice& rDev, size_t nCol, size_t nRow, - const Color* pForceColor = 0 ) const; /** Draws the part of the specified range, that is inside the clipping range. @param pForceColor If not NULL, only this color will be used to draw all frame borders. */ diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index 2c20e2bd1729..3107e7ac3408 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -186,11 +186,6 @@ const Cell& ArrayImpl::GetMergedOriginCell( size_t nCol, size_t nRow ) const return GetCell( GetMergedFirstCol( nCol, nRow ), GetMergedFirstRow( nCol, nRow ) ); } -Cell& ArrayImpl::GetMergedOriginCellAcc( size_t nCol, size_t nRow ) -{ - return GetCellAcc( GetMergedFirstCol( nCol, nRow ), GetMergedFirstRow( nCol, nRow ) ); -} - bool ArrayImpl::IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const { const Cell& rCell = GetCell( nCol, nRow ); @@ -346,7 +341,6 @@ MergedCellIterator& MergedCellIterator::operator++() #define CELL( col, row ) mxImpl->GetCell( col, row ) #define CELLACC( col, row ) mxImpl->GetCellAcc( col, row ) #define ORIGCELL( col, row ) mxImpl->GetMergedOriginCell( col, row ) -#define ORIGCELLACC( col, row ) mxImpl->GetMergedOriginCellAcc( col, row ) // ---------------------------------------------------------------------------- @@ -355,11 +349,6 @@ Array::Array() Initialize( 0, 0 ); } -Array::Array( size_t nWidth, size_t nHeight ) -{ - Initialize( nWidth, nHeight ); -} - Array::~Array() { } @@ -372,11 +361,6 @@ void Array::Initialize( size_t nWidth, size_t nHeight ) mxImpl.reset( new ArrayImpl( nWidth, nHeight, bDiagDblClip ) ); } -void Array::Clear() -{ - Initialize( mxImpl->mnWidth, mxImpl->mnHeight ); -} - size_t Array::GetColCount() const { return mxImpl->mnWidth; @@ -392,18 +376,6 @@ size_t Array::GetCellCount() const return mxImpl->maCells.size(); } -size_t Array::GetColFromIndex( size_t nCellIndex ) const -{ - DBG_FRAME_CHECK_INDEX( nCellIndex, "GetColFromIndex" ); - return mxImpl->mnWidth ? (nCellIndex % mxImpl->mnWidth) : 0; -} - -size_t Array::GetRowFromIndex( size_t nCellIndex ) const -{ - DBG_FRAME_CHECK_INDEX( nCellIndex, "GetRowFromIndex" ); - return mxImpl->mnWidth ? (nCellIndex / mxImpl->mnWidth) : 0; -} - size_t Array::GetCellIndex( size_t nCol, size_t nRow, bool bRTL ) const { DBG_FRAME_CHECK_COLROW( nCol, nRow, "GetCellIndex" ); @@ -649,17 +621,6 @@ void Array::SetMergedRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, lclSetMergedRange( mxImpl->maCells, mxImpl->mnWidth, nFirstCol, nFirstRow, nLastCol, nLastRow ); } -void Array::RemoveMergedRange( size_t nCol, size_t nRow ) -{ - DBG_FRAME_CHECK_COLROW( nCol, nRow, "RemoveMergedRange" ); - for( MergedCellIterator aIt( *this, nCol, nRow ); aIt.Is(); ++aIt ) - { - Cell& rCell = CELLACC( aIt.Col(), aIt.Row() ); - rCell.mbMergeOrig = rCell.mbOverlapX = rCell.mbOverlapY = false; - rCell.mnAddLeft = rCell.mnAddRight = rCell.mnAddTop = rCell.mnAddBottom = 0; - } -} - void Array::SetAddMergedLeftSize( size_t nCol, size_t nRow, long nAddSize ) { DBG_FRAME_CHECK_COLROW( nCol, nRow, "SetAddMergedLeftSize" ); @@ -698,18 +659,6 @@ bool Array::IsMerged( size_t nCol, size_t nRow ) const return CELL( nCol, nRow ).IsMerged(); } -bool Array::IsMergedOrigin( size_t nCol, size_t nRow ) const -{ - DBG_FRAME_CHECK_COLROW( nCol, nRow, "IsMergedOrigin" ); - return CELL( nCol, nRow ).mbMergeOrig; -} - -bool Array::IsMergedOverlapped( size_t nCol, size_t nRow ) const -{ - DBG_FRAME_CHECK_COLROW( nCol, nRow, "IsMergedOverlapped" ); - return CELL( nCol, nRow ).IsOverlapped(); -} - bool Array::IsMergedOverlappedLeft( size_t nCol, size_t nRow ) const { DBG_FRAME_CHECK_COLROW( nCol, nRow, "IsMergedOverlappedLeft" ); @@ -722,18 +671,6 @@ bool Array::IsMergedOverlappedRight( size_t nCol, size_t nRow ) const return mxImpl->IsMergedOverlappedRight( nCol, nRow ); } -bool Array::IsMergedOverlappedTop( size_t nCol, size_t nRow ) const -{ - DBG_FRAME_CHECK_COLROW( nCol, nRow, "IsMergedOverlappedTop" ); - return mxImpl->IsMergedOverlappedTop( nCol, nRow ); -} - -bool Array::IsMergedOverlappedBottom( size_t nCol, size_t nRow ) const -{ - DBG_FRAME_CHECK_COLROW( nCol, nRow, "IsMergedOverlappedBottom" ); - return mxImpl->IsMergedOverlappedBottom( nCol, nRow ); -} - void Array::GetMergedOrigin( size_t& rnFirstCol, size_t& rnFirstRow, size_t nCol, size_t nRow ) const { DBG_FRAME_CHECK_COLROW( nCol, nRow, "GetMergedOrigin" ); @@ -741,14 +678,6 @@ void Array::GetMergedOrigin( size_t& rnFirstCol, size_t& rnFirstRow, size_t nCol rnFirstRow = mxImpl->GetMergedFirstRow( nCol, nRow ); } -void Array::GetMergedSize( size_t& rnWidth, size_t& rnHeight, size_t nCol, size_t nRow ) const -{ - size_t nFirstCol, nFirstRow, nLastCol, nLastRow; - GetMergedRange( nFirstCol, nFirstRow, nLastCol, nLastRow, nCol, nRow ); - rnWidth = nLastCol - nFirstCol + 1; - rnHeight = nLastRow - nFirstRow + 1; -} - void Array::GetMergedRange( size_t& rnFirstCol, size_t& rnFirstRow, size_t& rnLastCol, size_t& rnLastRow, size_t nCol, size_t nRow ) const { @@ -769,18 +698,6 @@ void Array::SetClipRange( size_t nFirstCol, size_t nFirstRow, size_t nLastCol, s mxImpl->mnLastClipRow = nLastRow; } -void Array::RemoveClipRange() -{ - if( !mxImpl->maCells.empty() ) - SetClipRange( 0, 0, mxImpl->mnWidth - 1, mxImpl->mnHeight - 1 ); -} - -bool Array::IsInClipRange( size_t nCol, size_t nRow ) const -{ - DBG_FRAME_CHECK_COLROW( nCol, nRow, "IsInClipRange" ); - return mxImpl->IsInClipRange( nCol, nRow ); -} - Rectangle Array::GetClipRangeRectangle() const { return Rectangle( @@ -842,12 +759,6 @@ long Array::GetRowPosition( size_t nRow ) const return mxImpl->GetRowPosition( nRow ); } -long Array::GetColWidth( size_t nCol ) const -{ - DBG_FRAME_CHECK_COL( nCol, "GetColWidth" ); - return mxImpl->maWidths[ nCol ]; -} - long Array::GetColWidth( size_t nFirstCol, size_t nLastCol ) const { DBG_FRAME_CHECK_COL( nFirstCol, "GetColWidth" ); @@ -855,12 +766,6 @@ long Array::GetColWidth( size_t nFirstCol, size_t nLastCol ) const return GetColPosition( nLastCol + 1 ) - GetColPosition( nFirstCol ); } -long Array::GetRowHeight( size_t nRow ) const -{ - DBG_FRAME_CHECK_ROW( nRow, "GetRowHeight" ); - return mxImpl->maHeights[ nRow ]; -} - long Array::GetRowHeight( size_t nFirstRow, size_t nLastRow ) const { DBG_FRAME_CHECK_ROW( nFirstRow, "GetRowHeight" ); @@ -929,11 +834,6 @@ void Array::SetUseDiagDoubleClipping( bool bSet ) mxImpl->mbDiagDblClip = bSet; } -bool Array::GetUseDiagDoubleClipping() const -{ - return mxImpl->mbDiagDblClip; -} - // mirroring ------------------------------------------------------------------ void Array::MirrorSelfX( bool bMirrorStyles, bool bSwapDiag ) @@ -970,47 +870,8 @@ void Array::MirrorSelfX( bool bMirrorStyles, bool bSwapDiag ) mxImpl->mbXCoordsDirty = true; } -void Array::MirrorSelfY( bool bMirrorStyles, bool bSwapDiag ) -{ - CellVec aNewCells; - aNewCells.reserve( GetCellCount() ); - - size_t nCol, nRow; - for( nRow = 0; nRow < mxImpl->mnHeight; ++nRow ) - { - for( nCol = 0; nCol < mxImpl->mnWidth; ++nCol ) - { - aNewCells.push_back( CELL( nCol, mxImpl->GetMirrorRow( nRow ) ) ); - aNewCells.back().MirrorSelfY( bMirrorStyles, bSwapDiag ); - } - } - for( nRow = 0; nRow < mxImpl->mnHeight; ++nRow ) - { - for( nCol = 0; nCol < mxImpl->mnWidth; ++nCol ) - { - if( CELL( nCol, nRow ).mbMergeOrig ) - { - size_t nLastCol = mxImpl->GetMergedLastCol( nCol, nRow ); - size_t nLastRow = mxImpl->GetMergedLastRow( nCol, nRow ); - lclSetMergedRange( aNewCells, mxImpl->mnWidth, - nCol, mxImpl->GetMirrorRow( nLastRow ), - nLastCol, mxImpl->GetMirrorRow( nRow ) ); - } - } - } - mxImpl->maCells.swap( aNewCells ); - - std::reverse( mxImpl->maHeights.begin(), mxImpl->maHeights.end() ); - mxImpl->mbYCoordsDirty = true; -} - // drawing -------------------------------------------------------------------- -void Array::DrawCell( OutputDevice& rDev, size_t nCol, size_t nRow, const Color* pForceColor ) const -{ - DrawRange( rDev, nCol, nRow, nCol, nRow, pForceColor ); -} - void Array::DrawRange( drawinglayer::processor2d::BaseProcessor2D* pProcessor, size_t nFirstCol, size_t nFirstRow, size_t nLastCol, size_t nLastRow, const Color* pForceColor ) const @@ -1427,7 +1288,6 @@ void Array::DrawArray( OutputDevice& rDev, const Color* pForceColor ) const // ---------------------------------------------------------------------------- -#undef ORIGCELLACC #undef ORIGCELL #undef CELLACC #undef CELL |