diff options
-rw-r--r-- | include/svx/framelink.hxx | 5 | ||||
-rw-r--r-- | svx/source/dialog/framelink.cxx | 21 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 30 |
3 files changed, 35 insertions, 21 deletions
diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx index 729518904180..cdc221d1d4e1 100644 --- a/include/svx/framelink.hxx +++ b/include/svx/framelink.hxx @@ -125,7 +125,8 @@ public: inline double Prim() const { return mfPrim; } inline double Dist() const { return mfDist; } inline double Secn() const { return mfSecn; } - double Scale() const; + double PatternScale() const; + void SetPatternScale( double fScale ); inline editeng::SvxBorderStyle Type() const { return mnType; } /** Returns the total width of this frame style. */ @@ -166,7 +167,7 @@ private: double mfPrim; /// Width of primary (single, left, or top) line. double mfDist; /// Distance between primary and secondary line. double mfSecn; /// Width of secondary (right or bottom) line. - double mfScale; + double mfPatternScale; /// Scale used for line pattern spacing. editeng::SvxBorderStyle mnType; }; diff --git a/svx/source/dialog/framelink.cxx b/svx/source/dialog/framelink.cxx index a6a4f7224ef1..1ae4b7030823 100644 --- a/svx/source/dialog/framelink.cxx +++ b/svx/source/dialog/framelink.cxx @@ -1130,7 +1130,7 @@ void lclDrawDiagFrameBorders( Style::Style() : meRefMode(REFMODE_CENTERED), - mfScale(1.0), + mfPatternScale(1.0), mnType(table::BorderLineStyle::SOLID) { Clear(); @@ -1138,7 +1138,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(); @@ -1148,7 +1148,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 ); @@ -1156,14 +1156,19 @@ Style::Style( const Color& rColorPrim, const Color& rColorSecn, const Color& rCo Style::Style( const editeng::SvxBorderLine* pBorder, double fScale, sal_uInt16 nMaxWidth ) : meRefMode(REFMODE_CENTERED), - mfScale(fScale) + mfPatternScale(1.0) { 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() @@ -1426,7 +1431,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; } @@ -1454,7 +1459,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; } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index e1f37f2d948f..18bfe6fe05a8 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2797,13 +2797,17 @@ void calcOffsetForDoubleLine( SwLineEntryMap& rLines ) for (size_t i = 0; itSet != itSetEnd; ++itSet, ++i) { SwLineEntry aLine = *itSet; - aLine.mnOffset = static_cast<SwTwips>(aLine.maAttribute.Prim()+aLine.maAttribute.Dist()); - aLine.mbOffsetPerp = true; - - if (i == 0) - aLine.mbOffsetStart = true; - if (i == nEntryCount - 1) - aLine.mbOffsetEnd = true; + if (aLine.maAttribute.Secn()) + { + // Apply offset only for double lines. + aLine.mnOffset = static_cast<SwTwips>(aLine.maAttribute.Prim()+aLine.maAttribute.Dist()); + aLine.mbOffsetPerp = true; + + if (i == 0) + aLine.mbOffsetStart = true; + if (i == nEntryCount - 1) + aLine.mbOffsetEnd = true; + } aNewSet.insert(aLine); } @@ -2865,10 +2869,14 @@ void SwTabFrmPainter::Insert( const SwFrm& rFrm, const SvxBoxItem& rBoxItem ) const Fraction& rFracX = rMapMode.GetScaleX(); const Fraction& rFracY = rMapMode.GetScaleY(); - svx::frame::Style aL(rBoxItem.GetLeft(), rFracX); - svx::frame::Style aR(rBoxItem.GetRight(), rFracY); - svx::frame::Style aT(rBoxItem.GetTop(), rFracX); - svx::frame::Style aB(rBoxItem.GetBottom(), rFracY); + svx::frame::Style aL(rBoxItem.GetLeft()); + aL.SetPatternScale(rFracY); + svx::frame::Style aR(rBoxItem.GetRight()); + aR.SetPatternScale(rFracY); + svx::frame::Style aT(rBoxItem.GetTop()); + aT.SetPatternScale(rFracX); + svx::frame::Style aB(rBoxItem.GetBottom()); + aB.SetPatternScale(rFracX); aR.MirrorSelf(); aB.MirrorSelf(); |