summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-04-19 12:19:39 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-04-19 12:24:49 +1000
commit891e6a0be8e835edb102ecb272debe9c4e00b8e8 (patch)
tree4db5422ca026349bd02eb2b24e5f7435f5f7beb3
parent9ef07c55bc2803423e6b79aa45f9a1b44eb59c63 (diff)
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
-rw-r--r--include/vcl/outdev.hxx1
-rw-r--r--include/vcl/print.hxx1
-rw-r--r--vcl/source/gdi/print.cxx6
-rw-r--r--vcl/source/outdev/font.cxx23
4 files changed, 22 insertions, 9 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c2e9686216d8..0af54185ee11 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 ef4bec77ed82..40659356d490 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 b741faab3c7e..12a0638ffb2c 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 7b4db77dc268..c5973d3814bb 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)