[Libreoffice-commits] core.git: include/svx svx/source sw/source
Kohei Yoshida
kohei.yoshida at collabora.com
Tue Mar 18 09:34:50 PDT 2014
include/svx/framelink.hxx | 5 +++--
svx/source/dialog/framelink.cxx | 21 +++++++++++++--------
sw/source/core/layout/paintfrm.cxx | 30 +++++++++++++++++++-----------
3 files changed, 35 insertions(+), 21 deletions(-)
New commits:
commit 24b4fbfa39f212c769bf4d966258a8fb4c98c201
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Tue Mar 18 12:29:36 2014 -0400
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
diff --git a/include/svx/framelink.hxx b/include/svx/framelink.hxx
index 7295189..cdc221d 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 a6a4f72..1ae4b70 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 e1f37f2..18bfe6f 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();
More information about the Libreoffice-commits
mailing list