diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-03 10:13:00 +1100 |
---|---|---|
committer | Chris Sherlock <chris.sherlock79@gmail.com> | 2016-02-04 03:17:26 +0000 |
commit | 697d445ed0c7b60e463243db89af32e2145b475b (patch) | |
tree | 5a74d57cdc97f82bc78a686dee345a229a082a72 /sw/source | |
parent | 91a7580e03d5b47c6e2513afce85ddee45e730b6 (diff) |
vcl: take into account the font width is the average font width
I'm changing the Font class function names:
- SetSize -> SetFontSize
- GetSize -> GetFontSize
- SetHeight -> SetFontHeight
- GetHeight -> GetFontHeight
- SetWidth -> SetAverageFontWidth
- GetWidth -> GetAverageFontWidth
That's because it really makes no sense to say that there is a
single constant font width because obviously proportional fonts
don't have one - the best we can do is an average font width,
which is what folks like Microsoft sort of do already. On a fixed
font, the average is still accurate, for obvious reasons :-)
I'm also not a fan of GetSize/SetSize as I find it a might too
generic.
Change-Id: Ib80a604ba62d6883fd6cbc7994da763976be5c70
Reviewed-on: https://gerrit.libreoffice.org/22069
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Chris Sherlock <chris.sherlock79@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/inc/swfont.hxx | 10 | ||||
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/text/porfld.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/txtnode/fntcache.cxx | 26 | ||||
-rw-r--r-- | sw/source/core/txtnode/swfont.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 2 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par3.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/chrdlg/drpcps.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/config/optload.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/config/optpage.cxx | 10 | ||||
-rw-r--r-- | sw/source/ui/misc/insfnote.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/misc/outline.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/table/tautofmt.cxx | 18 | ||||
-rw-r--r-- | sw/source/uibase/docvw/AnnotationMenuButton.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/docvw/SidebarWin.cxx | 12 | ||||
-rw-r--r-- | sw/source/uibase/docvw/srcedtw.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/sidebar/StylePresetsPanel.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/uiview/srcview.cxx | 4 |
18 files changed, 66 insertions, 66 deletions
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx index 5df3acf3b48f..e5608e5d65c7 100644 --- a/sw/source/core/inc/swfont.hxx +++ b/sw/source/core/inc/swfont.hxx @@ -280,7 +280,7 @@ public: sal_uInt8 GetPropr() const { return m_aSub[m_nActual].GetPropr(); } FontItalic GetItalic() const { return m_aSub[m_nActual].GetItalic(); } LanguageType GetLanguage() const { return m_aSub[m_nActual].GetLanguage(); } - long GetHeight() const { return m_aSub[m_nActual].GetSize().Height(); } + long GetHeight() const { return m_aSub[m_nActual].GetFontSize().Height(); } FontWeight GetWeight() const { return m_aSub[m_nActual].GetWeight(); } FontEmphasisMark GetEmphasisMark() const { return m_aSub[m_nActual].GetEmphasisMark(); } @@ -293,7 +293,7 @@ public: inline rtl_TextEncoding GetCharSet( const sal_uInt8 nWhich ) const { return m_aSub[nWhich].GetCharSet(); } inline long GetHeight( const sal_uInt8 nWhich ) const - { return m_aSub[nWhich].GetSize().Height(); } + { return m_aSub[nWhich].GetFontSize().Height(); } // makes the logical font be effective in the OutputDevice void ChgPhysFnt( SwViewShell *pSh, OutputDevice& rOut ); @@ -715,10 +715,10 @@ inline void SwSubFont::SetSize( const Size& rSize ) { m_aSize = rSize; if ( GetPropr() == 100 ) - Font::SetSize( m_aSize ); + Font::SetFontSize( m_aSize ); else { - Font::SetSize( Size( + Font::SetFontSize( Size( (long) m_aSize.Width() * GetPropr() / 100L, (long) m_aSize.Height() * GetPropr() / 100L ) ); } @@ -748,7 +748,7 @@ inline void SwFont::SetActual( sal_uInt8 nNew ) inline void SwSubFont::SetProportion( const sal_uInt8 nNewPropr ) { m_pMagic = nullptr; - Font::SetSize( Size( (long) m_aSize.Width() * nNewPropr / 100L, + Font::SetFontSize( Size( (long) m_aSize.Width() * nNewPropr / 100L, (long) m_aSize.Height() * nNewPropr / 100L ) ); SvxFont::SetPropr( nNewPropr ); } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 07d0bc0fc814..80443c8394a3 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -3849,7 +3849,7 @@ void SwColumnFrame::PaintBreak( ) const basegfx::B2DVector aFontSize; OutputDevice* pOut = gProp.pSGlobalShell->GetOut(); vcl::Font aFont = pOut->GetSettings().GetStyleSettings().GetToolFont(); - aFont.SetHeight( 8 * 20 ); + aFont.SetFontHeight( 8 * 20 ); pOut->SetFont( aFont ); drawinglayer::attribute::FontAttribute aFontAttr = drawinglayer::primitive2d::getFontAttributeFromVclFont( aFontSize, aFont, false, false ); @@ -7367,7 +7367,7 @@ const vcl::Font& SwPageFrame::GetEmptyPageFont() if ( nullptr == pEmptyPgFont ) { pEmptyPgFont = new vcl::Font; - pEmptyPgFont->SetSize( Size( 0, 80 * 20 )); // == 80 pt + pEmptyPgFont->SetFontSize( Size( 0, 80 * 20 )); // == 80 pt pEmptyPgFont->SetWeight( WEIGHT_BOLD ); pEmptyPgFont->SetStyleName( aEmptyOUStr ); pEmptyPgFont->SetFamilyName("Helvetica"); diff --git a/sw/source/core/text/porfld.cxx b/sw/source/core/text/porfld.cxx index 792638dac411..d8f8a759168b 100644 --- a/sw/source/core/text/porfld.cxx +++ b/sw/source/core/text/porfld.cxx @@ -1172,7 +1172,7 @@ bool SwCombinedPortion::Format( SwTextFormatInfo &rInf ) { rInf.GetOut()->SetFont( rInf.GetFont()->GetFnt( aScrType[i] ) ); aWidth[ aScrType[i] ] = - static_cast<sal_uInt16>(2 * rInf.GetOut()->GetFontMetric().GetSize().Width() / 3); + static_cast<sal_uInt16>(2 * rInf.GetOut()->GetFontMetric().GetFontSize().Width() / 3); } } } diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx index e0910e20be20..4389f10b293e 100644 --- a/sw/source/core/txtnode/fntcache.cxx +++ b/sw/source/core/txtnode/fntcache.cxx @@ -148,12 +148,12 @@ void SwFntObj::CreatePrtFont( const OutputDevice& rPrt ) ((OutputDevice&)rPrt).SetFont( aFont ); const FontMetric aWinMet( rPrt.GetFontMetric() ); ((OutputDevice&)rPrt).SetFont( aOldFnt ); - long nWidth = ( aWinMet.GetSize().Width() * nPropWidth ) / 100; + long nWidth = ( aWinMet.GetFontSize().Width() * nPropWidth ) / 100; if( !nWidth ) ++nWidth; pPrtFont = new vcl::Font( aFont ); - pPrtFont->SetSize( Size( nWidth, aFont.GetSize().Height() ) ); + pPrtFont->SetFontSize( Size( nWidth, aFont.GetFontSize().Height() ) ); pScrFont = nullptr; } } @@ -515,7 +515,7 @@ void SwFntObj::GuessLeading( const SwViewShell& const vcl::Font aOldFnt( pWin->GetFont() ); pWin->SetFont( *pPrtFont ); const FontMetric aWinMet( pWin->GetFontMetric() ); - const sal_uInt16 nWinHeight = sal_uInt16( aWinMet.GetSize().Height() ); + const sal_uInt16 nWinHeight = sal_uInt16( aWinMet.GetFontSize().Height() ); if( pPrtFont->GetFamilyName().indexOf( aWinMet.GetFamilyName() ) != -1 ) { // If the Leading on the Window is also 0, then it has to stay @@ -1059,7 +1059,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) lcl_IsMonoSpaceFont( *(rInf.GetpOut()) ) ) { pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(), - rInf.GetKanaComp(), (sal_uInt16)aFont.GetSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ) , &aTextOriginPos ); + rInf.GetKanaComp(), (sal_uInt16)aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ) , &aTextOriginPos ); bSpecialJust = true; } ///Asian Justification @@ -1230,7 +1230,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) { pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(), rInf.GetKanaComp(), - (sal_uInt16)aFont.GetSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTextOriginPos ); + (sal_uInt16)aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTextOriginPos ); bSpecialJust = true; } @@ -1440,10 +1440,10 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) Point aTmpPos( aTextOriginPos ); pSI->Compress( pScrArray, rInf.GetIdx(), rInf.GetLen(), rInf.GetKanaComp(), - (sal_uInt16)aFont.GetSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTmpPos ); + (sal_uInt16)aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTmpPos ); pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(), rInf.GetKanaComp(), - (sal_uInt16)aFont.GetSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTextOriginPos ); + (sal_uInt16)aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ), &aTextOriginPos ); } // Asian Justification @@ -1657,7 +1657,7 @@ void SwFntObj::DrawText( SwDrawTextInfo &rInf ) if( rInf.GetLen() ) { long nHght = rInf.GetOut().LogicToPixel( - pPrtFont->GetSize() ).Height(); + pPrtFont->GetFontSize() ).Height(); if( WRONG_SHOW_MIN < nHght ) { if ( rInf.GetOut().GetConnectMetaFile() ) @@ -1736,9 +1736,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->GetSize() ); + lcl_DrawLineForWrongListData( aForbidden, rInf, rInf.GetWrong(), aCalcLinePosData, pPrtFont->GetFontSize() ); // draw wave line for grammar check errors - lcl_DrawLineForWrongListData( aForbidden, rInf, rInf.GetGrammarCheck(), aCalcLinePosData, pPrtFont->GetSize() ); + lcl_DrawLineForWrongListData( aForbidden, rInf, rInf.GetGrammarCheck(), aCalcLinePosData, pPrtFont->GetFontSize() ); } } @@ -1932,7 +1932,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) if( bCompress ) rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( pKernArray, rInf.GetIdx(), nLn, rInf.GetKanaComp(), - (sal_uInt16)aFont.GetSize().Height() ,lcl_IsFullstopCentered( rInf.GetOut() ) ) ); + (sal_uInt16)aFont.GetFontSize().Height() ,lcl_IsFullstopCentered( rInf.GetOut() ) ) ); else rInf.SetKanaDiff( 0 ); @@ -1995,7 +1995,7 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf ) rInf.GetIdx(), nLn ); rInf.SetKanaDiff( rInf.GetScriptInfo()->Compress( pKernArray, rInf.GetIdx(), nLn, rInf.GetKanaComp(), - (sal_uInt16) aFont.GetSize().Height() ,lcl_IsFullstopCentered( rInf.GetOut() ) ) ); + (sal_uInt16) aFont.GetFontSize().Height() ,lcl_IsFullstopCentered( rInf.GetOut() ) ) ); aTextSize.Width() = pKernArray[ nLn - 1 ]; delete[] pKernArray; } @@ -2055,7 +2055,7 @@ sal_Int32 SwFntObj::GetCursorOfst( SwDrawTextInfo &rInf ) { pSI->Compress( pKernArray, rInf.GetIdx(), rInf.GetLen(), rInf.GetKanaComp(), - (sal_uInt16) aFont.GetSize().Height(), + (sal_uInt16) aFont.GetFontSize().Height(), lcl_IsFullstopCentered( rInf.GetOut() ) ); } diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx index 012e913f1975..29e6ae4f23fc 100644 --- a/sw/source/core/txtnode/swfont.cxx +++ b/sw/source/core/txtnode/swfont.cxx @@ -502,7 +502,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, { const SvxFontHeightItem *pHeight = static_cast<const SvxFontHeightItem *>(pItem); m_aSub[SW_LATIN].SvxFont::SetPropr( 100 ); - m_aSub[SW_LATIN].m_aSize = m_aSub[SW_LATIN].Font::GetSize(); + m_aSub[SW_LATIN].m_aSize = m_aSub[SW_LATIN].Font::GetFontSize(); Size aTmpSize = m_aSub[SW_LATIN].m_aSize; aTmpSize.Height() = pHeight->GetHeight(); m_aSub[SW_LATIN].SetSize( aTmpSize ); @@ -532,7 +532,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, { const SvxFontHeightItem *pHeight = static_cast<const SvxFontHeightItem *>(pItem); m_aSub[SW_CJK].SvxFont::SetPropr( 100 ); - m_aSub[SW_CJK].m_aSize = m_aSub[SW_CJK].Font::GetSize(); + m_aSub[SW_CJK].m_aSize = m_aSub[SW_CJK].Font::GetFontSize(); Size aTmpSize = m_aSub[SW_CJK].m_aSize; aTmpSize.Height() = pHeight->GetHeight(); m_aSub[SW_CJK].SetSize( aTmpSize ); @@ -568,7 +568,7 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet, { const SvxFontHeightItem *pHeight = static_cast<const SvxFontHeightItem *>(pItem); m_aSub[SW_CTL].SvxFont::SetPropr( 100 ); - m_aSub[SW_CTL].m_aSize = m_aSub[SW_CTL].Font::GetSize(); + m_aSub[SW_CTL].m_aSize = m_aSub[SW_CTL].Font::GetFontSize(); Size aTmpSize = m_aSub[SW_CTL].m_aSize; aTmpSize.Height() = pHeight->GetHeight(); m_aSub[SW_CTL].SetSize( aTmpSize ); @@ -1035,7 +1035,7 @@ sal_uInt16 SwSubFont::CalcEscHeight( const sal_uInt16 nOldHeight, short SwSubFont::_CheckKerning( ) { - short nKernx = - short( Font::GetSize().Height() / 6 ); + short nKernx = - short( Font::GetFontSize().Height() / 6 ); if ( nKernx < GetFixKerning() ) return GetFixKerning(); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 7ec09795fc46..2dff4a4eaefe 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5356,7 +5356,7 @@ sal_uLong SwWW8ImplReader::CoreLoad(WW8Glossary *pGloss) Graphic aGraphic = vecBulletGrf[nGrfBulletCP]->GetGrf(); SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH); vcl::Font aFont = numfunc::GetDefBulletFont(); - int nHeight = aFont.GetHeight() * 12; + int nHeight = aFont.GetFontHeight() * 12; Size aPrefSize( aGraphic.GetPrefSize()); if (aPrefSize.Height() * aPrefSize.Width() != 0 ) { diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 35f27d39e2c6..c62886f21fd3 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2360,11 +2360,11 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString, case RES_CHRATR_FONTSIZE: { - Size aSize( aFont.GetSize().Width(), + Size aSize( aFont.GetFontSize().Width(), static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() ); aTmp <<= ((float)aSize.Height()) / 20.0; - aFont.SetSize(OutputDevice::LogicToLogic(aSize, MAP_TWIP, + aFont.SetFontSize(OutputDevice::LogicToLogic(aSize, MAP_TWIP, MAP_100TH_MM)); } break; diff --git a/sw/source/ui/chrdlg/drpcps.cxx b/sw/source/ui/chrdlg/drpcps.cxx index 3a2afb8b4e22..9a1a94086dc7 100644 --- a/sw/source/ui/chrdlg/drpcps.cxx +++ b/sw/source/ui/chrdlg/drpcps.cxx @@ -312,9 +312,9 @@ void SwDropCapsPict::UpdatePaintSettings() } mnTextH = mnLines * mnTotLineH; - aFont.SetSize(Size(0, mnTextH)); - maCJKFont.SetSize(Size(0, mnTextH)); - maCTLFont.SetSize(Size(0, mnTextH)); + aFont.SetFontSize(Size(0, mnTextH)); + maCJKFont.SetFontSize(Size(0, mnTextH)); + maCTLFont.SetFontSize(Size(0, mnTextH)); aFont.SetTransparent(true); maCJKFont.SetTransparent(true); @@ -328,11 +328,11 @@ void SwDropCapsPict::UpdatePaintSettings() maCJKFont.SetFillColor(GetSettings().GetStyleSettings().GetWindowColor()); maCTLFont.SetFillColor(GetSettings().GetStyleSettings().GetWindowColor()); - maCJKFont.SetSize(Size(0, maCJKFont.GetSize().Height())); - maCTLFont.SetSize(Size(0, maCTLFont.GetSize().Height())); + maCJKFont.SetFontSize(Size(0, maCJKFont.GetFontSize().Height())); + maCTLFont.SetFontSize(Size(0, maCTLFont.GetFontSize().Height())); SetFont(aFont); - aFont.SetSize(Size(0, aFont.GetSize().Height())); + aFont.SetFontSize(Size(0, aFont.GetFontSize().Height())); SetFont(aFont); maFont = aFont; diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 49c63a885b20..0bb49e74f310 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -409,7 +409,7 @@ void SwCaptionPreview::ApplySettings(vcl::RenderContext& rRenderContext) if (!mbFontInitialized) { maFont = vcl::Font(rRenderContext.GetFont()); - maFont.SetHeight(maFont.GetHeight() * 120 / 100); + maFont.SetFontHeight(maFont.GetFontHeight() * 120 / 100); mbFontInitialized = true; } rRenderContext.SetFont(maFont); diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 2c0c8d13938e..22742be8613d 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -2267,9 +2267,9 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin) vcl::Font aCTLFont( OutputDevice::GetDefaultFont( DefaultFontType::CTL_TEXT, eLangType, GetDefaultFontFlags::OnlyOne, &rExampleWin ) ); const Size aDefSize( 0, 12 ); - aFont.SetSize( aDefSize ); - aCJKFont.SetSize( aDefSize ); - aCTLFont.SetSize( aDefSize ); + aFont.SetFontSize( aDefSize ); + aCJKFont.SetFontSize( aDefSize ); + aCTLFont.SetFontSize( aDefSize ); aFont.SetFillColor( aBackCol ); aCJKFont.SetFillColor( aBackCol ); @@ -2284,8 +2284,8 @@ void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin) rCTLFont = aCTLFont; const Size aNewSize( 0, rExampleWin.GetOutputSize().Height() * 2 / 3 ); - rFont.SetSize( aNewSize ); - rCJKFont.SetSize( aNewSize ); + rFont.SetFontSize( aNewSize ); + rCJKFont.SetFontSize( aNewSize ); rExampleWin.SetFont( rFont, rCJKFont,rCTLFont ); diff --git a/sw/source/ui/misc/insfnote.cxx b/sw/source/ui/misc/insfnote.cxx index 20c8d748ba87..fb8181b91cb9 100644 --- a/sw/source/ui/misc/insfnote.cxx +++ b/sw/source/ui/misc/insfnote.cxx @@ -126,7 +126,7 @@ IMPL_LINK_NOARG_TYPED(SwInsFootNoteDlg, NumberExtCharHdl, Button*, void) { m_aFontName = pFontItem->GetFamilyName(); eCharSet = pFontItem->GetCharSet(); - vcl::Font aFont( m_aFontName, pFontItem->GetStyleName(), m_pNumberCharEdit->GetFont().GetSize() ); + vcl::Font aFont( m_aFontName, pFontItem->GetStyleName(), m_pNumberCharEdit->GetFont().GetFontSize() ); aFont.SetCharSet( pFontItem->GetCharSet() ); aFont.SetPitch( pFontItem->GetPitch() ); m_pNumberCharEdit->SetFont( aFont ); diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx index 0c691319bb1d..10685ec4ce15 100644 --- a/sw/source/ui/misc/outline.cxx +++ b/sw/source/ui/misc/outline.cxx @@ -870,7 +870,7 @@ static long lcl_DrawBullet(vcl::RenderContext* pVDev, const SwNumFormat& rFormat vcl::Font aTmpFont(pVDev->GetFont()); vcl::Font aFont(*rFormat.GetBulletFont()); - aFont.SetSize(rSize); + aFont.SetFontSize(rSize); aFont.SetTransparent(true); pVDev->SetFont(aFont); OUString aText(rFormat.GetBulletChar()); @@ -938,7 +938,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle aStdFont.SetColor(SwViewOption::GetFontColor()); const long nFontHeight = nYStep * ( bPosition ? 15 : 6 ) / 10; - aStdFont.SetSize(Size( 0, nFontHeight )); + aStdFont.SetFontSize(Size( 0, nFontHeight )); long nPreNum = pActNum->Get(0).GetStart(); @@ -990,7 +990,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType()) { nBulletWidth = lcl_DrawBullet(pVDev.get(), rFormat, nNumberXPos, - nYStart, aStdFont.GetSize()); + nYStart, aStdFont.GetFontSize()); } else { @@ -1081,7 +1081,7 @@ void NumberingPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle } else if (SVX_NUM_CHAR_SPECIAL == rFormat.GetNumberingType()) { - nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, aStdFont.GetSize()); + nTextOffset = lcl_DrawBullet(pVDev.get(), rFormat, nXStart, nYStart, aStdFont.GetFontSize()); nTextOffset += nXStep; } else diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index 3ecbd16825ce..fdd2c8000b63 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -584,20 +584,20 @@ void AutoFormatPreview::MakeFonts( sal_uInt8 nIndex, vcl::Font& rFont, vcl::Font const SwBoxAutoFormat& rBoxFormat = aCurData.GetBoxFormat( nIndex ); rFont = rCJKFont = rCTLFont = GetFont(); - Size aFontSize( rFont.GetSize().Width(), 10 * GetDPIScaleFactor() ); + Size aFontSize( rFont.GetFontSize().Width(), 10 * GetDPIScaleFactor() ); lcl_SetFontProperties( rFont, rBoxFormat.GetFont(), rBoxFormat.GetWeight(), rBoxFormat.GetPosture() ); lcl_SetFontProperties( rCJKFont, rBoxFormat.GetCJKFont(), rBoxFormat.GetCJKWeight(), rBoxFormat.GetCJKPosture() ); lcl_SetFontProperties( rCTLFont, rBoxFormat.GetCTLFont(), rBoxFormat.GetCTLWeight(), rBoxFormat.GetCTLPosture() ); - SETONALLFONTS( SetUnderline, (FontLineStyle)rBoxFormat.GetUnderline().GetValue() ); - SETONALLFONTS( SetOverline, (FontLineStyle)rBoxFormat.GetOverline().GetValue() ); - SETONALLFONTS( SetStrikeout, (FontStrikeout)rBoxFormat.GetCrossedOut().GetValue() ); - SETONALLFONTS( SetOutline, rBoxFormat.GetContour().GetValue() ); - SETONALLFONTS( SetShadow, rBoxFormat.GetShadowed().GetValue() ); - SETONALLFONTS( SetColor, rBoxFormat.GetColor().GetValue() ); - SETONALLFONTS( SetSize, aFontSize ); - SETONALLFONTS( SetTransparent, true ); + SETONALLFONTS( SetUnderline, (FontLineStyle)rBoxFormat.GetUnderline().GetValue() ); + SETONALLFONTS( SetOverline, (FontLineStyle)rBoxFormat.GetOverline().GetValue() ); + SETONALLFONTS( SetStrikeout, (FontStrikeout)rBoxFormat.GetCrossedOut().GetValue() ); + SETONALLFONTS( SetOutline, rBoxFormat.GetContour().GetValue() ); + SETONALLFONTS( SetShadow, rBoxFormat.GetShadowed().GetValue() ); + SETONALLFONTS( SetColor, rBoxFormat.GetColor().GetValue() ); + SETONALLFONTS( SetFontSize, aFontSize ); + SETONALLFONTS( SetTransparent, true ); } sal_uInt8 AutoFormatPreview::GetFormatIndex( size_t nCol, size_t nRow ) const diff --git a/sw/source/uibase/docvw/AnnotationMenuButton.cxx b/sw/source/uibase/docvw/AnnotationMenuButton.cxx index 3a207b03e865..876531c46cf2 100644 --- a/sw/source/uibase/docvw/AnnotationMenuButton.cxx +++ b/sw/source/uibase/docvw/AnnotationMenuButton.cxx @@ -162,7 +162,7 @@ void AnnotationMenuButton::Paint(vcl::RenderContext& rRenderContext, const Recta vcl::Font aFont(aOldFont); Color aCol(COL_BLACK); aFont.SetColor(aCol); - aFont.SetHeight(200); + aFont.SetFontHeight(200); aFont.SetWeight(WEIGHT_MEDIUM); rRenderContext.SetFont(aFont); rRenderContext.DrawText(aRect, OUString("Edit Note"), DrawTextFlags::Center); diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index 97d9767ad86d..4bc6cfc13887 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -572,7 +572,7 @@ void SwSidebarWin::InitControls() AllSettings aSettings = mpMetadataAuthor->GetSettings(); StyleSettings aStyleSettings = aSettings.GetStyleSettings(); vcl::Font aFont = aStyleSettings.GetFieldFont(); - aFont.SetHeight(8); + aFont.SetFontHeight(8); aStyleSettings.SetFieldFont(aFont); aSettings.SetStyleSettings(aStyleSettings); mpMetadataAuthor->SetSettings(aSettings); @@ -591,7 +591,7 @@ void SwSidebarWin::InitControls() AllSettings aSettings = mpMetadataDate->GetSettings(); StyleSettings aStyleSettings = aSettings.GetStyleSettings(); vcl::Font aFont = aStyleSettings.GetFieldFont(); - aFont.SetHeight(8); + aFont.SetFontHeight(8); aStyleSettings.SetFieldFont(aFont); aSettings.SetStyleSettings(aStyleSettings); mpMetadataDate->SetSettings(aSettings); @@ -720,17 +720,17 @@ void SwSidebarWin::Rescale() if ( mpMetadataAuthor ) { vcl::Font aFont( mpMetadataAuthor->GetSettings().GetStyleSettings().GetFieldFont() ); - sal_Int32 nHeight = aFont.GetHeight(); + sal_Int32 nHeight = aFont.GetFontHeight(); nHeight = nHeight * rFraction.GetNumerator() / rFraction.GetDenominator(); - aFont.SetHeight( nHeight ); + aFont.SetFontHeight( nHeight ); mpMetadataAuthor->SetControlFont( aFont ); } if ( mpMetadataDate ) { vcl::Font aFont( mpMetadataDate->GetSettings().GetStyleSettings().GetFieldFont() ); - sal_Int32 nHeight = aFont.GetHeight(); + sal_Int32 nHeight = aFont.GetFontHeight(); nHeight = nHeight * rFraction.GetNumerator() / rFraction.GetDenominator(); - aFont.SetHeight( nHeight ); + aFont.SetFontHeight( nHeight ); mpMetadataDate->SetControlFont( aFont ); } } diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index 353397e2b3d8..0c8e6367f0d0 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -992,11 +992,11 @@ void SwSrcEditWindow::SetFont() const vcl::Font& rFont = GetTextEngine()->GetFont(); vcl::Font aFont(aFontMetric); - Size aSize(rFont.GetSize()); + Size aSize(rFont.GetFontSize()); //font height is stored in point and set in twip aSize.Height() = officecfg::Office::Common::Font::SourceViewFont::FontHeight::get() * 20; - aFont.SetSize(pOutWin->LogicToPixel(aSize, MAP_TWIP)); + aFont.SetFontSize(pOutWin->LogicToPixel(aSize, MAP_TWIP)); GetTextEngine()->SetFont( aFont ); pOutWin->SetFont(aFont); } diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx index db3b7600e546..0ab4728b559f 100644 --- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx +++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx @@ -95,7 +95,7 @@ BitmapEx GenerateStylePreview(SfxObjectShell& rSource, OUString& aName) pVirtualDev->DrawRect(aNameRect); vcl::Font aFont; - aFont.SetSize(Size(0, nNameFontSize)); + aFont.SetFontSize(Size(0, nNameFontSize)); pVirtualDev->SetFont(aFont); diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index c70efd054b71..a20b6a965e4c 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -704,9 +704,9 @@ sal_Int32 SwSrcView::PrintSource( TextEngine* pTextEngine = aEditWin->GetTextEngine(); pOutDev->SetMapMode( MAP_100TH_MM ); vcl::Font aFont( aEditWin->GetOutWin()->GetFont() ); - Size aSize( aFont.GetSize() ); + Size aSize( aFont.GetFontSize() ); aSize = aEditWin->GetOutWin()->PixelToLogic( aSize, MAP_100TH_MM ); - aFont.SetSize( aSize ); + aFont.SetFontSize( aSize ); aFont.SetColor( COL_BLACK ); pOutDev->SetFont( aFont ); |