[Libreoffice-commits] core.git: include/vcl vcl/source
Chris Sherlock
chris.sherlock79 at gmail.com
Fri Apr 18 19:25:39 PDT 2014
include/vcl/outdev.hxx | 1 +
include/vcl/print.hxx | 1 +
vcl/source/gdi/print.cxx | 6 ++++++
vcl/source/outdev/font.cxx | 23 ++++++++++++++---------
4 files changed, 22 insertions(+), 9 deletions(-)
New commits:
commit 891e6a0be8e835edb102ecb272debe9c4e00b8e8
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date: Sat Apr 19 12:19:39 2014 +1000
fdo#74702 Allow Printer & OutputDevice to handle font orientation
Printer handles setting font orientation differently to how a Window
or VirtualDevice handles it.
Change-Id: I2903b971651fe56f8d262d3467e76baef617455c
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c2e9686..0af54185e 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -393,6 +393,7 @@ private:
protected:
virtual void ImplReleaseFonts();
+ virtual void SetFontOrientation( ImplFontEntry* const pFontEntry ) const;
public:
/** @name Initialization and accessor functions
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index ef4bec7..4065935 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -304,6 +304,7 @@ protected:
virtual void EmulateDrawTransparent( const PolyPolygon& rPolyPoly, sal_uInt16 nTransparencePercent ) SAL_OVERRIDE;
virtual void InitFont() const SAL_OVERRIDE;
+ virtual void SetFontOrientation( ImplFontEntry* const pFontEntry ) const SAL_OVERRIDE;
public:
Printer();
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index b741faa..12a0638 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -1834,4 +1834,10 @@ void Printer::InitFont() const
mbInitFont = false;
}
}
+
+void Printer::SetFontOrientation( ImplFontEntry* const pFontEntry ) const
+{
+ pFontEntry->mnOrientation = pFontEntry->maMetric.mnOrientation;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index 7b4db77..c5973d3 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -1242,15 +1242,7 @@ bool OutputDevice::ImplNewFont() const
pFontEntry->mnLineHeight = pFontEntry->maMetric.mnAscent + pFontEntry->maMetric.mnDescent;
- if( pFontEntry->maFontSelData.mnOrientation
- && !pFontEntry->maMetric.mnOrientation
- && (meOutDevType != OUTDEV_PRINTER) )
- {
- pFontEntry->mnOwnOrientation = sal::static_int_cast<short>(pFontEntry->maFontSelData.mnOrientation);
- pFontEntry->mnOrientation = pFontEntry->mnOwnOrientation;
- }
- else
- pFontEntry->mnOrientation = pFontEntry->maMetric.mnOrientation;
+ SetFontOrientation( pFontEntry );
}
}
@@ -1331,6 +1323,19 @@ bool OutputDevice::ImplNewFont() const
return true;
}
+void OutputDevice::SetFontOrientation( ImplFontEntry* const pFontEntry ) const
+{
+ if( pFontEntry->maFontSelData.mnOrientation && !pFontEntry->maMetric.mnOrientation )
+ {
+ pFontEntry->mnOwnOrientation = sal::static_int_cast<short>(pFontEntry->maFontSelData.mnOrientation);
+ pFontEntry->mnOrientation = pFontEntry->mnOwnOrientation;
+ }
+ else
+ {
+ pFontEntry->mnOrientation = pFontEntry->maMetric.mnOrientation;
+ }
+}
+
bool ImplFontAttributes::operator==(const ImplFontAttributes& rOther) const
{
if (maName != rOther.maName)
More information about the Libreoffice-commits
mailing list