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

Tor Lillqvist tml at iki.fi
Mon Apr 8 00:20:13 PDT 2013


 vcl/coretext/salcoretextlayout.cxx |   53 ++++++++++++++++---------------------
 1 file changed, 23 insertions(+), 30 deletions(-)

New commits:
commit df8ef9b01bc2577ce658a8ef142f88a3831f1bf3
Author: Tor Lillqvist <tml at iki.fi>
Date:   Mon Apr 8 10:13:33 2013 +0300

    Use SAL_OVERRIDE and drop an unused member function
    
    Drop GetGlyphOutlines() which is not used, does not override any base
    class function, and was even declared virtual even if there are no
    derived classes.
    
    Drop the dummy InitFont(), the equally dummy one in the base class is
    good enough.
    
    Also, put the overridden base class functions in the same order as in
    the base class. Improves code readability and understandability.
    
    Change-Id: Ia041ebaafae6c30cff18e00ee56f221e2f49b3e7

diff --git a/vcl/coretext/salcoretextlayout.cxx b/vcl/coretext/salcoretextlayout.cxx
index 4765076..6502b17 100644
--- a/vcl/coretext/salcoretextlayout.cxx
+++ b/vcl/coretext/salcoretextlayout.cxx
@@ -34,23 +34,26 @@ class CoreTextLayout : public SalLayout
 {
 public:
     CoreTextLayout( QuartzSalGraphics* graphics, CoreTextStyleInfo* style);
-    virtual         ~CoreTextLayout();
-
-    virtual void AdjustLayout( ImplLayoutArgs& );
-    virtual void DrawText( SalGraphics& ) const;
-    virtual void DropGlyph( int nStart );
-    virtual long FillDXArray( sal_Int32* pDXArray ) const;
-    virtual bool GetBoundRect( SalGraphics&, Rectangle& ) const;
-    virtual void GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const;
-    virtual bool GetGlyphOutlines( SalGraphics&, PolyPolyVector& ) const;
-    virtual int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
-                               sal_Int32* pGlyphAdvances, int* pCharIndexes ) const;
-    virtual int GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const;
-    virtual long GetTextWidth() const;
-    virtual void InitFont() const;
-    virtual bool LayoutText( ImplLayoutArgs& );
-    virtual void MoveGlyph( int nStart, long nNewXPos );
-    virtual void Simplify( bool bIsBase );
+    ~CoreTextLayout();
+
+    // Overrides in same order as in base class, without "virtual" and
+    // with explicit SAL_OVERRIDE. Just a question of taste;)
+    bool LayoutText( ImplLayoutArgs& ) SAL_OVERRIDE;
+    void AdjustLayout( ImplLayoutArgs& ) SAL_OVERRIDE;
+    void DrawText( SalGraphics& ) const SAL_OVERRIDE;
+
+    int GetTextBreak( long nMaxWidth, long nCharExtra, int nFactor ) const SAL_OVERRIDE;
+    long FillDXArray( sal_Int32* pDXArray ) const SAL_OVERRIDE;
+    long GetTextWidth() const SAL_OVERRIDE;
+    void GetCaretPositions( int nArraySize, sal_Int32* pCaretXArray ) const SAL_OVERRIDE;
+
+    int GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
+                       sal_Int32* pGlyphAdvances, int* pCharIndexes ) const SAL_OVERRIDE;
+    bool GetBoundRect( SalGraphics&, Rectangle& ) const SAL_OVERRIDE;
+
+    void MoveGlyph( int nStart, long nNewXPos ) SAL_OVERRIDE;
+    void DropGlyph( int nStart ) SAL_OVERRIDE;
+    void Simplify( bool bIsBase ) SAL_OVERRIDE;
 
 private:
     void GetMeasurements();
@@ -138,9 +141,10 @@ void CoreTextLayout::AdjustLayout( ImplLayoutArgs& rArgs )
 #ifndef NDEBUG
     assert( mnSavedMinCharPos == rArgs.mnMinCharPos );
     assert( mnSavedEndCharPos == rArgs.mnEndCharPos );
-    assert( memcmp( &mpSavedStr[mnSavedMinCharPos],
+    assert( mnCharCount == (mnSavedEndCharPos - mnSavedMinCharPos) );
+    assert( memcmp( &mpSavedStr[0],
                     &rArgs.mpStr[mnSavedMinCharPos],
-                    (mnSavedEndCharPos - mnSavedMinCharPos) * sizeof( sal_Unicode ) ) == 0 );
+                    mnCharCount * sizeof( sal_Unicode ) ) == 0 );
 #endif
 
     SalLayout::AdjustLayout( rArgs );
@@ -351,11 +355,6 @@ void CoreTextLayout::GetCaretPositions( int max_index, sal_Int32* caret_position
     }
 }
 
-bool CoreTextLayout::GetGlyphOutlines( SalGraphics&, PolyPolyVector& ) const
-{
-    return false;
-}
-
 int CoreTextLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIDs, Point& rPos, int& nStart,
                                    sal_Int32* pGlyphAdvances, int* pCharIndexes ) const
 {
@@ -488,12 +487,6 @@ long CoreTextLayout::GetTextWidth() const
     return w;
 }
 
-// not needed. CoreText manage fallback directly
-void CoreTextLayout::InitFont() const
-{
-    SAL_INFO( "vcl.coretext.layout", "InitFont(" << this << ")" );
-}
-
 bool CoreTextLayout::LayoutText( ImplLayoutArgs& rArgs)
 {
     SAL_INFO( "vcl.coretext.layout", "LayoutText(" << this << ",rArgs=" << rArgs << ")" );


More information about the Libreoffice-commits mailing list