Kaydet (Commit) df8ef9b0 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

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