Revert "fdo#79673 revert to old NPC for MacOSX only"
This reverts commit 3a2010c711
.
Prep to apply a full fix.
Change-Id: I3b71ad79f65e48456d9fd9d257bf471faa0f3482
This commit is contained in:
@@ -45,19 +45,7 @@ class SwScriptInfo;
|
||||
class SwViewOption;
|
||||
class SwWrongList;
|
||||
|
||||
// LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
// Old handling of non printing character color - color is the same as current color
|
||||
// Because of problems drawing glyphs on correct position in OSX, this functionallity is
|
||||
// disabled on OSX. See fdo#79673 for details.
|
||||
#ifdef MACOSX
|
||||
#define LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
#else
|
||||
#undef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
#endif
|
||||
|
||||
#ifndef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
#define NON_PRINTING_CHARACTER_COLOR RGB_COLORDATA(0x26, 0x8b, 0xd2)
|
||||
#endif
|
||||
|
||||
/// Represents the visualization of a paragraph.
|
||||
class SwTxtFrm: public SwCntntFrm
|
||||
|
@@ -562,9 +562,8 @@ bool SwTxtFrm::PaintEmpty( const SwRect &rRect, bool bCheck ) const
|
||||
aDrawInf.SetFrm( this );
|
||||
aDrawInf.SetFont( pFnt );
|
||||
aDrawInf.SetSnapToGrid( false );
|
||||
#ifndef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
|
||||
pFnt->SetColor(NON_PRINTING_CHARACTER_COLOR);
|
||||
#endif
|
||||
pFnt->_DrawText( aDrawInf );
|
||||
}
|
||||
delete pClip;
|
||||
|
@@ -891,16 +891,6 @@ static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rP
|
||||
((SwTxtPaintInfo&)rInf).SetPos( aOldPos );
|
||||
}
|
||||
|
||||
#ifdef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
static void lcl_DrawSpecial( const SwTxtPaintInfo& rInf, const SwLinePortion& rPor,
|
||||
SwRect& rRect, sal_Unicode cChar, sal_uInt8 nOptions )
|
||||
{
|
||||
const SwFont* pOldFnt = rInf.GetFont();
|
||||
Color aColor = pOldFnt->GetColor();
|
||||
lcl_DrawSpecial(rInf, rPor, rRect, aColor, cChar, nOptions);
|
||||
}
|
||||
#endif
|
||||
|
||||
void SwTxtPaintInfo::DrawRect( const SwRect &rRect, bool bNoGraphic,
|
||||
bool bRetouche ) const
|
||||
{
|
||||
@@ -961,11 +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;
|
||||
|
||||
#ifdef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
lcl_DrawSpecial( *this, rPor, aRect, cChar, nOptions );
|
||||
#else
|
||||
lcl_DrawSpecial( *this, rPor, aRect, NON_PRINTING_CHARACTER_COLOR, cChar, nOptions );
|
||||
#endif
|
||||
lcl_DrawSpecial( *this, rPor, aRect, Color(0x6a, 0xbe, 0xd3), cChar, nOptions );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -985,11 +971,7 @@ void SwTxtPaintInfo::DrawLineBreak( const SwLinePortion &rPor ) const
|
||||
CHAR_LINEBREAK_RTL : CHAR_LINEBREAK;
|
||||
const sal_uInt8 nOptions = 0;
|
||||
|
||||
#ifdef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
lcl_DrawSpecial( *this, rPor, aRect, cChar, nOptions );
|
||||
#else
|
||||
lcl_DrawSpecial( *this, rPor, aRect, Color(NON_PRINTING_CHARACTER_COLOR), cChar, nOptions );
|
||||
#endif
|
||||
}
|
||||
|
||||
((SwLinePortion&)rPor).Width( nOldWidth );
|
||||
|
@@ -61,12 +61,7 @@ void SwTmpEndPortion::Paint( const SwTxtPaintInfo &rInf ) const
|
||||
{
|
||||
if( rInf.OnWin() && rInf.GetOpt().IsParagraph() )
|
||||
{
|
||||
#ifdef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
const OUString aTmp( CH_PAR );
|
||||
rInf.DrawText( aTmp, *this );
|
||||
#else
|
||||
rInf.DrawSpecial( *this, CH_PAR, Color(NON_PRINTING_CHARACTER_COLOR) );
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -1353,11 +1353,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
|
||||
{
|
||||
const OUString* pStr = &rInf.GetText();
|
||||
OUString aStr;
|
||||
|
||||
#ifndef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
OUString aBulletOverlay;
|
||||
#endif
|
||||
|
||||
bool bBullet = rInf.GetBullet();
|
||||
if( bSymbol )
|
||||
bBullet = false;
|
||||
@@ -1483,26 +1479,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
|
||||
aStr = rInf.GetText().copy( nCopyStart, nCopyLen );
|
||||
pStr = &aStr;
|
||||
|
||||
#ifdef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
for (sal_Int32 i = 0; i < aStr.getLength(); ++i)
|
||||
{
|
||||
if (CH_BLANK == aStr[i])
|
||||
{
|
||||
/* fdo#72488 Hack: try to see if the space is zero width
|
||||
* and don't bother with inserting a bullet in this case.
|
||||
*/
|
||||
if ((i + nCopyStart + 1 >= rInf.GetLen()) ||
|
||||
pKernArray[i + nCopyStart] != pKernArray[ i + nCopyStart + 1])
|
||||
{
|
||||
aStr = aStr.replaceAt(i, 1, OUString(CH_BULLET));
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
aBulletOverlay = rInf.GetText().copy( nCopyStart, nCopyLen );
|
||||
|
||||
for( sal_Int32 i = 0; i < aBulletOverlay.getLength(); ++i )
|
||||
{
|
||||
if( CH_BLANK == aBulletOverlay[ i ] )
|
||||
{
|
||||
/* fdo#72488 Hack: try to see if the space is zero width
|
||||
@@ -1522,8 +1501,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
|
||||
{
|
||||
aBulletOverlay = aBulletOverlay.replaceAt(i, 1, OUString(CH_BLANK));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
sal_Int32 nCnt = rInf.GetText().getLength();
|
||||
@@ -1747,7 +1724,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
|
||||
|
||||
rInf.GetOut().DrawTextArray( aPos, *pStr, pKernArray + nOffs,
|
||||
nTmpIdx + nOffs , nLen - nOffs );
|
||||
#ifndef LEGACY_NON_PRINTING_CHARACTER_COLOR_FUNCTIONALITY
|
||||
if (bBullet)
|
||||
{
|
||||
rInf.GetOut().Push();
|
||||
@@ -1771,7 +1747,6 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
|
||||
pTmpFont->SetStrikeout(aPreviousStrikeout);
|
||||
rInf.GetOut().Pop();
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
delete[] pScrArray;
|
||||
|
Reference in New Issue
Block a user