summaryrefslogtreecommitdiff
path: root/sc/source/ui/docshell/docsh3.cxx
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-05-16 22:10:10 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-06-22 02:21:15 +0200
commit3537cef02c25c2c2459d7900eed13eeec533b7ae (patch)
treeb3cfb0c6545e6e9bde146cbd9f328f96e8a9d5bd /sc/source/ui/docshell/docsh3.cxx
parent986c2d86a7b53a6599d014db7327f47cb33d4fea (diff)
sc: factor out color from setting vcl::Font from a ItemSet
vcl::Font color parameter is deprecated so we need to handle the color separately from font data. This refactors GetFont into 2 separate functions - fillFontOnly and fillColor, where fillFont now does the same as previously GetFont function did. All GetFont calls have been changed depending on if we need only the font data or also color - where the color is now treated in a different call. There are a couple of calls where fillFont was used, because to change that needs a more complex refactoring. Change-Id: I0a2ce50a0cb28d196fcff87e1e80099a2bb60a9e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151858 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sc/source/ui/docshell/docsh3.cxx')
-rw-r--r--sc/source/ui/docshell/docsh3.cxx4
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index 5d3cd076f623..789737e5f824 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -378,7 +378,7 @@ void ScDocShell::CalcOutputFactor()
vcl::Font aOldFont = pRefDev->GetFont();
pRefDev->SetMapMode(MapMode(MapUnit::MapPixel));
- pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pRefDev); // font color doesn't matter here
+ pPattern->fillFontOnly(aDefFont, pRefDev); // font color doesn't matter here
pRefDev->SetFont(aDefFont);
nPrinterWidth = pRefDev->PixelToLogic(Size(pRefDev->GetTextWidth(aTestString), 0), MapMode(MapUnit::Map100thMM)).Width();
pRefDev->SetFont(aOldFont);
@@ -386,7 +386,7 @@ void ScDocShell::CalcOutputFactor()
ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *Application::GetDefaultDevice() );
pVirtWindow->SetMapMode(MapMode(MapUnit::MapPixel));
- pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here
+ pPattern->fillFontOnly(aDefFont, pVirtWindow); // font color doesn't matter here
pVirtWindow->SetFont(aDefFont);
double nWindowWidth = pVirtWindow->GetTextWidth(aTestString) / ScGlobal::nScreenPPTX;
nWindowWidth = o3tl::convert(nWindowWidth, o3tl::Length::twip, o3tl::Length::mm100);