summaryrefslogtreecommitdiff
path: root/docmodel
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2023-04-30 20:58:14 +0900
committerTomaž Vajngerl <quikee@gmail.com>2023-05-08 07:23:09 +0200
commit7a10187042c1a2b402a9872f66108cfcd8080117 (patch)
treee6d2e4614786fb5a1af630c4524fb0682f8c76a5 /docmodel
parent002ae41bb6088002ba3ed0188ac822fb823a23f9 (diff)
XComplexColor and UnoComplexColor - a wrapper for model:ComplexColor
Change-Id: I40107fc38a4d080d969fee862595660d2f585e51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151225 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'docmodel')
-rw-r--r--docmodel/Library_docmodel.mk1
-rw-r--r--docmodel/source/uno/UnoComplexColor.cxx37
2 files changed, 38 insertions, 0 deletions
diff --git a/docmodel/Library_docmodel.mk b/docmodel/Library_docmodel.mk
index 8a07e6532dad..7f0623bcbeda 100644
--- a/docmodel/Library_docmodel.mk
+++ b/docmodel/Library_docmodel.mk
@@ -10,6 +10,7 @@
$(eval $(call gb_Library_Library,docmodel))
$(eval $(call gb_Library_add_exception_objects,docmodel,\
+ docmodel/source/uno/UnoComplexColor \
docmodel/source/uno/UnoThemeColor \
docmodel/source/uno/UnoTheme \
docmodel/source/theme/ColorSet \
diff --git a/docmodel/source/uno/UnoComplexColor.cxx b/docmodel/source/uno/UnoComplexColor.cxx
new file mode 100644
index 000000000000..bffa81329f70
--- /dev/null
+++ b/docmodel/source/uno/UnoComplexColor.cxx
@@ -0,0 +1,37 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ */
+
+#include <docmodel/uno/UnoComplexColor.hxx>
+#include <cppuhelper/queryinterface.hxx>
+
+using namespace css;
+
+css::util::Color UnoComplexColor::getColor() { return css::util::Color(maColor.getRGBColor()); }
+
+namespace model::color
+{
+uno::Reference<util::XComplexColor> createXComplexColor(model::ComplexColor const& rColor)
+{
+ return new UnoComplexColor(rColor);
+}
+
+model::ComplexColor
+getFromXComplexColor(css::uno::Reference<css::util::XComplexColor> const& rxColor)
+{
+ model::ComplexColor aComplexColor;
+ UnoComplexColor const* pUnoComplexColor = static_cast<UnoComplexColor const*>(rxColor.get());
+ if (pUnoComplexColor)
+ aComplexColor = pUnoComplexColor->getComplexColor();
+ return aComplexColor;
+}
+
+} // end model::color
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */