summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-08-09 13:27:49 +0200
committerTomaž Vajngerl <quikee@gmail.com>2023-08-21 09:27:12 +0200
commit242bb3fdda5be165bd00701518df47cc1276438f (patch)
treebc61d6d7fa1b3ee628bfe2ff875c03b89728f59f /xmloff
parent84b12cd3ea96ee9b02365b5239f391af242f7303 (diff)
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>
Diffstat (limited to 'xmloff')
-rw-r--r--xmloff/source/style/GradientStyle.cxx3
-rw-r--r--xmloff/source/style/TransGradientStyle.cxx3
2 files changed, 4 insertions, 2 deletions
diff --git a/xmloff/source/style/GradientStyle.cxx b/xmloff/source/style/GradientStyle.cxx
index d80b3f866482..29a277a79bef 100644
--- a/xmloff/source/style/GradientStyle.cxx
+++ b/xmloff/source/style/GradientStyle.cxx
@@ -35,6 +35,7 @@
#include <xmloff/xmltoken.hxx>
#include <xmloff/xmluconv.hxx>
#include <basegfx/utils/bgradient.hxx>
+#include <docmodel/uno/UnoGradientTools.hxx>
using namespace ::com::sun::star;
using namespace ::xmloff::token;
@@ -226,7 +227,7 @@ void XMLGradientStyleExport::exportXML(
if (!rValue.has<css::awt::Gradient2>() && !rValue.has<css::awt::Gradient>())
return;
- basegfx::BGradient aGradient(rValue);
+ basegfx::BGradient aGradient = model::gradient::getFromAny(rValue);
// Export of axial gradient to OOXML produces a symmetrical linear multi-color gradient. Import
// does not regenerate it as 'axial' because that is not needed for MCGR. For export to ODF we
diff --git a/xmloff/source/style/TransGradientStyle.cxx b/xmloff/source/style/TransGradientStyle.cxx
index 3e89edb683f5..74b7670c024f 100644
--- a/xmloff/source/style/TransGradientStyle.cxx
+++ b/xmloff/source/style/TransGradientStyle.cxx
@@ -35,6 +35,7 @@
#include <xmloff/xmlnamespace.hxx>
#include <xmloff/xmltkmap.hxx>
#include <xmloff/xmluconv.hxx>
+#include <docmodel/uno/UnoGradientTools.hxx>
using namespace ::com::sun::star;
@@ -178,7 +179,7 @@ void XMLTransGradientStyleExport::exportXML(
if (!rValue.has<css::awt::Gradient2>() && !rValue.has<css::awt::Gradient>())
return;
- basegfx::BGradient aGradient(rValue);
+ basegfx::BGradient aGradient = model::gradient::getFromAny(rValue);
aGradient.tryToConvertToAxial();