diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2023-05-16 22:10:10 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2023-06-22 02:21:15 +0200 |
commit | 3537cef02c25c2c2459d7900eed13eeec533b7ae (patch) | |
tree | b3cfb0c6545e6e9bde146cbd9f328f96e8a9d5bd /sc/source/ui/vba | |
parent | 986c2d86a7b53a6599d014db7327f47cb33d4fea (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/vba')
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 089e92f8c948..913b05ceffc9 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -3834,8 +3834,8 @@ static double getDefaultCharWidth( ScDocShell* pDocShell ) OutputDevice* pRefDevice = rDoc.GetRefDevice(); ScPatternAttr* pAttr = rDoc.GetDefPattern(); vcl::Font aDefFont; - pAttr->GetFont( aDefFont, SC_AUTOCOL_BLACK, pRefDevice ); - pRefDevice->SetFont( aDefFont ); + pAttr->fillFontOnly(aDefFont, pRefDevice); + pRefDevice->SetFont(aDefFont); tools::Long nCharWidth = pRefDevice->GetTextWidth( OUString( '0' ) ); // 1/100th mm return o3tl::convert<double>(nCharWidth, o3tl::Length::mm100, o3tl::Length::pt); } |