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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 6 | ||||
-rw-r--r-- | svx/source/dialog/charmap.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/dialcontrol.cxx | 2 | ||||
-rw-r--r-- | svx/source/dialog/fntctrl.cxx | 20 | ||||
-rw-r--r-- | svx/source/dialog/pagectrl.cxx | 6 | ||||
-rw-r--r-- | svx/source/dialog/rubydialog.cxx | 4 | ||||
-rw-r--r-- | svx/source/dialog/svxbmpnumvalueset.cxx | 6 | ||||
-rw-r--r-- | svx/source/dialog/swframeexample.cxx | 4 | ||||
-rw-r--r-- | svx/source/fmcomp/fmgridif.cxx | 6 | ||||
-rw-r--r-- | svx/source/fmcomp/gridctrl.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/line/LineWidthValueSet.cxx | 4 | ||||
-rw-r--r-- | svx/source/sidebar/tools/ValueSetWithTextControl.cxx | 4 | ||||
-rw-r--r-- | svx/source/styles/CommonStylePreviewRenderer.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdfmtf.cxx | 4 | ||||
-rw-r--r-- | svx/source/svdraw/svdotext.cxx | 4 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbcontrl.cxx | 6 | ||||
-rw-r--r-- | svx/source/tbxctrls/tbunocontroller.cxx | 2 |
17 files changed, 45 insertions, 45 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index d049d7318c21..dde0b1b38c50 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -158,7 +158,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape, vcl::Font aFont; const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pCustomShape->GetMergedItem( EE_CHAR_FONTINFO )); - aFont.SetHeight( pCustomShape->GetLogicRect().GetHeight() / rFWData.nMaxParagraphsPerTextArea ); + aFont.SetFontHeight( pCustomShape->GetLogicRect().GetHeight() / rFWData.nMaxParagraphsPerTextArea ); aFont.SetAlignment( ALIGN_TOP ); aFont.SetFamilyName( rFontItem.GetFamilyName() ); aFont.SetFamily( rFontItem.GetFamily() ); @@ -245,7 +245,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F nFntItm = EE_CHAR_FONTINFO_CJK; const SvxFontItem& rFontItem = static_cast<const SvxFontItem&>(pCustomShape->GetMergedItem( nFntItm )); vcl::Font aFont; - aFont.SetHeight( rFWData.nSingleLineHeight ); + aFont.SetFontHeight( rFWData.nSingleLineHeight ); aFont.SetAlignment( ALIGN_TOP ); aFont.SetFamilyName( rFontItem.GetFamilyName() ); @@ -337,7 +337,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F pDXArry.reset(new long[ rText.getLength() ]); pVirDev->GetTextArray( rText, pDXArry.get()); FontMetric aFontMetric( pVirDev->GetFontMetric() ); - aFont.SetWidth( (sal_Int32)( (double)aFontMetric.GetWidth() * ( (double)100 / (double)nCharScaleWidth ) ) ); + aFont.SetAverageFontWidth( (sal_Int32)( (double)aFontMetric.GetAverageFontWidth() * ( (double)100 / (double)nCharScaleWidth ) ) ); pVirDev->SetFont( aFont ); } FWCharacterData aCharacterData; diff --git a/svx/source/dialog/charmap.cxx b/svx/source/dialog/charmap.cxx index bd3c81bf8600..c4fe0028b7bd 100644 --- a/svx/source/dialog/charmap.cxx +++ b/svx/source/dialog/charmap.cxx @@ -524,7 +524,7 @@ void SvxShowCharSet::InitSettings(vcl::RenderContext& rRenderContext) vcl::Font aFont(rRenderContext.GetFont()); aFont.SetWeight(WEIGHT_LIGHT); aFont.SetAlignment(ALIGN_TOP); - aFont.SetSize(maFontSize); + aFont.SetFontSize(maFontSize); aFont.SetTransparent(true); rRenderContext.SetFont(aFont); @@ -559,7 +559,7 @@ void SvxShowCharSet::RecalculateFont(vcl::RenderContext& rRenderContext) aFont.SetAlignment(ALIGN_TOP); int nFontHeight = (aSize.Height() - 5) * 2 / (3 * ROW_COUNT); maFontSize = rRenderContext.PixelToLogic(Size(0, nFontHeight)); - aFont.SetSize(maFontSize); + aFont.SetFontSize(maFontSize); aFont.SetTransparent(true); rRenderContext.SetFont(aFont); rRenderContext.GetFontCharMap(mxFontCharMap); diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 77f62b1b4fc4..c1f7eba13e61 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -470,7 +470,7 @@ void DialControl::Init( const Size& rWinSize ) vcl::Font aFont( OutputDevice::GetDefaultFont( DefaultFontType::UI_SANS, Application::GetSettings().GetUILanguageTag().getLanguageType(), GetDefaultFontFlags::OnlyOne ) ); - aFont.SetHeight(aDefaultSize.GetHeight()); + aFont.SetFontHeight(aDefaultSize.GetFontHeight()); Init( rWinSize, aFont ); } diff --git a/svx/source/dialog/fntctrl.cxx b/svx/source/dialog/fntctrl.cxx index 23fcff86a175..aa55415b7fe9 100644 --- a/svx/source/dialog/fntctrl.cxx +++ b/svx/source/dialog/fntctrl.cxx @@ -85,8 +85,8 @@ namespace { void scaleFontWidth(vcl::Font& rFont, vcl::RenderContext& rRenderContext,long& n100PercentFont) { - rFont.SetWidth(0); - n100PercentFont = rRenderContext.GetFontMetric(rFont).GetWidth(); + rFont.SetAverageFontWidth(0); + n100PercentFont = rRenderContext.GetFontMetric(rFont).GetAverageFontWidth(); } void initFont(vcl::Font& rFont) @@ -97,10 +97,10 @@ void initFont(vcl::Font& rFont) void setFontSize(vcl::Font& rFont) { - Size aSize(rFont.GetSize()); + Size aSize(rFont.GetFontSize()); aSize.Height() = (aSize.Height() * 3) / 5; aSize.Width() = (aSize.Width() * 3) / 5; - rFont.SetSize(aSize); + rFont.SetFontSize(aSize); } void calcFontHeightAnyAscent(vcl::RenderContext& rRenderContext, const vcl::Font& rFont, long& nHeight, long& nAscent) @@ -446,9 +446,9 @@ void FontPrevWin_Impl::ScaleFontWidth(vcl::RenderContext& rOutDev) scaleFontWidth(maCTLFont, rOutDev, mn100PercentFontWidthCTL); } - maFont.SetWidth(mn100PercentFontWidth * mnFontWidthScale / 100); - maCJKFont.SetWidth(mn100PercentFontWidthCJK * mnFontWidthScale / 100); - maCTLFont.SetWidth(mn100PercentFontWidthCTL * mnFontWidthScale / 100); + maFont.SetAverageFontWidth(mn100PercentFontWidth * mnFontWidthScale / 100); + maCJKFont.SetAverageFontWidth(mn100PercentFontWidthCJK * mnFontWidthScale / 100); + maCTLFont.SetAverageFontWidth(mn100PercentFontWidthCTL * mnFontWidthScale / 100); } void SvxFontPrevWindow::ResetSettings(bool bForeground, bool bBackground) @@ -763,7 +763,7 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl if (IsTwoLines()) { SvxFont aSmallFont(rFont); - Size aOldSize = pImpl->maCJKFont.GetSize(); + Size aOldSize = pImpl->maCJKFont.GetFontSize(); setFontSize(aSmallFont); setFontSize(pImpl->maCJKFont); @@ -811,7 +811,7 @@ void SvxFontPrevWindow::Paint(vcl::RenderContext& rRenderContext, const Rectangl OUString sBracket(pImpl->mcEndBracket); rFont.DrawPrev(&rRenderContext, pPrinter, aTmpPoint, sBracket); } - pImpl->maCJKFont.SetSize(aOldSize); + pImpl->maCJKFont.SetFontSize(aOldSize); } else { @@ -914,7 +914,7 @@ void SvxFontPrevWindow::SetFontSize( const SfxItemSet& rSet, sal_uInt16 nSlot, S else nH = 240;// as default 12pt - rFont.SetSize(Size(0, nH)); + rFont.SetFontSize(Size(0, nH)); } void SvxFontPrevWindow::SetFontLang(const SfxItemSet& rSet, sal_uInt16 nSlot, SvxFont& rFont) diff --git a/svx/source/dialog/pagectrl.cxx b/svx/source/dialog/pagectrl.cxx index 4f14fa4613d4..079c994e8d13 100644 --- a/svx/source/dialog/pagectrl.cxx +++ b/svx/source/dialog/pagectrl.cxx @@ -251,9 +251,9 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO { Point aPos; vcl::Font aFont(rRenderContext.GetFont()); - const Size aSaveSize = aFont.GetSize(); + const Size aSaveSize = aFont.GetFontSize(); Size aDrawSize(0,aRect.GetHeight() / 6); - aFont.SetSize(aDrawSize); + aFont.SetFontSize(aDrawSize); rRenderContext.SetFont(aFont); OUString sText("ABC"); Point aMove(1, rRenderContext.GetTextHeight()); @@ -308,7 +308,7 @@ void SvxPageWindow::DrawPage(vcl::RenderContext& rRenderContext, const Point& rO aPos.Y() += aMove.Y(); } } - aFont.SetSize(aSaveSize); + aFont.SetFontSize(aSaveSize); rRenderContext.SetFont(aFont); } diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 1dffa9b54b24..ae9c7a947e73 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -803,7 +803,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*r Size aWinSize = rRenderContext.GetOutputSize(); vcl::Font aSaveFont = rRenderContext.GetFont(); - aSaveFont.SetHeight(aWinSize.Height() / 4); + aSaveFont.SetFontHeight(aWinSize.Height() / 4); rRenderContext.SetFont(aSaveFont); Rectangle aRect(Point(0, 0), aWinSize); @@ -818,7 +818,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& /*r long nBaseWidth = rRenderContext.GetTextWidth(sBaseText); vcl::Font aRubyFont(aSaveFont); - aRubyFont.SetHeight(aRubyFont.GetHeight() * 70 / 100); + aRubyFont.SetFontHeight(aRubyFont.GetFontHeight() * 70 / 100); rRenderContext.SetFont(aRubyFont); long nRubyWidth = rRenderContext.GetTextWidth(sRubyText); rRenderContext.SetFont(aSaveFont); diff --git a/svx/source/dialog/svxbmpnumvalueset.cxx b/svx/source/dialog/svxbmpnumvalueset.cxx index 953f062a2095..e4d48afbcf6b 100644 --- a/svx/source/dialog/svxbmpnumvalueset.cxx +++ b/svx/source/dialog/svxbmpnumvalueset.cxx @@ -153,11 +153,11 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) vcl::Font aFont(OutputDevice::GetDefaultFont( DefaultFontType::UI_SANS, MsLangId::getSystemLanguage(), GetDefaultFontFlags::OnlyOne)); - Size aSize = aFont.GetSize(); + Size aSize = aFont.GetFontSize(); vcl::Font aRuleFont( lcl_GetDefaultBulletFont() ); aSize.Height() = nRectHeight/6; - aRuleFont.SetSize(aSize); + aRuleFont.SetFontSize(aSize); aRuleFont.SetColor(aTextColor); aRuleFont.SetFillColor(aBackColor); if(ePageType == NumberingPageType::BULLET) @@ -168,7 +168,7 @@ void SvxNumValueSet::UserDraw( const UserDrawEvent& rUDEvt ) } aFont.SetColor(aTextColor); aFont.SetFillColor(aBackColor); - aFont.SetSize( aSize ); + aFont.SetFontSize( aSize ); pDev->SetFont(aFont); if(!pVDev) diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index 0773a1407754..5c4fc1b27fae 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -175,13 +175,13 @@ void SvxSwFrameExample::InitAllRects_Impl(vcl::RenderContext& rRenderContext) if (nAnchor == TextContentAnchorType_AS_CHARACTER) { - aFont.SetSize(Size(0, aParaPrtArea.GetHeight() - 2)); + aFont.SetFontSize(Size(0, aParaPrtArea.GetHeight() - 2)); SetFont(aFont); aParaPrtArea.SetSize(Size(GetTextWidth(DEMOTEXT), GetTextHeight())); } else { - aFont.SetSize(Size(0, aParaPrtArea.GetHeight() / 2)); + aFont.SetFontSize(Size(0, aParaPrtArea.GetHeight() / 2)); rRenderContext.SetFont(aFont); aAutoCharFrame.SetSize(Size(GetTextWidth(OUString('A')), GetTextHeight())); aAutoCharFrame.SetPos(Point(aParaPrtArea.Left() + (aParaPrtArea.GetWidth() - aAutoCharFrame.GetWidth()) / 2, diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 5e63d62a3334..507df1631cdc 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -84,8 +84,8 @@ css::awt::FontDescriptor ImplCreateFontDescriptor( const vcl::Font& rFont ) css::awt::FontDescriptor aFD; aFD.Name = rFont.GetFamilyName(); aFD.StyleName = rFont.GetStyleName(); - aFD.Height = (sal_Int16)rFont.GetSize().Height(); - aFD.Width = (sal_Int16)rFont.GetSize().Width(); + aFD.Height = (sal_Int16)rFont.GetFontSize().Height(); + aFD.Width = (sal_Int16)rFont.GetFontSize().Width(); aFD.Family = (sal_Int16)rFont.GetFamilyType(); aFD.CharSet = rFont.GetCharSet(); aFD.Pitch = (sal_Int16)rFont.GetPitch(); @@ -107,7 +107,7 @@ vcl::Font ImplCreateFont( const css::awt::FontDescriptor& rDescr ) vcl::Font aFont; aFont.SetFamilyName( rDescr.Name ); aFont.SetStyleName( rDescr.StyleName ); - aFont.SetSize( ::Size( rDescr.Width, rDescr.Height ) ); + aFont.SetFontSize( ::Size( rDescr.Width, rDescr.Height ) ); aFont.SetFamily( (FontFamily)rDescr.Family ); aFont.SetCharSet( (rtl_TextEncoding)rDescr.CharSet ); aFont.SetPitch( (FontPitch)rDescr.Pitch ); diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 5348090cbb11..db84d3073e2a 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -446,7 +446,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls() { vcl::Font aApplFont (m_aAbsolute->GetFont()); const Size pointAbsoluteSize(m_aAbsolute->PixelToLogic( Size( 0, nH - 2 ), MapMode(MAP_POINT) )); - aApplFont.SetSize( pointAbsoluteSize ); + aApplFont.SetFontSize( pointAbsoluteSize ); m_aAbsolute->SetControlFont( aApplFont ); aApplFont.SetTransparent( true ); diff --git a/svx/source/sidebar/line/LineWidthValueSet.cxx b/svx/source/sidebar/line/LineWidthValueSet.cxx index 2d41152032c0..a260709bb678 100644 --- a/svx/source/sidebar/line/LineWidthValueSet.cxx +++ b/svx/source/sidebar/line/LineWidthValueSet.cxx @@ -98,9 +98,9 @@ void LineWidthValueSet::UserDraw( const UserDrawEvent& rUDEvt ) Color aOldFillColor = pDev->GetFillColor(); vcl::Font aFont(OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, MsLangId::getSystemLanguage(), GetDefaultFontFlags::OnlyOne)); - Size aSize = aFont.GetSize(); + Size aSize = aFont.GetFontSize(); aSize.Height() = nRectHeight*3/5; - aFont.SetSize( aSize ); + aFont.SetFontSize( aSize ); Point aLineStart(aBLPos.X() + 5, aBLPos.Y() + ( nRectHeight - nItemId )/2); Point aLineEnd(aBLPos.X() + nRectWidth * 7 / 9 - 10, aBLPos.Y() + ( nRectHeight - nItemId )/2); diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx index d2c9943113e5..440ea416dc94 100644 --- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx +++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx @@ -155,9 +155,9 @@ void ValueSetWithTextControl::UserDraw( const UserDrawEvent& rUDEvt ) vcl::Font aFont(OutputDevice::GetDefaultFont(DefaultFontType::UI_SANS, MsLangId::getSystemLanguage(), GetDefaultFontFlags::OnlyOne)); { - Size aSize = aFont.GetSize(); + Size aSize = aFont.GetFontSize(); aSize.Height() = (nRectHeight*4)/9; - aFont.SetSize( aSize ); + aFont.SetFontSize( aSize ); } { diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index b67864354468..49f884abf470 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -146,7 +146,7 @@ bool CommonStylePreviewRenderer::recalculate() const SvxFontHeightItem* pFontHeightItem = static_cast<const SvxFontHeightItem*>(pItem); Size aFontSize(0, pFontHeightItem->GetHeight()); maPixelSize = Size(mrOutputDev.LogicToPixel(aFontSize, mrShell.GetMapUnit())); - pFont->SetSize(maPixelSize); + pFont->SetFontSize(maPixelSize); vcl::Font aOldFont(mrOutputDev.GetFont()); @@ -158,7 +158,7 @@ bool CommonStylePreviewRenderer::recalculate() double ratio = double(mnMaxHeight) / aTextRect.Bottom(); maPixelSize.Width() *= ratio; maPixelSize.Height() *= ratio; - pFont->SetSize(maPixelSize); + pFont->SetFontSize(maPixelSize); } mrOutputDev.SetFont(aOldFont); } @@ -202,7 +202,7 @@ bool CommonStylePreviewRenderer::render(const Rectangle& aRectangle, RenderAlign if (maFontColor != COL_AUTO) mrOutputDev.SetTextColor(maFontColor); - Size aPixelSize((m_pFont) ? maPixelSize : mrOutputDev.GetFont().GetSize()); + Size aPixelSize((m_pFont) ? maPixelSize : mrOutputDev.GetFont().GetFontSize()); Point aFontDrawPosition = aRectangle.TopLeft(); if (eRenderAlign == RenderAlign::CENTER) diff --git a/svx/source/svdraw/svdfmtf.cxx b/svx/source/svdraw/svdfmtf.cxx index ace66d914d70..0f44f35cd274 100644 --- a/svx/source/svdraw/svdfmtf.cxx +++ b/svx/source/svdraw/svdfmtf.cxx @@ -406,7 +406,7 @@ void ImpSdrGDIMetaFileImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr if(bText && mbFntDirty) { vcl::Font aFnt(mpVD->GetFont()); - const sal_uInt32 nHeight(FRound(aFnt.GetSize().Height() * mfScaleY)); + const sal_uInt32 nHeight(FRound(aFnt.GetFontSize().Height() * mfScaleY)); mpTextAttr->Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO ) ); mpTextAttr->Put( SvxFontItem( aFnt.GetFamilyType(), aFnt.GetFamilyName(), aFnt.GetStyleName(), aFnt.GetPitch(), aFnt.GetCharSet(), EE_CHAR_FONTINFO_CJK ) ); @@ -1005,7 +1005,7 @@ void ImpSdrGDIMetaFileImport::ImportText( const Point& rPos, const OUString& rSt pText->SetMergedItem ( makeSdrTextRightDistItem (0)); pText->SetMergedItem ( makeSdrTextLeftDistItem (0)); - if ( aFnt.GetWidth() || ( rAct.GetType() == MetaActionType::STRETCHTEXT ) ) + if ( aFnt.GetAverageFontWidth() || ( rAct.GetType() == MetaActionType::STRETCHTEXT ) ) { pText->ClearMergedItem( SDRATTR_TEXT_AUTOGROWWIDTH ); pText->SetMergedItem( makeSdrTextAutoGrowHeightItem( false ) ); diff --git a/svx/source/svdraw/svdotext.cxx b/svx/source/svdraw/svdotext.cxx index 3656b9e6d3c6..64bb308c320e 100644 --- a/svx/source/svdraw/svdotext.cxx +++ b/svx/source/svdraw/svdotext.cxx @@ -915,10 +915,10 @@ void SdrTextObj::ImpSetCharStretching(SdrOutliner& rOutliner, const Size& rTextS vcl::Font aFontMerk(pOut->GetFont()); vcl::Font aTmpFont( OutputDevice::GetDefaultFont( DefaultFontType::SERIF, LANGUAGE_SYSTEM, GetDefaultFontFlags::OnlyOne ) ); - aTmpFont.SetSize(Size(0,100)); + aTmpFont.SetFontSize(Size(0,100)); pOut->SetFont(aTmpFont); Size aSize1(pOut->GetTextWidth(aTestString), pOut->GetTextHeight()); - aTmpFont.SetSize(Size(800,100)); + aTmpFont.SetFontSize(Size(800,100)); pOut->SetFont(aTmpFont); Size aSize2(pOut->GetTextWidth(aTestString), pOut->GetTextHeight()); pOut->SetFont(aFontMerk); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index 6bcb4a32f4e4..b544df07f90c 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -578,10 +578,10 @@ bool SvxStyleBox_Impl::AdjustFontForItemHeight(OutputDevice* pDevice, Rectangle& // the text does not fit, adjust the font size double ratio = static_cast< double >( nHeight ) / rTextRect.Bottom(); vcl::Font aFont(pDevice->GetFont()); - Size aPixelSize(aFont.GetSize()); + Size aPixelSize(aFont.GetFontSize()); aPixelSize.Width() *= ratio; aPixelSize.Height() *= ratio; - aFont.SetSize(aPixelSize); + aFont.SetFontSize(aPixelSize); pDevice->SetFont(aFont); return true; } @@ -659,7 +659,7 @@ void SvxStyleBox_Impl::SetupEntry(vcl::RenderContext& rRenderContext, vcl::Windo SvxFont aFont; aFont.SetFamilyName(pFontItem->GetFamilyName()); aFont.SetStyleName(pFontItem->GetStyleName()); - aFont.SetSize(aPixelSize); + aFont.SetFontSize(aPixelSize); const SfxPoolItem *pItem = pItemSet->GetItem( SID_ATTR_CHAR_WEIGHT ); if ( pItem ) diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index 22ea34f2b70f..9d9bb13037b7 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -198,7 +198,7 @@ void SvxFontSizeBox_Impl::UpdateFont( const css::awt::FontDescriptor& rCurrentFo FontMetric _aFontMetric; _aFontMetric.SetFamilyName( rCurrentFont.Name ); _aFontMetric.SetStyleName( rCurrentFont.StyleName ); - _aFontMetric.SetHeight( rCurrentFont.Height ); + _aFontMetric.SetFontHeight( rCurrentFont.Height ); Fill( &_aFontMetric, _pFontList ); } else |