summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNorbert Thiebaud <nthiebaud@gmail.com>2014-07-15 21:45:11 +0200
committerNorbert Thiebaud <nthiebaud@gmail.com>2014-07-15 21:45:11 +0200
commit7a8fcfca98ee10666c58011ebe0a5f96e008d22d (patch)
tree9b309898f40cde3f9945c170ec46e628d10d66cf /sw
parent6c8de2b107964cd3d26dba8fcf80c6da77b1d97a (diff)
fdo#79673 quartz: draw 'bullet' for 'space' directly in one pass
the current implementation of CoreText simply dropped the proper implementation of DrawTextArray, by ignoring DXArray this very visibly borked the show-non-displayable character feature of writer.. the bullet representing the 'spaces' was quite misplaced. This solve specifically this problem. More work is needed to bring proper support of DXArray back to CoreText Conflicts: vcl/inc/sallayout.hxx vcl/source/outdev/text.cxx Change-Id: Idb2cc90d5ffaa8b83f79241cee2d512112d1c3be
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/txtnode/fntcache.cxx32
1 files changed, 23 insertions, 9 deletions
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index a4584df57668..f0ede7690c87 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -1275,7 +1275,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// If it is a single underlined space, output 2 spaces:
if( 1 == rInf.GetLen() )
{
- pKernArray[0] = rInf.GetWidth() + nSpaceAdd;
+ pKernArray[0] = rInf.GetWidth() + nSpaceAdd;
rInf.GetOut().DrawTextArray( aPos, rInf.GetText(),
pKernArray, rInf.GetIdx(), 1 );
@@ -1352,8 +1352,11 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
else
{
const OUString* pStr = &rInf.GetText();
+
+#if !defined(MACOSX) && !defined(IOS)
OUString aStr;
OUString aBulletOverlay;
+#endif
bool bBullet = rInf.GetBullet();
if( bSymbol )
bBullet = false;
@@ -1463,6 +1466,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
nScrPos = pScrArray[ 0 ];
+#if !defined(MACOSX) && !defined(IOS)
if( bBullet )
{
// !!! HACK !!!
@@ -1502,7 +1506,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
aBulletOverlay = aBulletOverlay.replaceAt(i, 1, OUString(CH_BLANK));
}
}
-
+#endif
sal_Int32 nCnt = rInf.GetText().getLength();
if ( nCnt < rInf.GetIdx() )
nCnt = 0;
@@ -1526,11 +1530,16 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( bSwitchH2V )
rInf.GetFrm()->SwitchHorizontalToVertical( aPos );
+#if defined(MACOSX) || defined(IOS)
+ rInf.GetOut().DrawTextArray( aPos, rInf.GetText(),
+ pKernArray, rInf.GetIdx(), 1, bBullet ? SAL_LAYOUT_DRAW_BULLET : 0 );
+#else
rInf.GetOut().DrawTextArray( aPos, rInf.GetText(),
pKernArray, rInf.GetIdx(), 1 );
if( bBullet )
rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray,
rInf.GetIdx() ? 1 : 0, 1 );
+#endif
}
else
{
@@ -1708,13 +1717,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if( nOffs < nLen )
{
- // If we paint bullets instead of spaces, we use a copy of
- // the paragraph string. For the layout engine, the copy
- // of the string has to be an environment of the range which
- // is painted
- sal_Int32 nTmpIdx = bBullet ?
- ( rInf.GetIdx() ? 1 : 0 ) :
- rInf.GetIdx();
if ( bSwitchL2R )
rInf.GetFrm()->SwitchLTRtoRTL( aPos );
@@ -1722,6 +1724,17 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if ( bSwitchH2V )
rInf.GetFrm()->SwitchHorizontalToVertical( aPos );
+#if defined(MACOSX) || defined(IOS)
+ rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray + nOffs,
+ rInf.GetIdx() + nOffs , nLen - nOffs, bBullet ? SAL_LAYOUT_DRAW_BULLET : 0 );
+#else
+ // If we paint bullets instead of spaces, we use a copy of
+ // the paragraph string. For the layout engine, the copy
+ // of the string has to be an environment of the range which
+ // is painted
+ sal_Int32 nTmpIdx = bBullet ?
+ ( rInf.GetIdx() ? 1 : 0 ) :
+ rInf.GetIdx();
rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray + nOffs,
nTmpIdx + nOffs , nLen - nOffs );
if (bBullet)
@@ -1747,6 +1760,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
pTmpFont->SetStrikeout(aPreviousStrikeout);
rInf.GetOut().Pop();
}
+#endif
}
}
delete[] pScrArray;