[Libreoffice-commits] core.git: include/vcl

Chris Sherlock chris.sherlock79 at gmail.com
Sat Jan 16 08:14:28 PST 2016


 include/vcl/font.hxx   |   87 +++++++++++++++++++++++++++----------------------
 include/vcl/metric.hxx |    6 +--
 2 files changed, 51 insertions(+), 42 deletions(-)

New commits:
commit 2dd0b4317372b8022efe3911b38b4fa02956d8b9
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Sun Jan 17 00:24:09 2016 +1100

    vcl: font.hxx and metric.hxx cleanup, make ctors explicit and the dtor virtual
    
    Change-Id: Iab0160bdf664689404ff6fd093b51c0b4d2c4f10
    Reviewed-on: https://gerrit.libreoffice.org/21512
    Reviewed-by: Chris Sherlock <chris.sherlock79 at gmail.com>
    Tested-by: Chris Sherlock <chris.sherlock79 at gmail.com>

diff --git a/include/vcl/font.hxx b/include/vcl/font.hxx
index a406a76..bf50ab7 100644
--- a/include/vcl/font.hxx
+++ b/include/vcl/font.hxx
@@ -43,33 +43,57 @@ namespace vcl {
 
 class VCL_DLLPUBLIC Font
 {
-private:
-    ImplFont*           mpImplFont;
-    void                MakeUnique();
-
 public:
-                        Font();
-                        Font( const Font& );
-                        Font( const OUString& rFamilyName, const Size& );
-                        Font( const OUString& rFamilyName, const OUString& rStyleName, const Size& );
-                        Font( FontFamily eFamily, const Size& );
-                        ~Font();
+    explicit            Font();
+                        Font( const Font& ); // TODO make me explicit
+    explicit            Font( const OUString& rFamilyName, const Size& );
+    explicit            Font( const OUString& rFamilyName, const OUString& rStyleName, const Size& );
+    explicit            Font( FontFamily eFamily, const Size& );
+    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
     // valid use is for keeping backward compatibility with old MetaFiles
-    void                SetColor( const Color& );
     const Color&        GetColor() const;
-    void                SetFillColor( const Color& );
     const Color&        GetFillColor() const;
-    void                SetTransparent( bool bTransparent );
+
     bool                IsTransparent() const;
-    void                SetAlign( FontAlign );
-    FontAlign           GetAlign() const;
 
-    void                SetFamilyName( const OUString& rFamilyName );
-    const OUString&     GetFamilyName() const;
-    void                SetStyleName( const OUString& rStyleName );
-    const OUString&     GetStyleName() const;
+    void                SetColor( const Color& );
+    void                SetFillColor( const Color& );
+
+    void                SetTransparent( bool bTransparent );
+
     void                SetSize( const Size& );
     const Size&         GetSize() const;
     void                SetHeight( long nHeight );
@@ -77,14 +101,6 @@ public:
     void                SetWidth( long nWidth );
     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
     void                SetLanguageTag( const LanguageTag & );
     const LanguageTag&  GetLanguageTag() const;
@@ -94,9 +110,6 @@ public:
     LanguageType        GetLanguage() const;
     void                SetCJKContextLanguage( LanguageType );
     LanguageType        GetCJKContextLanguage() const;
-    void                SetPitch( FontPitch ePitch );
-    FontPitch           GetPitch();
-    FontPitch           GetPitch() const;
 
     void                SetOrientation( short nLineOrientation );
     short               GetOrientation() const;
@@ -106,15 +119,6 @@ public:
     FontKerning         GetKerning() 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 );
     bool                IsOutline() const;
     void                SetShadow( bool bShadow );
@@ -145,6 +149,11 @@ public:
     friend VCL_DLLPUBLIC SvStream&  ::WriteFont( SvStream& rOStm, const vcl::Font& );
 
     static Font identifyFont( const void* pBuffer, sal_uInt32 nLen );
+
+private:
+    ImplFont*           mpImplFont;
+    void                MakeUnique();
+
 };
 
 }
diff --git a/include/vcl/metric.hxx b/include/vcl/metric.hxx
index d3dfa9c..a263fda 100644
--- a/include/vcl/metric.hxx
+++ b/include/vcl/metric.hxx
@@ -38,9 +38,9 @@ typedef boost::intrusive_ptr< ImplFontMetric > ImplFontMetricPtr;
 class VCL_DLLPUBLIC FontMetric : public vcl::Font
 {
 public:
-                        FontMetric();
-                        FontMetric( const FontMetric& );
-                        ~FontMetric();
+    explicit            FontMetric();
+                        FontMetric( const FontMetric& );  // TODO make this explicit
+    virtual             ~FontMetric();
 
     FontType            GetType() const;
 


More information about the Libreoffice-commits mailing list