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/qa/unit/uicalc/uicalc2.cxx | |
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/qa/unit/uicalc/uicalc2.cxx')
-rw-r--r-- | sc/qa/unit/uicalc/uicalc2.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sc/qa/unit/uicalc/uicalc2.cxx b/sc/qa/unit/uicalc/uicalc2.cxx index 69db567f305c..3be123de219d 100644 --- a/sc/qa/unit/uicalc/uicalc2.cxx +++ b/sc/qa/unit/uicalc/uicalc2.cxx @@ -1218,16 +1218,16 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testUnallocatedColumnsAttributes) // That shouldn't need allocating more columns, just changing the default attribute. CPPUNIT_ASSERT_EQUAL(INITIALCOLCOUNT, pDoc->GetAllocatedColumnsCount(0)); vcl::Font aFont; - pDoc->GetPattern(pDoc->MaxCol(), 0, 0)->GetFont(aFont, SC_AUTOCOL_RAW); + pDoc->GetPattern(pDoc->MaxCol(), 0, 0)->fillFontOnly(aFont); CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight()); goToCell("A2:CV2"); // first 100 cells in row 2 dispatchCommand(mxComponent, ".uno:Bold", {}); // These need to be explicitly allocated. CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0)); - pDoc->GetPattern(99, 1, 0)->GetFont(aFont, SC_AUTOCOL_RAW); + pDoc->GetPattern(99, 1, 0)->fillFontOnly(aFont); CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight()); - pDoc->GetPattern(100, 1, 0)->GetFont(aFont, SC_AUTOCOL_RAW); + pDoc->GetPattern(100, 1, 0)->fillFontOnly(aFont); CPPUNIT_ASSERT_EQUAL_MESSAGE("font should not be bold", WEIGHT_NORMAL, aFont.GetWeight()); goToCell("CW3:" + pDoc->MaxColAsString() + "3"); // All but first 100 cells in row 3. @@ -1235,9 +1235,9 @@ CPPUNIT_TEST_FIXTURE(ScUiCalcTest2, testUnallocatedColumnsAttributes) // First 100 columns need to be allocated to not be bold, the rest should be handled // by the default attribute. CPPUNIT_ASSERT_EQUAL(SCCOL(100), pDoc->GetAllocatedColumnsCount(0)); - pDoc->GetPattern(99, 2, 0)->GetFont(aFont, SC_AUTOCOL_RAW); + pDoc->GetPattern(99, 2, 0)->fillFontOnly(aFont); CPPUNIT_ASSERT_EQUAL_MESSAGE("font should not be bold", WEIGHT_NORMAL, aFont.GetWeight()); - pDoc->GetPattern(100, 2, 0)->GetFont(aFont, SC_AUTOCOL_RAW); + pDoc->GetPattern(100, 2, 0)->fillFontOnly(aFont); CPPUNIT_ASSERT_EQUAL_MESSAGE("font should be bold", WEIGHT_BOLD, aFont.GetWeight()); } |