[Libreoffice-commits] core.git: 10 commits - canvas/source config_host/config_vcl.h.in configure.ac cppcanvas/source drawinglayer/source editeng/source filter/source include/editeng include/svtools include/vcl sc/source starmath/source svx/source sw/source toolkit/source vcl/generic vcl/inc vcl/quartz vcl/source vcl/win vcl/workben

Norbert Thiebaud nthiebaud at gmail.com
Sun Jul 20 13:55:35 PDT 2014


 canvas/source/cairo/cairo_textlayout.cxx                |    4 
 canvas/source/cairo/cairo_textlayout.hxx                |    2 
 canvas/source/opengl/ogl_canvashelper.cxx               |    2 
 canvas/source/vcl/textlayout.cxx                        |    8 
 canvas/source/vcl/textlayout.hxx                        |    2 
 config_host/config_vcl.h.in                             |   14 
 configure.ac                                            |   13 
 cppcanvas/source/inc/implrenderer.hxx                   |    2 
 cppcanvas/source/mtfrenderer/implrenderer.cxx           |   12 
 cppcanvas/source/mtfrenderer/textaction.cxx             |    8 
 cppcanvas/source/mtfrenderer/textaction.hxx             |    2 
 drawinglayer/source/primitive2d/metafileprimitive2d.cxx |    2 
 drawinglayer/source/primitive2d/textlayoutdevice.cxx    |    4 
 drawinglayer/source/processor2d/vclprocessor2d.cxx      |    7 
 editeng/source/accessibility/AccessibleStringWrap.cxx   |    2 
 editeng/source/editeng/editdoc.cxx                      |    6 
 editeng/source/editeng/editdoc.hxx                      |    6 
 editeng/source/editeng/editeng.cxx                      |   16 
 editeng/source/editeng/impedit.hxx                      |    3 
 editeng/source/editeng/impedit2.cxx                     |    2 
 editeng/source/editeng/impedit3.cxx                     |   46 -
 editeng/source/items/svxfont.cxx                        |    4 
 editeng/source/outliner/outleeng.cxx                    |   18 
 editeng/source/outliner/outleeng.hxx                    |   10 
 editeng/source/outliner/outliner.cxx                    |   23 
 filter/source/flash/swfwriter.hxx                       |    4 
 filter/source/flash/swfwriter1.cxx                      |   12 
 filter/source/graphicfilter/eos2met/eos2met.cxx         |    2 
 filter/source/graphicfilter/epict/epict.cxx             |    6 
 filter/source/graphicfilter/eps/eps.cxx                 |    8 
 filter/source/svg/svgwriter.cxx                         |   10 
 filter/source/svg/svgwriter.hxx                         |    4 
 include/editeng/editeng.hxx                             |   38 -
 include/editeng/outliner.hxx                            |   42 -
 include/editeng/svxfont.hxx                             |    6 
 include/svtools/calendar.hxx                            |    2 
 include/vcl/devicecoordinate.hxx                        |   30 +
 include/vcl/metaact.hxx                                 |    6 
 include/vcl/outdev.hxx                                  |   33 -
 include/vcl/outdevmap.hxx                               |    5 
 include/vcl/pdfwriter.hxx                               |    2 
 sc/source/ui/view/output2.cxx                           |    2 
 starmath/source/accessibility.cxx                       |    4 
 svx/source/customshapes/EnhancedCustomShapeFontWork.cxx |    4 
 sw/source/core/inc/scriptinfo.hxx                       |   14 
 sw/source/core/text/inftxt.cxx                          |    2 
 sw/source/core/text/porlay.cxx                          |   20 
 sw/source/core/txtnode/fntcache.cxx                     |   30 -
 toolkit/source/awt/vclxfont.cxx                         |    7 
 toolkit/source/awt/vclxgraphics.cxx                     |    7 
 vcl/generic/print/genpspgraphics.cxx                    |    4 
 vcl/inc/graphite_layout.hxx                             |    6 
 vcl/inc/graphite_serverfont.hxx                         |   21 
 vcl/inc/sallayout.hxx                                   |   33 -
 vcl/inc/textlayout.hxx                                  |   50 -
 vcl/quartz/CTRunData.cxx                                |    4 
 vcl/quartz/CTRunData.hxx                                |    2 
 vcl/quartz/ctlayout.cxx                                 |  419 ++++++++++------
 vcl/source/control/edit.cxx                             |   32 -
 vcl/source/filter/wmf/emfwr.cxx                         |   10 
 vcl/source/filter/wmf/emfwr.hxx                         |    2 
 vcl/source/filter/wmf/enhwmf.cxx                        |   14 
 vcl/source/filter/wmf/winmtf.cxx                        |    6 
 vcl/source/filter/wmf/winmtf.hxx                        |   13 
 vcl/source/filter/wmf/winwmf.cxx                        |   14 
 vcl/source/filter/wmf/wmfwr.cxx                         |   15 
 vcl/source/filter/wmf/wmfwr.hxx                         |   18 
 vcl/source/gdi/cvtsvm.cxx                               |   23 
 vcl/source/gdi/metaact.cxx                              |   17 
 vcl/source/gdi/pdfwriter.cxx                            |    2 
 vcl/source/gdi/pdfwriter_impl.cxx                       |    9 
 vcl/source/gdi/pdfwriter_impl.hxx                       |    2 
 vcl/source/gdi/sallayout.cxx                            |   80 +--
 vcl/source/gdi/textlayout.cxx                           |   14 
 vcl/source/glyphs/graphite_layout.cxx                   |   12 
 vcl/source/outdev/map.cxx                               |   52 +
 vcl/source/outdev/outdev.cxx                            |    4 
 vcl/source/outdev/text.cxx                              |  154 ++++-
 vcl/source/outdev/textline.cxx                          |   11 
 vcl/win/source/gdi/winlayout.cxx                        |   38 -
 vcl/workben/outdevgrind.cxx                             |    5 
 81 files changed, 973 insertions(+), 631 deletions(-)

New commits:
commit 3858f7ef2562544214bf55851c95b9e18c768c52
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun Jul 20 22:33:16 2014 +0200

    use consistant color for non displayable characters
    
    Change-Id: Ib4a569fc299325982b6e0da02311acc55fe18760

diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index b66bf33..a1edc44e 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -951,7 +951,7 @@ void SwTxtPaintInfo::DrawTab( const SwLinePortion &rPor ) const
         const sal_Unicode cChar = GetTxtFrm()->IsRightToLeft() ? CHAR_TAB_RTL : CHAR_TAB;
         const sal_uInt8 nOptions = DRAW_SPECIAL_OPTIONS_CENTER | DRAW_SPECIAL_OPTIONS_ROTATE;
 
-        lcl_DrawSpecial( *this, rPor, aRect, Color(0x6a, 0xbe, 0xd3), cChar, nOptions );
+        lcl_DrawSpecial( *this, rPor, aRect, Color(NON_PRINTING_CHARACTER_COLOR), cChar, nOptions );
     }
 }
 
commit 60075ca574b9f1e2f34908a7cb240005a35ee8b9
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun Jul 20 16:28:09 2014 +0200

    vcl quartz: restore old outline front drawing
    
    Change-Id: Idc2026ff65dfaf36ea4be21ae9557cf5534e8c6b

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 53535df..b02ed15 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -353,7 +353,7 @@ bool CTLayout::DrawTextSpecial( SalGraphics& rGraphics, sal_uInt32 flags ) const
     // short circuit if there is nothing to do
     if( (mnCharCount <= 0) || !rAquaGraphics.CheckContext() )
         return true;
-
+#if 0 /* temporarely revert to the 'old way' */
     if (flags & DRAWTEXT_F_OUTLINE)
     {
         CFMutableDictionaryRef styledict = CFDictionaryCreateMutableCopy(
@@ -384,6 +384,7 @@ bool CTLayout::DrawTextSpecial( SalGraphics& rGraphics, sal_uInt32 flags ) const
         return true;
     }
     else
+#endif
     {
         return SalLayout::DrawTextSpecial(rGraphics, flags);
     }
commit 4a0cb642f18b674f37db8e9bd30942740df08e4c
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sun Jul 20 07:49:45 2014 +0200

    vcl quartz: Add support back for DXArray tweaking
    
    The CoreText implementation dropped the support of DXArray
    more exactly ignored the values provided in it.
    And try to approximate the result by assuming that
    all it does is full justification... which is not quite right
    
    This ut the feature back, buy handing the glyph drawing
    directly, rather than defering to CoreText CTLineDraw
    to control the position of each Glyph
    
    Change-Id: Ibe0cfe789d3be441c012d8ac1104d939204a591c

diff --git a/vcl/quartz/CTRunData.cxx b/vcl/quartz/CTRunData.cxx
index 377615d..080052b 100644
--- a/vcl/quartz/CTRunData.cxx
+++ b/vcl/quartz/CTRunData.cxx
@@ -16,6 +16,7 @@ CTRunData::CTRunData( CTRunRef pRun, int start)
     : ownership_flags(0)
     , m_StartPos(start)
     , m_pRun(pRun)
+    , m_pAdjPositions(NULL)
 {
     assert(pRun);
 
@@ -50,7 +51,7 @@ CTRunData::CTRunData( CTRunRef pRun, int start)
         CTRunGetStringIndices( pRun, aAll, (CFIndex*)m_pStringIndices );
     }
 
-    m_pPositions = CTRunGetPositionsPtr( pRun );
+    m_pPositions = (CGPoint*)CTRunGetPositionsPtr( pRun );
     if( !m_pPositions )
     {
         m_pPositions = new CGPoint[m_nGlyphs];
@@ -80,6 +81,7 @@ CTRunData::~CTRunData()
     {
         delete [] m_pPositions;
     }
+    delete [] m_pAdjPositions;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/vcl/quartz/CTRunData.hxx b/vcl/quartz/CTRunData.hxx
index 0aafeef..b6d1a1d 100644
--- a/vcl/quartz/CTRunData.hxx
+++ b/vcl/quartz/CTRunData.hxx
@@ -44,7 +44,7 @@ public:
     const CGPoint* m_pPositions;
     const CGSize*  m_pAdvances;
     const CFIndex* m_pStringIndices;
-
+    CGPoint* m_pAdjPositions;
     CTRunData(CTRunRef pRun, int start);
    ~CTRunData(void);
 };
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 9172f4d..53535df 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -58,6 +58,7 @@ private:
     CGPoint         GetTextDrawPosition(void) const;
     double          GetWidth(void) const;
     bool            CacheGlyphLayout(void) const;
+    void            ApplyDXArray( ImplLayoutArgs& rArgs);
 
     const CoreTextStyle* const    mpTextStyle;
 
@@ -103,7 +104,9 @@ CTLayout::~CTLayout()
         CFRelease( mpCTLine );
     }
     if( mpAttrString )
+    {
         CFRelease( mpAttrString );
+    }
 }
 
 bool CTLayout::LayoutText( ImplLayoutArgs& rArgs )
@@ -114,6 +117,7 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs )
     // release an eventual older layout
     if( mpAttrString )
         CFRelease( mpAttrString );
+
     mpAttrString = NULL;
     if( mpCTLine )
     {
@@ -161,100 +165,149 @@ bool CTLayout::LayoutText( ImplLayoutArgs& rArgs )
     return true;
 }
 
-void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
+void CTLayout::ApplyDXArray(ImplLayoutArgs& rArgs)
 {
-    if( !mpCTLine)
-        return;
+    CacheGlyphLayout();
 
-    int nPixelWidth = rArgs.mpDXArray ? rArgs.mpDXArray[ mnCharCount - 1 ] : rArgs.mnLayoutWidth;
-    if( nPixelWidth <= 0)
-        return;
+    for (boost::ptr_vector<CTRunData>::iterator iter = m_vRunData.begin();
+         iter != m_vRunData.end();
+         ++iter)
+    {
+        CTRunStatus status = CTRunGetStatus(iter->m_pRun);
+        delete[] iter->m_pAdjPositions;
+        iter->m_pAdjPositions = new CGPoint[iter->m_nGlyphs];
 
-    // HACK: justification requests which change the width by just one pixel are probably
-    // #i86038# introduced by lossy conversions between integer based coordinate system
-    int fuzz =  (nPixelWidth - GetTextWidth()) / 2;
-    if (!fuzz)
+        if(!(status & kCTRunStatusNonMonotonic))
+        {
+            /* simple 1 to 1 */
+            for(int i = 0 ; i < iter->m_nGlyphs; i++)
+            {
+                if(iter->m_pStringIndices[i] == 0)
+                {
+                    iter->m_pAdjPositions[i].x = 0;
+                    SAL_INFO( "vcl.ct", "Apply DXArray["<< i << "]: 0.0 pos: " << iter->m_pPositions[i].x);
+                }
+                else
+                {
+                    iter->m_pAdjPositions[i].x = rArgs.mpDXArray[iter->m_pStringIndices[i-1]];
+                    SAL_INFO( "vcl.ct", "Apply to i DXArray["<< iter->m_pStringIndices[i-1] << "]: " << rArgs.mpDXArray[iter->m_pStringIndices[i-1]] << " pos: " << iter->m_pPositions[i].x);
+                }
+                iter->m_pAdjPositions[i].y = iter->m_pPositions[i].y;
+            }
+        }
+        else
+        {
+            delete[] iter->m_pAdjPositions;
+            iter->m_pAdjPositions = NULL;
+        }
+    }
+}
+
+void CTLayout::AdjustLayout( ImplLayoutArgs& rArgs )
+{
+    if( !mpCTLine)
     {
         return;
     }
 
-    // if the text to be justified has whitespace in it then
-    // - Writer goes crazy with its HalfSpace magic
-    // - CoreText handles spaces specially (in particular at the text end)
-    if( mnTrailingSpaceCount )
+    DeviceCoordinate nPixelWidth = 0;
+
+    if(rArgs.mpDXArray)
     {
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
-        // don't recreate line layout here, because this can lead to problems
-        // (looks like internal issues inside early CoreText versions)
-        mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( mpCTLine );
-#else
-        if(rArgs.mpDXArray)
+        nPixelWidth = rArgs.mpDXArray[ mnCharCount - 1 ];
+        if( nPixelWidth <= 0)
+            return;
+        ApplyDXArray( rArgs );
+        if( mnTrailingSpaceCount )
         {
-            int nFullPixelWidth = nPixelWidth;
-            nPixelWidth = mnTrailingSpaceCount == mnCharCount
-                ? 0 : rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount - 1];
+            DeviceCoordinate nFullPixelWidth = nPixelWidth;
+            nPixelWidth = (mnTrailingSpaceCount == mnCharCount) ? 0 :
+                rArgs.mpDXArray[ mnCharCount - mnTrailingSpaceCount - 1];
             mfTrailingSpaceWidth = nFullPixelWidth - nPixelWidth;
+            if( nPixelWidth <= 0)
+                return;
+            // in RTL-layouts trailing spaces are leftmost
+            // TODO: use BiDi-algorithm to thoroughly check this assumption
+            if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL)
+            {
+                mfBaseAdv = mfTrailingSpaceWidth;
+            }
         }
-        else
+        mfCachedWidth = nPixelWidth;
+    }
+    else
+    {
+        nPixelWidth = rArgs.mnLayoutWidth;
+        if( nPixelWidth <= 0)
+            return;
+
+        // if the text to be justified has whitespace in it then
+        // - Writer goes crazy with its HalfSpace magic
+        // - CoreText handles spaces specially (in particular at the text end)
+        if( mnTrailingSpaceCount )
         {
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
+            // don't recreate line layout here, because this can lead to problems
+            // (looks like internal issues inside early CoreText versions)
+            mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( mpCTLine );
+#else
             if(mfTrailingSpaceWidth <= 0.0)
             {
                 mfTrailingSpaceWidth = CTLineGetTrailingWhitespaceWidth( mpCTLine );
-                nPixelWidth -= rint(mfTrailingSpaceWidth);
+                nPixelWidth -= mfTrailingSpaceWidth;
+            }
+            if(nPixelWidth <= 0)
+            {
+                return;
+            }
+
+            // recreate the CoreText line layout without trailing spaces
+            SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" );
+            CFRelease( mpCTLine );
+            CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL,
+                                                                      rArgs.mpStr + mnMinCharPos,
+                                                                      mnCharCount - mnTrailingSpaceCount,
+                                                                      kCFAllocatorNull );
+            CFAttributedStringRef pAttrStr = CFAttributedStringCreate( NULL,
+                                                                       aCFText,
+                                                                       mpTextStyle->GetStyleDict() );
+            mpCTLine = CTLineCreateWithAttributedString( pAttrStr );
+            SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(\"" << GetOUString(aCFText) << "\") = " << mpCTLine );
+            CFRelease( pAttrStr );
+            CFRelease( aCFText );
+#endif
+            // in RTL-layouts trailing spaces are leftmost
+            // TODO: use BiDi-algorithm to thoroughly check this assumption
+            if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL)
+            {
+                mfBaseAdv = mfTrailingSpaceWidth;
             }
         }
-        if(nPixelWidth <= 0)
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
+        CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth - mfTrailingSpaceWidth );
+#else
+        CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth);
+        SAL_INFO( "vcl.ct", "CTLineCreateJustifiedLine(" << mpCTLine << ",1.0," << nPixelWidth << ") = " << pNewCTLine );
+#endif
+        if( !pNewCTLine )
         {
+            // CTLineCreateJustifiedLine can and does fail
+            // handle failure by keeping the unjustified layout
+            // TODO: a better solution such as
+            // - forcing glyph overlap
+            // - changing the font size
+            // - changing the CTM matrix
             return;
         }
-        // recreate the CoreText line layout without trailing spaces
         SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" );
         CFRelease( mpCTLine );
-        CFStringRef aCFText = CFStringCreateWithCharactersNoCopy( NULL,
-                                                                  rArgs.mpStr + mnMinCharPos,
-                                                                  mnCharCount - mnTrailingSpaceCount,
-                                                                  kCFAllocatorNull );
-        CFAttributedStringRef pAttrStr = CFAttributedStringCreate( NULL,
-                                                                   aCFText,
-                                                                   mpTextStyle->GetStyleDict() );
-        mpCTLine = CTLineCreateWithAttributedString( pAttrStr );
-        SAL_INFO( "vcl.ct", "CTLineCreateWithAttributedString(\"" << GetOUString(aCFText) << "\") = " << mpCTLine );
-        CFRelease( pAttrStr );
-        CFRelease( aCFText );
-#endif
-
-        // in RTL-layouts trailing spaces are leftmost
-        // TODO: use BiDi-algorithm to thoroughly check this assumption
-        if( rArgs.mnFlags & SAL_LAYOUT_BIDI_RTL)
-        {
-            mfBaseAdv = mfTrailingSpaceWidth;
-        }
-    }
-
+        mpCTLine = pNewCTLine;
 #if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
-    CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth - mfTrailingSpaceWidth );
+        mfCachedWidth = nPixelWidth;
 #else
-    CTLineRef pNewCTLine = CTLineCreateJustifiedLine( mpCTLine, 1.0, nPixelWidth);
-    SAL_INFO( "vcl.ct", "CTLineCreateJustifiedLine(" << mpCTLine << ",1.0," << nPixelWidth << ") = " << pNewCTLine );
+        mfCachedWidth = nPixelWidth + mfTrailingSpaceWidth;
 #endif
-    if( !pNewCTLine )
-    {
-        // CTLineCreateJustifiedLine can and does fail
-        // handle failure by keeping the unjustified layout
-        // TODO: a better solution such as
-        // - forcing glyph overlap
-        // - changing the font size
-        // - changing the CTM matrix
-        return;
     }
-    SAL_INFO( "vcl.ct", "CFRelease(" << mpCTLine << ")" );
-    CFRelease( mpCTLine );
-    mpCTLine = pNewCTLine;
-#if MAC_OS_X_VERSION_MAX_ALLOWED <= 1060
-    mfCachedWidth = nPixelWidth;
-#else
-    mfCachedWidth = nPixelWidth + mfTrailingSpaceWidth;
-#endif
 }
 
 // When drawing right aligned text, rounding errors in the position returned by
@@ -377,60 +430,135 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons
     // set the text color as fill color (see kCTForegroundColorFromContextAttributeName)
     CGContextSetFillColor( context, rAquaGraphics.maTextColor.AsArray() );
 
-    SAL_INFO( "vcl.ct", "CTLineDraw(" << ctline << "," << context << ")" );
-    // draw the text
-    CTLineDraw( ctline, context );
+    /* if we have a m_vRunData that indicate that an ApplyDXArray occured
+     * iow that we want to use DXArray to align glyphs
+     * Otherwise we just use CoreText to display the whole line
+     */
+    boost::ptr_vector<CTRunData>::const_iterator iter = m_vRunData.begin();
+    if(iter != m_vRunData.end())
+    {
+        for(; iter != m_vRunData.end(); ++iter)
+        {
+            CTRunRef run = iter->m_pRun;
+            /* if we do not have Ajusted Poistions for a run, just use CoreText to draw it */
+            if(iter->m_pAdjPositions)
+            {
+                CTFontRef runFont = iter->m_pFont;
+                CGFloat baseSize = CTFontGetSize(runFont);
+                for (CFIndex runGlyphIndex = 0;
+                     runGlyphIndex < CTRunGetGlyphCount(run);
+                     runGlyphIndex++)
+                {
+                    CGFontRef cgFont = CTFontCopyGraphicsFont(runFont, NULL);
+                    CGContextSaveGState(context);
 
-    if(mnLayoutFlags & SAL_LAYOUT_DRAW_BULLET)
+                    CGContextSetFont(context, cgFont);
+                    CGContextSetFontSize(context, CTFontGetSize(runFont));
+                    CGContextSetFillColor( context, rAquaGraphics.maTextColor.AsArray() );
+                    CGContextSetTextPosition( context, aTextPos.x, aTextPos.y );
+                    CGContextShowGlyphsAtPositions(context, iter->m_pGlyphs + runGlyphIndex,
+                                                   iter->m_pAdjPositions + runGlyphIndex, 1);
+                    CGContextRestoreGState(context);
+                    CFRelease(cgFont);
+                }
+                /* Do we want to show 'space' as 'bullet' */
+                if(mnLayoutFlags & SAL_LAYOUT_DRAW_BULLET)
+                {
+                    for(int i = 0 ; i < iter->m_nGlyphs; i++)
+                    {
+                        UniChar curChar = CFStringGetCharacterAtIndex (CFAttributedStringGetString(mpAttrString),
+                                                                   iter->m_pStringIndices[i]);
+                        /* is the character associated with the current glyph a space ? */
+                        if(curChar == ' ')
+                        {
+                            /* make a rect that will enclose the bullet we want to draw */
+                            CFRange glyphRange = CFRangeMake(i, 1);
+                            CGFloat ascent;
+                            CGFloat descent;
+                            CGFloat leading;
+                            CTRunGetTypographicBounds ( run, glyphRange,
+                                                        &ascent, &descent, &leading);
+                            CGRect bulletRect = CGRectMake(aTextPos.x + iter->m_pAdjPositions[i].x + iter->m_pAdvances[i].width / 4,
+                                                           aTextPos.y + iter->m_pAdjPositions[i].y + ascent / 3 - baseSize / 5,  baseSize / 5, baseSize / 5 );
+
+                            /* Draw a bullet filled with the 'special' color for non-displayable characters */
+                            CGContextSaveGState(context);
+                            RGBAColor bulletColor(MAKE_SALCOLOR(0x26, 0x8b, 0xd2 )); // NON_PRINTING_CHARACTER_COLOR
+                            CGContextSetFillColor( context, bulletColor.AsArray() );
+                            CGContextSetStrokeColor(context, bulletColor.AsArray());
+                            CGContextBeginPath(context);
+                            CGContextAddEllipseInRect(context, bulletRect);
+                            CGContextDrawPath(context, kCGPathFillStroke); // Or kCGPathFill
+                            CGContextRestoreGState(context);
+                        }
+                    }
+                }
+            }
+            else
+            {
+                CTRunDraw(run, context, CFRangeMake( 0, 0 ));
+                /* Fixme draw bullet */
+            }
+        }
+    }
+    else
     {
-        CFArrayRef runArray = CTLineGetGlyphRuns(ctline);
-        CFIndex runCount = CFArrayGetCount(runArray);
+        SAL_INFO( "vcl.ct", "CTLineDraw(" << ctline << "," << context << ")" );
+        // draw the text
+        CTLineDraw( ctline, context );
 
-        for (CFIndex runIndex = 0; runIndex < runCount; runIndex++)
+        if(mnLayoutFlags & SAL_LAYOUT_DRAW_BULLET)
         {
+            CFArrayRef runArray = CTLineGetGlyphRuns(ctline);
+            CFIndex runCount = CFArrayGetCount(runArray);
 
-            CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex(runArray, runIndex);
-            CFIndex runGlyphCount = CTRunGetGlyphCount(run);
+            for (CFIndex runIndex = 0; runIndex < runCount; runIndex++)
+            {
 
-            CGPoint position;
-            CGSize advance;
-            CFIndex runGlyphIndex = 0;
-            CFIndex stringIndice = 0;
+                CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex(runArray, runIndex);
+                CFIndex runGlyphCount = CTRunGetGlyphCount(run);
 
-            for (; runGlyphIndex < runGlyphCount; runGlyphIndex++)
-            {
-                CFRange glyphRange = CFRangeMake(runGlyphIndex, 1);
+                CGPoint position;
+                CGSize advance;
+                CFIndex runGlyphIndex = 0;
+                CFIndex stringIndice = 0;
 
-                CTRunGetStringIndices( run, glyphRange, &stringIndice );
-                UniChar curChar = CFStringGetCharacterAtIndex (CFAttributedStringGetString(mpAttrString), stringIndice);
-                if(curChar == ' ')
+                for (; runGlyphIndex < runGlyphCount; runGlyphIndex++)
                 {
-                    CGFloat ascent;
-                    CGFloat descent;
-                    CGFloat leading;
-                    CTFontRef runFont = (CTFontRef)CFDictionaryGetValue(CTRunGetAttributes(run),
-                                                             kCTFontAttributeName);
-                    CGFloat baseSize = CTFontGetSize(runFont);
-                    double fWidth = CTRunGetTypographicBounds ( run, glyphRange,
-                                                                &ascent, &descent, &leading);
-                    CTRunGetPositions(run, glyphRange, &position);
-                    CTRunGetAdvances(run, glyphRange, &advance);
-                    CGRect bulletRect = NSMakeRect(aTextPos.x + position.x + advance.width / 4,
+                    CFRange glyphRange = CFRangeMake(runGlyphIndex, 1);
+
+                    CTRunGetStringIndices( run, glyphRange, &stringIndice );
+                    UniChar curChar = CFStringGetCharacterAtIndex (CFAttributedStringGetString(mpAttrString), stringIndice);
+                    if(curChar == ' ')
+                    {
+                        CGFloat ascent;
+                        CGFloat descent;
+                        CGFloat leading;
+                        CTFontRef runFont = (CTFontRef)CFDictionaryGetValue(CTRunGetAttributes(run),
+                                                                            kCTFontAttributeName);
+                        CGFloat baseSize = CTFontGetSize(runFont);
+                        CTRunGetTypographicBounds ( run, glyphRange,
+                                                    &ascent, &descent, &leading);
+
+                        CTRunGetPositions(run, glyphRange, &position);
+                        CTRunGetAdvances(run, glyphRange, &advance);
+                        CGRect bulletRect = NSMakeRect(aTextPos.x + position.x + advance.width / 4,
                                                    aTextPos.y + position.y + ascent / 3 - baseSize / 5,  baseSize / 5, baseSize / 5 );
-                    CGContextSaveGState(context);
-                    RGBAColor bulletColor(MAKE_SALCOLOR(0x26, 0x8b, 0xd2 )); // NON_PRINTING_CHARACTER_COLOR
-                    CGContextSetFillColor( context, bulletColor.AsArray() );
-                    CGContextSetStrokeColor(context, bulletColor.AsArray());
-
-                    CGContextBeginPath(context);
-                    CGContextAddEllipseInRect(context, bulletRect);
-                    CGContextDrawPath(context, kCGPathFillStroke); // Or kCGPathFill
-                    CGContextRestoreGState(context);
+                        CGContextSaveGState(context);
+                        RGBAColor bulletColor(MAKE_SALCOLOR(0x26, 0x8b, 0xd2 )); // NON_PRINTING_CHARACTER_COLOR
+                        CGContextSetFillColor( context, bulletColor.AsArray() );
+                        CGContextSetStrokeColor(context, bulletColor.AsArray());
+
+                        CGContextBeginPath(context);
+                        CGContextAddEllipseInRect(context, bulletRect);
+                        CGContextDrawPath(context, kCGPathFillStroke); // Or kCGPathFill
+                        CGContextRestoreGState(context);
+                    }
                 }
             }
         }
-    }
 
+    }
     // restore the original graphic context transformations
     SAL_INFO( "vcl.ct", "CGContextRestoreGState(" << context << ")" );
     CGContextRestoreGState( context );
@@ -591,14 +719,17 @@ DeviceCoordinate CTLayout::FillDXArray( DeviceCoordinate* pDXArray ) const
     if( !pDXArray )
         return nPixWidth;
 
-    // prepare the sub-pixel accurate logical-width array
-    ::std::vector<double> aWidthVector( mnCharCount );
+    for(int i = 0; i < mnCharCount; i++)
+    {
+        pDXArray[i] = 0.0;
+    }
     if( mnTrailingSpaceCount && (mfTrailingSpaceWidth > 0.0) )
     {
         const double fOneWidth = mfTrailingSpaceWidth / mnTrailingSpaceCount;
-        ::std::fill_n(aWidthVector.begin() + (mnCharCount - mnTrailingSpaceCount),
-                      mnTrailingSpaceCount,
-                      fOneWidth);
+        for(int i = mnCharCount - mnTrailingSpaceCount; i < mnCharCount; i++)
+        {
+            pDXArray[i] = fOneWidth;
+        }
     }
 
     // handle each glyph run
@@ -623,20 +754,10 @@ DeviceCoordinate CTLayout::FillDXArray( DeviceCoordinate* pDXArray ) const
         for( int i = 0; i != nGlyphCount; ++i )
         {
             const int nRelIdx = aIndexVec[i];
-            aWidthVector[nRelIdx] += aSizeVec[i].width;
+            pDXArray[nRelIdx] += aSizeVec[i].width;
+            SAL_INFO( "vcl.ct", "Fill DXArray["<< nRelIdx << "]: " << pDXArray[nRelIdx] << " aSizeVer[" << i << "].width :" << aSizeVec[i].width);
         }
     }
-
-    // convert the sub-pixel accurate array into classic pDXArray integers
-    double fWidthSum = 0.0;
-    sal_Int32 nOldDX = 0;
-    for( int i = 0; i < mnCharCount; ++i)
-    {
-        const sal_Int32 nNewDX = rint( fWidthSum += aWidthVector[i]);
-        pDXArray[i] = nNewDX - nOldDX;
-        nOldDX = nNewDX;
-    }
-
     return nPixWidth;
 }
 
commit 213a13c52b5db9d1ebe9857857f9e7415cf97dce
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jul 19 22:30:46 2014 +0200

    vcl quartz use the font size to approximate the position of the bullet
    
    Change-Id: I00bf83c82814cd3d215bda361a14eb01836e2d0a

diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index b8a0636..9172f4d 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -408,12 +408,15 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons
                     CGFloat ascent;
                     CGFloat descent;
                     CGFloat leading;
+                    CTFontRef runFont = (CTFontRef)CFDictionaryGetValue(CTRunGetAttributes(run),
+                                                             kCTFontAttributeName);
+                    CGFloat baseSize = CTFontGetSize(runFont);
                     double fWidth = CTRunGetTypographicBounds ( run, glyphRange,
                                                                 &ascent, &descent, &leading);
                     CTRunGetPositions(run, glyphRange, &position);
                     CTRunGetAdvances(run, glyphRange, &advance);
                     CGRect bulletRect = NSMakeRect(aTextPos.x + position.x + advance.width / 4,
-                                                   aTextPos.y + position.y + ascent / 3 - fWidth / 2, fWidth / 2, fWidth / 2);
+                                                   aTextPos.y + position.y + ascent / 3 - baseSize / 5,  baseSize / 5, baseSize / 5 );
                     CGContextSaveGState(context);
                     RGBAColor bulletColor(MAKE_SALCOLOR(0x26, 0x8b, 0xd2 )); // NON_PRINTING_CHARACTER_COLOR
                     CGContextSetFillColor( context, bulletColor.AsArray() );
commit d9d16df299607d0fdbb7067ad1a8f7bccc85abf7
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jul 19 16:22:54 2014 +0200

    vcl quartz: draw 'bullet' manually for better control
    
    Change-Id: If0f6bd93adc5d39fd421bb482833619f85f7a461

diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index 8420d9e..7f30727 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -78,7 +78,7 @@ public:
 
     // positioning related inputs
     const DeviceCoordinate* mpDXArray;     // in pixel units
-    DeviceCoordinate   mnLayoutWidth;      // in pixel units
+    DeviceCoordinate    mnLayoutWidth;      // in pixel units
     int                 mnOrientation;      // in 0-3600 system
 
     // data for bidi and glyph+script fallback
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 3baadb4..b8a0636 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -341,11 +341,12 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons
     // the view is vertically flipped => flipped glyphs
     // so apply a temporary transformation that it flips back
     // also compensate if the font was size limited
-    SAL_INFO( "vcl.ct", "CGContextSaveGState(" << rAquaGraphics.mrContext << ")" );
-    CGContextSaveGState( rAquaGraphics.mrContext );
-    SAL_INFO( "vcl.ct", "CGContextScaleCTM(" << rAquaGraphics.mrContext << ",1.0,-1.0)" );
-    CGContextScaleCTM( rAquaGraphics.mrContext, 1.0, -1.0 );
-    CGContextSetShouldAntialias( rAquaGraphics.mrContext, !rAquaGraphics.mbNonAntialiasedText );
+    CGContextRef context = rAquaGraphics.mrContext;
+    SAL_INFO( "vcl.ct", "CGContextSaveGState(" << context << ")" );
+    CGContextSaveGState( context );
+    SAL_INFO( "vcl.ct", "CGContextScaleCTM(" << context << ",1.0,-1.0)" );
+    CGContextScaleCTM( context, 1.0, -1.0 );
+    CGContextSetShouldAntialias( context, !rAquaGraphics.mbNonAntialiasedText );
 
     // set the text transformation (e.g. position)
     CGPoint aTextPos = GetTextDrawPosition();
@@ -353,49 +354,46 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons
     if( pStyle->mfFontRotation != 0.0 )
     {
         const CGFloat fRadians = pStyle->mfFontRotation;
-        SAL_INFO( "vcl.ct", "CGContextRotateCTM(" << rAquaGraphics.mrContext << "," << +fRadians << ")" );
-        CGContextRotateCTM( rAquaGraphics.mrContext, +fRadians );
+        SAL_INFO( "vcl.ct", "CGContextRotateCTM(" << context << "," << +fRadians << ")" );
+        CGContextRotateCTM( context, +fRadians );
 
         const CGAffineTransform aInvMatrix = CGAffineTransformMakeRotation( -fRadians );
         aTextPos = CGPointApplyAffineTransform( aTextPos, aInvMatrix );
     }
 
-    SAL_INFO( "vcl.ct", "CGContextSetTextPosition(" << rAquaGraphics.mrContext << "," << aTextPos << ")" );
-    CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x, aTextPos.y );
+    SAL_INFO( "vcl.ct", "CGContextSetTextPosition(" << context << "," << aTextPos << ")" );
+    CGContextSetTextPosition( context, aTextPos.x, aTextPos.y );
 
 #ifndef IOS
     // request an update of the to-be-changed window area
     if( rAquaGraphics.IsWindowGraphics() )
     {
-        const CGRect aInkRect = CTLineGetImageBounds( mpCTLine, rAquaGraphics.mrContext );
-        const CGRect aRefreshRect = CGContextConvertRectToDeviceSpace( rAquaGraphics.mrContext, aInkRect );
+        const CGRect aInkRect = CTLineGetImageBounds( mpCTLine, context );
+        const CGRect aRefreshRect = CGContextConvertRectToDeviceSpace( context, aInkRect );
         rAquaGraphics.RefreshRect( aRefreshRect );
     }
 #endif
 
     // set the text color as fill color (see kCTForegroundColorFromContextAttributeName)
-    CGContextSetFillColor( rAquaGraphics.mrContext, rAquaGraphics.maTextColor.AsArray() );
+    CGContextSetFillColor( context, rAquaGraphics.maTextColor.AsArray() );
 
-    SAL_INFO( "vcl.ct", "CTLineDraw(" << ctline << "," << rAquaGraphics.mrContext << ")" );
+    SAL_INFO( "vcl.ct", "CTLineDraw(" << ctline << "," << context << ")" );
     // draw the text
-    CTLineDraw( ctline, rAquaGraphics.mrContext );
+    CTLineDraw( ctline, context );
 
     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++)
+        for (CFIndex runIndex = 0; runIndex < runCount; runIndex++)
         {
 
             CTRunRef run = (CTRunRef)CFArrayGetValueAtIndex(runArray, runIndex);
             CFIndex runGlyphCount = CTRunGetGlyphCount(run);
 
             CGPoint position;
+            CGSize advance;
             CFIndex runGlyphIndex = 0;
             CFIndex stringIndice = 0;
 
@@ -407,36 +405,32 @@ void CTLayout::drawCTLine(AquaSalGraphics& rAquaGraphics, CTLineRef ctline, cons
                 UniChar curChar = CFStringGetCharacterAtIndex (CFAttributedStringGetString(mpAttrString), stringIndice);
                 if(curChar == ' ')
                 {
+                    CGFloat ascent;
+                    CGFloat descent;
+                    CGFloat leading;
+                    double fWidth = CTRunGetTypographicBounds ( run, glyphRange,
+                                                                &ascent, &descent, &leading);
                     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(0x26, 0x8b, 0xd2 )); // NON_PRINTING_CHARACTER_COLOR
-                        CGContextSetFillColor( rAquaGraphics.mrContext, bulletColor.AsArray() );
-                    }
-                    CGContextSetTextPosition( rAquaGraphics.mrContext, aTextPos.x + position.x, position.y + aTextPos.y );
-                    CTLineDraw(ctlinebullet, rAquaGraphics.mrContext);
+                    CTRunGetAdvances(run, glyphRange, &advance);
+                    CGRect bulletRect = NSMakeRect(aTextPos.x + position.x + advance.width / 4,
+                                                   aTextPos.y + position.y + ascent / 3 - fWidth / 2, fWidth / 2, fWidth / 2);
+                    CGContextSaveGState(context);
+                    RGBAColor bulletColor(MAKE_SALCOLOR(0x26, 0x8b, 0xd2 )); // NON_PRINTING_CHARACTER_COLOR
+                    CGContextSetFillColor( context, bulletColor.AsArray() );
+                    CGContextSetStrokeColor(context, bulletColor.AsArray());
+
+                    CGContextBeginPath(context);
+                    CGContextAddEllipseInRect(context, bulletRect);
+                    CGContextDrawPath(context, kCGPathFillStroke); // Or kCGPathFill
+                    CGContextRestoreGState(context);
                 }
             }
         }
-        if(ctlinebullet)
-        {
-            CFRelease(ctlinebullet);
-        }
     }
 
     // restore the original graphic context transformations
-    SAL_INFO( "vcl.ct", "CGContextRestoreGState(" << rAquaGraphics.mrContext << ")" );
-    CGContextRestoreGState( rAquaGraphics.mrContext );
+    SAL_INFO( "vcl.ct", "CGContextRestoreGState(" << context << ")" );
+    CGContextRestoreGState( context );
 }
 
 void CTLayout::DrawText( SalGraphics& rGraphics ) const
commit 6ca2d0d6645a697d323593a401ea8b1da02445bf
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Sat Jul 19 00:00:03 2014 +0200

    vcl use DeviceCoordinate got GetNextGlyphs
    
    Change-Id: I0b03973b2d09a0ce51a6ee7dcca5a310a544c3a9

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index dc95427..9b9c1e3 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -941,9 +941,12 @@ public:
                                               FontUnderline eOverline,
                                               bool bUnderlineAbove = false );
 
-    void                        ImplDrawTextLine( long nBaseX, long nX, long nY, long nWidth, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, bool bUnderlineAbove );
+    void                        ImplDrawTextLine( long nBaseX, long nX, long nY, DeviceCoordinate nWidth,
+                                                  FontStrikeout eStrikeout, FontUnderline eUnderline,
+                                                  FontUnderline eOverline, bool bUnderlineAbove );
 
-    void                        ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline, FontUnderline eOverline, bool bWordLine, bool bUnderlineAbove );
+    void                        ImplDrawTextLines( SalLayout&, FontStrikeout eStrikeout, FontUnderline eUnderline,
+                                                   FontUnderline eOverline, bool bWordLine, bool bUnderlineAbove );
 
     void                        DrawWaveLine( const Point& rStartPos, const Point& rEndPos );
 
diff --git a/vcl/generic/print/genpspgraphics.cxx b/vcl/generic/print/genpspgraphics.cxx
index d4072ed..c09da8f 100644
--- a/vcl/generic/print/genpspgraphics.cxx
+++ b/vcl/generic/print/genpspgraphics.cxx
@@ -709,7 +709,7 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx
 {
     const int nMaxGlyphs = 200;
     sal_GlyphId aGlyphAry[ nMaxGlyphs ];
-    sal_Int32   aWidthAry[ nMaxGlyphs ];
+    DeviceCoordinate aWidthAry[ nMaxGlyphs ];
     sal_Int32   aIdxAry  [ nMaxGlyphs ];
     sal_Unicode aUnicodes[ nMaxGlyphs ];
     int         aCharPosAry [ nMaxGlyphs ];
@@ -743,7 +743,7 @@ static void DrawPrinterLayout( const SalLayout& rLayout, ::psp::PrinterGfx& rGfx
         if( !nGlyphCount )
             break;
 
-        sal_Int32 nXOffset = 0;
+        DeviceCoordinate nXOffset = 0;
         for( int i = 0; i < nGlyphCount; ++i )
         {
             nXOffset += aWidthAry[ i ];
diff --git a/vcl/inc/sallayout.hxx b/vcl/inc/sallayout.hxx
index 976ac5b..8420d9e 100644
--- a/vcl/inc/sallayout.hxx
+++ b/vcl/inc/sallayout.hxx
@@ -179,8 +179,8 @@ public:
 
     // methods using glyph indexing
     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdAry, Point& rPos, int&,
-                        long* pGlyphAdvAry = NULL, int* pCharPosAry = NULL,
-                        const PhysicalFontFace** pFallbackFonts = NULL ) const = 0;
+                                   DeviceCoordinate* pGlyphAdvAry = NULL, int* pCharPosAry = NULL,
+                                   const PhysicalFontFace** pFallbackFonts = NULL ) const = 0;
     virtual bool    GetOutline( SalGraphics&, ::basegfx::B2DPolyPolygonVector& ) const;
     virtual bool    GetBoundRect( SalGraphics&, Rectangle& ) const;
 
@@ -233,7 +233,7 @@ public:
     virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const SAL_OVERRIDE;
     virtual void    GetCaretPositions( int nArraySize, long* pCaretXArray ) const SAL_OVERRIDE;
     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& rPos,
-                                   int&, long* pGlyphAdvAry, int* pCharPosAry,
+                                   int&, DeviceCoordinate* pGlyphAdvAry, int* pCharPosAry,
                                    const PhysicalFontFace** pFallbackFonts ) const SAL_OVERRIDE;
     virtual bool    GetOutline( SalGraphics&, ::basegfx::B2DPolyPolygonVector& ) const SAL_OVERRIDE;
 
@@ -336,8 +336,8 @@ public:
 
     // used by display layers
     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& rPos, int&,
-                        long* pGlyphAdvAry = NULL, int* pCharPosAry = NULL,
-                        const PhysicalFontFace** pFallbackFonts = NULL ) const SAL_OVERRIDE;
+                                   DeviceCoordinate* pGlyphAdvAry = NULL, int* pCharPosAry = NULL,
+                                   const PhysicalFontFace** pFallbackFonts = NULL ) const SAL_OVERRIDE;
 
 protected:
                     GenericSalLayout();
diff --git a/vcl/quartz/ctlayout.cxx b/vcl/quartz/ctlayout.cxx
index 48d9626..3baadb4 100644
--- a/vcl/quartz/ctlayout.cxx
+++ b/vcl/quartz/ctlayout.cxx
@@ -39,7 +39,7 @@ public:
     virtual bool    DrawTextSpecial( SalGraphics& rGraphics, sal_uInt32 flags ) const SAL_OVERRIDE;
 
     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, int&,
-                                   long* pGlyphAdvances, int* pCharIndexes,
+                                   DeviceCoordinate* pGlyphAdvances, int* pCharIndexes,
                                    const PhysicalFontFace** pFallbackFonts ) const SAL_OVERRIDE;
 
     virtual long    GetTextWidth() const SAL_OVERRIDE;
@@ -473,7 +473,7 @@ bool CTLayout::CacheGlyphLayout(void) const // eew!
 }
 
 int CTLayout::GetNextGlyphs( int nLen, sal_GlyphId* pOutGlyphIds, Point& rPos, int& nStart,
-                             long* pGlyphAdvances, int* pCharIndexes,
+                             DeviceCoordinate* pGlyphAdvances, int* pCharIndexes,
                              const PhysicalFontFace** pFallbackFonts ) const
 {
     if( !mpCTLine )
diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx
index 718da49..2ff64f1 100644
--- a/vcl/source/gdi/pdfwriter_impl.cxx
+++ b/vcl/source/gdi/pdfwriter_impl.cxx
@@ -7416,7 +7416,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
     aUnicodes.reserve( nMaxGlyphs );
     sal_Int32 pUnicodesPerGlyph[nMaxGlyphs];
     int pCharPosAry[nMaxGlyphs];
-    long nAdvanceWidths[nMaxGlyphs];
+    DeviceCoordinate nAdvanceWidths[nMaxGlyphs];
     const PhysicalFontFace* pFallbackFonts[nMaxGlyphs] = { NULL };
     bool bVertical = m_aCurrentPDFState.m_aFont.IsVertical();
     int nGlyphs;
@@ -7655,7 +7655,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
         {
             Point aPos, aStartPt;
             sal_Int32 nWidth = 0;
-            long nAdvance = 0;
+            DeviceCoordinate nAdvance = 0;
             for( int nStart = 0;;)
             {
                 sal_GlyphId aGlyphId;
@@ -7758,7 +7758,7 @@ void PDFWriterImpl::drawLayout( SalLayout& rLayout, const OUString& rText, bool
         {
             Point aPos;
             sal_GlyphId aGlyphId;
-            long nAdvance;
+            DeviceCoordinate nAdvance;
             if( !rLayout.GetNextGlyphs( 1, &aGlyphId, aPos, nStart, &nAdvance ) )
                 break;
 
diff --git a/vcl/source/gdi/sallayout.cxx b/vcl/source/gdi/sallayout.cxx
index 6724862..8faddc5 100644
--- a/vcl/source/gdi/sallayout.cxx
+++ b/vcl/source/gdi/sallayout.cxx
@@ -1298,7 +1298,7 @@ sal_Int32 GenericSalLayout::GetTextBreak( long nMaxWidth, long nCharExtra, int n
 }
 
 int GenericSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos,
-                                     int& nStart, long* pGlyphAdvAry, int* pCharPosAry,
+                                     int& nStart, DeviceCoordinate* pGlyphAdvAry, int* pCharPosAry,
                                      const PhysicalFontFace** /*pFallbackFonts*/ ) const
 {
     GlyphVector::const_iterator pG = m_GlyphItems.begin();
@@ -1607,7 +1607,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
     int nStartOld[ MAX_FALLBACK ];
     int nStartNew[ MAX_FALLBACK ];
     int nCharPos[ MAX_FALLBACK ];
-    long nGlyphAdv[ MAX_FALLBACK ];
+    DeviceCoordinate nGlyphAdv[ MAX_FALLBACK ];
     int nValid[ MAX_FALLBACK ] = {0};
 
     sal_GlyphId nDummy;
@@ -1640,7 +1640,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
         nValid[ nLevel ] = mpLayouts[n]->GetNextGlyphs( 1, &nDummy, aPos,
             nStartNew[ nLevel ], &nGlyphAdv[ nLevel ], &nCharPos[ nLevel ] );
 #ifdef MULTI_SL_DEBUG
-        if (nValid[nLevel]) fprintf(mslLog(), "layout[%d]->GetNextGlyphs %d,%d x%d a%d c%d %x\n", n, nStartOld[nLevel], nStartNew[nLevel], aPos.X(), nGlyphAdv[nLevel], nCharPos[nLevel],
+        if (nValid[nLevel]) fprintf(mslLog(), "layout[%d]->GetNextGlyphs %d,%d x%d a%d c%d %x\n", n, nStartOld[nLevel], nStartNew[nLevel], aPos.X(), (long)nGlyphAdv[nLevel], nCharPos[nLevel],
             rArgs.mpStr[nCharPos[nLevel]]);
 #endif
         if( (n > 0) && !nValid[ nLevel ] )
@@ -1710,7 +1710,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
                 nValid[0] = mpLayouts[0]->GetNextGlyphs( 1, &nDummy, aPos,
                     nStartNew[0], &nGlyphAdv[0], &nCharPos[0] );
 #ifdef MULTI_SL_DEBUG
-                if (nValid[0]) fprintf(mslLog(), "layout[0]->GetNextGlyphs %d,%d x%d a%d c%d %x\n", nStartOld[0], nStartNew[0], aPos.X(), nGlyphAdv[0], nCharPos[0], rArgs.mpStr[nCharPos[0]]);
+                if (nValid[0]) fprintf(mslLog(), "layout[0]->GetNextGlyphs %d,%d x%d a%d c%d %x\n", nStartOld[0], nStartNew[0], aPos.X(), (long)nGlyphAdv[0], nCharPos[0], rArgs.mpStr[nCharPos[0]]);
 #endif
                 if( !nValid[0] )
                    break;
@@ -1718,7 +1718,7 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
         }
 
         // skip to end of layout run and calculate its advance width
-        int nRunAdvance = 0;
+        DeviceCoordinate nRunAdvance = 0;
         bool bKeepNotDef = (nFBLevel >= nLevel);
         for(;;)
         {
@@ -1728,9 +1728,9 @@ void MultiSalLayout::AdjustLayout( ImplLayoutArgs& rArgs )
             nStartOld[n] = nStartNew[n];
             int nOrigCharPos = nCharPos[n];
             nValid[n] = mpLayouts[n]->GetNextGlyphs( 1, &nDummy, aPos,
-                nStartNew[n], &nGlyphAdv[n], &nCharPos[n] );
+                                                     nStartNew[n], &nGlyphAdv[n], &nCharPos[n] );
 #ifdef MULTI_SL_DEBUG
-            if (nValid[n]) fprintf(mslLog(), "layout[%d]->GetNextGlyphs %d,%d a%d c%d %x\n", n, nStartOld[n], nStartNew[n], nGlyphAdv[n], nCharPos[n], rArgs.mpStr[nCharPos[n]]);
+            if (nValid[n]) fprintf(mslLog(), "layout[%d]->GetNextGlyphs %d,%d a%d c%d %x\n", n, nStartOld[n], nStartNew[n], (long)nGlyphAdv[n], nCharPos[n], rArgs.mpStr[nCharPos[n]]);
 #endif
             // break after last glyph of active layout
             if( !nValid[n] )
@@ -2015,7 +2015,7 @@ void MultiSalLayout::GetCaretPositions( int nMaxIndex, long* pCaretXArray ) cons
 }
 
 int MultiSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& rPos,
-                                   int& nStart, long* pGlyphAdvAry, int* pCharPosAry,
+                                   int& nStart, DeviceCoordinate* pGlyphAdvAry, int* pCharPosAry,
                                    const PhysicalFontFace** pFallbackFonts ) const
 {
     // for multi-level fallback only single glyphs should be used
@@ -2041,8 +2041,8 @@ int MultiSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& r
             {
                 if( pGlyphAdvAry )
                 {
-                    long w = pGlyphAdvAry[i];
-                    w = static_cast<long>(w * fUnitMul + 0.5);
+                    DeviceCoordinate w = pGlyphAdvAry[i];
+                    w = static_cast<DeviceCoordinate>(w * fUnitMul + 0.5);
                     pGlyphAdvAry[i] = w;
                 }
                 pGlyphIdxAry[ i ] |= nFontTag;
@@ -2063,7 +2063,7 @@ int MultiSalLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIdxAry, Point& r
 }
 
 bool MultiSalLayout::GetOutline( SalGraphics& rGraphics,
-    ::basegfx::B2DPolyPolygonVector& rPPV ) const
+                                 ::basegfx::B2DPolyPolygonVector& rPPV ) const
 {
     bool bRet = false;
 
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index f04b5ec..e5cb5a7 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -1212,8 +1212,8 @@ void GraphiteLayout::GetCaretPositions( int nArraySize, long* pCaretXArray ) con
 // The logic in this method must match that expected in MultiSalLayout which
 // is used when glyph fallback is in operation.
 int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out,
-        ::Point & aPosOut, int &glyph_slot, sal_Int32 * glyph_adv, int *char_index,
-        const PhysicalFontFace** /*pFallbackFonts*/ ) const
+                                   ::Point & aPosOut, int &glyph_slot, DeviceCoordinate* glyph_adv, int *char_index,
+                                   const PhysicalFontFace** /*pFallbackFonts*/ ) const
 {
   // Sanity check on the slot index.
   if (glyph_slot >= signed(mvGlyphs.size()))
@@ -1277,7 +1277,7 @@ int GraphiteLayout::GetNextGlyphs( int length, sal_GlyphId * glyph_out,
 #ifdef GRLAYOUT_DEBUG
     fprintf(grLog(),"GetNextGlyphs g%d gid%d c%d x%ld,%ld adv%ld, pos %ld,%ld\n",
             glyph_slot - 1, glyph_itr->maGlyphId,
-            mvGlyph2Char[glyph_slot-1], glyph_itr->maLinearPos.X(), glyph_itr->maLinearPos.Y(), nGlyphAdvance,
+            mvGlyph2Char[glyph_slot-1], glyph_itr->maLinearPos.X(), glyph_itr->maLinearPos.Y(), (long)nGlyphAdvance,
             aPosOut.X(), aPosOut.Y());
 #endif
 
diff --git a/vcl/source/outdev/text.cxx b/vcl/source/outdev/text.cxx
index 1cffe58..00cf4e6 100644
--- a/vcl/source/outdev/text.cxx
+++ b/vcl/source/outdev/text.cxx
@@ -1330,7 +1330,7 @@ SalLayout* OutputDevice::ImplLayout(const OUString& rOrigStr,
     DeviceCoordinate* pDXPixelArray = NULL;
     if( nLogicalWidth && mbMap )
     {
-        nPixelWidth = ImplLogicWidthToDevicePixel( nLogicalWidth );
+        nPixelWidth = LogicWidthToDeviceCoordinate( nLogicalWidth );
     }
 
     if( pDXArray)
@@ -1340,9 +1340,11 @@ SalLayout* OutputDevice::ImplLayout(const OUString& rOrigStr,
             // convert from logical units to font units using a temporary array
             pDXPixelArray = (DeviceCoordinate*)alloca( nLen * sizeof(DeviceCoordinate) );
             // using base position for better rounding a.k.a. "dancing characters"
-            DeviceCoordinate nPixelXOfs = ImplLogicWidthToDevicePixel( rLogicalPos.X() );
+            DeviceCoordinate nPixelXOfs = LogicWidthToDeviceCoordinate( rLogicalPos.X() );
             for( int i = 0; i < nLen; ++i )
-                pDXPixelArray[i] = ImplLogicWidthToDevicePixel( rLogicalPos.X() + pDXArray[i] ) - nPixelXOfs;
+            {
+                pDXPixelArray[i] = LogicWidthToDeviceCoordinate( rLogicalPos.X() + pDXArray[i] ) - nPixelXOfs;
+            }
         }
         else
         {
@@ -1422,12 +1424,12 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
         long nWidthFactor = pSalLayout->GetUnitsPerPixel();
         long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1;
         nTextWidth *= nWidthFactor * nSubPixelFactor;
-        long nTextPixelWidth = ImplLogicWidthToDevicePixel( nTextWidth );
-        long nExtraPixelWidth = 0;
+        DeviceCoordinate nTextPixelWidth = LogicWidthToDeviceCoordinate( nTextWidth );
+        DeviceCoordinate nExtraPixelWidth = 0;
         if( nCharExtra != 0 )
         {
             nCharExtra *= nWidthFactor * nSubPixelFactor;
-            nExtraPixelWidth = ImplLogicWidthToDevicePixel( nCharExtra );
+            nExtraPixelWidth = LogicWidthToDeviceCoordinate( nCharExtra );
         }
         nRetVal = pSalLayout->GetTextBreak( nTextPixelWidth, nExtraPixelWidth, nSubPixelFactor );
 
@@ -1456,12 +1458,12 @@ sal_Int32 OutputDevice::GetTextBreak( const OUString& rStr, long nTextWidth,
         long nSubPixelFactor = (nWidthFactor < 64 ) ? 64 : 1;
 
         nTextWidth *= nWidthFactor * nSubPixelFactor;
-        long nTextPixelWidth = ImplLogicWidthToDevicePixel( nTextWidth );
-        long nExtraPixelWidth = 0;
+        DeviceCoordinate nTextPixelWidth = LogicWidthToDeviceCoordinate( nTextWidth );
+        DeviceCoordinate nExtraPixelWidth = 0;
         if( nCharExtra != 0 )
         {
             nCharExtra *= nWidthFactor * nSubPixelFactor;
-            nExtraPixelWidth = ImplLogicWidthToDevicePixel( nCharExtra );
+            nExtraPixelWidth = LogicWidthToDeviceCoordinate( nCharExtra );
         }
 
         // calculate un-hyphenated break position
@@ -1646,14 +1648,14 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
                     {
                         long        nMnemonicX;
                         long        nMnemonicY;
-                        long        nMnemonicWidth;
+                        DeviceCoordinate nMnemonicWidth;
 
                         long* pCaretXArray = (long*) alloca( 2 * sizeof(long) * nLineLen );
                         /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray,
                                                 nIndex, nLineLen );
                         long lc_x1 = pCaretXArray[2*(nMnemonicPos - nIndex)];
                         long lc_x2 = pCaretXArray[2*(nMnemonicPos - nIndex)+1];
-                        nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
+                        nMnemonicWidth = rTargetDevice.LogicWidthToDeviceCoordinate( ::abs((long)(lc_x1 - lc_x2)) );
 
                         Point       aTempPos = rTargetDevice.LogicToPixel( aPos );
                         nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( std::min( lc_x1, lc_x2 ) );
@@ -1714,14 +1716,14 @@ void OutputDevice::ImplDrawText( OutputDevice& rTargetDevice, const Rectangle& r
 
         long nMnemonicX = 0;
         long nMnemonicY = 0;
-        long nMnemonicWidth = 0;
+        DeviceCoordinate nMnemonicWidth = 0;
         if ( nMnemonicPos != -1 )
         {
             long* pCaretXArray = (long*) alloca( 2 * sizeof(long) * aStr.getLength() );
             /*sal_Bool bRet =*/ _rLayout.GetCaretPositions( aStr, pCaretXArray, 0, aStr.getLength() );
             long lc_x1 = pCaretXArray[2*(nMnemonicPos)];
             long lc_x2 = pCaretXArray[2*(nMnemonicPos)+1];
-            nMnemonicWidth = rTargetDevice.ImplLogicWidthToDevicePixel( ::abs((int)(lc_x1 - lc_x2)) );
+            nMnemonicWidth = rTargetDevice.LogicWidthToDeviceCoordinate( ::abs((long)(lc_x1 - lc_x2)) );
 
             Point aTempPos = rTargetDevice.LogicToPixel( aPos );
             nMnemonicX = rTargetDevice.GetOutOffXPixel() + aTempPos.X() + rTargetDevice.ImplLogicWidthToDevicePixel( std::min(lc_x1, lc_x2) );
diff --git a/vcl/source/outdev/textline.cxx b/vcl/source/outdev/textline.cxx
index 5acd59f..4e0add0 100644
--- a/vcl/source/outdev/textline.cxx
+++ b/vcl/source/outdev/textline.cxx
@@ -668,7 +668,7 @@ void OutputDevice::ImplDrawStrikeoutChar( long nBaseX, long nBaseY,
 }
 
 void OutputDevice::ImplDrawTextLine( long nX, long nY,
-                                     long nDistX, long nWidth,
+                                     long nDistX, DeviceCoordinate nWidth,
                                      FontStrikeout eStrikeout,
                                      FontUnderline eUnderline,
                                      FontUnderline eOverline,
@@ -745,8 +745,9 @@ void OutputDevice::ImplDrawTextLines( SalLayout& rSalLayout, FontStrikeout eStri
 
         // calculate distance of each word from the base point
         Point aPos;
-        sal_Int32 nDist = 0, nWidth = 0;
-        long nAdvance = 0;
+        DeviceCoordinate nDist = 0;
+        DeviceCoordinate nWidth = 0;
+        DeviceCoordinate nAdvance = 0;
         for( int nStart = 0;;)
         {
             // iterate through the layouted glyphs
@@ -964,9 +965,10 @@ void OutputDevice::DrawTextLine( const Point& rPos, long nWidth,
         InitFont();
 
     Point aPos = ImplLogicToDevicePixel( rPos );
-    nWidth = ImplLogicWidthToDevicePixel( nWidth );
+    DeviceCoordinate fWidth;
+    fWidth = LogicWidthToDeviceCoordinate( nWidth );
     aPos += Point( mnTextOffX, mnTextOffY );
-    ImplDrawTextLine( aPos.X(), aPos.X(), 0, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
+    ImplDrawTextLine( aPos.X(), aPos.X(), 0, fWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
 
     if( mpAlphaVDev )
         mpAlphaVDev->DrawTextLine( rPos, nWidth, eStrikeout, eUnderline, eOverline, bUnderlineAbove );
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 6d5f468..3eb5c5e 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -142,8 +142,8 @@ public:
     virtual void    DrawText( SalGraphics& ) const;
 
     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
-                        sal_Int32* pGlyphAdvances, int* pCharIndexes,
-                        const PhysicalFontFace** pFallbackFonts = NULL ) const;
+                                   DeviceCoordinate* pGlyphAdvances, int* pCharIndexes,
+                                   const PhysicalFontFace** pFallbackFonts = NULL ) const;
 
     virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const;
     virtual sal_Int32 GetTextBreak(long nMaxWidth, long nCharExtra, int nFactor) const SAL_OVERRIDE;
@@ -514,8 +514,8 @@ bool SimpleWinLayout::LayoutText( ImplLayoutArgs& rArgs )
 }
 
 int SimpleWinLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphIds, Point& rPos, int& nStart,
-    long* pGlyphAdvances, int* pCharIndexes,
-    const PhysicalFontFace** /*pFallbackFonts*/ ) const
+                                    DeviceCoordinate* pGlyphAdvances, int* pCharIndexes,
+                                    const PhysicalFontFace** /*pFallbackFonts*/ ) const
 {
     // return zero if no more glyph found
     if( nStart >= mnGlyphCount )
@@ -963,8 +963,8 @@ public:
     virtual void    AdjustLayout( ImplLayoutArgs& );
     virtual void    DrawText( SalGraphics& ) const;
     virtual int     GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos, int&,
-                        sal_Int32* pGlyphAdvances, int* pCharPosAry,
-                        const PhysicalFontFace** pFallbackFonts = NULL ) const;
+                                   DeviceCoordinate* pGlyphAdvances, int* pCharPosAry,
+                                   const PhysicalFontFace** pFallbackFonts = NULL ) const;
 
     virtual DeviceCoordinate FillDXArray( DeviceCoordinate* pDXArray ) const;
     virtual sal_Int32 GetTextBreak(long nMaxWidth, long nCharExtra, int nFactor) const SAL_OVERRIDE;
@@ -1579,8 +1579,8 @@ bool UniscribeLayout::GetItemSubrange( const VisualItem& rVisualItem,
 }
 
 int UniscribeLayout::GetNextGlyphs( int nLen, sal_GlyphId* pGlyphs, Point& rPos,
-    int& nStartx8, sal_Int32* pGlyphAdvances, int* pCharPosAry,
-    const PhysicalFontFace** /*pFallbackFonts*/ ) const
+                                    int& nStartx8, DeviceCoordinate* pGlyphAdvances, int* pCharPosAry,
+                                    const PhysicalFontFace** /*pFallbackFonts*/ ) const
 {
     // HACK to allow fake-glyph insertion (e.g. for kashidas)
     // TODO: use iterator idiom instead of GetNextGlyphs(...)
@@ -2647,8 +2647,8 @@ public:
 
     // methods using glyph indexing
     virtual int   GetNextGlyphs(int nLen, sal_GlyphId* pGlyphIdxAry, ::Point & rPos, int&,
-                      long* pGlyphAdvAry = NULL, int* pCharPosAry = NULL,
-                      const PhysicalFontFace** pFallbackFonts = NULL ) const;
+                                DeviceCoordinate* pGlyphAdvAry = NULL, int* pCharPosAry = NULL,
+                                const PhysicalFontFace** pFallbackFonts = NULL ) const;
 
     // used by glyph+font+script fallback
     virtual void    MoveGlyph( int nStart, long nNewXPos );
@@ -2794,8 +2794,8 @@ void GraphiteWinLayout::GetCaretPositions( int nArraySize, long* pCaretXArray )
 }
 
 int GraphiteWinLayout::GetNextGlyphs( int length, sal_GlyphId* glyph_out,
-        ::Point & pos_out, int &glyph_slot, long * glyph_adv, int *char_index,
-        const PhysicalFontFace** pFallbackFonts ) const
+                                      ::Point& pos_out, int& glyph_slot, DeviceCoordinate* glyph_adv, int* char_index,
+                                      const PhysicalFontFace** pFallbackFonts ) const
 {
     maImpl.DrawBase() = WinLayout::maDrawBase;
     maImpl.DrawOffset() = WinLayout::maDrawOffset;
commit cd3d26b7edbce67805259a71e4118223e02ebdd4
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jul 18 18:21:12 2014 +0200

    vcl consitent use of long for corrdinate
    
    most of length in vcl are calculated in 'long'
    but array of X position tend to be in sal_Int32.
    As a prep work to be able to support 'double'
    as the base type of Device Coordinate, harmonize
    the use of 'long' for non-float coordinate.
    
    Change-Id: I7cb33301ff6a5e2c62247b36a4e07e168a58a323

diff --git a/canvas/source/cairo/cairo_textlayout.cxx b/canvas/source/cairo/cairo_textlayout.cxx
index 2eb7b0c..db9a21c 100644
--- a/canvas/source/cairo/cairo_textlayout.cxx
+++ b/canvas/source/cairo/cairo_textlayout.cxx
@@ -353,7 +353,7 @@ namespace cairocanvas
         setupLayoutMode( rOutDev, mnTextDirection );
 
         // TODO(P2): cache that
-        ::boost::scoped_array< sal_Int32 > aOffsets(new sal_Int32[maLogicalAdvancements.getLength()]);
+        ::boost::scoped_array< long > aOffsets(new long[maLogicalAdvancements.getLength()]);
 
         if( maLogicalAdvancements.getLength() )
         {
@@ -615,7 +615,7 @@ namespace cairocanvas
         };
     }
 
-    void TextLayout::setupTextOffsets( sal_Int32*                       outputOffsets,
+    void TextLayout::setupTextOffsets( long*                       outputOffsets,
                                        const uno::Sequence< double >&   inputOffsets,
                                        const rendering::ViewState&      viewState,
                                        const rendering::RenderState&    renderState     ) const
diff --git a/canvas/source/cairo/cairo_textlayout.hxx b/canvas/source/cairo/cairo_textlayout.hxx
index 77a293e..4509b52 100644
--- a/canvas/source/cairo/cairo_textlayout.hxx
+++ b/canvas/source/cairo/cairo_textlayout.hxx
@@ -87,7 +87,7 @@ namespace cairocanvas
                    const ::com::sun::star::rendering::ViewState&   viewState,
                    const ::com::sun::star::rendering::RenderState& renderState ) const;
 
-        void setupTextOffsets( sal_Int32*                                       outputOffsets,
+        void setupTextOffsets( long*                                       outputOffsets,
                                const ::com::sun::star::uno::Sequence< double >& inputOffsets,
                                const ::com::sun::star::rendering::ViewState&    viewState,
                                const ::com::sun::star::rendering::RenderState&  renderState     ) const;
diff --git a/canvas/source/opengl/ogl_canvashelper.cxx b/canvas/source/opengl/ogl_canvashelper.cxx
index e9983f0..d6db4db 100644
--- a/canvas/source/opengl/ogl_canvashelper.cxx
+++ b/canvas/source/opengl/ogl_canvashelper.cxx
@@ -779,7 +779,7 @@ namespace oglcanvas
                 {
                     // create the DXArray
                     const sal_Int32 nLen( aLogicalAdvancements.getLength() );
-                    ::boost::scoped_array<sal_Int32> pDXArray( new sal_Int32[nLen] );
+                    ::boost::scoped_array<long> pDXArray( new long[nLen] );
                     for( sal_Int32 i=0; i<nLen; ++i )
                         pDXArray[i] = basegfx::fround( aLogicalAdvancements[i] );
 
diff --git a/canvas/source/vcl/textlayout.cxx b/canvas/source/vcl/textlayout.cxx
index 6cbb3d5..3f81276 100644
--- a/canvas/source/vcl/textlayout.cxx
+++ b/canvas/source/vcl/textlayout.cxx
@@ -121,7 +121,7 @@ namespace vclcanvas
             uno::Sequence<double>(4),
             rendering::CompositeOperation::SOURCE);
 
-        ::boost::scoped_array< sal_Int32 > aOffsets(new sal_Int32[maLogicalAdvancements.getLength()]);
+        ::boost::scoped_array< long > aOffsets(new long[maLogicalAdvancements.getLength()]);
         setupTextOffsets(aOffsets.get(), maLogicalAdvancements, aViewState, aRenderState);
 
         uno::Sequence< uno::Reference< rendering::XPolyPolygon2D> > aOutlineSequence;
@@ -174,7 +174,7 @@ namespace vclcanvas
             uno::Sequence<double>(4),
             rendering::CompositeOperation::SOURCE);
 
-        ::boost::scoped_array< sal_Int32 > aOffsets(new sal_Int32[maLogicalAdvancements.getLength()]);
+        ::boost::scoped_array< long > aOffsets(new long[maLogicalAdvancements.getLength()]);
         setupTextOffsets(aOffsets.get(), maLogicalAdvancements, aViewState, aRenderState);
 
         MetricVector aMetricVector;
@@ -386,7 +386,7 @@ namespace vclcanvas
         if( maLogicalAdvancements.getLength() )
         {
             // TODO(P2): cache that
-            ::boost::scoped_array< sal_Int32 > aOffsets(new sal_Int32[maLogicalAdvancements.getLength()]);
+            ::boost::scoped_array< long > aOffsets(new long[maLogicalAdvancements.getLength()]);
             setupTextOffsets( aOffsets.get(), maLogicalAdvancements, viewState, renderState );
 
             // TODO(F3): ensure correct length and termination for DX
@@ -441,7 +441,7 @@ namespace vclcanvas
         };
     }
 
-    void TextLayout::setupTextOffsets( sal_Int32*                       outputOffsets,
+    void TextLayout::setupTextOffsets( long*                       outputOffsets,
                                        const uno::Sequence< double >&   inputOffsets,
                                        const rendering::ViewState&      viewState,
                                        const rendering::RenderState&    renderState     ) const
diff --git a/canvas/source/vcl/textlayout.hxx b/canvas/source/vcl/textlayout.hxx
index 38e36f8..8dc7f89 100644
--- a/canvas/source/vcl/textlayout.hxx
+++ b/canvas/source/vcl/textlayout.hxx
@@ -88,7 +88,7 @@ namespace vclcanvas
                    const ::com::sun::star::rendering::RenderState& renderState ) const;
 
     private:
-        void setupTextOffsets( sal_Int32*                                       outputOffsets,
+        void setupTextOffsets( long* outputOffsets,
                                const ::com::sun::star::uno::Sequence< double >& inputOffsets,
                                const ::com::sun::star::rendering::ViewState&    viewState,
                                const ::com::sun::star::rendering::RenderState&  renderState     ) const;
diff --git a/cppcanvas/source/inc/implrenderer.hxx b/cppcanvas/source/inc/implrenderer.hxx
index 76a86c8..7ff185e 100644
--- a/cppcanvas/source/inc/implrenderer.hxx
+++ b/cppcanvas/source/inc/implrenderer.hxx
@@ -269,7 +269,7 @@ static float GetSwapFloat( SvStream& rSt )
                                    const OUString&                rString,
                                    int                            nIndex,
                                    int                            nLength,
-                                   const sal_Int32*               pCharWidths,
+                                   const long*                    pCharWidths,
                                    const ActionFactoryParameters& rParms,
                                    bool                           bSubsettable );
 
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 4f261b0..0208486 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -863,7 +863,7 @@ namespace cppcanvas
                                              const OUString&                rString,
                                              int                            nIndex,
                                              int                            nLength,
-                                             const sal_Int32*               pCharWidths,
+                                             const long*                    pCharWidths,
                                              const ActionFactoryParameters& rParms,
                                              bool                           bSubsettableActions )
         {
@@ -996,7 +996,7 @@ namespace cppcanvas
                 {
                     long nInterval = ( nWidth - nStrikeoutWidth * nLen ) / nLen;
                     nStrikeoutWidth += nInterval;
-                    sal_Int32* pStrikeoutCharWidths = new sal_Int32[nLen];
+                    long* pStrikeoutCharWidths = new long[nLen];
 
                     for ( int i = 0;i<nLen; i++)
                     {
@@ -2602,7 +2602,7 @@ namespace cppcanvas
                         // generating a DX array, and uniformly
                         // distributing the excess/insufficient width
                         // to every logical character.
-                        ::boost::scoped_array< sal_Int32 > pDXArray( new sal_Int32[nLen] );
+                        ::boost::scoped_array< long > pDXArray( new long[nLen] );
 
                         rVDev.GetTextArray( pAct->GetText(), pDXArray.get(),
                                             pAct->GetIndex(), pAct->GetLen() );
@@ -2610,8 +2610,8 @@ namespace cppcanvas
                         const sal_Int32 nWidthDifference( pAct->GetWidth() - pDXArray[ nLen-1 ] );
 
                         // Last entry of pDXArray contains total width of the text
-                        sal_Int32* p=pDXArray.get();
-                        for (sal_Int32 i=1; i<=nLen; ++i)
+                        long* p = pDXArray.get();
+                        for (sal_Int32 i = 1; i <= nLen; ++i)
                         {
                             // calc ratio for every array entry, to
                             // distribute rounding errors 'evenly'
@@ -2619,7 +2619,7 @@ namespace cppcanvas
                             // entry represents the 'end' position of
                             // the corresponding character, thus, we
                             // let i run from 1 to nLen.
-                            *p++ += (sal_Int32)i*nWidthDifference/nLen;
+                            *p++ += (long)i*nWidthDifference/nLen;
                         }
 
                         createTextAction(
diff --git a/cppcanvas/source/mtfrenderer/textaction.cxx b/cppcanvas/source/mtfrenderer/textaction.cxx
index 6849a3e..7173357 100644
--- a/cppcanvas/source/mtfrenderer/textaction.cxx
+++ b/cppcanvas/source/mtfrenderer/textaction.cxx
@@ -168,7 +168,7 @@ namespace cppcanvas
                     rTextLineInfo );
             }
 
-            uno::Sequence< double > setupDXArray( const sal_Int32*   pCharWidths,
+            uno::Sequence< double > setupDXArray( const long*   pCharWidths,
                                                   sal_Int32          nLen,
                                                   const OutDevState& rState )
             {
@@ -197,7 +197,7 @@ namespace cppcanvas
             {
                 // no external DX array given, create one from given
                 // string
-                ::boost::scoped_array< sal_Int32 > pCharWidths( new sal_Int32[nLen] );
+                ::boost::scoped_array< long > pCharWidths( new long[nLen] );
 
                 rVDev.GetTextArray( rText, pCharWidths.get(),
                                     nStartPos, nLen );
@@ -1939,7 +1939,7 @@ namespace cppcanvas
                                            const OUString&                  rText,
                                            sal_Int32                        nStartPos,
                                            sal_Int32                        nLen,
-                                           const sal_Int32*                 pDXArray,
+                                           const long*                      pDXArray,
                                            VirtualDevice&                   rVDev,
                                            const CanvasSharedPtr&           rCanvas,
                                            const OutDevState&               rState,
@@ -2089,7 +2089,7 @@ namespace cppcanvas
                                                              const OUString&                rText,
                                                              sal_Int32                      nStartPos,
                                                              sal_Int32                      nLen,
-                                                             const sal_Int32*               pDXArray,
+                                                             const long*                    pDXArray,
                                                              VirtualDevice&                 rVDev,
                                                              const CanvasSharedPtr&         rCanvas,
                                                              const OutDevState&             rState,
diff --git a/cppcanvas/source/mtfrenderer/textaction.hxx b/cppcanvas/source/mtfrenderer/textaction.hxx
index 7afe47a..6223602 100644
--- a/cppcanvas/source/mtfrenderer/textaction.hxx
+++ b/cppcanvas/source/mtfrenderer/textaction.hxx
@@ -73,7 +73,7 @@ namespace cppcanvas
                                                      const OUString&                rText,
                                                      sal_Int32                      nStartPos,
                                                      sal_Int32                      nLen,
-                                                     const sal_Int32*               pDXArray,
+                                                     const long*                    pDXArray,
                                                      VirtualDevice&                 rVDev,
                                                      const CanvasSharedPtr&         rCanvas,
                                                      const OutDevState&             rState,
diff --git a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
index dc922b5..943e16a 100644
--- a/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
+++ b/drawinglayer/source/primitive2d/metafileprimitive2d.cxx
@@ -1997,7 +1997,7 @@ namespace
                     {
                         // preapare DXArray (if used)
                         std::vector< double > aDXArray;
-                        sal_Int32* pDXArray = pA->GetDXArray();
+                        long* pDXArray = pA->GetDXArray();
 
                         if(pDXArray)
                         {
diff --git a/drawinglayer/source/primitive2d/textlayoutdevice.cxx b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
index 3abe03d..cbd21e3 100644
--- a/drawinglayer/source/primitive2d/textlayoutdevice.cxx
+++ b/drawinglayer/source/primitive2d/textlayoutdevice.cxx
@@ -241,7 +241,7 @@ namespace drawinglayer
             if(nDXArrayCount)
             {
                 OSL_ENSURE(nDXArrayCount == nTextLength, "DXArray size does not correspond to text portion size (!)");
-                std::vector< sal_Int32 > aIntegerDXArray(nDXArrayCount);
+                std::vector< long > aIntegerDXArray(nDXArrayCount);
 
                 for(sal_uInt32 a(0); a < nDXArrayCount; a++)
                 {
@@ -347,7 +347,7 @@ namespace drawinglayer
             if(nTextLength)
             {
                 aRetval.reserve(nTextLength);
-                ::std::vector<sal_Int32> aArray(nTextLength);
+                ::std::vector<long> aArray(nTextLength);
                 mrDevice.GetTextArray(rText, &aArray[0], nIndex, nLength);
                 aRetval.assign(aArray.begin(), aArray.end());
             }
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index 9b90471..137901e 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -242,7 +242,7 @@ namespace drawinglayer
                     }
 
                     // create transformed integer DXArray in view coordinate system
-                    ::std::vector< sal_Int32 > aTransformedDXArray;
+                    ::std::vector< long > aTransformedDXArray;
 
                     if(rTextCandidate.getDXArray().size())
                     {
@@ -277,7 +277,7 @@ namespace drawinglayer
                     sal_Int32 nPos = rTextCandidate.getTextPosition();
                     sal_Int32 nLen = rTextCandidate.getTextLength();
 
-                    sal_Int32* pDXArray = aTransformedDXArray.size() ? &(aTransformedDXArray[0]) : NULL ;
+                    long* pDXArray = aTransformedDXArray.size() ? &(aTransformedDXArray[0]) : NULL ;
 
                     if ( rTextCandidate.isFilled() )
                     {
@@ -287,8 +287,7 @@ namespace drawinglayer
 
                         long nWidthToFill = static_cast<long>(rTextCandidate.getWidthToFill( ) * aFontScaling.getX() / aOldFontScaling.getX());
 
-                        long nWidth = mpOutputDevice->GetTextArray(
-                            rTextCandidate.getText(), pDXArray, 0, 1 );
+                        long nWidth = mpOutputDevice->GetTextArray( rTextCandidate.getText(), pDXArray, 0, 1 );
                         long nChars = 2;
                         if ( nWidth )
                             nChars = nWidthToFill / nWidth;
diff --git a/editeng/source/accessibility/AccessibleStringWrap.cxx b/editeng/source/accessibility/AccessibleStringWrap.cxx
index e98f77e..ecddbd3 100644
--- a/editeng/source/accessibility/AccessibleStringWrap.cxx
+++ b/editeng/source/accessibility/AccessibleStringWrap.cxx
@@ -56,7 +56,7 @@ void AccessibleStringWrap::GetCharacterBounds( sal_Int32 nIndex, Rectangle& rRec
     }
     else
     {
-        sal_Int32 aXArray[2];
+        long aXArray[2];
         mrDev.GetCaretPositions( maText, aXArray, static_cast< sal_uInt16 >(nIndex), 1 );
         rRect.Left() = 0;
         rRect.Top() = 0;
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index 162491f..97073c0 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -548,13 +548,13 @@ ExtraPortionInfo::~ExtraPortionInfo()
     delete[] pOrgDXArray;
 }
 
-void ExtraPortionInfo::SaveOrgDXArray( const sal_Int32* pDXArray, sal_Int32 nLen )
+void ExtraPortionInfo::SaveOrgDXArray( const long* pDXArray, sal_Int32 nLen )
 {
     delete[] pOrgDXArray;
     if (pDXArray)
     {
-        pOrgDXArray = new sal_Int32[nLen];
-        memcpy( pOrgDXArray, pDXArray, nLen*sizeof(sal_Int32) );
+        pOrgDXArray = new long[nLen];
+        memcpy( pOrgDXArray, pDXArray, nLen * sizeof(long) );
     }
     else
         pOrgDXArray = NULL;
diff --git a/editeng/source/editeng/editdoc.hxx b/editeng/source/editeng/editdoc.hxx
index c9ba449..3db2ac3 100644
--- a/editeng/source/editeng/editdoc.hxx
+++ b/editeng/source/editeng/editdoc.hxx
@@ -351,14 +351,14 @@ struct ExtraPortionInfo
     bool    bFirstCharIsRightPunktuation;
     bool    bCompressed;
 
-    sal_Int32*    pOrgDXArray;
+    long*    pOrgDXArray;
     ::std::vector< sal_Int32 > lineBreaksList;
 
 
             ExtraPortionInfo();
             ~ExtraPortionInfo();
 
-    void    SaveOrgDXArray( const sal_Int32* pDXArray, sal_Int32 nLen );
+    void    SaveOrgDXArray( const long* pDXArray, sal_Int32 nLen );
 };
 
 
@@ -465,7 +465,7 @@ class ParaPortion;
 class EditLine
 {
 public:
-    typedef std::vector<sal_Int32> CharPosArrayType;
+    typedef std::vector<long> CharPosArrayType;
 
 private:
     CharPosArrayType aPositions;
diff --git a/editeng/source/editeng/editeng.cxx b/editeng/source/editeng/editeng.cxx
index 7b4d94a..86ebf83 100644
--- a/editeng/source/editeng/editeng.cxx
+++ b/editeng/source/editeng/editeng.cxx
@@ -2424,19 +2424,19 @@ ParagraphInfos EditEngine::GetParagraphInfos( sal_Int32 nPara )
 // ======================    Virtual Methods    ========================
 
 void EditEngine::DrawingText( const Point&, const OUString&, sal_Int32, sal_Int32,
-    const sal_Int32*, const SvxFont&, sal_Int32, sal_Int32, sal_uInt8,
-    const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool,
-    const ::com::sun::star::lang::Locale*, const Color&, const Color&)
+                              const long*, const SvxFont&, sal_Int32, sal_Int32, sal_uInt8,
+                              const EEngineData::WrongSpellVector*, const SvxFieldData*, bool, bool, bool,
+                              const ::com::sun::star::lang::Locale*, const Color&, const Color&)
 
 {
 }
 
 void EditEngine::DrawingTab( const Point& /*rStartPos*/, long /*nWidth*/,
-                                      const OUString& /*rChar*/, const SvxFont& /*rFont*/,
-                                      sal_Int32 /*nPara*/, sal_Int32 /*nIndex*/,
-                                      sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/,
-                                      bool /*bEndOfParagraph*/, const Color& /*rOverlineColor*/,
-                                      const Color& /*rTextLineColor*/)
+                             const OUString& /*rChar*/, const SvxFont& /*rFont*/,
+                             sal_Int32 /*nPara*/, sal_Int32 /*nIndex*/,
+                             sal_uInt8 /*nRightToLeft*/, bool /*bEndOfLine*/,
+                             bool /*bEndOfParagraph*/, const Color& /*rOverlineColor*/,
+                             const Color& /*rTextLineColor*/)
 {
 }
 
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index b1e64b1..e406a67 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -602,7 +602,8 @@ private:
     bool            IsScriptChange( const EditPaM& rPaM ) const;
     bool            HasScriptType( sal_Int32 nPara, sal_uInt16 nType ) const;
 
-    bool                ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_Int32 nStartPos, sal_Int32* pDXArray, sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray );
+    bool                ImplCalcAsianCompression( ContentNode* pNode, TextPortion* pTextPortion, sal_Int32 nStartPos,
+                                                  long* pDXArray, sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray );
     void                ImplExpandCompressedPortions( EditLine* pLine, ParaPortion* pParaPortion, long nRemainingWidth );
 
     void                ImplInitLayoutMode( OutputDevice* pOutDev, sal_Int32 nPara, sal_Int32 nIndex );
diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx
index a1bac55..339b102 100644
--- a/editeng/source/editeng/impedit2.cxx
+++ b/editeng/source/editeng/impedit2.cxx
@@ -3978,7 +3978,7 @@ long ImpEditEngine::GetXPos(
                         if ( nType == CHAR_PUNCTUATIONRIGHT && !pLine->GetCharPosArray().empty() )
                         {
                             sal_Int32 n = nIndex - nTextPortionStart;
-                            const sal_Int32* pDXArray = &pLine->GetCharPosArray()[0]+( nTextPortionStart-pLine->GetStart() );
+                            const long* pDXArray = &pLine->GetCharPosArray()[0]+( nTextPortionStart-pLine->GetStart() );
                             sal_Int32 nCharWidth = ( ( (n+1) < pPortion->GetLen() ) ? pDXArray[n] : pPortion->GetSize().Width() )
                                                             - ( n ? pDXArray[n-1] : 0 );
                             if ( (n+1) < pPortion->GetLen() )
diff --git a/editeng/source/editeng/impedit3.cxx b/editeng/source/editeng/impedit3.cxx
index adbc9fe..f6961f7 100644
--- a/editeng/source/editeng/impedit3.cxx
+++ b/editeng/source/editeng/impedit3.cxx
@@ -151,18 +151,17 @@ sal_uInt8 GetCharTypeForCompression( sal_Unicode cChar )
     }
 }
 
-static void lcl_DrawRedLines(
-    OutputDevice* pOutDev,
-    long nFontHeight,
-    const Point& rPnt,
-    size_t nIndex,
-    size_t nMaxEnd,
-    const sal_Int32* pDXArray,
-    WrongList* pWrongs,
-    short nOrientation,
-    const Point& rOrigin,
-    bool bVertical,
-    bool bIsRightToLeft )
+static void lcl_DrawRedLines( OutputDevice* pOutDev,
+                              long nFontHeight,
+                              const Point& rPnt,
+                              size_t nIndex,
+                              size_t nMaxEnd,
+                              const long* pDXArray,
+                              WrongList* pWrongs,
+                              short nOrientation,
+                              const Point& rOrigin,
+                              bool bVertical,
+                              bool bIsRightToLeft )
 {
     // But only if font is not too small ...
     long nHght = pOutDev->LogicToPixel( Size( 0, nFontHeight ) ).Height();
@@ -733,7 +732,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
     SvxFont aTmpFont( pNode->GetCharAttribs().GetDefFont() );
 
     bool bCalcCharPositions = true;
-    boost::scoped_array<sal_Int32> pBuf(new sal_Int32[ pNode->Len() ]);
+    boost::scoped_array<long> pBuf(new long[ pNode->Len() ]);
 
     bool bSameLineAgain = false;    // For TextRanger, if the height changes.
     TabInfo aCurrentTab;
@@ -1079,7 +1078,7 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
                 if ( pPortion->GetLen() && GetAsianCompressionMode() )
                 {
                     EditLine::CharPosArrayType& rArray = pLine->GetCharPosArray();
-                    sal_Int32* pDXArray = &rArray[0] + nTmpPos - pLine->GetStart();
+                    long* pDXArray = &rArray[0] + nTmpPos - pLine->GetStart();
                     bCompressedChars |= ImplCalcAsianCompression(
                         pNode, pPortion, nTmpPos, pDXArray, 10000, false);
                 }
@@ -1255,9 +1254,11 @@ bool ImpEditEngine::CreateLines( sal_Int32 nPara, sal_uInt32 nStartPosY )
             if ( bCompressedChars && pPortion && ( pPortion->GetLen() > 1 ) && pPortion->GetExtraInfos() && pPortion->GetExtraInfos()->bCompressed )
             {
                 // I need the manipulated DXArray for determining the break position...
-                sal_Int32* pDXArray = NULL;
+                long* pDXArray = NULL;
                 if (!pLine->GetCharPosArray().empty())
+                {
                     pDXArray = &pLine->GetCharPosArray()[0] + (nPortionStart - pLine->GetStart());
+                }
                 ImplCalcAsianCompression(
                     pNode, pPortion, nPortionStart, pDXArray, 10000, true);
             }
@@ -3038,8 +3039,8 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
                                 OUString aText;
                                 sal_Int32 nTextStart = 0;
                                 sal_Int32 nTextLen = 0;
-                                const sal_Int32* pDXArray = 0;
-                                boost::scoped_array<sal_Int32> pTmpDXArray;
+                                const long* pDXArray = 0;
+                                boost::scoped_array<long> pTmpDXArray;
 
                                 if ( pTextPortion->GetKind() == PORTIONKIND_TEXT )
                                 {
@@ -3183,7 +3184,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
                                         }
                                     }
 
-                                    pTmpDXArray.reset(new sal_Int32[ aText.getLength() ]);
+                                    pTmpDXArray.reset(new long[ aText.getLength() ]);
                                     pDXArray = pTmpDXArray.get();
                                     Font _aOldFont( GetRefDevice()->GetFont() );
                                     aTmpFont.SetPhysFont( GetRefDevice() );
@@ -3213,7 +3214,7 @@ void ImpEditEngine::Paint( OutputDevice* pOutDev, Rectangle aClipRect, Point aSt
                                     nTextLen = aText.getLength();
 
                                     // crash when accessing 0 pointer in pDXArray
-                                    pTmpDXArray.reset(new sal_Int32[ aText.getLength() ]);
+                                    pTmpDXArray.reset(new long[ aText.getLength() ]);
                                     pDXArray = pTmpDXArray.get();
                                     Font _aOldFont( GetRefDevice()->GetFont() );
                                     aTmpFont.SetPhysFont( GetRefDevice() );
@@ -4390,8 +4391,9 @@ Color ImpEditEngine::GetAutoColor() const
 
 
 bool ImpEditEngine::ImplCalcAsianCompression(ContentNode* pNode,
-        TextPortion* pTextPortion, sal_Int32 nStartPos, sal_Int32* pDXArray,
-        sal_uInt16 n100thPercentFromMax, bool bManipulateDXArray)
+                                             TextPortion* pTextPortion, sal_Int32 nStartPos,
+                                             long* pDXArray, sal_uInt16 n100thPercentFromMax,
+                                             bool bManipulateDXArray)
 {
     DBG_ASSERT( GetAsianCompressionMode(), "ImplCalcAsianCompression - Why?" );
     DBG_ASSERT( pTextPortion->GetLen(), "ImplCalcAsianCompression - Empty Portion?" );
@@ -4557,7 +4559,7 @@ void ImpEditEngine::ImplExpandCompressedPortions( EditLine* pLine, ParaPortion*
                 sal_Int32 nTxtPortion = pParaPortion->GetTextPortions().GetPos( pTP );
                 sal_Int32 nTxtPortionStart = pParaPortion->GetTextPortions().GetStartPos( nTxtPortion );
                 DBG_ASSERT( nTxtPortionStart >= pLine->GetStart(), "Portion doesn't belong to the line!!!" );
-                sal_Int32* pDXArray = NULL;
+                long* pDXArray = NULL;
                 if (!pLine->GetCharPosArray().empty())
                 {
                     pDXArray = &pLine->GetCharPosArray()[0]+( nTxtPortionStart-pLine->GetStart() );
diff --git a/editeng/source/items/svxfont.cxx b/editeng/source/items/svxfont.cxx
index 895eef6..d4c2de0 100644
--- a/editeng/source/items/svxfont.cxx
+++ b/editeng/source/items/svxfont.cxx
@@ -404,7 +404,7 @@ Size SvxFont::GetPhysTxtSize( const OutputDevice *pOut, const OUString &rTxt )
 }
 
 Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const OUString &rTxt,
-                         const sal_Int32 nIdx, const sal_Int32 nLen, sal_Int32* pDXArray ) const
+                         const sal_Int32 nIdx, const sal_Int32 nLen, long* pDXArray ) const
 {
     if ( !IsCaseMap() && !IsKern() )
         return Size( pOut->GetTextArray( rTxt, pDXArray, nIdx, nLen ),
@@ -454,7 +454,7 @@ Size SvxFont::GetTxtSize( const OutputDevice *pOut, const OUString &rTxt,
 
 void SvxFont::QuickDrawText( OutputDevice *pOut,
     const Point &rPos, const OUString &rTxt,
-    const sal_Int32 nIdx, const sal_Int32 nLen, const sal_Int32* pDXArray ) const
+    const sal_Int32 nIdx, const sal_Int32 nLen, const long* pDXArray ) const
 {
 
     // Font has to be selected in OutputDevice...
diff --git a/editeng/source/outliner/outleeng.cxx b/editeng/source/outliner/outleeng.cxx
index bac8437..db90fda 100644
--- a/editeng/source/outliner/outleeng.cxx
+++ b/editeng/source/outliner/outleeng.cxx
@@ -147,15 +147,15 @@ OUString OutlinerEditEng::GetUndoComment( sal_uInt16 nUndoId ) const
 }
 
 void OutlinerEditEng::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, sal_Int32 nTextLen,
-    const sal_Int32* pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
-    const EEngineData::WrongSpellVector* pWrongSpellVector,
-    const SvxFieldData* pFieldData,
-    bool bEndOfLine,
-    bool bEndOfParagraph,
-    bool bEndOfBullet,
-    const ::com::sun::star::lang::Locale* pLocale,
-    const Color& rOverlineColor,
-    const Color& rTextLineColor)
+                                   const long* pDXArray, const SvxFont& rFont, sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
+                                   const EEngineData::WrongSpellVector* pWrongSpellVector,
+                                   const SvxFieldData* pFieldData,
+                                   bool bEndOfLine,
+                                   bool bEndOfParagraph,
+                                   bool bEndOfBullet,
+                                   const ::com::sun::star::lang::Locale* pLocale,
+                                   const Color& rOverlineColor,
+                                   const Color& rTextLineColor)
 {
     pOwner->DrawingText(rStartPos,rText,nTextStart,nTextLen,pDXArray,rFont,nPara,nIndex,nRightToLeft,
         pWrongSpellVector, pFieldData, bEndOfLine, bEndOfParagraph, bEndOfBullet, pLocale, rOverlineColor, rTextLineColor);
diff --git a/editeng/source/outliner/outleeng.hxx b/editeng/source/outliner/outleeng.hxx
index dae743f..a802eed 100644
--- a/editeng/source/outliner/outleeng.hxx
+++ b/editeng/source/outliner/outleeng.hxx
@@ -44,11 +44,11 @@ public:
     virtual void        ParagraphDeleted( sal_Int32 nDeletedParagraph ) SAL_OVERRIDE;
     virtual void        ParagraphConnected( sal_Int32 nLeftParagraph, sal_Int32 nRightParagraph ) SAL_OVERRIDE;
 
-    virtual void DrawingText(
-        const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, sal_Int32 nTextLen, const sal_Int32* pDXArray, const SvxFont& rFont,
-        sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
-        const EEngineData::WrongSpellVector* pWrongSpellVector,
-        const SvxFieldData* pFieldData,
+    virtual void DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
+                              sal_Int32 nTextLen, const long* pDXArray, const SvxFont& rFont,
+                              sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
+                              const EEngineData::WrongSpellVector* pWrongSpellVector,
+                              const SvxFieldData* pFieldData,
         bool bEndOfLine,
         bool bEndOfParagraph,
         bool bEndOfBullet,
diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx
index aaa843d..ace9482 100644
--- a/editeng/source/outliner/outliner.cxx
+++ b/editeng/source/outliner/outliner.cxx
@@ -1005,7 +1005,7 @@ void Outliner::PaintBullet( sal_Int32 nPara, const Point& rStartPos,
                 if(bStrippingPortions)
                 {
                     const Font aSvxFont(pOutDev->GetFont());
-                    boost::scoped_array<sal_Int32> pBuf(new sal_Int32[ pPara->GetText().getLength() ]);
+                    boost::scoped_array<long> pBuf(new long[ pPara->GetText().getLength() ]);
                     pOutDev->GetTextArray( pPara->GetText(), pBuf.get() );
 
                     if(bSymbol)
@@ -1738,16 +1738,17 @@ void Outliner::StripPortions()
     bStrippingPortions = false;
 }
 
-void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart, sal_Int32 nTextLen, const sal_Int32* pDXArray,const SvxFont& rFont,
-    sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
-    const EEngineData::WrongSpellVector* pWrongSpellVector,
-    const SvxFieldData* pFieldData,
-    bool bEndOfLine,
-    bool bEndOfParagraph,
-    bool bEndOfBullet,
-    const ::com::sun::star::lang::Locale* pLocale,
-    const Color& rOverlineColor,
-    const Color& rTextLineColor)
+void Outliner::DrawingText( const Point& rStartPos, const OUString& rText, sal_Int32 nTextStart,
+                            sal_Int32 nTextLen, const long* pDXArray,const SvxFont& rFont,
+                            sal_Int32 nPara, sal_Int32 nIndex, sal_uInt8 nRightToLeft,
+                            const EEngineData::WrongSpellVector* pWrongSpellVector,
+                            const SvxFieldData* pFieldData,
+                            bool bEndOfLine,
+                            bool bEndOfParagraph,
+                            bool bEndOfBullet,
+                            const ::com::sun::star::lang::Locale* pLocale,
+                            const Color& rOverlineColor,
+                            const Color& rTextLineColor)
 {
 
     if(aDrawPortionHdl.IsSet())
diff --git a/filter/source/flash/swfwriter.hxx b/filter/source/flash/swfwriter.hxx
index 4c31000..7b3161f 100644
--- a/filter/source/flash/swfwriter.hxx
+++ b/filter/source/flash/swfwriter.hxx
@@ -345,8 +345,8 @@ private:
     void Impl_writePolygon( const Polygon& rPoly, bool bFilled, const Color& rFillColor, const Color& rLineColor );
     void Impl_writePolyPolygon( const PolyPolygon& rPolyPoly, bool bFilled, sal_uInt8 nTransparence = 0);
     void Impl_writePolyPolygon( const PolyPolygon& rPolyPoly, bool bFilled, const Color& rFillColor, const Color& rLineColor );
-    void Impl_writeText( const Point& rPos, const OUString& rText, const sal_Int32* pDXArray, long nWidth );
-    void Impl_writeText( const Point& rPos, const OUString& rText, const sal_Int32* pDXArray, long nWidth, Color aTextColor );
+    void Impl_writeText( const Point& rPos, const OUString& rText, const long* pDXArray, long nWidth );
+    void Impl_writeText( const Point& rPos, const OUString& rText, const long* pDXArray, long nWidth, Color aTextColor );
     void Impl_writeGradientEx( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
     void Impl_writeLine( const Point& rPt1, const Point& rPt2, const Color* pLineColor = NULL );
     void Impl_writeRect( const Rectangle& rRect, long nRadX, long nRadY );
diff --git a/filter/source/flash/swfwriter1.cxx b/filter/source/flash/swfwriter1.cxx
index 9ea53e5..dedcb98 100644
--- a/filter/source/flash/swfwriter1.cxx
+++ b/filter/source/flash/swfwriter1.cxx
@@ -403,7 +403,7 @@ FlashFont& Writer::Impl_getFont( const Font& rFont )
 
 
 
-void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const sal_Int32* pDXArray, long nWidth )
+void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const long* pDXArray, long nWidth )
 {
     const FontMetric aMetric( mpVDev->GetFontMetric() );
 
@@ -491,7 +491,7 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const sal
     }
 }
 
-void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const sal_Int32* pDXArray, long nWidth, Color aTextColor )
+void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const long* pDXArray, long nWidth, Color aTextColor )
 {
     sal_Int32 nLen = rText.getLength();
 
@@ -524,18 +524,18 @@ void Writer::Impl_writeText( const Point& rPos, const OUString& rText, const sal
     else
     {
         Size    aNormSize;
-        boost::scoped_array<sal_Int32> pOwnArray;
-        sal_Int32* pDX;
+        boost::scoped_array<long> pOwnArray;
+        long* pDX;
 
         // get text sizes
         if( pDXArray )
         {
             aNormSize = Size( mpVDev->GetTextWidth( rText ), 0 );
-            pDX = (sal_Int32*) pDXArray;
+            pDX = (long*) pDXArray;
         }
         else
         {
-            pOwnArray.reset(new sal_Int32[ nLen ]);
+            pOwnArray.reset(new long[ nLen ]);
             aNormSize = Size( mpVDev->GetTextArray( rText, pOwnArray.get() ), 0 );
             pDX = pOwnArray.get();
         }
diff --git a/filter/source/graphicfilter/eos2met/eos2met.cxx b/filter/source/graphicfilter/eos2met/eos2met.cxx
index 5927744..a217c58 100644
--- a/filter/source/graphicfilter/eos2met/eos2met.cxx
+++ b/filter/source/graphicfilter/eos2met/eos2met.cxx
@@ -1957,7 +1957,7 @@ void METWriter::WriteOrders( const GDIMetaFile* pMTF )
                 METSetChrAngle( nOrientation = aGDIFont.GetOrientation() );
                 METSetChrSet(FindChrSet(aGDIFont));
                 aStr = pA->GetText().copy(pA->GetIndex(),pA->GetLen());
-                boost::scoped_array<sal_Int32> pDXAry(new sal_Int32[aStr.getLength()]);
+                boost::scoped_array<long> pDXAry(new long[aStr.getLength()]);
                 nNormSize = aVDev.GetTextArray( aStr, pDXAry.get() );
 
                 for ( i = 0; i < aStr.getLength(); i++ )

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list