summaryrefslogtreecommitdiff
path: root/svx/qa/unit
diff options
context:
space:
mode:
Diffstat (limited to 'svx/qa/unit')
-rw-r--r--svx/qa/unit/styles.cxx32
-rw-r--r--svx/qa/unit/xoutdev.cxx33
2 files changed, 31 insertions, 34 deletions
diff --git a/svx/qa/unit/styles.cxx b/svx/qa/unit/styles.cxx
index d44bf9ac4dc8..05eeb451ba1b 100644
--- a/svx/qa/unit/styles.cxx
+++ b/svx/qa/unit/styles.cxx
@@ -13,7 +13,7 @@
#include <com/sun/star/drawing/XDrawPagesSupplier.hpp>
#include <com/sun/star/drawing/XMasterPageTarget.hpp>
#include <com/sun/star/text/XTextRange.hpp>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
using namespace ::com::sun::star;
@@ -75,30 +75,28 @@ CPPUNIT_TEST_FIXTURE(Test, testThemeChange)
// The theme color of this filled shape is set by the PPTX import:
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xShape4->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xShape4->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
}
uno::Reference<beans::XPropertySet> xShape5(xDrawPageShapes->getByIndex(5), uno::UNO_QUERY);
// Blue, lighter.
CPPUNIT_ASSERT_EQUAL(Color(0xb4c7e7), GetShapeFillColor(xShape5));
// The theme index, and effects (lum mod, lum off) are set by the PPTX import:
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xShape5->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xShape5->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod,
- aThemeColor.getTransformations()[0].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aThemeColor.getTransformations()[0].mnValue);
+ aComplexColor.getTransformations()[0].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(4000), aComplexColor.getTransformations()[0].mnValue);
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff,
- aThemeColor.getTransformations()[1].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aThemeColor.getTransformations()[1].mnValue);
+ aComplexColor.getTransformations()[1].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(6000), aComplexColor.getTransformations()[1].mnValue);
}
// When changing the master slide of slide 1 to use the theme of the second master slide:
uno::Reference<drawing::XMasterPageTarget> xDrawPage2(
diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx
index 6cd68a0c8172..800c709770de 100644
--- a/svx/qa/unit/xoutdev.cxx
+++ b/svx/qa/unit/xoutdev.cxx
@@ -19,7 +19,7 @@
#include <vcl/graphicfilter.hxx>
#include <svx/xoutbmp.hxx>
#include <vcl/filter/PDFiumLibrary.hxx>
-#include <docmodel/uno/UnoThemeColor.hxx>
+#include <docmodel/uno/UnoComplexColor.hxx>
using namespace com::sun::star;
@@ -103,28 +103,27 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testFillColorThemeUnoApi)
uno::Reference<beans::XPropertySet> xShape(xPage->getByIndex(0), uno::UNO_QUERY);
// Set theme color
{
- model::ThemeColor aThemeColor;
- aThemeColor.setType(model::ThemeColorType::Accent1);
- aThemeColor.addTransformation({ model::TransformationType::LumMod, 2000 });
- aThemeColor.addTransformation({ model::TransformationType::LumOff, 8000 });
- xShape->setPropertyValue("FillColorThemeReference",
- uno::Any(model::theme::createXThemeColor(aThemeColor)));
+ model::ComplexColor aComplexColor;
+ aComplexColor.setSchemeColor(model::ThemeColorType::Accent1);
+ aComplexColor.addTransformation({ model::TransformationType::LumMod, 2000 });
+ aComplexColor.addTransformation({ model::TransformationType::LumOff, 8000 });
+ xShape->setPropertyValue("FillComplexColor",
+ uno::Any(model::color::createXComplexColor(aComplexColor)));
}
// Then make sure the value we read back is the expected one:
{
- uno::Reference<util::XThemeColor> xThemeColor;
- CPPUNIT_ASSERT(xShape->getPropertyValue("FillColorThemeReference") >>= xThemeColor);
- CPPUNIT_ASSERT(xThemeColor.is());
- model::ThemeColor aThemeColor;
- model::theme::setFromXThemeColor(aThemeColor, xThemeColor);
- CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aThemeColor.getType());
+ uno::Reference<util::XComplexColor> xComplexColor;
+ CPPUNIT_ASSERT(xShape->getPropertyValue("FillComplexColor") >>= xComplexColor);
+ CPPUNIT_ASSERT(xComplexColor.is());
+ auto aComplexColor = model::color::getFromXComplexColor(xComplexColor);
+ CPPUNIT_ASSERT_EQUAL(model::ThemeColorType::Accent1, aComplexColor.getSchemeType());
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumMod,
- aThemeColor.getTransformations()[0].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aThemeColor.getTransformations()[0].mnValue);
+ aComplexColor.getTransformations()[0].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(2000), aComplexColor.getTransformations()[0].mnValue);
CPPUNIT_ASSERT_EQUAL(model::TransformationType::LumOff,
- aThemeColor.getTransformations()[1].meType);
- CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aThemeColor.getTransformations()[1].mnValue);
+ aComplexColor.getTransformations()[1].meType);
+ CPPUNIT_ASSERT_EQUAL(sal_Int16(8000), aComplexColor.getTransformations()[1].mnValue);
}
}