summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-03-18 12:29:36 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-03-18 12:33:12 -0400
commit24b4fbfa39f212c769bf4d966258a8fb4c98c201 (patch)
tree2d7552fe6254b5d624f83ac8431a4025cc9e092b
parent50d5b97a776342d3f032f3df2f2f2c90b02d7f34 (diff)
fdo#75260: More adjustments.
1) Offset top and left border lines only for double lines. 2) Don't apply zoom level scaling to border widths. That's used for line pattern spacing only. Change-Id: I12bdd1492531cc6651e22955c3dca4bdda0f1e4c
-rw-r--r--include/svx/framelink.hxx5
-rw-r--r--svx/source/dialog/framelink.cxx21
-rw-r--r--sw/source/core/layout/paintfrm.cxx30
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();