[Libreoffice-commits] core.git: sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Mon Jun 27 09:23:47 UTC 2016
sw/source/core/inc/fntcache.hxx | 46 ++---
sw/source/core/txtnode/fntcache.cxx | 328 ++++++++++++++++++------------------
2 files changed, 187 insertions(+), 187 deletions(-)
New commits:
commit 85ce665ee43b1f20df593fc36f935c5799418f54
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Mon Jun 27 09:58:25 2016 +0200
sw: prefix members of SwFntObj
Change-Id: I98af56984ae559eb4a7fcd1df261e4274b61d66a
Reviewed-on: https://gerrit.libreoffice.org/26692
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/sw/source/core/inc/fntcache.hxx b/sw/source/core/inc/fntcache.hxx
index 053456b..33423b9 100644
--- a/sw/source/core/inc/fntcache.hxx
+++ b/sw/source/core/inc/fntcache.hxx
@@ -61,20 +61,20 @@ class SwFntObj : public SwCacheObj
friend void InitCore();
friend void FinitCore();
- vcl::Font aFont;
- vcl::Font *pScrFont;
- vcl::Font *pPrtFont;
- VclPtr<OutputDevice> pPrinter;
- sal_uInt16 nGuessedLeading;
- sal_uInt16 nExtLeading;
- sal_uInt16 nScrAscent;
- sal_uInt16 nPrtAscent;
- sal_uInt16 nScrHeight;
- sal_uInt16 nPrtHeight;
- sal_uInt16 nPropWidth;
- sal_uInt16 nZoom;
- bool bSymbol : 1;
- bool bPaintBlank : 1;
+ vcl::Font m_aFont;
+ vcl::Font *m_pScrFont;
+ vcl::Font *m_pPrtFont;
+ VclPtr<OutputDevice> m_pPrinter;
+ sal_uInt16 m_nGuessedLeading;
+ sal_uInt16 m_nExtLeading;
+ sal_uInt16 m_nScrAscent;
+ sal_uInt16 m_nPrtAscent;
+ sal_uInt16 m_nScrHeight;
+ sal_uInt16 m_nPrtHeight;
+ sal_uInt16 m_nPropWidth;
+ sal_uInt16 m_nZoom;
+ bool m_bSymbol : 1;
+ bool m_bPaintBlank : 1;
static long nPixWidth;
static MapMode *pPixMap;
@@ -87,12 +87,12 @@ public:
virtual ~SwFntObj();
- inline vcl::Font *GetScrFont() { return pScrFont; }
- inline vcl::Font& GetFont() { return aFont; }
- inline const vcl::Font& GetFont() const { return aFont; }
+ inline vcl::Font *GetScrFont() { return m_pScrFont; }
+ inline vcl::Font& GetFont() { return m_aFont; }
+ inline const vcl::Font& GetFont() const { return m_aFont; }
- inline sal_uInt16 GetGuessedLeading() const { return nGuessedLeading; }
- inline sal_uInt16 GetExternalLeading() const { return nExtLeading; }
+ inline sal_uInt16 GetGuessedLeading() const { return m_nGuessedLeading; }
+ inline sal_uInt16 GetExternalLeading() const { return m_nExtLeading; }
sal_uInt16 GetFontAscent( const SwViewShell *pSh, const OutputDevice& rOut );
sal_uInt16 GetFontHeight( const SwViewShell *pSh, const OutputDevice& rOut );
@@ -101,10 +101,10 @@ public:
void GuessLeading( const SwViewShell& rSh, const FontMetric& rMet );
void SetDevFont( const SwViewShell *pSh, OutputDevice& rOut );
- inline OutputDevice* GetPrt() const { return pPrinter; }
- inline sal_uInt16 GetZoom() const { return nZoom; }
- inline sal_uInt16 GetPropWidth() const { return nPropWidth; }
- inline bool IsSymbol() const { return bSymbol; }
+ inline OutputDevice* GetPrt() const { return m_pPrinter; }
+ inline sal_uInt16 GetZoom() const { return m_nZoom; }
+ inline sal_uInt16 GetPropWidth() const { return m_nPropWidth; }
+ inline bool IsSymbol() const { return m_bSymbol; }
void DrawText( SwDrawTextInfo &rInf );
/// determine the TextSize (of the printer)
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index 13791d2..f75e712 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -107,55 +107,55 @@ void SwFntCache::Flush( )
SwFntObj::SwFntObj(const SwSubFont &rFont, const void *pOwn, SwViewShell const *pSh)
: SwCacheObj(pOwn)
- , aFont(rFont)
- , pScrFont(nullptr)
- , pPrtFont(&aFont)
- , pPrinter(nullptr)
- , nGuessedLeading(USHRT_MAX)
- , nExtLeading(USHRT_MAX)
- , nScrAscent(0)
- , nPrtAscent(USHRT_MAX)
- , nScrHeight(0)
- , nPrtHeight(USHRT_MAX)
- , nPropWidth(rFont.GetPropWidth())
+ , m_aFont(rFont)
+ , m_pScrFont(nullptr)
+ , m_pPrtFont(&m_aFont)
+ , m_pPrinter(nullptr)
+ , m_nGuessedLeading(USHRT_MAX)
+ , m_nExtLeading(USHRT_MAX)
+ , m_nScrAscent(0)
+ , m_nPrtAscent(USHRT_MAX)
+ , m_nScrHeight(0)
+ , m_nPrtHeight(USHRT_MAX)
+ , m_nPropWidth(rFont.GetPropWidth())
{
- nZoom = pSh ? pSh->GetViewOptions()->GetZoom() : USHRT_MAX;
- bSymbol = RTL_TEXTENCODING_SYMBOL == aFont.GetCharSet();
- bPaintBlank = ( LINESTYLE_NONE != aFont.GetUnderline()
- || LINESTYLE_NONE != aFont.GetOverline()
- || STRIKEOUT_NONE != aFont.GetStrikeout() )
- && !aFont.IsWordLineMode();
- aFont.SetLanguage(rFont.GetLanguage());
+ m_nZoom = pSh ? pSh->GetViewOptions()->GetZoom() : USHRT_MAX;
+ m_bSymbol = RTL_TEXTENCODING_SYMBOL == m_aFont.GetCharSet();
+ m_bPaintBlank = ( LINESTYLE_NONE != m_aFont.GetUnderline()
+ || LINESTYLE_NONE != m_aFont.GetOverline()
+ || STRIKEOUT_NONE != m_aFont.GetStrikeout() )
+ && !m_aFont.IsWordLineMode();
+ m_aFont.SetLanguage(rFont.GetLanguage());
}
SwFntObj::~SwFntObj()
{
- if ( pScrFont != pPrtFont )
- delete pScrFont;
- if ( pPrtFont != &aFont )
- delete pPrtFont;
+ if ( m_pScrFont != m_pPrtFont )
+ delete m_pScrFont;
+ if ( m_pPrtFont != &m_aFont )
+ delete m_pPrtFont;
}
void SwFntObj::CreatePrtFont( const OutputDevice& rPrt )
{
- if ( nPropWidth != 100 && pPrinter != &rPrt )
+ if ( m_nPropWidth != 100 && m_pPrinter != &rPrt )
{
- if( pScrFont != pPrtFont )
- delete pScrFont;
- if( pPrtFont != &aFont )
- delete pPrtFont;
+ if( m_pScrFont != m_pPrtFont )
+ delete m_pScrFont;
+ if( m_pPrtFont != &m_aFont )
+ delete m_pPrtFont;
const vcl::Font aOldFnt( rPrt.GetFont() );
- ((OutputDevice&)rPrt).SetFont( aFont );
+ ((OutputDevice&)rPrt).SetFont( m_aFont );
const FontMetric aWinMet( rPrt.GetFontMetric() );
((OutputDevice&)rPrt).SetFont( aOldFnt );
- long nWidth = ( aWinMet.GetFontSize().Width() * nPropWidth ) / 100;
+ long nWidth = ( aWinMet.GetFontSize().Width() * m_nPropWidth ) / 100;
if( !nWidth )
++nWidth;
- pPrtFont = new vcl::Font( aFont );
- pPrtFont->SetFontSize( Size( nWidth, aFont.GetFontSize().Height() ) );
- pScrFont = nullptr;
+ m_pPrtFont = new vcl::Font( m_aFont );
+ m_pPrtFont->SetFontSize( Size( nWidth, m_aFont.GetFontSize().Height() ) );
+ m_pScrFont = nullptr;
}
}
@@ -276,22 +276,22 @@ sal_uInt16 SwFntObj::GetFontAscent( const SwViewShell *pSh, const OutputDevice&
if ( pSh && lcl_IsFontAdjustNecessary( rOut, rRefDev ) )
{
CreateScrFont( *pSh, rOut );
- OSL_ENSURE( USHRT_MAX != nScrAscent, "nScrAscent is going berzerk" );
- nRet = nScrAscent;
+ OSL_ENSURE( USHRT_MAX != m_nScrAscent, "nScrAscent is going berzerk" );
+ nRet = m_nScrAscent;
}
else
{
- if (nPrtAscent == USHRT_MAX) // printer ascent unknown?
+ if (m_nPrtAscent == USHRT_MAX) // printer ascent unknown?
{
CreatePrtFont( rOut );
const vcl::Font aOldFnt( rRefDev.GetFont() );
- ((OutputDevice&)rRefDev).SetFont( *pPrtFont );
+ ((OutputDevice&)rRefDev).SetFont( *m_pPrtFont );
const FontMetric aOutMet( rRefDev.GetFontMetric() );
- nPrtAscent = (sal_uInt16) aOutMet.GetAscent();
+ m_nPrtAscent = (sal_uInt16) aOutMet.GetAscent();
( (OutputDevice&)rRefDev).SetFont( aOldFnt );
}
- nRet = nPrtAscent;
+ nRet = m_nPrtAscent;
}
#if !defined(MACOSX) // #i89844# extleading is below the line for Mac
@@ -313,17 +313,17 @@ sal_uInt16 SwFntObj::GetFontHeight( const SwViewShell* pSh, const OutputDevice&
if ( pSh && lcl_IsFontAdjustNecessary( rOut, rRefDev ) )
{
CreateScrFont( *pSh, rOut );
- OSL_ENSURE( USHRT_MAX != nScrHeight, "nScrHeight is going berzerk" );
- nRet = nScrHeight + GetFontLeading( pSh, rRefDev );
+ OSL_ENSURE( USHRT_MAX != m_nScrHeight, "nScrHeight is going berzerk" );
+ nRet = m_nScrHeight + GetFontLeading( pSh, rRefDev );
}
else
{
- if (nPrtHeight == USHRT_MAX) // printer height unknown?
+ if (m_nPrtHeight == USHRT_MAX) // printer height unknown?
{
CreatePrtFont( rOut );
const vcl::Font aOldFnt( rRefDev.GetFont() );
- ((OutputDevice&)rRefDev).SetFont( *pPrtFont );
- nPrtHeight = static_cast<sal_uInt16>(rRefDev.GetTextHeight());
+ ((OutputDevice&)rRefDev).SetFont( *m_pPrtFont );
+ m_nPrtHeight = static_cast<sal_uInt16>(rRefDev.GetTextHeight());
#if OSL_DEBUG_LEVEL > 0
// Check if vcl did not change the meaning of GetTextHeight
@@ -331,14 +331,14 @@ sal_uInt16 SwFntObj::GetFontHeight( const SwViewShell* pSh, const OutputDevice&
long nTmpPrtHeight = (sal_uInt16)aOutMet.GetAscent() + aOutMet.GetDescent();
(void) nTmpPrtHeight;
// #i106098#: do not compare with == here due to rounding error
- OSL_ENSURE( std::abs(nTmpPrtHeight - nPrtHeight) < 3,
+ OSL_ENSURE( std::abs(nTmpPrtHeight - m_nPrtHeight) < 3,
"GetTextHeight != Ascent + Descent" );
#endif
((OutputDevice&)rRefDev).SetFont( aOldFnt );
}
- nRet = nPrtHeight + GetFontLeading( pSh, rRefDev );
+ nRet = m_nPrtHeight + GetFontLeading( pSh, rRefDev );
}
OSL_ENSURE( USHRT_MAX != nRet, "GetFontHeight returned USHRT_MAX" );
@@ -351,17 +351,17 @@ sal_uInt16 SwFntObj::GetFontLeading( const SwViewShell *pSh, const OutputDevice&
if ( pSh )
{
- if ( USHRT_MAX == nGuessedLeading || USHRT_MAX == nExtLeading )
+ if ( USHRT_MAX == m_nGuessedLeading || USHRT_MAX == m_nExtLeading )
{
SolarMutexGuard aGuard;
const vcl::Font aOldFnt( rOut.GetFont() );
- ((OutputDevice&)rOut).SetFont( *pPrtFont );
+ ((OutputDevice&)rOut).SetFont( *m_pPrtFont );
const FontMetric aMet( rOut.GetFontMetric() );
((OutputDevice&)rOut).SetFont( aOldFnt );
- bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet();
+ m_bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet();
GuessLeading( *pSh, aMet );
- nExtLeading = static_cast<sal_uInt16>(aMet.GetExternalLeading());
+ m_nExtLeading = static_cast<sal_uInt16>(aMet.GetExternalLeading());
/* HACK: FIXME There is something wrong with Writer's bullet rendering, causing lines
with bullets to be higher than they should be. I think this is because
Writer uses font's external leading incorrect, as the vertical distance
@@ -377,8 +377,8 @@ sal_uInt16 SwFntObj::GetFontLeading( const SwViewShell *pSh, const OutputDevice&
Interestingly enough, bSymbol is false for 'StarSymbol; Arial Unicode MS', so
also check explicitly.
*/
- if( bSymbol || IsStarSymbol( pPrtFont->GetFamilyName()))
- nExtLeading = 0;
+ if( m_bSymbol || IsStarSymbol( m_pPrtFont->GetFamilyName()))
+ m_nExtLeading = 0;
}
const IDocumentSettingAccess& rIDSA = pSh->getIDocumentSettingAccess();
@@ -387,9 +387,9 @@ sal_uInt16 SwFntObj::GetFontLeading( const SwViewShell *pSh, const OutputDevice&
!pSh->GetViewOptions()->IsPrtFormat() );
if ( !bBrowse && rIDSA.get(DocumentSettingId::ADD_EXT_LEADING) )
- nRet = nExtLeading;
+ nRet = m_nExtLeading;
else
- nRet = nGuessedLeading;
+ nRet = m_nGuessedLeading;
}
OSL_ENSURE( USHRT_MAX != nRet, "GetFontLeading returned USHRT_MAX" );
@@ -399,7 +399,7 @@ sal_uInt16 SwFntObj::GetFontLeading( const SwViewShell *pSh, const OutputDevice&
// pOut is the output device, not the reference device
void SwFntObj::CreateScrFont( const SwViewShell& rSh, const OutputDevice& rOut )
{
- if ( pScrFont )
+ if ( m_pScrFont )
return;
// any changes to the output device are reset at the end of the function
@@ -408,7 +408,7 @@ void SwFntObj::CreateScrFont( const SwViewShell& rSh, const OutputDevice& rOut )
// Save old font
vcl::Font aOldOutFont( pOut->GetFont() );
- nScrHeight = USHRT_MAX;
+ m_nScrHeight = USHRT_MAX;
// Condition for output font / refdev font adjustment
OutputDevice* pPrt = &rSh.GetRefDev();
@@ -417,50 +417,50 @@ void SwFntObj::CreateScrFont( const SwViewShell& rSh, const OutputDevice& rOut )
!rSh.GetViewOptions()->getBrowseMode() ||
rSh.GetViewOptions()->IsPrtFormat() )
{
- // After CreatePrtFont pPrtFont is the font which is actually used
+ // After CreatePrtFont m_pPrtFont is the font which is actually used
// by the reference device
CreatePrtFont( *pPrt );
- pPrinter = pPrt;
+ m_pPrinter = pPrt;
// save old reference device font
vcl::Font aOldPrtFnt( pPrt->GetFont() );
// set the font used at the reference device at the reference device
// and the output device
- pPrt->SetFont( *pPrtFont );
- pOut->SetFont( *pPrtFont );
+ pPrt->SetFont( *m_pPrtFont );
+ pOut->SetFont( *m_pPrtFont );
// This should be the default for pScrFont.
- pScrFont = pPrtFont;
+ m_pScrFont = m_pPrtFont;
FontMetric aMet = pPrt->GetFontMetric( );
// Don't lose "faked" properties of the logical font that don't truly
// exist in the physical font metrics which vcl which fake up for us
- aMet.SetWeight(pScrFont->GetWeight());
- aMet.SetItalic(pScrFont->GetItalic());
+ aMet.SetWeight(m_pScrFont->GetWeight());
+ aMet.SetItalic(m_pScrFont->GetItalic());
- bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet();
+ m_bSymbol = RTL_TEXTENCODING_SYMBOL == aMet.GetCharSet();
- if ( USHRT_MAX == nGuessedLeading )
+ if ( USHRT_MAX == m_nGuessedLeading )
GuessLeading( rSh, aMet );
- if ( USHRT_MAX == nExtLeading )
- nExtLeading = static_cast<sal_uInt16>(aMet.GetExternalLeading());
+ if ( USHRT_MAX == m_nExtLeading )
+ m_nExtLeading = static_cast<sal_uInt16>(aMet.GetExternalLeading());
// reset the original reference device font
pPrt->SetFont( aOldPrtFnt );
}
else
{
- bSymbol = RTL_TEXTENCODING_SYMBOL == aFont.GetCharSet();
- if ( nGuessedLeading == USHRT_MAX )
- nGuessedLeading = 0;
+ m_bSymbol = RTL_TEXTENCODING_SYMBOL == m_aFont.GetCharSet();
+ if ( m_nGuessedLeading == USHRT_MAX )
+ m_nGuessedLeading = 0;
// no external leading in browse mode
- if ( nExtLeading == USHRT_MAX )
- nExtLeading = 0;
+ if ( m_nExtLeading == USHRT_MAX )
+ m_nExtLeading = 0;
- pScrFont = pPrtFont;
+ m_pScrFont = m_pPrtFont;
}
// check zoom factor, e.g. because of PrtOle2 during export
@@ -478,13 +478,13 @@ void SwFntObj::CreateScrFont( const SwViewShell& rSh, const OutputDevice& rOut )
}
else
nTmp = 0;
- if( nTmp != nZoom )
- nZoom = USHRT_MAX - 1;
+ if( nTmp != m_nZoom )
+ m_nZoom = USHRT_MAX - 1;
}
- nScrAscent = (sal_uInt16)pOut->GetFontMetric().GetAscent();
- if ( USHRT_MAX == nScrHeight )
- nScrHeight = (sal_uInt16)pOut->GetTextHeight();
+ m_nScrAscent = (sal_uInt16)pOut->GetFontMetric().GetAscent();
+ if ( USHRT_MAX == m_nScrHeight )
+ m_nScrHeight = (sal_uInt16)pOut->GetTextHeight();
// reset original output device font
pOut->SetFont( aOldOutFont );
@@ -500,7 +500,7 @@ void SwFntObj::GuessLeading( const SwViewShell&
// Nothing has to be done.
if ( rMet.GetInternalLeading() >= 5 )
{
- nGuessedLeading = 0;
+ m_nGuessedLeading = 0;
return;
}
@@ -514,10 +514,10 @@ void SwFntObj::GuessLeading( const SwViewShell&
MapMode aOldMap = pWin->GetMapMode( );
pWin->SetMapMode( aTmpMap );
const vcl::Font aOldFnt( pWin->GetFont() );
- pWin->SetFont( *pPrtFont );
+ pWin->SetFont( *m_pPrtFont );
const FontMetric aWinMet( pWin->GetFontMetric() );
const sal_uInt16 nWinHeight = sal_uInt16( aWinMet.GetFontSize().Height() );
- if( pPrtFont->GetFamilyName().indexOf( aWinMet.GetFamilyName() ) != -1 )
+ if( m_pPrtFont->GetFamilyName().indexOf( aWinMet.GetFamilyName() ) != -1 )
{
// If the Leading on the Window is also 0, then it has to stay
// that way (see also StarMath).
@@ -527,13 +527,13 @@ void SwFntObj::GuessLeading( const SwViewShell&
pWin->SetFont( rMet );
nTmpLeading = (long)pWin->GetFontMetric().GetInternalLeading();
if( nTmpLeading < 0 )
- nGuessedLeading = 0;
+ m_nGuessedLeading = 0;
else
- nGuessedLeading = sal_uInt16(nTmpLeading);
+ m_nGuessedLeading = sal_uInt16(nTmpLeading);
}
else
{
- nGuessedLeading = sal_uInt16(nTmpLeading);
+ m_nGuessedLeading = sal_uInt16(nTmpLeading);
// Manta-Hack #50153#:
// Wer beim Leading luegt, luegt moeglicherweise auch beim
// Ascent/Descent, deshalb wird hier ggf. der Font ein wenig
@@ -546,9 +546,9 @@ void SwFntObj::GuessLeading( const SwViewShell&
aWinMet.GetAscent() - rMet.GetAscent() - nTmpLeading );
if( nDiff > 0 )
{
- OSL_ENSURE( nPrtAscent < USHRT_MAX, "GuessLeading: PrtAscent-Fault" );
- if ( nPrtAscent < USHRT_MAX )
- nPrtAscent = nPrtAscent + (sal_uInt16)(( 2 * nDiff ) / 5);
+ OSL_ENSURE( m_nPrtAscent < USHRT_MAX, "GuessLeading: PrtAscent-Fault" );
+ if ( m_nPrtAscent < USHRT_MAX )
+ m_nPrtAscent = m_nPrtAscent + (sal_uInt16)(( 2 * nDiff ) / 5);
}
}
}
@@ -556,14 +556,14 @@ void SwFntObj::GuessLeading( const SwViewShell&
{
// If all else fails, take 15% of the height, as empirically
// determined by CL
- nGuessedLeading = (nWinHeight * 15) / 100;
+ m_nGuessedLeading = (nWinHeight * 15) / 100;
}
pWin->SetFont( aOldFnt );
pWin->SetMapMode( aOldMap );
}
else
#endif
- nGuessedLeading = 0;
+ m_nGuessedLeading = 0;
}
// Set the font at the given output device; for screens it may be
@@ -576,15 +576,15 @@ void SwFntObj::SetDevFont( const SwViewShell *pSh, OutputDevice& rOut )
{
CreateScrFont( *pSh, rOut );
if( !GetScrFont()->IsSameInstance( rOut.GetFont() ) )
- rOut.SetFont( *pScrFont );
- if( pPrinter && ( !pPrtFont->IsSameInstance( pPrinter->GetFont() ) ) )
- pPrinter->SetFont( *pPrtFont );
+ rOut.SetFont( *m_pScrFont );
+ if( m_pPrinter && ( !m_pPrtFont->IsSameInstance( m_pPrinter->GetFont() ) ) )
+ m_pPrinter->SetFont( *m_pPrtFont );
}
else
{
CreatePrtFont( rOut );
- if( !pPrtFont->IsSameInstance( rOut.GetFont() ) )
- rOut.SetFont( *pPrtFont );
+ if( !m_pPrtFont->IsSameInstance( rOut.GetFont() ) )
+ rOut.SetFont( *m_pPrtFont );
}
// Here, we actually do not need the leading values, but by calling
@@ -783,7 +783,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
const bool bUseScrFont =
lcl_IsFontAdjustNecessary( rInf.GetOut(), rRefDev );
- vcl::Font* pTmpFont = bUseScrFont ? pScrFont : pPrtFont;
+ vcl::Font* pTmpFont = bUseScrFont ? m_pScrFont : m_pPrtFont;
// bDirectPrint and bUseScrFont should have these values:
@@ -868,7 +868,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// robust: better use the printer font instead of using no font at all
OSL_ENSURE( pTmpFont, "No screen or printer font?" );
if ( ! pTmpFont )
- pTmpFont = pPrtFont;
+ pTmpFont = m_pPrtFont;
// HACK: LINESTYLE_WAVE must not be abused any more, hence the grey wave
// line of the ExtendedAttributeSets will appear in the font color first
@@ -881,10 +881,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
( ComplexTextLayoutFlags::Default != ( ComplexTextLayoutFlags::BiDiRtl & nMode ) ) );
// be sure to have the correct layout mode at the printer
- if ( pPrinter )
+ if ( m_pPrinter )
{
- pPrinter->SetLayoutMode( rInf.GetOut().GetLayoutMode() );
- pPrinter->SetDigitLanguage( rInf.GetOut().GetDigitLanguage() );
+ m_pPrinter->SetLayoutMode( rInf.GetOut().GetLayoutMode() );
+ m_pPrinter->SetDigitLanguage( rInf.GetOut().GetDigitLanguage() );
}
Point aTextOriginPos( rInf.GetPos() );
@@ -929,8 +929,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// kerning array - gives the absolute position of end of each character
long* pKernArray = new long[rInf.GetLen()];
- if ( pPrinter )
- pPrinter->GetTextArray( rInf.GetText(), pKernArray,
+ if ( m_pPrinter )
+ m_pPrinter->GetTextArray( rInf.GetText(), pKernArray,
rInf.GetIdx(), rInf.GetLen() );
else
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray,
@@ -1038,8 +1038,8 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
long* pKernArray = new long[rInf.GetLen()];
- if ( pPrinter )
- pPrinter->GetTextArray( rInf.GetText(), pKernArray,
+ if ( m_pPrinter )
+ m_pPrinter->GetTextArray( rInf.GetText(), pKernArray,
rInf.GetIdx(), rInf.GetLen() );
else
rInf.GetOut().GetTextArray( rInf.GetText(), pKernArray,
@@ -1060,7 +1060,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
lcl_IsMonoSpaceFont( *(rInf.GetpOut()) ) )
{
pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(),
- rInf.GetKanaComp(), (sal_uInt16)aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ) , &aTextOriginPos );
+ rInf.GetKanaComp(), (sal_uInt16)m_aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ) , &aTextOriginPos );
bSpecialJust = true;
}
///Asian Justification
@@ -1095,7 +1095,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
}
///With through/uderstr. Grouped style requires a blank at the end
///of a text edition special measures:
- if( bPaintBlank && rInf.GetLen() && (CH_BLANK ==
+ if( m_bPaintBlank && rInf.GetLen() && (CH_BLANK ==
rInf.GetText()[ rInf.GetIdx() + rInf.GetLen() - 1 ] ) )
{
///If it concerns a singular, underlined space acts,
@@ -1231,7 +1231,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
{
pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(),
rInf.GetKanaComp(),
- (sal_uInt16)aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTextOriginPos );
+ (sal_uInt16)m_aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTextOriginPos );
bSpecialJust = true;
}
@@ -1292,7 +1292,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
long nKernSum = rInf.GetKern();
- if ( bStretch || bPaintBlank || rInf.GetKern() || bSpecialJust )
+ if ( bStretch || m_bPaintBlank || rInf.GetKern() || bSpecialJust )
{
for( sal_Int32 i = 0; i < rInf.GetLen(); i++,
nKernSum += rInf.GetKern() )
@@ -1304,7 +1304,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// In case of underlined/strike-through justified text
// a blank at the end requires special handling:
- if( bPaintBlank && rInf.GetLen() && ( CH_BLANK ==
+ if( m_bPaintBlank && rInf.GetLen() && ( CH_BLANK ==
rInf.GetText()[ rInf.GetIdx()+rInf.GetLen()-1 ] ) )
{
// If it is a single underlined space, output 2 spaces:
@@ -1393,7 +1393,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
OUString aBulletOverlay;
#endif
bool bBullet = rInf.GetBullet();
- if( bSymbol )
+ if( m_bSymbol )
bBullet = false;
long* pKernArray = new long[ rInf.GetLen() ];
CreateScrFont( *rInf.GetShell(), rInf.GetOut() );
@@ -1406,15 +1406,15 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// OLE: no printer available
// OSL_ENSURE( pPrinter, "DrawText needs pPrinter" )
- if ( pPrinter )
+ if ( m_pPrinter )
{
// pTmpFont has already been set as current font for rInf.GetOut()
- if ( pPrinter.get() != rInf.GetpOut() || pTmpFont != pPrtFont )
+ if ( m_pPrinter.get() != rInf.GetpOut() || pTmpFont != m_pPrtFont )
{
- if( !pPrtFont->IsSameInstance( pPrinter->GetFont() ) )
- pPrinter->SetFont( *pPrtFont );
+ if( !m_pPrtFont->IsSameInstance( m_pPrinter->GetFont() ) )
+ m_pPrinter->SetFont( *m_pPrtFont );
}
- pPrinter->GetTextArray( rInf.GetText(), pKernArray, rInf.GetIdx(),
+ m_pPrinter->GetTextArray( rInf.GetText(), pKernArray, rInf.GetIdx(),
rInf.GetLen() );
}
else
@@ -1441,10 +1441,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
Point aTmpPos( aTextOriginPos );
pSI->Compress( pScrArray, rInf.GetIdx(), rInf.GetLen(),
rInf.GetKanaComp(),
- (sal_uInt16)aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTmpPos );
+ (sal_uInt16)m_aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTmpPos );
pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(),
rInf.GetKanaComp(),
- (sal_uInt16)aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTextOriginPos );
+ (sal_uInt16)m_aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTextOriginPos );
}
// Asian Justification
@@ -1582,7 +1582,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// In case of Pair Kerning the printer influence on the positioning
// grows
- const int nMul = pPrtFont->GetKerning() != FontKerning::NONE ? 1 : 3;
+ const int nMul = m_pPrtFont->GetKerning() != FontKerning::NONE ? 1 : 3;
const int nDiv = nMul+1;
// nSpaceSum contains the sum of the intermediate space distributed
@@ -1597,7 +1597,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// the underline/strike-through would have gaps.
long nSpaceSum = 0;
// in word line mode and for Arabic, we disable the half space trick:
- const long nHalfSpace = pPrtFont->IsWordLineMode() || bNoHalfSpace ? 0 : nSpaceAdd / 2;
+ const long nHalfSpace = m_pPrtFont->IsWordLineMode() || bNoHalfSpace ? 0 : nSpaceAdd / 2;
const long nOtherHalf = nSpaceAdd - nHalfSpace;
if ( nSpaceAdd && ( cChPrev == CH_BLANK ) )
nSpaceSum = nHalfSpace;
@@ -1646,7 +1646,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// ends with a blank, the full nSpaceAdd value has been added to the character in
// front of the blank. This leads to painting artifacts, therefore we remove the
// nSpaceAdd value again:
- if ( (bNoHalfSpace || pPrtFont->IsWordLineMode()) && i+1 == nCnt && nCh == CH_BLANK )
+ if ( (bNoHalfSpace || m_pPrtFont->IsWordLineMode()) && i+1 == nCnt && nCh == CH_BLANK )
pKernArray[i-1] = pKernArray[i-1] - nSpaceAdd;
}
@@ -1658,7 +1658,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
if( rInf.GetLen() )
{
long nHght = rInf.GetOut().LogicToPixel(
- pPrtFont->GetFontSize() ).Height();
+ m_pPrtFont->GetFontSize() ).Height();
if( WRONG_SHOW_MIN < nHght )
{
if ( rInf.GetOut().GetConnectMetaFile() )
@@ -1721,7 +1721,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
}
}
}
- else if( !bSymbol && rInf.GetLen() )
+ else if( !m_bSymbol && rInf.GetLen() )
{
// anything to do?
if (rInf.GetWrong() || rInf.GetGrammarCheck() || rInf.GetSmartTags())
@@ -1737,9 +1737,9 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf )
// draw them BEFORE the grammar check lines to 'override' the latter in case of conflict.
// reason: some grammar errors can only be found if spelling errors are fixed,
// therefore we don't want the user to miss a spelling error.
- lcl_DrawLineForWrongListData( aForbidden, rInf, rInf.GetWrong(), aCalcLinePosData, pPrtFont->GetFontSize() );
+ lcl_DrawLineForWrongListData( aForbidden, rInf, rInf.GetWrong(), aCalcLinePosData, m_pPrtFont->GetFontSize() );
// draw wave line for grammar check errors
- lcl_DrawLineForWrongListData( aForbidden, rInf, rInf.GetGrammarCheck(), aCalcLinePosData, pPrtFont->GetFontSize() );
+ lcl_DrawLineForWrongListData( aForbidden, rInf, rInf.GetGrammarCheck(), aCalcLinePosData, m_pPrtFont->GetFontSize() );
}
}
@@ -1828,10 +1828,10 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
rInf.GetText().getLength();
// be sure to have the correct layout mode at the printer
- if ( pPrinter )
+ if ( m_pPrinter )
{
- pPrinter->SetLayoutMode( rInf.GetOut().GetLayoutMode() );
- pPrinter->SetDigitLanguage( rInf.GetOut().GetDigitLanguage() );
+ m_pPrinter->SetLayoutMode( rInf.GetOut().GetLayoutMode() );
+ m_pPrinter->SetDigitLanguage( rInf.GetOut().GetDigitLanguage() );
}
if ( rInf.GetFrame() && nLn && rInf.SnapToGrid() && rInf.GetFont() &&
@@ -1845,11 +1845,11 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
OutputDevice* pOutDev;
- if ( pPrinter )
+ if ( m_pPrinter )
{
- if( !pPrtFont->IsSameInstance( pPrinter->GetFont() ) )
- pPrinter->SetFont(*pPrtFont);
- pOutDev = pPrinter;
+ if( !m_pPrtFont->IsSameInstance( m_pPrinter->GetFont() ) )
+ m_pPrinter->SetFont(*m_pPrtFont);
+ pOutDev = m_pPrinter;
}
else
pOutDev = rInf.GetpOut();
@@ -1884,11 +1884,11 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
{
const long nGridWidthAdd = EvalGridWidthAdd( pGrid, rInf );
OutputDevice* pOutDev;
- if ( pPrinter )
+ if ( m_pPrinter )
{
- if( !pPrtFont->IsSameInstance( pPrinter->GetFont() ) )
- pPrinter->SetFont(*pPrtFont);
- pOutDev = pPrinter;
+ if( !m_pPrtFont->IsSameInstance( m_pPrinter->GetFont() ) )
+ m_pPrinter->SetFont(*m_pPrtFont);
+ pOutDev = m_pPrinter;
}
else
pOutDev = rInf.GetpOut();
@@ -1916,24 +1916,24 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
// This is the part used e.g., for cursor travelling
// See condition for DrawText or DrawTextArray (bDirectPrint)
- if ( pPrinter && pPrinter.get() != rInf.GetpOut() )
+ if ( m_pPrinter && m_pPrinter.get() != rInf.GetpOut() )
{
- if( !pPrtFont->IsSameInstance( pPrinter->GetFont() ) )
- pPrinter->SetFont(*pPrtFont);
- aTextSize.Width() = pPrinter->GetTextWidth( rInf.GetText(),
+ if( !m_pPrtFont->IsSameInstance( m_pPrinter->GetFont() ) )
+ m_pPrinter->SetFont(*m_pPrtFont);
+ aTextSize.Width() = m_pPrinter->GetTextWidth( rInf.GetText(),
rInf.GetIdx(), nLn );
- aTextSize.Height() = pPrinter->GetTextHeight();
+ aTextSize.Height() = m_pPrinter->GetTextHeight();
long* pKernArray = new long[nLn];
CreateScrFont( *rInf.GetShell(), rInf.GetOut() );
if( !GetScrFont()->IsSameInstance( rInf.GetOut().GetFont() ) )
- rInf.GetOut().SetFont( *pScrFont );
+ rInf.GetOut().SetFont( *m_pScrFont );
long nScrPos;
- pPrinter->GetTextArray( rInf.GetText(), pKernArray, rInf.GetIdx(),nLn );
+ m_pPrinter->GetTextArray( rInf.GetText(), pKernArray, rInf.GetIdx(),nLn );
if( bCompress )
rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( pKernArray,
rInf.GetIdx(), nLn, rInf.GetKanaComp(),
- (sal_uInt16)aFont.GetFontSize().Height() ,lcl_IsFullstopCentered( rInf.GetOut() ) ) );
+ (sal_uInt16)m_aFont.GetFontSize().Height() ,lcl_IsFullstopCentered( rInf.GetOut() ) ) );
else
rInf.SetKanaDiff( 0 );
@@ -1957,7 +1957,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
// In case of Pair Kerning the printer influence on the positioning
// grows
- const int nMul = pPrtFont->GetKerning() != FontKerning::NONE ? 1 : 3;
+ const int nMul = m_pPrtFont->GetKerning() != FontKerning::NONE ? 1 : 3;
const int nDiv = nMul+1;
for( sal_Int32 i = 1; i<nCnt; i++ )
{
@@ -1987,8 +1987,8 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
}
else
{
- if( !pPrtFont->IsSameInstance( rInf.GetOut().GetFont() ) )
- rInf.GetOut().SetFont( *pPrtFont );
+ if( !m_pPrtFont->IsSameInstance( rInf.GetOut().GetFont() ) )
+ rInf.GetOut().SetFont( *m_pPrtFont );
if( bCompress )
{
long* pKernArray = new long[nLn];
@@ -1996,7 +1996,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
rInf.GetIdx(), nLn );
rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( pKernArray,
rInf.GetIdx(), nLn, rInf.GetKanaComp(),
- (sal_uInt16) aFont.GetFontSize().Height() ,lcl_IsFullstopCentered( rInf.GetOut() ) ) );
+ (sal_uInt16) m_aFont.GetFontSize().Height() ,lcl_IsFullstopCentered( rInf.GetOut() ) ) );
aTextSize.Width() = pKernArray[ nLn - 1 ];
delete[] pKernArray;
}
@@ -2033,11 +2033,11 @@ sal_Int32 SwFntObj::GetCursorOfst( SwDrawTextInfo &rInf )
long* pKernArray = new long[ rInf.GetLen() ];
// be sure to have the correct layout mode at the printer
- if ( pPrinter )
+ if ( m_pPrinter )
{
- pPrinter->SetLayoutMode( rInf.GetOut().GetLayoutMode() );
- pPrinter->SetDigitLanguage( rInf.GetOut().GetDigitLanguage() );
- pPrinter->GetTextArray( rInf.GetText(), pKernArray,
+ m_pPrinter->SetLayoutMode( rInf.GetOut().GetLayoutMode() );
+ m_pPrinter->SetDigitLanguage( rInf.GetOut().GetDigitLanguage() );
+ m_pPrinter->GetTextArray( rInf.GetText(), pKernArray,
rInf.GetIdx(), rInf.GetLen() );
}
else
@@ -2056,7 +2056,7 @@ sal_Int32 SwFntObj::GetCursorOfst( SwDrawTextInfo &rInf )
{
pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(),
rInf.GetKanaComp(),
- (sal_uInt16) aFont.GetFontSize().Height(),
+ (sal_uInt16) m_aFont.GetFontSize().Height(),
lcl_IsFullstopCentered( rInf.GetOut() ) );
}
@@ -2258,7 +2258,7 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
{
pFntObj = Get();
if ( ( pFntObj->GetZoom( ) == nZoom ) &&
- ( pFntObj->pPrinter == pOut ) &&
+ ( pFntObj->m_pPrinter == pOut ) &&
pFntObj->GetPropWidth() ==
static_cast<SwSubFont const *>(pOwn)->GetPropWidth() )
{
@@ -2271,20 +2271,20 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
// Search by font comparison, quite expensive!
// Look for same font and same printer
pFntObj = pFntCache->First();
- while ( pFntObj && !( pFntObj->aFont == *static_cast<vcl::Font const *>(pOwn) &&
+ while ( pFntObj && !( pFntObj->m_aFont == *static_cast<vcl::Font const *>(pOwn) &&
pFntObj->GetZoom() == nZoom &&
pFntObj->GetPropWidth() ==
static_cast<SwSubFont const *>(pOwn)->GetPropWidth() &&
- ( !pFntObj->pPrinter || pFntObj->pPrinter == pOut ) ) )
+ ( !pFntObj->m_pPrinter || pFntObj->m_pPrinter == pOut ) ) )
pFntObj = SwFntCache::Next( pFntObj );
- if( pFntObj && pFntObj->pPrinter.get() != pOut )
+ if( pFntObj && pFntObj->m_pPrinter.get() != pOut )
{
// found one without printer, let's see if there is one with
// the same printer as well
SwFntObj *pTmpObj = pFntObj;
- while( pTmpObj && !( pTmpObj->aFont == *static_cast<vcl::Font const *>(pOwn) &&
- pTmpObj->GetZoom()==nZoom && pTmpObj->pPrinter==pOut &&
+ while( pTmpObj && !( pTmpObj->m_aFont == *static_cast<vcl::Font const *>(pOwn) &&
+ pTmpObj->GetZoom()==nZoom && pTmpObj->m_pPrinter==pOut &&
pTmpObj->GetPropWidth() ==
static_cast<SwSubFont const *>(pOwn)->GetPropWidth() ) )
pTmpObj = SwFntCache::Next( pTmpObj );
@@ -2303,16 +2303,16 @@ SwFntAccess::SwFntAccess( const void* &rMagic,
else // Font has been found, so we lock it.
{
pFntObj->Lock();
- if (pFntObj->pPrinter.get() != pOut) // if no printer is known by now
+ if (pFntObj->m_pPrinter.get() != pOut) // if no printer is known by now
{
- OSL_ENSURE( !pFntObj->pPrinter, "SwFntAccess: Printer Changed" );
+ OSL_ENSURE( !pFntObj->m_pPrinter, "SwFntAccess: Printer Changed" );
pFntObj->CreatePrtFont( *pOut );
- pFntObj->pPrinter = pOut;
- pFntObj->pScrFont = nullptr;
- pFntObj->nGuessedLeading = USHRT_MAX;
- pFntObj->nExtLeading = USHRT_MAX;
- pFntObj->nPrtAscent = USHRT_MAX;
- pFntObj->nPrtHeight = USHRT_MAX;
+ pFntObj->m_pPrinter = pOut;
+ pFntObj->m_pScrFont = nullptr;
+ pFntObj->m_nGuessedLeading = USHRT_MAX;
+ pFntObj->m_nExtLeading = USHRT_MAX;
+ pFntObj->m_nPrtAscent = USHRT_MAX;
+ pFntObj->m_nPrtHeight = USHRT_MAX;
}
m_pObj = pFntObj;
}
More information about the Libreoffice-commits
mailing list