diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-05 13:09:35 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-07-05 15:11:12 +0200 |
commit | 4b557c96597a9bbb51677fd83bac98a2edbb9db1 (patch) | |
tree | da031b299e570520a682127e60e83fd7082b8867 /include | |
parent | 1e529c9338ab663aa2b19b967a947dbf68fd8082 (diff) |
flatten and simplify FontMetric
Change-Id: I9cce47c132345e40d3500ba69178e871d68bf764
Reviewed-on: https://gerrit.libreoffice.org/75130
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/vcl/metric.hxx | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx index 55d26cede8fd..0eb584960c16 100644 --- a/include/vcl/metric.hxx +++ b/include/vcl/metric.hxx @@ -25,7 +25,6 @@ #include <tools/ref.hxx> #include <tools/gen.hxx> -class ImplFontMetric; class FontCharMap; typedef sal_uInt32 sal_UCS4; @@ -36,35 +35,44 @@ class VCL_DLLPUBLIC FontMetric : public vcl::Font public: explicit FontMetric(); FontMetric( const FontMetric& ); // TODO make this explicit - virtual ~FontMetric() override; + ~FontMetric() override; - long GetAscent() const; - long GetDescent() const; - long GetInternalLeading() const; - long GetExternalLeading() const; - long GetLineHeight() const; - long GetSlant() const; - long GetBulletOffset() const; + long GetAscent() const { return mnAscent; } + long GetDescent() const { return mnDescent; } + long GetInternalLeading() const { return mnIntLeading; } + long GetExternalLeading() const { return mnExtLeading; } + long GetLineHeight() const { return mnLineHeight; } // TODO this is ascent + descnt + long GetSlant() const { return mnSlant; } + long GetBulletOffset() const { return mnBulletOffset; } - void SetAscent(long); - void SetDescent(long); - void SetExternalLeading(long); - void SetInternalLeading(long); - void SetLineHeight(long); - void SetSlant(long); - void SetBulletOffset(long); + void SetAscent( long nAscent ) { mnAscent = nAscent; } + void SetDescent( long nDescent ) { mnDescent = nDescent; } + void SetExternalLeading( long nExtLeading ) { mnExtLeading = nExtLeading; } + void SetInternalLeading( long nIntLeading ) { mnIntLeading = nIntLeading; } + void SetLineHeight( long nHeight ) { mnLineHeight = nHeight; } // TODO this is ascent + descent + void SetSlant( long nSlant ) { mnSlant = nSlant; } + void SetBulletOffset( long nOffset ) { mnBulletOffset = nOffset; } - bool IsFullstopCentered() const; + bool IsFullstopCentered() const { return mbFullstopCentered; } - void SetFullstopCenteredFlag(bool); + void SetFullstopCenteredFlag( bool bCentered ) { mbFullstopCentered = bCentered; } + using Font::operator=; FontMetric& operator=( const FontMetric& rMetric ); FontMetric& operator=( FontMetric&& rMetric ); bool operator==( const FontMetric& rMetric ) const; bool operator!=( const FontMetric& rMetric ) const { return !operator==( rMetric ); } private: - tools::SvRef<ImplFontMetric> mxImplMetric; // Implementation + long mnAscent; // Ascent + long mnDescent; // Descent + long mnIntLeading; // Internal Leading + long mnExtLeading; // External Leading + long mnLineHeight; // Ascent+Descent+EmphasisMark + long mnSlant; // Slant + long mnBulletOffset; // Offset for non-printing character + + bool mbFullstopCentered; }; template< typename charT, typename traits > |