diff options
author | Armin Le Grand (allotropia) <armin.le.grand.extern@allotropia.de> | 2023-05-12 15:32:51 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@me.com> | 2023-05-15 15:19:53 +0200 |
commit | 438f0752deaf7d6e6d9d1df381b64aca4628e944 (patch) | |
tree | f1907b25dad1cbf2604b16c657e11f5623c8b5b2 /chart2 | |
parent | efa965969c6d3dfe5745a535605a6b9a482a03bd (diff) |
MCGR: consolidations/cleanups for changes so far
Change-Id: I85cf40e4803b0485bb40349d8e81adc8123666c4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151706
Tested-by: Jenkins
Reviewed-by: Armin Le Grand <Armin.Le.Grand@me.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/inc/pch/precompiled_chartcontroller.hxx | 1 | ||||
-rw-r--r-- | chart2/qa/extras/chart2import.cxx | 8 | ||||
-rw-r--r-- | chart2/source/controller/main/ChartController_Tools.cxx | 11 |
3 files changed, 7 insertions, 13 deletions
diff --git a/chart2/inc/pch/precompiled_chartcontroller.hxx b/chart2/inc/pch/precompiled_chartcontroller.hxx index 6839b807696d..ba4ccbddf15e 100644 --- a/chart2/inc/pch/precompiled_chartcontroller.hxx +++ b/chart2/inc/pch/precompiled_chartcontroller.hxx @@ -409,7 +409,6 @@ #include <svx/svxdllapi.h> #include <svx/xdash.hxx> #include <svx/xdef.hxx> -#include <svx/xgrad.hxx> #include <svx/xhatch.hxx> #include <svx/xit.hxx> #include <svx/xpoly.hxx> diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx index fc5caf42c3a7..890841a79849 100644 --- a/chart2/qa/extras/chart2import.cxx +++ b/chart2/qa/extras/chart2import.cxx @@ -628,9 +628,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testBnc889755) uno::Reference<beans::XPropertySet> xShapeProps(xPage->getByIndex(4), uno::UNO_QUERY_THROW); awt::Gradient2 aTransparence; xShapeProps->getPropertyValue("FillTransparenceGradient") >>= aTransparence; - - basegfx::ColorStops aColorStops; - basegfx::utils::fillColorStopsFromGradient2(aColorStops, aTransparence); + const basegfx::BColorStops aColorStops(aTransparence.ColorStops); CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size()); CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0)); @@ -673,9 +671,7 @@ CPPUNIT_TEST_FIXTURE(Chart2ImportTest, testTransparencyGradientValue) uno::Reference< container::XNameAccess > xTransparenceGradient(xFact->createInstance("com.sun.star.drawing.TransparencyGradientTable"), uno::UNO_QUERY); uno::Any rTransparenceValue = xTransparenceGradient->getByName(sTranspGradientName); CPPUNIT_ASSERT(rTransparenceValue >>= aTransparenceGradient); - - basegfx::ColorStops aColorStops; - basegfx::utils::fillColorStopsFromGradient2(aColorStops, aTransparenceGradient); + const basegfx::BColorStops aColorStops(aTransparenceGradient.ColorStops); // MCGR: Use the whole completely imported transparency gradient to check for correctness CPPUNIT_ASSERT_EQUAL(size_t(2), aColorStops.size()); diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index acc5dd950391..1a8f5071982f 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -74,7 +74,6 @@ #include <svx/unoapi.hxx> #include <svx/unopage.hxx> #include <svx/unoshape.hxx> -#include <svx/xgrad.hxx> #include <PropertyHelper.hxx> #include <LibreOfficeKit/LibreOfficeKitEnums.h> @@ -957,8 +956,8 @@ void ChartController::executeDispatch_FillColor(sal_uInt32 nColor) void ChartController::executeDispatch_FillGradient(std::u16string_view sJSONGradient) { - XGradient aXGradient = XGradient::fromJSON(sJSONGradient); - css::awt::Gradient aGradient = aXGradient.toGradientUNO(); + basegfx::BGradient aBGradient = basegfx::BGradient::fromJSON(sJSONGradient); + css::awt::Gradient aGradient = aBGradient.getAsGradient2(); try { @@ -973,9 +972,9 @@ void ChartController::executeDispatch_FillGradient(std::u16string_view sJSONGrad if( xPropSet.is() ) { OUString aPrefferedName = - OUString::number(static_cast<sal_Int32>(Color(aXGradient.GetColorStops().front().getStopColor()))) - + OUString::number(static_cast<sal_Int32>(Color(aXGradient.GetColorStops().back().getStopColor()))) - + OUString::number(static_cast<sal_Int32>(aXGradient.GetAngle().get())); + OUString::number(static_cast<sal_Int32>(Color(aBGradient.GetColorStops().front().getStopColor()))) + + OUString::number(static_cast<sal_Int32>(Color(aBGradient.GetColorStops().back().getStopColor()))) + + OUString::number(static_cast<sal_Int32>(aBGradient.GetAngle().get())); OUString aNewName = PropertyHelper::addGradientUniqueNameToTable(css::uno::Any(aGradient), xChartModel, |