summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
Diffstat (limited to 'chart2')
-rw-r--r--chart2/Library_chartcontroller.mk3
-rw-r--r--chart2/import_setup.mk1
-rw-r--r--chart2/qa/extras/chart2import.cxx5
-rw-r--r--chart2/source/controller/main/ChartController_Tools.cxx4
4 files changed, 9 insertions, 4 deletions
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index 56a80ea9e43d..ca50d52a1fd9 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -33,10 +33,11 @@ $(eval $(call gb_Library_use_libraries,chartcontroller,\
cppu \
cppuhelper \
drawinglayer \
+ docmodel \
editeng \
sal \
salhelper \
- i18nlangtag \
+ i18nlangtag \
sfx \
sot \
svl \
diff --git a/chart2/import_setup.mk b/chart2/import_setup.mk
index fb004d9830f4..a63d314bfc34 100644
--- a/chart2/import_setup.mk
+++ b/chart2/import_setup.mk
@@ -30,6 +30,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_import$(1), \
cppu \
cppuhelper \
drawinglayer \
+ docmodel \
editeng \
for \
forui \
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index 0b8acca9a3ab..b219baccad74 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -35,6 +35,7 @@
#include <com/sun/star/awt/Gradient2.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <basegfx/utils/gradienttools.hxx>
+#include <docmodel/uno/UnoGradientTools.hxx>
class Chart2ImportTest : public ChartTest
{
@@ -628,7 +629,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;
- const basegfx::BColorStops aColorStops(aTransparence.ColorStops);
+ const basegfx::BColorStops aColorStops = model::gradient::getColorStopsFromUno(aTransparence.ColorStops);
CPPUNIT_ASSERT_EQUAL(size_t(3), aColorStops.size());
CPPUNIT_ASSERT(basegfx::fTools::equal(aColorStops[0].getStopOffset(), 0.0));
@@ -671,7 +672,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);
- const basegfx::BColorStops aColorStops(aTransparenceGradient.ColorStops);
+ const basegfx::BColorStops aColorStops = model::gradient::getColorStopsFromUno(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 6d4a463a4487..48dbfaf7f673 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -47,6 +47,7 @@
#include <ObjectNameProvider.hxx>
#include <unonames.hxx>
+#include <com/sun/star/awt/Gradient.hpp>
#include <com/sun/star/chart2/DataPointLabel.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
#include <com/sun/star/graphic/XGraphic.hpp>
@@ -55,6 +56,7 @@
#include <com/sun/star/chart/ErrorBarStyle.hpp>
#include <com/sun/star/chart2/XRegressionCurveContainer.hpp>
+#include <docmodel/uno/UnoGradientTools.hxx>
#include <editeng/editview.hxx>
#include <editeng/outliner.hxx>
#include <svx/ActionDescriptionProvider.hxx>
@@ -957,7 +959,7 @@ void ChartController::executeDispatch_FillColor(sal_uInt32 nColor)
void ChartController::executeDispatch_FillGradient(std::u16string_view sJSONGradient)
{
basegfx::BGradient aBGradient = basegfx::BGradient::fromJSON(sJSONGradient);
- css::awt::Gradient aGradient = aBGradient.getAsGradient2();
+ css::awt::Gradient aGradient = model::gradient::createUnoGradient2(aBGradient);
try
{