diff options
author | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-08-16 19:50:56 +0200 |
---|---|---|
committer | Norbert Thiebaud <nthiebaud@gmail.com> | 2014-09-03 10:58:34 +0200 |
commit | 1632f2a42eaf4c6bdcea9616b3ebc324ecdc30a3 (patch) | |
tree | 24105ed7877480f4c94c7a7b1b6feef2db7c2e24 /vcl/quartz/ctlayout.cxx | |
parent | fd81523328891c69ee7cb28bf22308225da42744 (diff) |
SalLayout GetTextWidth return DeviceCoordinate
Change-Id: I5b995e54992213e95845e60169238270863e9a7e
Diffstat (limited to 'vcl/quartz/ctlayout.cxx')
-rw-r--r-- | vcl/quartz/ctlayout.cxx | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx index 659d89b7c3ee..da844a799771 100644 --- a/vcl/quartz/ctlayout.cxx +++ b/vcl/quartz/ctlayout.cxx @@ -42,7 +42,7 @@ public: DeviceCoordinate* pGlyphAdvances, int* pCharIndexes, const PhysicalFontFace** pFallbackFonts ) const SAL_OVERRIDE; - virtual long GetTextWidth() const SAL_OVERRIDE; + virtual DeviceCoordinate GetTextWidth() const SAL_OVERRIDE; virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const SAL_OVERRIDE; virtual sal_Int32 GetTextBreak(DeviceCoordinate nMaxWidth, long nCharExtra, int nFactor) const SAL_OVERRIDE; virtual void GetCaretPositions( int nArraySize, long* pCaretXArray ) const SAL_OVERRIDE; @@ -56,7 +56,6 @@ public: private: void drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, const CoreTextStyle* const pStyle) const; CGPoint GetTextDrawPosition(void) const; - double GetWidth(void) const; bool CacheGlyphLayout(void) const; void ApplyDXArray( ImplLayoutArgs& rArgs); @@ -327,7 +326,7 @@ CGPoint CTLayout::GetTextDrawPosition(void) const { // text is always drawn at its leftmost point const Point aPos = DrawBase(); - fPosX = aPos.X() + mfBaseAdv - GetWidth(); + fPosX = aPos.X() + mfBaseAdv - GetTextWidth(); fPosY = aPos.Y(); } else @@ -695,7 +694,7 @@ int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, i } -double CTLayout::GetWidth() const +DeviceCoordinate CTLayout::GetTextWidth() const { if( (mnCharCount <= 0) || !mpCTLine ) return 0; @@ -708,14 +707,9 @@ double CTLayout::GetWidth() const return mfCachedWidth; } -long CTLayout::GetTextWidth() const -{ - return lrint(GetWidth()); -} - DeviceCoordinate CTLayout::FillDXArray( DeviceCoordinate* pDXArray ) const { - DeviceCoordinate nPixWidth = GetWidth(); + DeviceCoordinate nPixWidth = GetTextWidth(); // short circuit requests which don't need full details if( !pDXArray ) return nPixWidth; @@ -771,7 +765,6 @@ sal_Int32 CTLayout::GetTextBreak( DeviceCoordinate nMaxWidth, long nCharExtra, i } CTTypesetterRef aCTTypeSetter = CTTypesetterCreateWithAttributedString( mpAttrString ); CFIndex nBestGuess = (nCharExtra >= 0) ? 0 : mnCharCount; - SAL_INFO("vcl.ct", "GetTextBreak nMaxWidth:" << nMaxWidth << " nBestGuess:" << nBestGuess << " nCharExtra:" << nCharExtra << " nFactor:" << nFactor); for( int i = 1; i <= mnCharCount; i *= 2 ) { // guess the target width considering char-extra expansion/condensation @@ -779,7 +772,6 @@ sal_Int32 CTLayout::GetTextBreak( DeviceCoordinate nMaxWidth, long nCharExtra, i const double fCTMaxWidth = nTargetWidth / nFactor; // calculate the breaking index for the guessed target width const CFIndex nNewIndex = CTTypesetterSuggestClusterBreak( aCTTypeSetter, 0, fCTMaxWidth ); - SAL_INFO("vcl.ct", "GetTextBreak nTargetWidth:" << nTargetWidth << " fCTMaxWidth:" << fCTMaxWidth << " nNewIndex:" << nNewIndex); if( nNewIndex >= mnCharCount ) { CFRelease( aCTTypeSetter ); |