summaryrefslogtreecommitdiff
path: root/sd/source/ui
diff options
context:
space:
mode:
authorChris Sherlock <chris.sherlock79@gmail.com>2016-02-03 10:13:00 +1100
committerChris Sherlock <chris.sherlock79@gmail.com>2016-02-04 03:17:26 +0000
commit697d445ed0c7b60e463243db89af32e2145b475b (patch)
tree5a74d57cdc97f82bc78a686dee345a229a082a72 /sd/source/ui
parent91a7580e03d5b47c6e2513afce85ddee45e730b6 (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 'sd/source/ui')
-rw-r--r--sd/source/ui/annotations/annotationwindow.cxx6
-rw-r--r--sd/source/ui/func/bulmaper.cxx2
-rw-r--r--sd/source/ui/slideshow/showwin.cxx4
-rw-r--r--sd/source/ui/slidesorter/view/SlsTheme.cxx8
-rw-r--r--sd/source/ui/tools/PreviewRenderer.cxx2
-rw-r--r--sd/source/ui/view/grviewsh.cxx2
-rw-r--r--sd/source/ui/view/outlview.cxx6
-rw-r--r--sd/source/ui/view/sdview.cxx4
8 files changed, 17 insertions, 17 deletions
diff --git a/sd/source/ui/annotations/annotationwindow.cxx b/sd/source/ui/annotations/annotationwindow.cxx
index e0c42c49225a..7ecf96fc617a 100644
--- a/sd/source/ui/annotations/annotationwindow.cxx
+++ b/sd/source/ui/annotations/annotationwindow.cxx
@@ -321,7 +321,7 @@ void AnnotationWindow::InitControls()
AllSettings aSettings = mpMeta->GetSettings();
StyleSettings aStyleSettings = aSettings.GetStyleSettings();
vcl::Font aFont = aStyleSettings.GetFieldFont();
- aFont.SetHeight(8);
+ aFont.SetFontHeight(8);
aStyleSettings.SetFieldFont(aFont);
aSettings.SetStyleSettings(aStyleSettings);
mpMeta->SetSettings(aSettings);
@@ -386,9 +386,9 @@ void AnnotationWindow::Rescale()
if ( mpMeta )
{
vcl::Font aFont( mpMeta->GetSettings().GetStyleSettings().GetFieldFont() );
- sal_Int32 nHeight = aFont.GetHeight();
+ sal_Int32 nHeight = aFont.GetFontHeight();
nHeight = nHeight * aMode.GetScaleY().GetNumerator() / aMode.GetScaleY().GetDenominator();
- aFont.SetHeight( nHeight );
+ aFont.SetFontHeight( nHeight );
mpMeta->SetControlFont( aFont );
}
}
diff --git a/sd/source/ui/func/bulmaper.cxx b/sd/source/ui/func/bulmaper.cxx
index 96316eb88945..3f9615a22bae 100644
--- a/sd/source/ui/func/bulmaper.cxx
+++ b/sd/source/ui/func/bulmaper.cxx
@@ -72,7 +72,7 @@ void SdBulletMapper::MapFontsInNumRule( SvxNumRule& aNumRule, const SfxItemSet&
const SvxFontHeightItem& rFHItem =
static_cast<const SvxFontHeightItem&>(rSet.Get(GetWhich( (sal_uInt16)nFontHeightID )));
- aMyFont.SetSize(Size(0, rFHItem.GetHeight()));
+ aMyFont.SetFontSize(Size(0, rFHItem.GetHeight()));
const SvxWeightItem& rWItem =
static_cast<const SvxWeightItem&>(rSet.Get(GetWhich( (sal_uInt16)nWeightID )));
diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx
index ecbebd0bb363..85be7aaca1d2 100644
--- a/sd/source/ui/slideshow/showwin.cxx
+++ b/sd/source/ui/slideshow/showwin.cxx
@@ -476,7 +476,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly )
vcl::Font aFont( GetSettings().GetStyleSettings().GetMenuFont() );
const vcl::Font aOldFont( GetFont() );
- aFont.SetSize( aTextSize );
+ aFont.SetFontSize( aTextSize );
aFont.SetColor( COL_WHITE );
aFont.SetCharSet( aOldFont.GetCharSet() );
aFont.SetLanguage( aOldFont.GetLanguage() );
@@ -545,7 +545,7 @@ void ShowWindow::DrawEndScene()
const Size aTextSize( LogicToLogic( Size( 0, 14 ), MAP_POINT, GetMapMode() ) );
const OUString aText( SdResId( STR_PRES_SOFTEND ) );
- aFont.SetSize( aTextSize );
+ aFont.SetFontSize( aTextSize );
aFont.SetColor( COL_WHITE );
aFont.SetCharSet( aOldFont.GetCharSet() );
aFont.SetLanguage( aOldFont.GetLanguage() );
diff --git a/sd/source/ui/slidesorter/view/SlsTheme.cxx b/sd/source/ui/slidesorter/view/SlsTheme.cxx
index f669b6ad4639..1ae6f92b48c8 100644
--- a/sd/source/ui/slidesorter/view/SlsTheme.cxx
+++ b/sd/source/ui/slidesorter/view/SlsTheme.cxx
@@ -147,8 +147,8 @@ std::shared_ptr<vcl::Font> Theme::GetFont (
pFont->SetTransparent(true);
pFont->SetWeight(WEIGHT_NORMAL);
{
- const Size aSize (pFont->GetSize());
- pFont->SetSize(Size(aSize.Width()*5/3, aSize.Height()*5/3));
+ const Size aSize (pFont->GetFontSize());
+ pFont->SetFontSize(Size(aSize.Width()*5/3, aSize.Height()*5/3));
}
break;
}
@@ -157,10 +157,10 @@ std::shared_ptr<vcl::Font> Theme::GetFont (
{
// Transform the point size to pixel size.
const MapMode aFontMapMode (MAP_POINT);
- const Size aFontSize (rDevice.LogicToPixel(pFont->GetSize(), aFontMapMode));
+ const Size aFontSize (rDevice.LogicToPixel(pFont->GetFontSize(), aFontMapMode));
// Transform the font size to the logical coordinates of the device.
- pFont->SetSize(rDevice.PixelToLogic(aFontSize));
+ pFont->SetFontSize(rDevice.PixelToLogic(aFontSize));
}
return pFont;
diff --git a/sd/source/ui/tools/PreviewRenderer.cxx b/sd/source/ui/tools/PreviewRenderer.cxx
index fa63de954286..5c6af241911f 100644
--- a/sd/source/ui/tools/PreviewRenderer.cxx
+++ b/sd/source/ui/tools/PreviewRenderer.cxx
@@ -334,7 +334,7 @@ void PreviewRenderer::PaintSubstitutionText (const OUString& rSubstitutionText)
const vcl::Font& rOriginalFont (mpPreviewDevice->GetFont());
vcl::Font aFont (mpPreviewDevice->GetSettings().GetStyleSettings().GetAppFont());
sal_Int32 nHeight (mpPreviewDevice->PixelToLogic(Size(0,snSubstitutionTextSize)).Height());
- aFont.SetHeight(nHeight);
+ aFont.SetFontHeight(nHeight);
mpPreviewDevice->SetFont (aFont);
// Paint the substitution text.
diff --git a/sd/source/ui/view/grviewsh.cxx b/sd/source/ui/view/grviewsh.cxx
index 7e635aef641b..361a538d66a2 100644
--- a/sd/source/ui/view/grviewsh.cxx
+++ b/sd/source/ui/view/grviewsh.cxx
@@ -76,7 +76,7 @@ void GraphicViewShell::ArrangeGUIElements()
Size aSize = mpLayerTabBar->GetSizePixel();
const Size aFrameSize (GetViewFrame()->GetWindow().GetOutputSizePixel());
- aSize.Height() = GetParentWindow()->GetFont().GetHeight() + 4;
+ aSize.Height() = GetParentWindow()->GetFont().GetFontHeight() + 4;
aSize.Width() = aFrameSize.Width();
Point aPos (0, maViewSize.Height() - aSize.Height());
diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx
index d3c04c2a77de..7834bf19d8ba 100644
--- a/sd/source/ui/view/outlview.cxx
+++ b/sd/source/ui/view/outlview.cxx
@@ -129,10 +129,10 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie
LanguageType eLang = mrOutliner.GetDefaultLanguage();
maPageNumberFont = OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE, eLang, GetDefaultFontFlags::NONE );
- maPageNumberFont.SetHeight( 500 );
+ maPageNumberFont.SetFontHeight( 500 );
maBulletFont.SetColor( COL_AUTO );
- maBulletFont.SetHeight( 1000 );
+ maBulletFont.SetFontHeight( 1000 );
maBulletFont.SetCharSet(RTL_TEXTENCODING_MS_1252); // and replacing other values by standard
maBulletFont.SetFamilyName( "StarSymbol" );
maBulletFont.SetWeight(WEIGHT_NORMAL);
@@ -1686,7 +1686,7 @@ IMPL_LINK_TYPED(OutlineView, PaintingFirstLineHdl, PaintFirstLineInfo*, pInfo, v
Point aTextPos( aImagePos.X() - aOffset.Width(), pInfo->mrStartPos.Y() );
vcl::Font aNewFont( OutputDevice::GetDefaultFont( DefaultFontType::SANS_UNICODE, eLang, GetDefaultFontFlags::NONE ) );
- aNewFont.SetSize( aFontSz );
+ aNewFont.SetFontSize( aFontSz );
aNewFont.SetVertical( bVertical );
aNewFont.SetOrientation( bVertical ? 2700 : 0 );
aNewFont.SetColor( COL_AUTO );
diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx
index 98c6615c4077..482ad6135812 100644
--- a/sd/source/ui/view/sdview.cxx
+++ b/sd/source/ui/view/sdview.cxx
@@ -379,7 +379,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
static sal_uInt32 nTextSizeFactor(100);
// use a factor to get more linear text size calculations
- aScaledVclFont.SetHeight( 500 * nTextSizeFactor );
+ aScaledVclFont.SetFontHeight( 500 * nTextSizeFactor );
// get basic geometry and get text size
drawinglayer::primitive2d::TextLayouterDevice aTextLayouter;
@@ -404,7 +404,7 @@ drawinglayer::primitive2d::Primitive2DContainer ViewRedirector::createRedirected
vcl::Font aVclFont;
basegfx::B2DVector aTextSizeAttribute;
- aVclFont.SetHeight( 500 );
+ aVclFont.SetFontHeight( 500 );
const drawinglayer::attribute::FontAttribute aFontAttribute(
drawinglayer::primitive2d::getFontAttributeFromVclFont(