diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-08-11 18:32:33 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-09-15 12:58:03 +0200 |
commit | fe14ddf25003c0f79f9f8a249bc22d45f57a0068 (patch) | |
tree | f0470ccd992a439bf52b83688d818c776bcd733e /include/svx/framelink.hxx | |
parent | Handle also the case where a range extends an existing one with overlap (diff) | |
download | core-fe14ddf25003c0f79f9f8a249bc22d45f57a0068.tar.gz core-fe14ddf25003c0f79f9f8a249bc22d45f57a0068.zip |
borderline: Abstraction of BorderLinePrimitive
As preparation for more detailed definition of BorderLine
primitives I have adapted the BorderLine definition to
work with motre possibilities to define the LineStartEnd
definitions in a BorderLineExtend class. That one is
flexible to hold all kinds of definitions - from none to
all four possible extends (Start/End, Left/Right of vector)
Cleanup of DiagStyle and others: DiagStyle is not needed
anymore due to no longer using angles calculated, but
being based on vectors defining the geometry. Also cleaned
up quite a bit of no longer needed calculation stuff for
the control.
Diffstat (limited to 'include/svx/framelink.hxx')
-rw-r--r-- | include/svx/framelink.hxx | 72 |
1 files changed, 4 insertions, 68 deletions
diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx index c53f429c3b59..973c401f5aec 100644 --- a/include/svx/framelink.hxx +++ b/include/svx/framelink.hxx @@ -184,72 +184,8 @@ SVX_DLLPUBLIC bool operator<( const Style& rL, const Style& rR ); inline bool operator>( const Style& rL, const Style& rR ) { return rR < rL; } - -/** Extends the Style struct with an angle for diagonal frame borders. - - The angle is specified in radian (a full circle is equivalent to 2*PI). - It is dependent on the context, how the value is interpreted, i.e. it may - specify the angle to a horizontal or vertical frame border. - */ -class SAL_WARN_UNUSED DiagStyle : public Style -{ -public: - /** Constructs an invisible diagonal frame style. */ - explicit DiagStyle() {} - /** Constructs a diagonal frame style passed style and angle. */ - explicit DiagStyle( const Style& rStyle, double /*fAngle*/ ) : - Style( rStyle ) {} -}; - - // Various helper functions - -/** Returns the angle between horizontal border of a rectangle and its diagonal. - - The returned values represents the inner angle between the diagonals and - horizontal borders, and is therefore in the range [0,PI/2] (inclusive). The - passed sizes may be negative, calculation is done with absolute values. - */ -SVX_DLLPUBLIC double GetHorDiagAngle( long nWidth, long nHeight ); - -/** Returns an X coordinate for a diagonal frame border in the specified height. - - This function is for usage with the top-left end of a top-left to - bottom-right diagonal frame border, connected to the left end of a - horizontal frame border. - - The function returns the relative X position (i.e. for a polygon) of the - diagonal frame border according to the specified relative Y position. The - mentioned positions are relative to the reference point of both frame - borders. - - +---------------------------------------------------------- - | The horizontal frame border. - | | - - - - - - - | --+-- <---- Reference point for horizontal and diagonal frame borders. - ^ | \ | \ - nVerOffs | \ \ <--- The diagonal frame border. - v +---\ \------------------------------------------------ - - - - - - - - - -\- - -X <----- The function calculates the X position of i.e. - \ \ this point (relative from X of reference point). - \ \ - Primary -->\ \<-- Secondary - - @param nVerOffs - The vertical position of the point to be calculated, relative to the Y - coordinate of the reference point. - @param nDiagOffs - The width offset across the diagonal frame border (0 = middle), - regardless of the gradient of the diagonal frame border (always - vertical to the direction of the diagonal frame border). This value is - not related in any way to the reference point. For details about - relative width offsets, see description of class Style. - @param fAngle - Inner (right) angle between diagonal and horizontal frame border. - */ -SVX_DLLPUBLIC long GetTLDiagOffset( long nVerOffs, long nDiagOffs, double fAngle ); - /** Checks whether two horizontal frame borders are "connectable". Two borders are "connectable" in terms of this function, if both can be @@ -339,17 +275,17 @@ SVX_DLLPUBLIC void CreateBorderPrimitives( const Style& rBorder, /// Style of the processed frame border. - const DiagStyle& rLFromTR, /// Diagonal frame border from top-right to left end of rBorder. + const Style& rLFromTR, /// Diagonal frame border from top-right to left end of rBorder. const Style& rLFromT, /// Vertical frame border from top to left end of rBorder. const Style& rLFromL, /// Horizontal frame border from left to left end of rBorder. const Style& rLFromB, /// Vertical frame border from bottom to left end of rBorder. - const DiagStyle& rLFromBR, /// Diagonal frame border from bottom-right to left end of rBorder. + const Style& rLFromBR, /// Diagonal frame border from bottom-right to left end of rBorder. - const DiagStyle& rRFromTL, /// Diagonal frame border from top-left to right end of rBorder. + const Style& rRFromTL, /// Diagonal frame border from top-left to right end of rBorder. const Style& rRFromT, /// Vertical frame border from top to right end of rBorder. const Style& rRFromR, /// Horizontal frame border from right to right end of rBorder. const Style& rRFromB, /// Vertical frame border from bottom to right end of rBorder. - const DiagStyle& rRFromBL, /// Diagonal frame border from bottom-left to right end of rBorder. + const Style& rRFromBL, /// Diagonal frame border from bottom-left to right end of rBorder. const Color* pForceColor /// If specified, overrides frame border color. ); |