diff options
author | Sarper Akdemir <sarper.akdemir@collabora.com> | 2023-03-15 19:25:03 +0300 |
---|---|---|
committer | Sarper Akdemir <sarper.akdemir@collabora.com> | 2023-04-18 17:43:18 +0200 |
commit | c27946fb157fe46fbfaefbe93f2c6794b1af4411 (patch) | |
tree | 0ddcaa0e4439713835d8e6b80121336adaf056e5 /include/svx | |
parent | be7ce49f33035fcd289a5ffc7a2307bd9a566780 (diff) |
tdf#150020 pptx import: handle algn for outerShdw
Introduces RectangleAlignmentItem that holds a value of the enum
model::RectangleAlignment.
Introduces SDRATTR_SHADOWALIGNMENT that holds alignment for a shadow.
Implements import of algn for outerShdw.
Makes the alignment considered while the shadow is being scaled.
Also adds a unit test that covers this.
Change-Id: I8f4eaed5f0d9428a7f405c65f19237f9e70ca151
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148934
Tested-by: Jenkins
Reviewed-by: Sarper Akdemir <sarper.akdemir@collabora.com>
Diffstat (limited to 'include/svx')
-rw-r--r-- | include/svx/RectangleAlignmentItem.hxx | 42 | ||||
-rw-r--r-- | include/svx/svddef.hxx | 4 | ||||
-rw-r--r-- | include/svx/unoshprp.hxx | 3 |
3 files changed, 47 insertions, 2 deletions
diff --git a/include/svx/RectangleAlignmentItem.hxx b/include/svx/RectangleAlignmentItem.hxx new file mode 100644 index 000000000000..91179e628a40 --- /dev/null +++ b/include/svx/RectangleAlignmentItem.hxx @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */ +/* + * 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/. + */ + +#pragma once + +#include <svl/eitem.hxx> +#include <svx/svxdllapi.h> + +namespace model +{ +enum class RectangleAlignment; +} + +/** Item that holds a rectangle alignment value. + + e.g. Top Left, Top, Top Right, Center. + @see model::RectangleAlignment + */ +class SVXCORE_DLLPUBLIC SvxRectangleAlignmentItem final + : public SfxEnumItem<model::RectangleAlignment> +{ +public: + SvxRectangleAlignmentItem(sal_uInt16 nWhich, model::RectangleAlignment nValue); + virtual ~SvxRectangleAlignmentItem() override; + + SvxRectangleAlignmentItem(SvxRectangleAlignmentItem const&) = default; + SvxRectangleAlignmentItem(SvxRectangleAlignmentItem&&) = default; + SvxRectangleAlignmentItem& operator=(SvxRectangleAlignmentItem const&) = delete; + SvxRectangleAlignmentItem& operator=(SvxRectangleAlignmentItem&&) = delete; + + virtual SvxRectangleAlignmentItem* Clone(SfxItemPool* pPool = nullptr) const override; + + virtual sal_uInt16 GetValueCount() const override; +}; + +/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */ diff --git a/include/svx/svddef.hxx b/include/svx/svddef.hxx index 84db8c4d0aa4..18088731bca1 100644 --- a/include/svx/svddef.hxx +++ b/include/svx/svddef.hxx @@ -160,6 +160,7 @@ class SvxBoxInfoItem; class SvxBoxItem; class SvxColorItem; class SvxLineItem; +class SvxRectangleAlignmentItem; class SvxTextRotateItem; class SvxWritingModeItem; class XColorItem; @@ -191,7 +192,8 @@ constexpr TypedWhichId<SfxVoidItem> SDRATTR_SHADOWPERSP (SDRATTR_SHADO constexpr TypedWhichId<SdrMetricItem> SDRATTR_SHADOWSIZEX (SDRATTR_SHADOW_FIRST+ 7); constexpr TypedWhichId<SdrMetricItem> SDRATTR_SHADOWSIZEY (SDRATTR_SHADOW_FIRST+ 8); constexpr TypedWhichId<SdrMetricItem> SDRATTR_SHADOWBLUR (SDRATTR_SHADOW_FIRST+ 9); -constexpr sal_uInt16 SDRATTR_SHADOW_LAST (SDRATTR_SHADOWBLUR); /* 1078 */ /* 1078 */ /* 1061 */ /* Pool V1: 1039 */ +constexpr TypedWhichId<SvxRectangleAlignmentItem> SDRATTR_SHADOWALIGNMENT(SDRATTR_SHADOW_FIRST + 10); +constexpr sal_uInt16 SDRATTR_SHADOW_LAST (SDRATTR_SHADOWALIGNMENT); /* 1078 */ /* 1078 */ /* 1061 */ /* Pool V1: 1039 */ constexpr sal_uInt16 SDRATTR_CAPTION_FIRST (SDRATTR_SHADOW_LAST + 1); /* 1080 */ /* 1080 */ /* 1063 */ /* Pool V1: 1041 */ constexpr TypedWhichId<SdrCaptionTypeItem> SDRATTR_CAPTIONTYPE (SDRATTR_CAPTION_FIRST+ 0); /* 1080 */ /* 1080 */ /* 1063 */ diff --git a/include/svx/unoshprp.hxx b/include/svx/unoshprp.hxx index a1fa9412afc9..c385f0766358 100644 --- a/include/svx/unoshprp.hxx +++ b/include/svx/unoshprp.hxx @@ -230,7 +230,8 @@ { UNO_NAME_SHADOWYDIST, SDRATTR_SHADOWYDIST, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ { UNO_NAME_SHADOWSIZEX, SDRATTR_SHADOWSIZEX, ::cppu::UnoType<sal_Int32>::get(), 0, 0}, \ { UNO_NAME_SHADOWSIZEY, SDRATTR_SHADOWSIZEY, ::cppu::UnoType<sal_Int32>::get(), 0, 0}, \ - { UNO_NAME_SHADOWBLUR, SDRATTR_SHADOWBLUR, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, + { UNO_NAME_SHADOWBLUR, SDRATTR_SHADOWBLUR, ::cppu::UnoType<sal_Int32>::get(), 0, 0, PropertyMoreFlags::METRIC_ITEM}, \ + { UNO_NAME_SHADOWALIGNMENT, SDRATTR_SHADOWALIGNMENT, /*ENUM*/::cppu::UnoType<sal_Int32>::get(), 0, 0}, #define LINE_PROPERTIES_DEFAULTS\ |