summaryrefslogtreecommitdiff
path: root/vcl/source/gdi/metric.cxx
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-01-14 09:34:59 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-01-14 09:34:59 +1100
commit9b0c3d99e667c532428193e020b9133dd6287bcc (patch)
tree820668ed1c72c15b6caaebfe016b9b77a40b0e42 /vcl/source/gdi/metric.cxx
parent59c5738e4d98addb271290c391435e844fd70741 (diff)
vcl: split off ImplFontMetric into impfontmetric.hxx
The fact that there is now an impfontmetricdata.hxx and an impfontmetric.hxx file in the same folder highlights the need for refactoring :-) Change-Id: Ic81f32cfa8523dccabe7b419bf97f1566e2d67da
Diffstat (limited to 'vcl/source/gdi/metric.cxx')
-rw-r--r--vcl/source/gdi/metric.cxx99
1 files changed, 51 insertions, 48 deletions
diff --git a/vcl/source/gdi/metric.cxx b/vcl/source/gdi/metric.cxx
index a24cc3ff50b5..eb7271d4a82e 100644
--- a/vcl/source/gdi/metric.cxx
+++ b/vcl/source/gdi/metric.cxx
@@ -17,61 +17,14 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <impfont.hxx>
#include <vcl/metric.hxx>
+#include "impfontmetric.hxx"
#include <vector>
#include <set>
#include <cstdio>
-ImplFontMetric::ImplFontMetric()
-: mnAscent( 0 ),
- mnDescent( 0 ),
- mnIntLeading( 0 ),
- mnExtLeading( 0 ),
- mnLineHeight( 0 ),
- mnSlant( 0 ),
- mnBulletOffset( 0 ),
- mnRefCount( 1 ),
- mbScalableFont( false ),
- mbFullstopCentered( false ),
- mbDevice( false )
-{}
-
-inline void ImplFontMetric::AddReference()
-{
- // TODO: disable refcounting on the default maps?
- ++mnRefCount;
-}
-
-inline void ImplFontMetric::DeReference()
-{
- // TODO: disable refcounting on the default maps?
- if( --mnRefCount <= 0 )
- delete this;
-}
-
-bool ImplFontMetric::operator==( const ImplFontMetric& r ) const
-{
- if( mbScalableFont != r.mbScalableFont
- || mbFullstopCentered != r.mbFullstopCentered
- || mbDevice != r.mbDevice) // mbDevice == built-in font flag
- return false;
- if( mnAscent != r.mnAscent )
- return false;
- if( mnDescent != r.mnDescent )
- return false;
- if( mnIntLeading != r.mnIntLeading )
- return false;
- if( mnExtLeading != r.mnExtLeading )
- return false;
- if( mnSlant != r.mnSlant )
- return false;
-
- return true;
-}
-
FontMetric::FontMetric()
: mpImplMetric( new ImplFontMetric )
{}
@@ -218,4 +171,54 @@ void FontMetric::SetBuiltInFontFlag( bool bIsBuiltInFont )
mpImplMetric->SetBuiltInFontFlag( bIsBuiltInFont );
}
+
+
+ImplFontMetric::ImplFontMetric()
+: mnAscent( 0 ),
+ mnDescent( 0 ),
+ mnIntLeading( 0 ),
+ mnExtLeading( 0 ),
+ mnLineHeight( 0 ),
+ mnSlant( 0 ),
+ mnBulletOffset( 0 ),
+ mnRefCount( 1 ),
+ mbScalableFont( false ),
+ mbFullstopCentered( false ),
+ mbDevice( false )
+{}
+
+inline void ImplFontMetric::AddReference()
+{
+ // TODO: disable refcounting on the default maps?
+ ++mnRefCount;
+}
+
+inline void ImplFontMetric::DeReference()
+{
+ // TODO: disable refcounting on the default maps?
+ if( --mnRefCount <= 0 )
+ delete this;
+}
+
+bool ImplFontMetric::operator==( const ImplFontMetric& r ) const
+{
+ if( mbScalableFont != r.mbScalableFont
+ || mbFullstopCentered != r.mbFullstopCentered
+ || mbDevice != r.mbDevice) // mbDevice == built-in font flag
+ return false;
+ if( mnAscent != r.mnAscent )
+ return false;
+ if( mnDescent != r.mnDescent )
+ return false;
+ if( mnIntLeading != r.mnIntLeading )
+ return false;
+ if( mnExtLeading != r.mnExtLeading )
+ return false;
+ if( mnSlant != r.mnSlant )
+ return false;
+
+ return true;
+}
+
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */