[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - include/vcl sw/source vcl/inc vcl/quartz vcl/source

Norbert Thiebaud nthiebaud at gmail.com
Tue Jul 15 04:35:42 PDT 2014


 include/vcl/outdev.hxx              |   24 ++-------------
 sw/source/core/txtnode/fntcache.cxx |   16 +---------
 vcl/inc/sallayout.hxx               |   16 +++++++++-
 vcl/quartz/ctlayout.cxx             |   56 ------------------------------------
 vcl/source/outdev/text.cxx          |   24 +++++++--------
 5 files changed, 31 insertions(+), 105 deletions(-)

New commits:
commit 3123ac2fcf6bf0d4e11e536b3987b454e514f6aa
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Jul 15 13:34:40 2014 +0200

    Revert "fdo#79673 quartz: draw 'bullet' for 'space' directly in one pass"
    
    This reverts commit 36ff78d83b6a012d2a2c8ef2c6d8f0db62ecffc9.

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index c8e93c5..25bf4cf 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -97,21 +97,6 @@ class VirtualDevice;
 class Window;
 struct SalTwoRect;
 
-// Layout options
-#define SAL_LAYOUT_BIDI_RTL                 (1<<0)
-#define SAL_LAYOUT_BIDI_STRONG              (1<<1)
-#define SAL_LAYOUT_RIGHT_ALIGN              (1<<2)
-#define SAL_LAYOUT_KERNING_PAIRS            (1<<4)
-#define SAL_LAYOUT_KERNING_ASIAN            (1<<5)
-#define SAL_LAYOUT_VERTICAL                 (1<<6)
-#define SAL_LAYOUT_COMPLEX_DISABLED         (1<<8)
-#define SAL_LAYOUT_ENABLE_LIGATURES         (1<<9)
-#define SAL_LAYOUT_SUBSTITUTE_DIGITS        (1<<10)
-#define SAL_LAYOUT_KASHIDA_JUSTIFICATON     (1<<11)
-#define SAL_LAYOUT_DISABLE_GLYPH_PROCESSING (1<<12)
-#define SAL_LAYOUT_FOR_FALLBACK             (1<<13)
-#define SAL_LAYOUT_DRAW_BULLET              (1<<14)
-
 namespace com {
 namespace sun {
 namespace star {
@@ -1035,8 +1020,7 @@ public:
     void                        DrawTextArray( const Point& rStartPt, const OUString& rStr,
                                                const sal_Int32* pDXAry = NULL,
                                                sal_Int32 nIndex = 0,
-                                               sal_Int32 nLen = -1,
-                                               int flags = 0);
+                                               sal_Int32 nLen = -1 );
     long                        GetTextArray( const OUString& rStr, sal_Int32* pDXAry = NULL,
                                               sal_Int32 nIndex = 0, sal_Int32 nLen = -1 ) const;
 
@@ -1046,7 +1030,7 @@ public:
                                               bool bCellBreaking = true ) const;
     void                        DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
                                                  const OUString& rStr,
-                                                 sal_Int32 nIndex = 0, sal_Int32 nLen = -1);
+                                                 sal_Int32 nIndex = 0, sal_Int32 nLen = -1 );
     sal_Int32                   GetTextBreak( const OUString& rStr, long nTextWidth,
                                               sal_Int32 nIndex = 0, sal_Int32 nLen = -1,
                                               long nCharExtra = 0 ) const;
@@ -1195,9 +1179,9 @@ public:
     virtual bool                HasMirroredGraphics() const;
     SAL_DLLPRIVATE SalLayout*   ImplLayout( const OUString&, sal_Int32 nIndex, sal_Int32 nLen,
                                             const Point& rLogicPos = Point(0,0), long nLogicWidth=0,
-                                            const sal_Int32* pLogicDXArray=NULL, int flags=0 ) const;
+                                            const sal_Int32* pLogicDXArray=NULL ) const;
     SAL_DLLPRIVATE ImplLayoutArgs ImplPrepareLayoutArgs( OUString&, const sal_Int32 nIndex, const sal_Int32 nLen,
-                                                         long nPixelWidth, const sal_Int32* pPixelDXArray, int flags = 0 ) const;
+                                            long nPixelWidth, const sal_Int32* pPixelDXArray ) const;
     SAL_DLLPRIVATE SalLayout*   ImplGlyphFallbackLayout( SalLayout*, ImplLayoutArgs& ) const;
     // tells whether this output device is RTL in an LTR UI or LTR in a RTL UI
     SAL_DLLPRIVATE SalLayout*   getFallbackFont(ImplFontEntry &rFallbackFont,
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index af2276e..b4a80b7 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1275,7 +1275,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     // If it is a single underlined space, output 2 spaces:
                     if( 1 == rInf.GetLen() )
                     {
-                        pKernArray[0] = rInf.GetWidth() + nSpaceAdd;
+                           pKernArray[0] = rInf.GetWidth() + nSpaceAdd;
 
                         rInf.GetOut().DrawTextArray( aPos, rInf.GetText(),
                                                      pKernArray, rInf.GetIdx(), 1 );
@@ -1463,8 +1463,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
 
         nScrPos = pScrArray[ 0 ];
 
-#if defined(MACOSX) || defined(IOS)
-#else
         if( bBullet )
         {
             // !!! HACK !!!
@@ -1504,7 +1502,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     aBulletOverlay = aBulletOverlay.replaceAt(i, 1, OUString(CH_BLANK));
                 }
         }
-#endif
+
         sal_Int32 nCnt = rInf.GetText().getLength();
         if ( nCnt < rInf.GetIdx() )
             nCnt = 0;
@@ -1528,16 +1526,11 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
             if ( bSwitchH2V )
                 rInf.GetFrm()->SwitchHorizontalToVertical( aPos );
 
-#if defined(MACOSX) || defined(IOS)
-            rInf.GetOut().DrawTextArray( aPos, rInf.GetText(),
-                                         pKernArray, rInf.GetIdx(), 1, bBullet ? SAL_LAYOUT_DRAW_BULLET : 0 );
-#else
             rInf.GetOut().DrawTextArray( aPos, rInf.GetText(),
                                          pKernArray, rInf.GetIdx(), 1 );
             if( bBullet )
                 rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray,
                                              rInf.GetIdx() ? 1 : 0, 1 );
-#endif
         }
         else
         {
@@ -1729,10 +1722,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                 if ( bSwitchH2V )
                     rInf.GetFrm()->SwitchHorizontalToVertical( aPos );
 
-#if defined(MACOSX) || defined(IOS)
-                rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray + nOffs,
-                                             nTmpIdx + nOffs , nLen - nOffs, bBullet ? SAL_LAYOUT_DRAW_BULLET : 0 );
-#else
                 rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray + nOffs,
                                              nTmpIdx + nOffs , nLen - nOffs );
                 if (bBullet)
@@ -1758,7 +1747,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
                     pTmpFont->SetStrikeout(aPreviousStrikeout);
                     rInf.GetOut().Pop();
                 }
-#endif
             }
         }
         delete[] pScrArray;
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index d191a38..03f314f 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -40,6 +40,19 @@ typedef unsigned short LanguageType;
 class SalGraphics;
 class PhysicalFontFace;
 
+// Layout options
+#define SAL_LAYOUT_BIDI_RTL                 0x0001
+#define SAL_LAYOUT_BIDI_STRONG              0x0002
+#define SAL_LAYOUT_RIGHT_ALIGN              0x0004
+#define SAL_LAYOUT_KERNING_PAIRS            0x0010
+#define SAL_LAYOUT_KERNING_ASIAN            0x0020
+#define SAL_LAYOUT_VERTICAL                 0x0040
+#define SAL_LAYOUT_COMPLEX_DISABLED         0x0100
+#define SAL_LAYOUT_ENABLE_LIGATURES         0x0200
+#define SAL_LAYOUT_SUBSTITUTE_DIGITS        0x0400
+#define SAL_LAYOUT_KASHIDA_JUSTIFICATON     0x0800
+#define SAL_LAYOUT_DISABLE_GLYPH_PROCESSING 0x1000
+#define SAL_LAYOUT_FOR_FALLBACK             0x2000
 
 // used for managing runs e.g. for BiDi, glyph and script fallback
 class VCL_PLUGIN_PUBLIC ImplLayoutRuns
@@ -86,8 +99,7 @@ public:
 
 public:
                 ImplLayoutArgs( const sal_Unicode* pStr, int nLength,
-                                int nMinCharPos, int nEndCharPos, int nFlags,
-                                const LanguageTag& rLanguageTag );
+                    int nMinCharPos, int nEndCharPos, int nFlags, const LanguageTag& rLanguageTag );
 
     void        SetLayoutWidth( long nWidth )       { mnLayoutWidth = nWidth; }
     void        SetDXArray( const sal_Int32* pDXArray )  { mpDXArray = pDXArray; }
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 91af578..f0cdc8a 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -361,62 +361,6 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons
     // draw the text
     CTLineDraw( ctline, rAquaGraphics.mrContext );
 
-    if(mnLayoutFlags & SAL_LAYOUT_DRAW_BULLET)
-    {
-        CFArrayRef runArray = CTLineGetGlyphRuns(ctline);
-        CFIndex runCount = CFArrayGetCount(runArray);
-
-        CFIndex runIndex = 0;
-        CTLineRef ctlinebullet = 0;
-        OUString sBullet((sal_Unicode)0xb7); // centered bullet
-
-        for (; runIndex < runCount; runIndex++)
-        {
-
-            CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex(runArray, runIndex);
-            CFIndex runGlyphCount = CTRunGetGlyphCount(run);
-
-            CGPoint position;
-            CFIndex runGlyphIndex = 0;
-            CFIndex stringIndice = 0;
-
-            for (; runGlyphIndex < runGlyphCount; runGlyphIndex++)
-            {
-                CFRange glyphRange = CFRangeMake(runGlyphIndex, 1);
-
-                CTRunGetStringIndices( run, glyphRange, &stringIndice );
-                UniChar curChar = CFStringGetCharacterAtIndex (CFAttributedStringGetString(mpAttrString), stringIndice);
-                if(curChar == ' ')
-                {
-                    CTRunGetPositions(run, glyphRange, &position);
-                    // print a dot
-                    if(!ctlinebullet)
-                    {
-                        CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL,
-                                                                                  sBullet.getStr(),
-                                                                                  1,
-                                                                                  kCFAllocatorNull );
-                        // CFAttributedStringCreate copies the attribues parameter
-                        CFAttributedStringRef bulletAttrString = CFAttributedStringCreate( NULL, aCFText, mpTextStyle->GetStyleDict() );
-                        ctlinebullet = CTLineCreateWithAttributedString( bulletAttrString );
-                        CFRelease( aCFText);
-                        CFRelease( bulletAttrString);
-                        RGBAColor bulletColor(MAKE_SALCOLOR(0x6A, 0xBE, 0xD3 )); // NON_PRINTING_CHARACTER_COLOR
-                        CGContextSetFillColor( rAquaGraphics.mrContext, bulletColor.AsArray() );
-                    }
-                    CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x + position.x, position.y + aTextPos.y );
-                    CTLineDraw(ctlinebullet, rAquaGraphics.mrContext);
-                }
-            }
-        }
-        if(ctlinebullet)
-        {
-            CFRelease(ctlinebullet);
-        }
-    }
-
-//#endif
-
     // restore the original graphic context transformations
     CGContextRestoreGState( rAquaGraphics.mrContext );
 }
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index a492d3a..b7bb028 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -280,8 +280,6 @@ bool OutputDevice::ImplDrawRotateText( SalLayout& rSalLayout )
 }
 
 bool OutputDevice::ImplDrawTextDirect( SalLayout& rSalLayout, bool bTextLines, sal_uInt32 flags )
-                                       bool bTextLines,
-                                       sal_uInt32 flags )
 {
     if( mpFontEntry->mnOwnOrientation )
         if( ImplDrawRotateText( rSalLayout ) )
@@ -940,7 +938,7 @@ float OutputDevice::approximate_char_width() const
 
 void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr,
                                   const sal_Int32* pDXAry,
-                                  sal_Int32 nIndex, sal_Int32 nLen, int flags )
+                                  sal_Int32 nIndex, sal_Int32 nLen )
 {
     if(nLen == 0x0FFFF)
     {
@@ -963,7 +961,7 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr,
     if( mbOutputClipped )
         return;
 
-    SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry, flags);
+    SalLayout* pSalLayout = ImplLayout(rStr, nIndex, nLen, rStartPt, 0, pDXAry);
     if( pSalLayout )
     {
         ImplDrawText( *pSalLayout );
@@ -971,7 +969,7 @@ void OutputDevice::DrawTextArray( const Point& rStartPt, const OUString& rStr,
     }
 
     if( mpAlphaVDev )
-        mpAlphaVDev->DrawTextArray( rStartPt, rStr, pDXAry, nIndex, nLen, flags );
+        mpAlphaVDev->DrawTextArray( rStartPt, rStr, pDXAry, nIndex, nLen );
 }
 
 long OutputDevice::GetTextArray( const OUString& rStr, sal_Int32* pDXAry,
@@ -1091,7 +1089,7 @@ bool OutputDevice::GetCaretPositions( const OUString& rStr, sal_Int32* pCaretXAr
 
 void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
                                     const OUString& rStr,
-                                    sal_Int32 nIndex, sal_Int32 nLen)
+                                    sal_Int32 nIndex, sal_Int32 nLen )
 {
     if(nIndex < 0 || nIndex == 0x0FFFF || nLen == 0x0FFFF)
     {
@@ -1121,9 +1119,8 @@ void OutputDevice::DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
 }
 
 ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
-                                                    const sal_Int32 nMinIndex, const sal_Int32 nLen,
-                                                    long nPixelWidth, const sal_Int32* pDXArray,
-                                                    int nLayoutFlags ) const
+                                       const sal_Int32 nMinIndex, const sal_Int32 nLen,
+                                       long nPixelWidth, const sal_Int32* pDXArray ) const
 {
     assert(nMinIndex >= 0);
     assert(nLen >= 0);
@@ -1137,6 +1134,7 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
     if( nEndIndex < nMinIndex )
         nEndIndex = nMinIndex;
 
+    int nLayoutFlags = 0;
     if( mnTextLayoutMode & TEXT_LAYOUT_BIDI_RTL )
         nLayoutFlags |= SAL_LAYOUT_BIDI_RTL;
     if( mnTextLayoutMode & TEXT_LAYOUT_BIDI_STRONG )
@@ -1234,9 +1232,9 @@ ImplLayoutArgs OutputDevice::ImplPrepareLayoutArgs( OUString& rStr,
 }
 
 SalLayout* OutputDevice::ImplLayout(const OUString& rOrigStr,
-                                    sal_Int32 nMinIndex, sal_Int32 nLen,
-                                    const Point& rLogicalPos, long nLogicalWidth,
-                                    const sal_Int32* pDXArray, int flags) const
+    sal_Int32 nMinIndex, sal_Int32 nLen,
+    const Point& rLogicalPos, long nLogicalWidth,
+    const sal_Int32* pDXArray) const
 {
     // we need a graphics
     if( !mpGraphics )
@@ -1282,7 +1280,7 @@ SalLayout* OutputDevice::ImplLayout(const OUString& rOrigStr,
         pDXArray = pTempDXAry;
     }
 
-    ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nMinIndex, nLen, nPixelWidth, pDXArray, flags);
+    ImplLayoutArgs aLayoutArgs = ImplPrepareLayoutArgs( aStr, nMinIndex, nLen, nPixelWidth, pDXArray );
 
     // get matching layout object for base font
     SalLayout* pSalLayout = mpGraphics->GetTextLayout( aLayoutArgs, 0 );


More information about the Libreoffice-commits mailing list