22#include <rtl/math.hxx>
47 Set( rColorPrim, rColorSecn, rColorGap, bUseGapColor, nP, nD, nS );
53 if(
nullptr != pBorder)
56 Set( pBorder, fScale );
71 mnType = SvxBorderLineStyle::SOLID;
84 mfPrim = rtl::math::round(nP ? nP : nS, 2);
85 mfDist = rtl::math::round((nP && nS) ? nD : 0, 2);
86 mfSecn = rtl::math::round((nP && nD) ? nS : 0, 2);
89void Style::Set(
const Color& rColorPrim,
const Color& rColorSecn,
const Color& rColorGap,
bool bUseGapColor,
double nP,
double nD,
double nS )
100 if(
nullptr == pBorder)
113 const sal_uInt16 nSecn(pBorder->
GetInWidth());
120 Set( std::min<double>(nPrim * fScale, nMaxWidth), 0, 0 );
124 Set(std::min<double>(nPrim * fScale, nMaxWidth), std::min<double>(nDist * fScale, nMaxWidth), std::min<double>(nSecn * fScale, nMaxWidth));
126 double nPixWidth = std::min<double>((nPrim + nDist + nSecn) * fScale, nMaxWidth);
198double GetWordTableCellBorderWeight(
const Style& rStyle)
201 int nBorderNumber = 0;
205 switch (rStyle.
Type())
207 case SvxBorderLineStyle::NONE:
209 case SvxBorderLineStyle::DOTTED:
210 case SvxBorderLineStyle::DASHED:
212 case SvxBorderLineStyle::SOLID:
218 case SvxBorderLineStyle::DOUBLE:
219 case SvxBorderLineStyle::DOUBLE_THIN:
226 case SvxBorderLineStyle::DASH_DOT:
230 case SvxBorderLineStyle::DASH_DOT_DOT:
234 case SvxBorderLineStyle::THINTHICK_SMALLGAP:
238 case SvxBorderLineStyle::THICKTHIN_SMALLGAP:
243 case SvxBorderLineStyle::THINTHICK_MEDIUMGAP:
247 case SvxBorderLineStyle::THICKTHIN_MEDIUMGAP:
252 case SvxBorderLineStyle::THINTHICK_LARGEGAP:
256 case SvxBorderLineStyle::THICKTHIN_LARGEGAP:
261 case SvxBorderLineStyle::FINE_DASHED:
265 case SvxBorderLineStyle::EMBOSSED:
269 case SvxBorderLineStyle::ENGRAVED:
273 case SvxBorderLineStyle::OUTSET:
277 case SvxBorderLineStyle::INSET:
283 return nBorderNumber * fWidth;
293 double fLW = GetWordTableCellBorderWeight(*
this);
294 double fRW = GetWordTableCellBorderWeight(rOther);
295 if (!rtl::math::approxEqual(fLW, fRW))
304 if( !rtl::math::approxEqual(nLW, nRW) )
return nLW < nRW;
307 if( (
Secn() == 0) != (rOther.
Secn() == 0) )
return Secn() == 0;
sal_uInt16 GetDistance() const
Color GetColorIn(bool bLeftOrTop=true) const
sal_uInt16 GetOutWidth() const
sal_uInt16 GetInWidth() const
Color GetColorOut(bool bLeftOrTop=true) const
Color GetColorGap() const
SvxBorderLineStyle GetBorderLineStyle() const
Contains the widths of primary and secondary line of a frame style.
void Clear()
Sets the frame style to invisible state.
double mfDist
Width of primary (single, left, or top) line.
bool mbWordTableCell
Reference point handling for this frame border.
double mfPatternScale
Width of secondary (right or bottom) line.
void Set(double nP, double nD, double nS)
Sets the frame style to the passed line widths.
Color GetColorGap() const
Color GetColorSecn() const
double GetWidth() const
Returns the total width of this frame style.
Color GetColorPrim() const
SvxBorderLineStyle mnType
Scale used for line pattern spacing.
Style & MirrorSelf()
Mirrors this style (exchanges primary and secondary), if it is a double frame style.
Style()
Constructs an invisible frame style.
RefMode GetRefMode() const
double mfSecn
Distance between primary and secondary line.
SvxBorderLineStyle Type() const
bool operator==(const Style &rOther) const
bool operator<(const Style &rOther) const
@ Begin
The reference points specify the begin of the frame border width.
@ End
The reference points specify the end of the frame border width.
@ Centered
Frame borders are drawn centered to the reference points.