From 60e78fbb806bb45e635ba1de45ceffe187938ac0 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 16 Sep 2014 10:09:58 +0200 Subject: fdo#82577: Handle Font Put the VCL Font class in the vcl namespace. Avoids clash with the X11 Font typedef. Change-Id: I1a84f7cad8b31697b9860a3418f7dff794ff6537 --- sw/source/ui/chrdlg/drpcps.cxx | 10 +++++----- sw/source/ui/config/optload.cxx | 2 +- sw/source/ui/config/optpage.cxx | 10 +++++----- sw/source/ui/dialog/ascfldlg.cxx | 2 +- sw/source/ui/envelp/labfmt.cxx | 6 +++--- sw/source/ui/fldui/inpdlg.cxx | 2 +- sw/source/ui/fldui/javaedit.cxx | 2 +- sw/source/ui/misc/insfnote.cxx | 4 ++-- sw/source/ui/misc/outline.cxx | 4 ++-- sw/source/ui/table/tautofmt.cxx | 12 ++++++------ 10 files changed, 27 insertions(+), 27 deletions(-) (limited to 'sw/source/ui') diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index cb3bbe40050f..8a6b14a84a26 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -95,7 +95,7 @@ class SwDropCapsPict : public Control Size CalcTextSize( void ); inline void InitPrinter( void ); void _InitPrinter( void ); - void GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, sal_uInt16 _nWhich ); + void GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _rFont, sal_uInt16 _nWhich ); void GetFirstScriptSegment(sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType); bool GetNextScriptSegment(size_t &nIdx, sal_Int32 &start, sal_Int32 &end, sal_uInt16 &scriptType); @@ -188,7 +188,7 @@ OUString GetDefaultString(sal_uInt16 nChars) return aStr; } -static void calcFontHeightAnyAscent( OutputDevice* _pWin, Font& _rFont, long& _nHeight, long& _nAscent ) +static void calcFontHeightAnyAscent( OutputDevice* _pWin, vcl::Font& _rFont, long& _nHeight, long& _nAscent ) { if ( !_nHeight ) { @@ -243,7 +243,7 @@ bool SwDropCapsPict::GetNextScriptSegment(size_t &nIdx, sal_Int32 &start, sal_In #define LINES 10 #define BORDER 2 -void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, Font& _rFont, sal_uInt16 _nWhich ) +void SwDropCapsPict::GetFontSettings( const SwDropCapsPage& _rPage, vcl::Font& _rFont, sal_uInt16 _nWhich ) { SfxItemSet aSet( _rPage.rSh.GetAttrPool(), _nWhich, _nWhich); _rPage.rSh.GetCurAttr(aSet); @@ -264,7 +264,7 @@ void SwDropCapsPict::UpdatePaintSettings( void ) mnTotLineH = (GetOutputSizePixel().Height() - 2 * BORDER) / LINES; mnLineH = mnTotLineH - 2; - Font aFont; + vcl::Font aFont; if (mpPage) { if (!mpPage->m_pTemplateBox->GetSelectEntryPos()) @@ -380,7 +380,7 @@ void SwDropCapsPict::DrawPrev( const Point& rPt ) Point aPt(rPt); InitPrinter(); - Font aOldFont = mpPrinter->GetFont(); + vcl::Font aOldFont = mpPrinter->GetFont(); sal_uInt16 nScript; size_t nIdx = 0; sal_Int32 nStart; diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 4444efccbdb5..564ed0aeab88 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -382,7 +382,7 @@ void SwCaptionPreview::Init() SetFillColor( aBack.GetColor() ); SetLineColor( aBack.GetColor() ); SetBorderStyle( WINDOW_BORDER_MONO ); - Font aFont(GetFont()); + vcl::Font aFont(GetFont()); aFont.SetHeight(aFont.GetHeight() * 120 / 100 ); SetFont(aFont); } diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index b642e6a5228f..5507ebf11137 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -597,7 +597,7 @@ static void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType, SfxPrinter* pPrt, const OUString& rStyle, sal_uInt16 nFontWhich) { - Font aFont( rStyle, Size( 0, 10 ) ); + vcl::Font aFont( rStyle, Size( 0, 10 ) ); if( pPrt ) aFont = pPrt->GetFontMetric( aFont ); SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType); @@ -676,7 +676,7 @@ bool SwStdFontTabPage::FillItemSet( SfxItemSet* ) FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE); if(sStandard != sShellStd) { - Font aFont( sStandard, Size( 0, 10 ) ); + vcl::Font aFont( sStandard, Size( 0, 10 ) ); if( pPrinter ) aFont = pPrinter->GetFontMetric( aFont ); pWrtShell->SetDefault(SvxFontItem(aFont.GetFamily(), aFont.GetName(), @@ -2169,11 +2169,11 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin) SvxFont& rCJKFont = rExampleWin.GetCJKFont(); SvxFont& rCTLFont = rExampleWin.GetCTLFont(); - Font aFont( OutputDevice::GetDefaultFont( DEFAULTFONT_SERIF, eLangType, + vcl::Font aFont( OutputDevice::GetDefaultFont( DEFAULTFONT_SERIF, eLangType, DEFAULTFONT_FLAGS_ONLYONE, &rExampleWin ) ); - Font aCJKFont( OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_TEXT, eLangType, + vcl::Font aCJKFont( OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_TEXT, eLangType, DEFAULTFONT_FLAGS_ONLYONE, &rExampleWin ) ); - Font aCTLFont( OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_TEXT, eLangType, + vcl::Font aCTLFont( OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_TEXT, eLangType, DEFAULTFONT_FLAGS_ONLYONE, &rExampleWin ) ); const Size aDefSize( 0, 12 ); aFont.SetSize( aDefSize ); diff --git a/sw/source/ui/dialog/ascfldlg.cxx b/sw/source/ui/dialog/ascfldlg.cxx index 2e18bf360a19..5c498d4f1b3f 100644 --- a/sw/source/ui/dialog/ascfldlg.cxx +++ b/sw/source/ui/dialog/ascfldlg.cxx @@ -204,7 +204,7 @@ SwAsciiFilterDlg::SwAsciiFilterDlg( Window* pParent, SwDocShell& rDocSh, if( aOpt.GetFontName().isEmpty() ) { LanguageType eLang = aOpt.GetLanguage(); - Font aTmpFont(OutputDevice::GetDefaultFont(DEFAULTFONT_FIXED, eLang, DEFAULTFONT_FLAGS_ONLYONE, pPrt)); + vcl::Font aTmpFont(OutputDevice::GetDefaultFont(DEFAULTFONT_FIXED, eLang, DEFAULTFONT_FLAGS_ONLYONE, pPrt)); aOpt.SetFontName(aTmpFont.GetName()); } diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index dda067144928..94d61202645a 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -62,7 +62,7 @@ SwLabPreview::SwLabPreview(Window* pParent) const Color& rWinColor = rStyleSettings.GetWindowColor(); SetBackground(Wallpaper(rWinColor)); - Font aFont = GetFont(); + vcl::Font aFont = GetFont(); aFont.SetTransparent(true); aFont.SetWeight (WEIGHT_NORMAL); SetFont(aFont); @@ -106,7 +106,7 @@ void SwLabPreview::Paint(const Rectangle &) const Color& rWinColor = rStyleSettings.GetWindowColor(); const Color& rFieldTextColor = SwViewOption::GetFontColor(); - Font aFont = GetFont(); + vcl::Font aFont = GetFont(); aFont.SetFillColor( rWinColor ); aFont.SetColor(rFieldTextColor); SetFont(aFont); @@ -115,7 +115,7 @@ void SwLabPreview::Paint(const Rectangle &) SetLineColor(rWinColor); SetFillColor(aGrayColor); - Font aPaintFont(GetFont()); + vcl::Font aPaintFont(GetFont()); aPaintFont.SetTransparent(false); SetFont(aPaintFont); diff --git a/sw/source/ui/fldui/inpdlg.cxx b/sw/source/ui/fldui/inpdlg.cxx index 958748a9051f..df9f54a66968 100644 --- a/sw/source/ui/fldui/inpdlg.cxx +++ b/sw/source/ui/fldui/inpdlg.cxx @@ -46,7 +46,7 @@ SwFldInputDlg::SwFldInputDlg( Window *pParent, SwWrtShell &rS, get(m_pNextBT, "next"); get(m_pOKBT, "ok"); // switch font for Edit - Font aFont(m_pEditED->GetFont()); + vcl::Font aFont(m_pEditED->GetFont()); aFont.SetWeight(WEIGHT_LIGHT); m_pEditED->SetFont(aFont); diff --git a/sw/source/ui/fldui/javaedit.cxx b/sw/source/ui/fldui/javaedit.cxx index c9f5bc90a174..5a2c8891a7fb 100644 --- a/sw/source/ui/fldui/javaedit.cxx +++ b/sw/source/ui/fldui/javaedit.cxx @@ -69,7 +69,7 @@ SwJavaEditDialog::SwJavaEditDialog(Window* pParent, SwWrtShell* pWrtSh) : m_pEditRB->SetClickHdl(aLk); m_pUrlPB->SetClickHdl(LINK(this, SwJavaEditDialog, InsertFileHdl)); - Font aFont( m_pEditED->GetFont() ); + vcl::Font aFont( m_pEditED->GetFont() ); aFont.SetWeight( WEIGHT_LIGHT ); m_pEditED->SetFont( aFont ); diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index c96807725bff..9e9dd470d5b2 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -133,7 +133,7 @@ IMPL_LINK_NOARG(SwInsFootNoteDlg, NumberExtCharHdl) { m_aFontName = pFontItem->GetFamilyName(); eCharSet = pFontItem->GetCharSet(); - Font aFont( m_aFontName, pFontItem->GetStyleName(), m_pNumberCharEdit->GetFont().GetSize() ); + vcl::Font aFont( m_aFontName, pFontItem->GetStyleName(), m_pNumberCharEdit->GetFont().GetSize() ); aFont.SetCharSet( pFontItem->GetCharSet() ); aFont.SetPitch( pFontItem->GetPitch() ); m_pNumberCharEdit->SetFont( aFont ); @@ -214,7 +214,7 @@ void SwInsFootNoteDlg::Init() { SwFmtFtn aFtnNote; OUString sNumStr; - Font aFont; + vcl::Font aFont; bExtCharAvailable = false; rSh.StartAction(); diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 62df032ad4e7..042e0c8ea1a0 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -847,9 +847,9 @@ static long lcl_DrawBullet(VirtualDevice* pVDev, const SwNumFmt& rFmt, long nXStart, long nYStart, const Size& rSize) { - Font aTmpFont(pVDev->GetFont()); + vcl::Font aTmpFont(pVDev->GetFont()); - Font aFont(*rFmt.GetBulletFont()); + vcl::Font aFont(*rFmt.GetBulletFont()); aFont.SetSize(rSize); aFont.SetTransparent(true); pVDev->SetFont( aFont ); diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 063a37786ac2..981cc7ddbfdf 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -87,14 +87,14 @@ private: void CalcLineMap (); void PaintCells (); - sal_uInt8 GetFormatIndex( size_t nCol, size_t nRow ) const; + sal_uInt8 GetFormatIndex( size_t nCol, size_t nRow ) const; const SvxBoxItem& GetBoxItem( size_t nCol, size_t nRow ) const; void DrawString( size_t nCol, size_t nRow ); void DrawStrings(); void DrawBackground(); - void MakeFonts ( sal_uInt8 nIndex, Font& rFont, Font& rCJKFont, Font& rCTLFont ); + void MakeFonts( sal_uInt8 nIndex, vcl::Font& rFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont ); }; class SwStringInputDlg : public ModalDialog @@ -537,7 +537,7 @@ AutoFmtPreview::~AutoFmtPreview() } static void lcl_SetFontProperties( - Font& rFont, + vcl::Font& rFont, const SvxFontItem& rFontItem, const SvxWeightItem& rWeightItem, const SvxPostureItem& rPostureItem ) @@ -556,7 +556,7 @@ rFont.MethodName( Value ); \ rCJKFont.MethodName( Value ); \ rCTLFont.MethodName( Value ); -void AutoFmtPreview::MakeFonts( sal_uInt8 nIndex, Font& rFont, Font& rCJKFont, Font& rCTLFont ) +void AutoFmtPreview::MakeFonts( sal_uInt8 nIndex, vcl::Font& rFont, vcl::Font& rCJKFont, vcl::Font& rCTLFont ) { const SwBoxAutoFmt& rBoxFmt = aCurData.GetBoxFmt( nIndex ); @@ -670,7 +670,7 @@ MAKENUMSTR: cellRect.GetHeight() - FRAME_OFFSET ); if( aCurData.IsFont() ) { - Font aFont, aCJKFont, aCTLFont; + vcl::Font aFont, aCJKFont, aCTLFont; MakeFonts( nFmtIndex, aFont, aCJKFont, aCTLFont ); aScriptedText.SetFonts( &aFont, &aCJKFont, &aCTLFont ); } @@ -855,7 +855,7 @@ void AutoFmtPreview::DoPaint( const Rectangle& /*rRect*/ ) Point aCenterPos; Size theWndSize = GetSizePixel(); Color oldColor; - Font aFont; + vcl::Font aFont; aFont = aVD.GetFont(); aFont.SetTransparent( true ); -- cgit