summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2014-04-20 11:47:58 +1000
committerChris Sherlock <chris.sherlock79@gmail.com>2014-04-20 12:17:50 +1000
commit588bb542bebdee5a67bd4695253c70646fb8a303 (patch)
tree1c91b0e9dc31f745a7b00d874df27525065fa789 /vcl
parent7f62b44458fb27f8aca652436aeafb5e033264bd (diff)
fdo#74702 Only VirtualDevice should handle the Word ext lead bug
In #i60945# it was discovered that Unix's leading external font spacing causes problems with the display of documents. Therefore, the reference device implemented a workaround, which was to set the spacing to zero. However, the reference device is a VirtualDevice, so it should really be handled there, not in OutputDevice. I have added a new protected function to OutputDevice, GetFontExtLead() that handles this. Change-Id: I1b84ee7d9f7ae96841b441b52705e67c8115ae5c
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/virdev.cxx14
-rw-r--r--vcl/source/outdev/font.cxx18
2 files changed, 23 insertions, 9 deletions
diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx
index 856a35893dd5..be348ec25fd9 100644
--- a/vcl/source/gdi/virdev.cxx
+++ b/vcl/source/gdi/virdev.cxx
@@ -548,4 +548,18 @@ void VirtualDevice::Compat_ZeroExtleadBug()
meRefDevMode = (sal_uInt8)meRefDevMode | REFDEV_FORCE_ZERO_EXTLEAD;
}
+long VirtualDevice::GetFontExtLeading() const
+{
+#ifdef UNX
+ // backwards compatible line metrics after fixing #i60945#
+ if ( ForceZeroExtleadBug() )
+ return 0;
+#endif
+
+ ImplFontEntry* pEntry = mpFontEntry;
+ ImplFontMetricData* pMetric = &(pEntry->maMetric);
+
+ return pMetric->mnExtLeading;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx
index c5973d3814bb..225dac3a2811 100644
--- a/vcl/source/outdev/font.cxx
+++ b/vcl/source/outdev/font.cxx
@@ -2137,14 +2137,12 @@ Size OutputDevice::GetDevFontSize( const Font& rFont, int nSizeIndex ) const
bool OutputDevice::IsFontAvailable( const OUString& rFontName ) const
{
-
PhysicalFontFamily* pFound = mpFontCollection->FindFontFamily( rFontName );
return (pFound != NULL);
}
FontMetric OutputDevice::GetFontMetric() const
{
-
FontMetric aMetric;
if( mbNewFont && !ImplNewFont() )
return aMetric;
@@ -2181,20 +2179,22 @@ FontMetric OutputDevice::GetFontMetric() const
aMetric.mpImplMetric->mnAscent = ImplDevicePixelToLogicHeight( pMetric->mnAscent+mnEmphasisAscent );
aMetric.mpImplMetric->mnDescent = ImplDevicePixelToLogicHeight( pMetric->mnDescent+mnEmphasisDescent );
aMetric.mpImplMetric->mnIntLeading = ImplDevicePixelToLogicHeight( pMetric->mnIntLeading+mnEmphasisAscent );
+ aMetric.mpImplMetric->mnExtLeading = ImplDevicePixelToLogicHeight( GetFontExtLeading() );
aMetric.mpImplMetric->mnExtLeading = ImplDevicePixelToLogicHeight( pMetric->mnExtLeading );
aMetric.mpImplMetric->mnLineHeight = ImplDevicePixelToLogicHeight( pMetric->mnAscent+pMetric->mnDescent+mnEmphasisAscent+mnEmphasisDescent );
aMetric.mpImplMetric->mnSlant = ImplDevicePixelToLogicHeight( pMetric->mnSlant );
-#ifdef UNX
- // backwards compatible line metrics after fixing #i60945#
- if( (meOutDevType == OUTDEV_VIRDEV)
- && static_cast<const VirtualDevice*>(this)->ForceZeroExtleadBug() )
- aMetric.mpImplMetric->mnExtLeading = 0;
-#endif
-
return aMetric;
}
+long OutputDevice::GetFontExtLeading() const
+{
+ ImplFontEntry* pEntry = mpFontEntry;
+ ImplFontMetricData* pMetric = &(pEntry->maMetric);
+
+ return pMetric->mnExtLeading;
+}
+
FontMetric OutputDevice::GetFontMetric( const Font& rFont ) const
{
// select font, query metrics, select original font again