include/drawinglayer/primitive2d/borderlineprimitive2d.hxx | 5 include/drawinglayer/processor2d/baseprocessor2d.hxx | 6 include/svtools/ctrlbox.hxx | 17 -- include/svx/framelinkarray.hxx | 86 ------------- sc/qa/unit/data/xls/cell-borders.xls |binary svtools/source/control/ctrlbox.cxx | 14 +- svx/source/dialog/framelinkarray.cxx | 82 ++++++++++++ 7 files changed, 100 insertions(+), 110 deletions(-)
New commits: commit 4712d40803370f3686b28ccf46c691b32bd35e60 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Mon Jan 13 17:50:11 2014 -0500 Add OOXML border names. Change-Id: I6fd1a43487fb5033564483f2c5148125023e3ebf diff --git a/sc/qa/unit/data/xls/cell-borders.xls b/sc/qa/unit/data/xls/cell-borders.xls index 143bfb3..87d6cf9 100644 Binary files a/sc/qa/unit/data/xls/cell-borders.xls and b/sc/qa/unit/data/xls/cell-borders.xls differ commit 02cfb5faa1be6c3a59c5d864ffb9168a2c27ce5b Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Mon Jan 13 17:28:16 2014 -0500 Updated test document. Rather than a box of borders, just use a single border. Change-Id: I50174ec745816b9f520b72c97a218c0a1e0a3b6e diff --git a/sc/qa/unit/data/xls/cell-borders.xls b/sc/qa/unit/data/xls/cell-borders.xls index 2eb8dc2..143bfb3 100644 Binary files a/sc/qa/unit/data/xls/cell-borders.xls and b/sc/qa/unit/data/xls/cell-borders.xls differ commit 3887060333df009c5a3c1d44340bdb23b664f991 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Mon Jan 13 17:13:35 2014 -0500 Remove STYLE_* and use css::table::BorderLineStyle instead. Change-Id: I187511dbf85ecdfe0c5d05c6f77cf4ac93363051 diff --git a/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx index c0f225e..3e85b3a 100644 --- a/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx @@ -26,7 +26,8 @@ #include <basegfx/color/bcolor.hxx> #include <basegfx/matrix/b2dhommatrix.hxx> #include <basegfx/polygon/b2dpolypolygon.hxx> -#include <svtools/ctrlbox.hxx> + +#include <com/sun/star/table/BorderLineStyle.hpp> ////////////////////////////////////////////////////////////////////////////// @@ -74,7 +75,7 @@ namespace drawinglayer bool isSolidLine() const { - return (mnStyle==STYLE_SOLID); + return mnStyle == com::sun::star::table::BorderLineStyle::SOLID; } bool isInsideUsed() const diff --git a/include/svtools/ctrlbox.hxx b/include/svtools/ctrlbox.hxx index 19eea12..29fee68 100644 --- a/include/svtools/ctrlbox.hxx +++ b/include/svtools/ctrlbox.hxx @@ -29,6 +29,8 @@ #include <vcl/metric.hxx> #include <vcl/field.hxx> +#include <com/sun/star/table/BorderLineStyle.hpp> + class FontList; class ImplColorListData; class ImpLineListData; @@ -37,15 +39,6 @@ typedef ::std::vector< ImplColorListData* > ImpColorList; typedef ::std::vector< ImpLineListData* > ImpLineList; typedef ::std::vector< FontInfo > ImplFontList; -// FIXME: STYLE_* duplicate values from editeng::SvxBorderStyle, -// which in turn duplicates values from com::sun::star::table::BorderLineStyle: -// this needs cleaning up on master -#define STYLE_SOLID ( ( sal_uInt16 ) 0 ) -#define STYLE_DOTTED ( ( sal_uInt16 ) 1 ) -#define STYLE_DASHED ( ( sal_uInt16 ) 2 ) -#define STYLE_FINE_DASHED ( ( sal_uInt16 ) 14 ) -#define STYLE_NONE ( ( sal_uInt16 ) -1) - #define CHANGE_LINE1 ( ( sal_uInt16 ) 1 ) #define CHANGE_LINE2 ( ( sal_uInt16 ) 2 ) #define CHANGE_DIST ( ( sal_uInt16 ) 4 ) @@ -339,17 +332,17 @@ public: virtual void Clear(); using ListBox::GetEntryPos; - virtual sal_uInt16 GetEntryPos( sal_uInt16 nStyle = STYLE_SOLID ) const; + virtual sal_uInt16 GetEntryPos( sal_uInt16 nStyle = com::sun::star::table::BorderLineStyle::SOLID ) const; sal_uInt16 GetEntryStyle( sal_uInt16 nPos ) const; void SelectEntry( const OUString& rStr, sal_Bool bSelect = sal_True ) { ListBox::SelectEntry( rStr, bSelect ); } - void SelectEntry( sal_uInt16 nStyle = STYLE_SOLID, sal_Bool bSelect = sal_True ); + void SelectEntry( sal_uInt16 nStyle = com::sun::star::table::BorderLineStyle::SOLID, sal_Bool bSelect = sal_True ); sal_uInt16 GetSelectEntryStyle( sal_uInt16 nSelIndex = 0 ) const; bool IsEntrySelected(const OUString& rStr) const { return ListBox::IsEntrySelected(rStr); } - bool IsEntrySelected(sal_uInt16 nStyle = STYLE_SOLID) const + bool IsEntrySelected( sal_uInt16 nStyle = com::sun::star::table::BorderLineStyle::SOLID ) const { sal_uInt16 nPos = GetEntryPos( nStyle ); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) diff --git a/svtools/source/control/ctrlbox.cxx b/svtools/source/control/ctrlbox.cxx index 2078cd5..1575103 100644 --- a/svtools/source/control/ctrlbox.cxx +++ b/svtools/source/control/ctrlbox.cxx @@ -41,6 +41,8 @@ #include <basegfx/polygon/b2dpolygon.hxx> #include <basegfx/polygon/b2dpolygontools.hxx> +#include <com/sun/star/table/BorderLineStyle.hpp> + #include <rtl/bootstrap.hxx> #if OSL_DEBUG_LEVEL > 1 @@ -527,7 +529,7 @@ Color ImpLineListData::GetColorDist( const Color& rMain, const Color& rDefault ) sal_uInt16 LineListBox::GetSelectEntryStyle( sal_uInt16 nSelIndex ) const { - sal_uInt16 nStyle = STYLE_SOLID; + sal_uInt16 nStyle = table::BorderLineStyle::SOLID; sal_uInt16 nPos = GetSelectEntryPos( nSelIndex ); if ( nPos != LISTBOX_ENTRY_NOTFOUND ) { @@ -588,7 +590,7 @@ namespace svtools ::std::vector < double >aPattern; switch ( nDashing ) { - case STYLE_DOTTED: + case table::BorderLineStyle::DOTTED: if ( eUnit == MAP_TWIP ) { aPattern.push_back( 30.0 ); @@ -605,7 +607,7 @@ namespace svtools aPattern.push_back( 3.0 ); } break; - case STYLE_DASHED: + case table::BorderLineStyle::DASHED: if ( eUnit == MAP_TWIP ) { aPattern.push_back( 110 ); @@ -622,7 +624,7 @@ namespace svtools aPattern.push_back( 20 ); } break; - case STYLE_FINE_DASHED: + case table::BorderLineStyle::FINE_DASHED: if ( eUnit == MAP_PIXEL ) { aPattern.push_back( 8 ); @@ -748,7 +750,7 @@ void LineListBox::ImpGetLine( long nLine1, long nLine2, long nDistance, { double y2 = n1 + nDist + double( n2 ) / 2; aVirDev.SetFillColor( aColor2 ); - svtools::DrawLine( aVirDev, basegfx::B2DPoint( 0, y2 ), basegfx::B2DPoint( aSize.Width(), y2 ), n2, STYLE_SOLID ); + svtools::DrawLine( aVirDev, basegfx::B2DPoint( 0, y2 ), basegfx::B2DPoint( aSize.Width(), y2 ), n2, table::BorderLineStyle::SOLID ); } rBmp = aVirDev.GetBitmap( Point(), Size( aSize.Width(), n1+nDist+n2 ) ); } @@ -923,7 +925,7 @@ sal_uInt16 LineListBox::GetEntryPos( sal_uInt16 nStyle ) const sal_uInt16 LineListBox::GetEntryStyle( sal_uInt16 nPos ) const { ImpLineListData* pData = (nPos < pLineList->size()) ? (*pLineList)[ nPos ] : NULL; - return ( pData ) ? pData->GetStyle() : STYLE_NONE; + return ( pData ) ? pData->GetStyle() : table::BorderLineStyle::NONE; } // ----------------------------------------------------------------------- commit 6c51059ba11246dfd187932233d42fecc8bae308 Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Mon Jan 13 14:08:58 2014 -0500 Typos etc. Change-Id: I4838514bc85636df1b3f0558ce1796431bfe19f3 diff --git a/include/drawinglayer/processor2d/baseprocessor2d.hxx b/include/drawinglayer/processor2d/baseprocessor2d.hxx index 62a0f87..dcf5201 100644 --- a/include/drawinglayer/processor2d/baseprocessor2d.hxx +++ b/include/drawinglayer/processor2d/baseprocessor2d.hxx @@ -33,7 +33,7 @@ namespace drawinglayer { /** BaseProcessor2D class - Baseclass for all C++ implementations of instances which process + Base class for all C++ implementations of instances which process primitives. Instances which process primitives can be renderers, but also stuff @@ -69,7 +69,7 @@ namespace drawinglayer Basic Primitives: - - BitmapPrimitive2D (bitmap data, evtl. with transparence) + - BitmapPrimitive2D (bitmap data, eventually with transparency) - PointArrayPrimitive2D (single points) - PolygonHairlinePrimitive2D (hairline curves/polygons) - PolyPolygonColorPrimitive2D (colored polygons) @@ -83,7 +83,7 @@ namespace drawinglayer - TransformPrimitive2D (for a transformation stack) A processor doing so is a minimal processor. Of course a processor may - handle any higher-level prmitive (that has a decomposition implementation) + handle any higher-level primitive (that has a decomposition implementation) for more direct data access or performance reasons, too. The main part of a processBasePrimitive2D implementation is a switch..case commit 2a6e592f1b6a2067c810de33c301336e77f603da Author: Kohei Yoshida <kohei.yosh...@collabora.com> Date: Mon Jan 13 13:18:25 2014 -0500 Hide the implementation of svx::frame::Array. Change-Id: Iad2d494bf7dd9f1f69e4e863aeaa514bf76c7c76 diff --git a/include/svx/framelinkarray.hxx b/include/svx/framelinkarray.hxx index b589958..f9782ea 100644 --- a/include/svx/framelinkarray.hxx +++ b/include/svx/framelinkarray.hxx @@ -31,91 +31,7 @@ namespace svx { namespace frame { -// ============================================================================ - - -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 ); -}; - -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; - - 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; -}; +class ArrayImpl; /** Stores frame styles of an array of cells, supports merged ranges. diff --git a/svx/source/dialog/framelinkarray.cxx b/svx/source/dialog/framelinkarray.cxx index d82b959..6b83afb 100644 --- a/svx/source/dialog/framelinkarray.cxx +++ b/svx/source/dialog/framelinkarray.cxx @@ -27,8 +27,32 @@ namespace svx { namespace frame { -// ============================================================================ +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 ); +}; +typedef std::vector< long > LongVec; +typedef std::vector< Cell > CellVec; Cell::Cell() : mnAddLeft( 0 ), @@ -95,7 +119,61 @@ static const Cell OBJ_CELL_NONE; const bool DIAG_DBL_CLIP_DEFAULT = false; -// ============================================================================ +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; + + 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; +}; ArrayImpl::ArrayImpl( size_t nWidth, size_t nHeight, bool bDiagDblClip ) : mnWidth( nWidth ), _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits