summaryrefslogtreecommitdiff
path: root/svx/source/dialog/framelink.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'svx/source/dialog/framelink.cxx')
-rw-r--r--svx/source/dialog/framelink.cxx53
1 files changed, 29 insertions, 24 deletions
diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx
index 82683743302c..28383a920456 100644
--- a/svx/source/dialog/framelink.cxx
+++ b/svx/source/dialog/framelink.cxx
@@ -1126,7 +1126,7 @@ void lclDrawDiagFrameBorders(
Style::Style() :
meRefMode(REFMODE_CENTERED),
- mfScale(1.0),
+ mfPatternScale(1.0),
mnType(table::BorderLineStyle::SOLID)
{
Clear();
@@ -1134,7 +1134,7 @@ Style::Style() :
Style::Style( double nP, double nD, double nS, editeng::SvxBorderStyle nType ) :
meRefMode(REFMODE_CENTERED),
- mfScale(1.0),
+ mfPatternScale(1.0),
mnType(nType)
{
Clear();
@@ -1144,7 +1144,7 @@ Style::Style( double nP, double nD, double nS, editeng::SvxBorderStyle nType ) :
Style::Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor,
double nP, double nD, double nS, editeng::SvxBorderStyle nType ) :
meRefMode(REFMODE_CENTERED),
- mfScale(1.0),
+ mfPatternScale(1.0),
mnType(nType)
{
Set( rColorPrim, rColorSecn, rColorGap, bUseGapColor, nP, nD, nS );
@@ -1152,21 +1152,26 @@ Style::Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rCo
Style::Style( const editeng::SvxBorderLine& rBorder, double fScale, sal_uInt16 nMaxWidth ) :
meRefMode(REFMODE_CENTERED),
- mfScale(fScale)
+ mfPatternScale(fScale)
{
Set( rBorder, fScale, nMaxWidth );
}
Style::Style( const editeng::SvxBorderLine* pBorder, double fScale, sal_uInt16 nMaxWidth ) :
meRefMode(REFMODE_CENTERED),
- mfScale(fScale)
+ mfPatternScale(fScale)
{
Set( pBorder, fScale, nMaxWidth );
}
-double Style::Scale() const
+double Style::PatternScale() const
{
- return mfScale;
+ return mfPatternScale;
+}
+
+void Style::SetPatternScale( double fScale )
+{
+ mfPatternScale = fScale;
}
void Style::Clear()
@@ -1183,9 +1188,9 @@ void Style::Set( double nP, double nD, double nS )
>0 0 >0 nP 0 0
>0 >0 >0 nP nD nS
*/
- mnPrim = rtl::math::round(nP ? nP : nS, 2);
- mnDist = rtl::math::round((nP && nS) ? nD : 0, 2);
- mnSecn = rtl::math::round((nP && nD) ? nS : 0, 2);
+ mfPrim = rtl::math::round(nP ? nP : nS, 2);
+ mfDist = rtl::math::round((nP && nS) ? nD : 0, 2);
+ mfSecn = rtl::math::round((nP && nD) ? nS : 0, 2);
}
void Style::Set( const Color& rColorPrim, const Color& rColorSecn, const Color& rColorGap, bool bUseGapColor, double nP, double nD, double nS )
@@ -1219,29 +1224,29 @@ void Style::Set( const SvxBorderLine& rBorder, double fScale, sal_uInt16 nMaxWid
// Enlarge the style if distance is too small due to rounding losses.
double nPixWidth = SCALEVALUE( nPrim + nDist + nSecn );
if( nPixWidth > GetWidth() )
- mnDist = nPixWidth - mnPrim - mnSecn;
+ mfDist = nPixWidth - mfPrim - mfSecn;
// Shrink the style if it is too thick for the control.
while( GetWidth() > nMaxWidth )
{
// First decrease space between lines.
- if( mnDist )
- --mnDist;
+ if( mfDist )
+ --mfDist;
// Still too thick? Decrease the line widths.
if( GetWidth() > nMaxWidth )
{
- if( rtl::math::approxEqual(mnPrim, 0.0) && rtl::math::approxEqual(mnPrim, mnSecn) )
+ if( rtl::math::approxEqual(mfPrim, 0.0) && rtl::math::approxEqual(mfPrim, mfSecn) )
{
// Both lines equal - decrease both to keep symmetry.
- --mnPrim;
- --mnSecn;
+ --mfPrim;
+ --mfSecn;
}
else
{
// Decrease each line for itself
- if( mnPrim )
- --mnPrim;
- if( (GetWidth() > nMaxWidth) && !rtl::math::approxEqual(mnSecn, 0.0) )
- --mnSecn;
+ if( mfPrim )
+ --mfPrim;
+ if( (GetWidth() > nMaxWidth) && !rtl::math::approxEqual(mfSecn, 0.0) )
+ --mfSecn;
}
}
}
@@ -1261,8 +1266,8 @@ void Style::Set( const SvxBorderLine* pBorder, double fScale, sal_uInt16 nMaxWid
Style& Style::MirrorSelf()
{
- if( mnSecn )
- std::swap( mnPrim, mnSecn );
+ if( mfSecn )
+ std::swap( mfPrim, mfSecn );
if( meRefMode != REFMODE_CENTERED )
meRefMode = (meRefMode == REFMODE_BEGIN) ? REFMODE_END : REFMODE_BEGIN;
return *this;
@@ -1429,7 +1434,7 @@ drawinglayer::primitive2d::Primitive2DSequence CreateClippedBorderPrimitives (
rBorder.GetColorSecn().getBColor(),
rBorder.GetColorPrim().getBColor(),
rBorder.GetColorGap().getBColor(),
- rBorder.UseGapColor(), rBorder.Type(), rBorder.Scale() );
+ rBorder.UseGapColor(), rBorder.Type(), rBorder.PatternScale() );
return aSequence;
}
@@ -1457,7 +1462,7 @@ drawinglayer::primitive2d::Primitive2DSequence CreateBorderPrimitives(
rBorder.GetColorSecn().getBColor(),
rBorder.GetColorPrim().getBColor(),
rBorder.GetColorGap().getBColor(),
- rBorder.UseGapColor(), rBorder.Type(), rBorder.Scale() );
+ rBorder.UseGapColor(), rBorder.Type(), rBorder.PatternScale() );
return aSequence;
}