these can be const

This commit is contained in:
Caolán McNamara
2011-10-16 14:20:46 +01:00
parent e748b09663
commit bf939922f0
3 changed files with 9 additions and 9 deletions

View File

@@ -104,7 +104,7 @@ public:
Size GetPhysTxtSize( const OutputDevice *pOut, const String &rTxt );
Size GetTxtSize( const OutputDevice *pOut, const String &rTxt,
const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN );
const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN ) const;
void DrawText( OutputDevice *pOut, const Point &rPos, const String &rTxt,
const sal_uInt16 nIdx = 0, const sal_uInt16 nLen = STRING_LEN ) const;

View File

@@ -463,7 +463,7 @@ Size SvxFont::QuickGetTextSize( const OutputDevice *pOut, const XubString &rTxt,
Size SvxFont::GetTxtSize( const OutputDevice *pOut, const XubString &rTxt,
const xub_StrLen nIdx, const xub_StrLen nLen )
const xub_StrLen nIdx, const xub_StrLen nLen ) const
{
xub_StrLen nTmp = nLen;
if ( nTmp == STRING_LEN ) // already initialized?

View File

@@ -115,7 +115,7 @@ namespace
_rFont.SetSize( aSize );
}
// -----------------------------------------------------------------------
void calcFontHeightAnyAscent(OutputDevice* _pWin,Font& _rFont,long& _nHeight,long& _nAscent)
void calcFontHeightAnyAscent(OutputDevice* _pWin,const Font& _rFont,long& _nHeight,long& _nAscent)
{
if ( !_nHeight )
{
@@ -202,8 +202,8 @@ public:
}
void CheckScript();
Size CalcTextSize( OutputDevice* pWin, OutputDevice* pPrt, SvxFont &rFont );
void DrawPrev( OutputDevice* pWin, Printer* pPrt, Point &rPt, SvxFont &rFont );
Size CalcTextSize( OutputDevice* pWin, OutputDevice* pPrt, const SvxFont &rFont );
void DrawPrev( OutputDevice* pWin, Printer* pPrt, Point &rPt, const SvxFont &rFont );
sal_Bool SetFontWidthScale( sal_uInt16 nScaleInPercent );
inline void Invalidate100PercentFontWidth();
@@ -315,7 +315,7 @@ void FontPrevWin_Impl::_CheckScript()
*/
Size FontPrevWin_Impl::CalcTextSize( OutputDevice* pWin, OutputDevice* _pPrinter,
SvxFont &rFont )
const SvxFont &rFont )
{
sal_uInt16 nScript;
sal_uInt16 nIdx = 0;
@@ -341,7 +341,7 @@ Size FontPrevWin_Impl::CalcTextSize( OutputDevice* pWin, OutputDevice* _pPrinter
long nCTLAscent = 0;
do
{
SvxFont& rFnt = (nScript==com::sun::star::i18n::ScriptType::ASIAN) ? aCJKFont : ((nScript==com::sun::star::i18n::ScriptType::COMPLEX) ? aCTLFont : rFont);
const SvxFont& rFnt = (nScript==com::sun::star::i18n::ScriptType::ASIAN) ? aCJKFont : ((nScript==com::sun::star::i18n::ScriptType::COMPLEX) ? aCTLFont : rFont);
sal_uIntPtr nWidth = rFnt.GetTxtSize( _pPrinter, aText, nStart, nEnd-nStart ).
Width();
aTextWidth[ nIdx++ ] = nWidth;
@@ -393,7 +393,7 @@ Size FontPrevWin_Impl::CalcTextSize( OutputDevice* pWin, OutputDevice* _pPrinter
*/
void FontPrevWin_Impl::DrawPrev( OutputDevice* pWin, Printer* _pPrinter,
Point &rPt, SvxFont &rFont )
Point &rPt, const SvxFont &rFont )
{
Font aOldFont = _pPrinter->GetFont();
sal_uInt16 nScript;
@@ -413,7 +413,7 @@ void FontPrevWin_Impl::DrawPrev( OutputDevice* pWin, Printer* _pPrinter,
}
do
{
SvxFont& rFnt = (nScript==com::sun::star::i18n::ScriptType::ASIAN) ? aCJKFont : ((nScript==com::sun::star::i18n::ScriptType::COMPLEX) ? aCTLFont : rFont);
const SvxFont& rFnt = (nScript==com::sun::star::i18n::ScriptType::ASIAN) ? aCJKFont : ((nScript==com::sun::star::i18n::ScriptType::COMPLEX) ? aCTLFont : rFont);
_pPrinter->SetFont( rFnt );
rFnt.DrawPrev( pWin, _pPrinter, rPt, aText, nStart, nEnd - nStart );