office-gobmx/docmodel/source/uno/UnoThemeColor.cxx
Tomaž Vajngerl bd0f526f2d introduce docmodel comp., model::ThemeColor, use it in SvxColorItem
Added a new component docmodel, that has the document model types,
which only depend on other basic components. This is needed so the
types can be used in every relevant component - xmloff, oox, svx,
editeng,...

Introduces model::ThemeColor, which is a class used to store the
theme color data, including transformations (svx::Transformation).
For UNO use XThemeColor is added, and the implementation UnoThemeColor
which wraps svx::ThemeColor, so it can be tranported around.

Reactor all the code and tests to accomodate for this change.

Change-Id: I7ce6752cdfaf5e4d3b8e4d90314afa469dd65cfc
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144847
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
2023-01-12 23:15:58 +00:00

40 lines
1.1 KiB
C++

/* -*- 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/UnoThemeColor.hxx>
#include <cppuhelper/queryinterface.hxx>
using namespace css;
// css::lang::XUnoTunnel
UNO3_GETIMPLEMENTATION_IMPL(UnoThemeColor);
sal_Int16 UnoThemeColor::getType() { return sal_uInt16(maThemeColor.getType()); }
namespace model::theme
{
uno::Reference<util::XThemeColor> createXThemeColor(model::ThemeColor const& rThemeColor)
{
return new UnoThemeColor(rThemeColor);
}
void setFromXThemeColor(model::ThemeColor& rThemeColor,
uno::Reference<util::XThemeColor> const& rxColorTheme)
{
UnoThemeColor* pUnoThemeColor = comphelper::getFromUnoTunnel<UnoThemeColor>(rxColorTheme);
if (pUnoThemeColor)
{
rThemeColor = pUnoThemeColor->getThemeColor();
}
}
} // end model::theme
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */