diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-01-13 13:18:25 -0500 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2014-01-29 22:33:16 +0000 |
commit | 9a19e8d838753128504274e1885eb3ce8ec1dbb8 (patch) | |
tree | ba7783a8d2ddfa3a4f2fedd9fc4075e1b8a0990b /include | |
parent | 33ada1f20a2cdd6d52e6cb6e81aa0477ec0df563 (diff) |
fdo#73487, fdo#73886: Overhaul cell borders to make them look sane.
Change-Id: Ie563f272b60ec8b6b8a4ff0df7256902997610c1
Reviewed-on: https://gerrit.libreoffice.org/7597
Reviewed-by: Andras Timar <andras.timar@collabora.com>
Tested-by: Andras Timar <andras.timar@collabora.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/drawinglayer/primitive2d/borderlineprimitive2d.hxx | 11 | ||||
-rw-r--r-- | include/drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx | 3 | ||||
-rw-r--r-- | include/svtools/borderhelper.hxx | 19 | ||||
-rw-r--r-- | include/svx/framelink.hxx | 23 |
4 files changed, 27 insertions, 29 deletions
diff --git a/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx b/include/drawinglayer/primitive2d/borderlineprimitive2d.hxx index c0f225e36ca3..9726dcd6dd03 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> ////////////////////////////////////////////////////////////////////////////// @@ -68,13 +69,15 @@ namespace drawinglayer short mnStyle; + double mfPatternScale; + /// local helpers double getWidth( const geometry::ViewInformation2D& rViewInformation) const; bool isSolidLine() const { - return (mnStyle==STYLE_SOLID); + return mnStyle == com::sun::star::table::BorderLineStyle::SOLID; } bool isInsideUsed() const @@ -110,7 +113,8 @@ namespace drawinglayer const basegfx::BColor& rRGBColorLeft, const basegfx::BColor& rRGBColorGap, bool bHasGapColor, - const short nStyle ); + const short nStyle, + double fPatternScale = 1.0 ); /// data read access const basegfx::B2DPoint& getStart() const { return maStart; } @@ -127,6 +131,7 @@ namespace drawinglayer const basegfx::BColor& getRGBColorGap () const { return maRGBColorGap; } bool hasGapColor( ) const { return mbHasGapColor; } short getStyle () const { return mnStyle; } + double getPatternScale() const { return mfPatternScale; } /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; diff --git a/include/drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx b/include/drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx index a2e21948a908..aaa2095fb9d3 100644 --- a/include/drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx +++ b/include/drawinglayer/primitive2d/clippedborderlineprimitive2d.hxx @@ -46,7 +46,8 @@ namespace drawinglayer const basegfx::BColor& rRGBColorLeft, const basegfx::BColor& rRGBColorGap, bool bHasGapColor, - const short nStyle ); + const short nStyle, + double fPatternScale = 1.0 ); /// compare operator virtual bool operator==(const BasePrimitive2D& rPrimitive) const; diff --git a/include/svtools/borderhelper.hxx b/include/svtools/borderhelper.hxx index ea89ca8e8e3e..5e4328dfd147 100644 --- a/include/svtools/borderhelper.hxx +++ b/include/svtools/borderhelper.hxx @@ -27,19 +27,18 @@ #include <basegfx/point/b2dpoint.hxx> #include <vcl/outdev.hxx> -namespace svtools -{ - SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, - sal_uInt16 nDashing, MapUnit eUnit ); +namespace svtools { - SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( const basegfx::B2DPolygon& rPolygon, - sal_uInt16 nDashing, MapUnit eUnit, double fScale ); +SVT_DLLPUBLIC std::vector<double> GetLineDashing( sal_uInt16 nDashing, double fScale ); - SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const basegfx::B2DPoint& rBeg, - const basegfx::B2DPoint& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing ); +SVT_DLLPUBLIC basegfx::B2DPolyPolygon ApplyLineDashing( + const basegfx::B2DPolygon& rPolygon, sal_uInt16 nDashing, double fScale ); - SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const Point& rBeg, - const Point& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing ); +SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const basegfx::B2DPoint& rBeg, + const basegfx::B2DPoint& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing ); + +SVT_DLLPUBLIC void DrawLine( OutputDevice& rDev, const Point& rBeg, + const Point& rEnd, sal_uInt32 nWidth, sal_uInt16 nDashing ); } #endif diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx index 952d66e73806..afae83e428e7 100644 --- a/include/svx/framelink.hxx +++ b/include/svx/framelink.hxx @@ -108,25 +108,16 @@ class SVX_DLLPUBLIC Style { public: /** Constructs an invisible frame style. */ - inline explicit Style() - : meRefMode( REFMODE_CENTERED ) - , mnType( ::com::sun::star::table::BorderLineStyle::SOLID ) - { Clear(); } + explicit Style(); /** Constructs a frame style with passed line widths. */ - inline explicit Style( double nP, double nD, double nS, editeng::SvxBorderStyle nType ) : - meRefMode( REFMODE_CENTERED ), mnType( nType ) - { Clear(); Set( nP, nD, nS ); } + explicit Style( double nP, double nD, double nS, editeng::SvxBorderStyle nType ); /** Constructs a frame style with passed color and line widths. */ - inline explicit Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, - double nP, double nD, double nS, editeng::SvxBorderStyle nType ) : - meRefMode( REFMODE_CENTERED ), mnType( nType ) - { Set( rColorPrim, rColorSecn, rColorGap, bUseGapColor, nP, nD, nS ); } + explicit Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, + double nP, double nD, double nS, editeng::SvxBorderStyle nType ); /** Constructs a frame style from the passed SvxBorderLine struct. */ - inline explicit Style( const editeng::SvxBorderLine& rBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 ) : - meRefMode( REFMODE_CENTERED ) { Set( rBorder, fScale, nMaxWidth ); } + explicit Style( const editeng::SvxBorderLine& rBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 ); /** Constructs a frame style from the passed SvxBorderLine struct. Clears the style, if pBorder is 0. */ - inline explicit Style( const editeng::SvxBorderLine* pBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 ) : - meRefMode( REFMODE_CENTERED ) { Set( pBorder, fScale, nMaxWidth ); } + explicit Style( const editeng::SvxBorderLine* pBorder, double fScale = 1.0, sal_uInt16 nMaxWidth = SAL_MAX_UINT16 ); inline RefMode GetRefMode() const { return meRefMode; } inline const Color& GetColorPrim() const { return maColorPrim; } @@ -136,6 +127,7 @@ public: inline double Prim() const { return mnPrim; } inline double Dist() const { return mnDist; } inline double Secn() const { return mnSecn; } + double Scale() const; inline editeng::SvxBorderStyle Type() const { return mnType; } /** Returns the total width of this frame style. */ @@ -176,6 +168,7 @@ private: double mnPrim; /// Width of primary (single, left, or top) line. double mnDist; /// Distance between primary and secondary line. double mnSecn; /// Width of secondary (right or bottom) line. + double mfScale; editeng::SvxBorderStyle mnType; }; |