Kaydet (Commit) 2dd0b431 authored tarafından Chris Sherlock's avatar Chris Sherlock

vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual

Change-Id: Iab0160bdf664689404ff6fd093b51c0b4d2c4f10
Reviewed-on: https://gerrit.libreoffice.org/21512Reviewed-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
Tested-by: 's avatarChris Sherlock <chris.sherlock79@gmail.com>
üst 5ab13bf3
...@@ -43,33 +43,57 @@ namespace vcl { ...@@ -43,33 +43,57 @@ namespace vcl {
class VCL_DLLPUBLIC Font class VCL_DLLPUBLIC Font
{ {
private:
ImplFont* mpImplFont;
void MakeUnique();
public: public:
Font(); explicit Font();
Font( const Font& ); Font( const Font& ); // TODO make me explicit
Font( const OUString& rFamilyName, const Size& ); explicit Font( const OUString& rFamilyName, const Size& );
Font( const OUString& rFamilyName, const OUString& rStyleName, const Size& ); explicit Font( const OUString& rFamilyName, const OUString& rStyleName, const Size& );
Font( FontFamily eFamily, const Size& ); explicit Font( FontFamily eFamily, const Size& );
~Font(); virtual ~Font();
const OUString& GetFamilyName() const;
FontFamily GetFamily();
FontFamily GetFamily() const;
const OUString& GetStyleName() const;
FontWeight GetWeight();
FontWeight GetWeight() const;
FontItalic GetItalic();
FontItalic GetItalic() const;
FontPitch GetPitch();
FontPitch GetPitch() const;
FontWidth GetWidthType();
FontWidth GetWidthType() const;
rtl_TextEncoding GetCharSet() const;
FontAlign GetAlign() const;
bool IsSymbolFont() const;
void SetFamilyName( const OUString& rFamilyName );
void SetStyleName( const OUString& rStyleName );
void SetFamily( FontFamily );
void SetPitch( FontPitch ePitch );
void SetItalic( FontItalic );
void SetWeight( FontWeight );
void SetWidthType( FontWidth );
void SetCharSet( rtl_TextEncoding );
void SetAlign( FontAlign );
void SetSymbolFlag( bool );
// setting the color on the font is obsolete, the only remaining // setting the color on the font is obsolete, the only remaining
// valid use is for keeping backward compatibility with old MetaFiles // valid use is for keeping backward compatibility with old MetaFiles
void SetColor( const Color& );
const Color& GetColor() const; const Color& GetColor() const;
void SetFillColor( const Color& );
const Color& GetFillColor() const; const Color& GetFillColor() const;
void SetTransparent( bool bTransparent );
bool IsTransparent() const; bool IsTransparent() const;
void SetAlign( FontAlign );
FontAlign GetAlign() const;
void SetFamilyName( const OUString& rFamilyName ); void SetColor( const Color& );
const OUString& GetFamilyName() const; void SetFillColor( const Color& );
void SetStyleName( const OUString& rStyleName );
const OUString& GetStyleName() const; void SetTransparent( bool bTransparent );
void SetSize( const Size& ); void SetSize( const Size& );
const Size& GetSize() const; const Size& GetSize() const;
void SetHeight( long nHeight ); void SetHeight( long nHeight );
...@@ -77,14 +101,6 @@ public: ...@@ -77,14 +101,6 @@ public:
void SetWidth( long nWidth ); void SetWidth( long nWidth );
long GetWidth() const; long GetWidth() const;
void SetFamily( FontFamily );
FontFamily GetFamily();
FontFamily GetFamily() const;
void SetCharSet( rtl_TextEncoding );
rtl_TextEncoding GetCharSet() const;
void SetSymbolFlag( bool );
bool IsSymbolFont() const;
// Prefer LanguageTag over LanguageType // Prefer LanguageTag over LanguageType
void SetLanguageTag( const LanguageTag & ); void SetLanguageTag( const LanguageTag & );
const LanguageTag& GetLanguageTag() const; const LanguageTag& GetLanguageTag() const;
...@@ -94,9 +110,6 @@ public: ...@@ -94,9 +110,6 @@ public:
LanguageType GetLanguage() const; LanguageType GetLanguage() const;
void SetCJKContextLanguage( LanguageType ); void SetCJKContextLanguage( LanguageType );
LanguageType GetCJKContextLanguage() const; LanguageType GetCJKContextLanguage() const;
void SetPitch( FontPitch ePitch );
FontPitch GetPitch();
FontPitch GetPitch() const;
void SetOrientation( short nLineOrientation ); void SetOrientation( short nLineOrientation );
short GetOrientation() const; short GetOrientation() const;
...@@ -106,15 +119,6 @@ public: ...@@ -106,15 +119,6 @@ public:
FontKerning GetKerning() const; FontKerning GetKerning() const;
bool IsKerning() const; bool IsKerning() const;
void SetWeight( FontWeight );
FontWeight GetWeight();
FontWeight GetWeight() const;
void SetWidthType( FontWidth );
FontWidth GetWidthType();
FontWidth GetWidthType() const;
void SetItalic( FontItalic );
FontItalic GetItalic();
FontItalic GetItalic() const;
void SetOutline( bool bOutline ); void SetOutline( bool bOutline );
bool IsOutline() const; bool IsOutline() const;
void SetShadow( bool bShadow ); void SetShadow( bool bShadow );
...@@ -145,6 +149,11 @@ public: ...@@ -145,6 +149,11 @@ public:
friend VCL_DLLPUBLIC SvStream& ::WriteFont( SvStream& rOStm, const vcl::Font& ); friend VCL_DLLPUBLIC SvStream& ::WriteFont( SvStream& rOStm, const vcl::Font& );
static Font identifyFont( const void* pBuffer, sal_uInt32 nLen ); static Font identifyFont( const void* pBuffer, sal_uInt32 nLen );
private:
ImplFont* mpImplFont;
void MakeUnique();
}; };
} }
......
...@@ -38,9 +38,9 @@ typedef boost::intrusive_ptr< ImplFontMetric > ImplFontMetricPtr; ...@@ -38,9 +38,9 @@ typedef boost::intrusive_ptr< ImplFontMetric > ImplFontMetricPtr;
class VCL_DLLPUBLIC FontMetric : public vcl::Font class VCL_DLLPUBLIC FontMetric : public vcl::Font
{ {
public: public:
FontMetric(); explicit FontMetric();
FontMetric( const FontMetric& ); FontMetric( const FontMetric& ); // TODO make this explicit
~FontMetric(); virtual ~FontMetric();
FontType GetType() const; FontType GetType() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment