summaryrefslogtreecommitdiffstats
path: root/chart2
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-08-09 13:27:49 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2023-09-06 16:56:27 +0200
commiteee4b3f8e46b85b3bb4f7cbe83b8af552594be89 (patch)
treeacfe160d74d0a0622ea439d40b0e96d13c295a18 /chart2
parentUpdate git submodules (diff)
downloadcore-eee4b3f8e46b85b3bb4f7cbe83b8af552594be89.tar.gz
core-eee4b3f8e46b85b3bb4f7cbe83b8af552594be89.zip
move BGradient to awt::Gradient2 UNO conversion into docmodel
This is needed because the module dependencies are an issues if the conversion is done in basegfx. The bigger issue will come when the ComplexColor conversion will be done as basegfx can't depend on docmodel because of circular dependencies. The BGradient is also more suitable for docmodel anyway as the previously it was part of the model and is not a basic (gfx) type - however this doesn't move the whole BGradient into docmodel yet. Change-Id: Id91ce52232f89f00e09b451c13da36e2854ae14b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/155674 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com> (cherry picked from commit 242bb3fdda5be165bd00701518df47cc1276438f) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156449 Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
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 890841a79849..d4bae4aa40d5 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 1a8f5071982f..da166261328f 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
{