vcl/aqua/source/gdi/atsui/salgdi.cxx | 29 +++++++++++++++++++++++++++-- vcl/inc/aqua/atsui/salgdi.h | 1 + 2 files changed, 28 insertions(+), 2 deletions(-)
New commits: commit f1651ee579bf38a49b839dbcb28ac38c0163a3d2 Author: Sergey Farbotka <z8serge...@gmail.com> Date: Fri Sep 21 14:12:09 2012 +0200 Fix fdo#55142 - wrong character pos calculation on mac. Change-Id: If8a0f527102b70bf1dcf292f8df31aaff9fba5c8 diff --git a/vcl/aqua/source/gdi/atsui/salgdi.cxx b/vcl/aqua/source/gdi/atsui/salgdi.cxx index 5c0bff7..a57068d 100644 --- a/vcl/aqua/source/gdi/atsui/salgdi.cxx +++ b/vcl/aqua/source/gdi/atsui/salgdi.cxx @@ -354,6 +354,8 @@ AquaSalGraphics::AquaSalGraphics() { // create the style object for font attributes ATSUCreateStyle( &maATSUStyle ); + + ResetFontStyle(); } // ----------------------------------------------------------------------- @@ -579,6 +581,29 @@ bool AquaSalGraphics::AddTempDevFont( ImplDevFontList*, // ----------------------------------------------------------------------- +void AquaSalGraphics::ResetFontStyle() +{ + ATSUClearStyle(maATSUStyle); + + // Set justification attributes + ATSJustPriorityWidthDeltaOverrides nPriorityJustOverrides; + memset(nPriorityJustOverrides, 0, sizeof(nPriorityJustOverrides)); + + nPriorityJustOverrides[kJUSTLetterPriority].growFlags = kJUSTOverrideLimits; + nPriorityJustOverrides[kJUSTLetterPriority].shrinkFlags = kJUSTOverrideLimits; + + ATSUAttributeTag theTag = kATSUPriorityJustOverrideTag; + ByteCount theSize = sizeof(ATSJustPriorityWidthDeltaOverrides); + ATSUAttributeValuePtr thePtr = &nPriorityJustOverrides; + OSStatus eStatus = ATSUSetAttributes(maATSUStyle, 1, &theTag, &theSize, &thePtr); + if (eStatus != noErr) + { + DBG_WARNING("AquaSalGraphics::ResetFontStyle() : Could not override justification attributes!\n"); + } +} + +// ----------------------------------------------------------------------- + // callbacks from ATSUGlyphGetCubicPaths() fore GetGlyphOutline() struct GgoData { basegfx::B2DPolygon maPolygon; basegfx::B2DPolyPolygon* mpPolyPoly; }; @@ -698,7 +723,7 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac { if( !pReqFont ) { - ATSUClearStyle( maATSUStyle ); + ResetFontStyle(); mpMacFontData = NULL; return 0; } @@ -784,7 +809,7 @@ sal_uInt16 AquaSalGraphics::SetFont( FontSelectPattern* pReqFont, int /*nFallbac if( eStatus != noErr ) { DBG_WARNING( "AquaSalGraphics::SetFont() : Could not set font attributes!\n"); - ATSUClearStyle( maATSUStyle ); + ResetFontStyle(); mpMacFontData = NULL; return 0; } diff --git a/vcl/inc/aqua/atsui/salgdi.h b/vcl/inc/aqua/atsui/salgdi.h index 19fe1f4..eeb7aa4 100644 --- a/vcl/inc/aqua/atsui/salgdi.h +++ b/vcl/inc/aqua/atsui/salgdi.h @@ -353,6 +353,7 @@ private: bool GetRawFontData( const PhysicalFontFace* pFontData, std::vector<unsigned char>& rBuffer, bool* pJustCFF ); + void ResetFontStyle(); }; // --- some trivial inlines _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits