summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@iki.fi>2013-04-08 10:13:33 +0300
committerTor Lillqvist <tml@iki.fi>2013-04-08 10:19:18 +0300
commitdf8ef9b01bc2577ce658a8ef142f88a3831f1bf3 (patch)
tree200e020918f8aecc0d355b4c937c8e835dadd0e7 /vcl
parent2cff5631297adc89dfcfdceee7d33d0a27233b9b (diff)
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
Diffstat (limited to 'vcl')
-rw-r--r--vcl/coretext/salcoretextlayout.cxx53
1 files changed, 23 insertions, 30 deletions
diff --git a/vcl/coretext/salcoretextlayout.cxx b/vcl/coretext/salcoretextlayout.cxx
index 47650765fb35..6502b17a2782 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 << ")" );