diff options
author | Kurt Zenker <kz@openoffice.org> | 2007-09-05 16:41:43 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2007-09-05 16:41:43 +0000 |
commit | 26dbf5fe0602bfdeb5dcc8783739f59f5988d755 (patch) | |
tree | 839831c6a843a7a7fe595c523a11d315e0a68dec /svx | |
parent | bdfd7ed115a6f543c9c5d665e191f28e1421ae16 (diff) |
INTEGRATION: CWS ause083 (1.2.154); FILE MERGED
2007/07/17 10:30:31 hjs 1.2.154.1: #i79470# cleanup to survive pch
Diffstat (limited to 'svx')
-rw-r--r-- | svx/inc/svx/framelinkarray.hxx | 92 |
1 files changed, 89 insertions, 3 deletions
diff --git a/svx/inc/svx/framelinkarray.hxx b/svx/inc/svx/framelinkarray.hxx index 7c93a8158db2..be61a4ca52f5 100644 --- a/svx/inc/svx/framelinkarray.hxx +++ b/svx/inc/svx/framelinkarray.hxx @@ -4,9 +4,9 @@ * * $RCSfile: framelinkarray.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: vg $ $Date: 2007-04-11 15:54:34 $ + * last change: $Author: kz $ $Date: 2007-09-05 17:41:43 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,6 +42,8 @@ #include <memory> +#include <vector> + #ifndef INCLUDED_SVXDLLAPI_H #include "svx/svxdllapi.h" #endif @@ -51,7 +53,91 @@ namespace frame { // ============================================================================ -struct ArrayImpl; + +struct Cell +{ + Style maLeft; + Style maRight; + Style maTop; + Style maBottom; + Style maTLBR; + Style maBLTR; + long mnAddLeft; + long mnAddRight; + long mnAddTop; + long mnAddBottom; + bool mbMergeOrig; + bool mbOverlapX; + bool mbOverlapY; + + explicit Cell(); + + inline bool IsMerged() const { return mbMergeOrig || mbOverlapX || mbOverlapY; } + inline bool IsOverlapped() const { return mbOverlapX || mbOverlapY; } + + void MirrorSelfX( bool bMirrorStyles, bool bSwapDiag ); + void MirrorSelfY( bool bMirrorStyles, bool bSwapDiag ); +}; + +typedef std::vector< long > LongVec; +typedef std::vector< Cell > CellVec; + +struct ArrayImpl +{ + CellVec maCells; + LongVec maWidths; + LongVec maHeights; + mutable LongVec maXCoords; + mutable LongVec maYCoords; + size_t mnWidth; + size_t mnHeight; + size_t mnFirstClipCol; + size_t mnFirstClipRow; + size_t mnLastClipCol; + size_t mnLastClipRow; + mutable bool mbXCoordsDirty; + mutable bool mbYCoordsDirty; + bool mbDiagDblClip; + + explicit ArrayImpl( size_t nWidth, size_t nHeight, bool bDiagDblClip ); + + inline bool IsValidPos( size_t nCol, size_t nRow ) const + { return (nCol < mnWidth) && (nRow < mnHeight); } + inline size_t GetIndex( size_t nCol, size_t nRow ) const + { return nRow * mnWidth + nCol; } + + const Cell& GetCell( size_t nCol, size_t nRow ) const; + Cell& GetCellAcc( size_t nCol, size_t nRow ); + + size_t GetMergedFirstCol( size_t nCol, size_t nRow ) const; + size_t GetMergedFirstRow( size_t nCol, size_t nRow ) const; + size_t GetMergedLastCol( size_t nCol, size_t nRow ) const; + 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; + bool IsMergedOverlappedTop( size_t nCol, size_t nRow ) const; + bool IsMergedOverlappedBottom( size_t nCol, size_t nRow ) const; + + bool IsInClipRange( size_t nCol, size_t nRow ) const; + bool IsColInClipRange( size_t nCol ) const; + bool IsRowInClipRange( size_t nRow ) const; + + inline size_t GetMirrorCol( size_t nCol ) const { return mnWidth - nCol - 1; } + inline size_t GetMirrorRow( size_t nRow ) const { return mnHeight - nRow - 1; } + + long GetColPosition( size_t nCol ) const; + long GetRowPosition( size_t nRow ) const; + + long GetColWidth( size_t nFirstCol, size_t nLastCol ) const; + long GetRowHeight( size_t nFirstRow, size_t nLastRow ) const; + + double GetHorDiagAngle( size_t nCol, size_t nRow, bool bSimple = false ) const; + double GetVerDiagAngle( size_t nCol, size_t nRow, bool bSimple = false ) const; +}; /** Stores frame styles of an array of cells, supports merged ranges. |