diff options
author | Maxim Monastirsky <momonasmon@gmail.com> | 2023-04-19 01:47:10 +0300 |
---|---|---|
committer | Maxim Monastirsky <momonasmon@gmail.com> | 2023-04-19 13:31:17 +0200 |
commit | 0f6e6e82a4a693a6970540db6e98d0302f3fefa6 (patch) | |
tree | 7e05587e23f22f23f9a1875ba63547f4845fd559 /sc/source | |
parent | b28fd940ca46828be624679863364b4db89dd38c (diff) |
sc drawstyles: Fix export of transparency
Change-Id: I1abf277223718ae2d650728e5bd141372a771a87
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/150590
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky <momonasmon@gmail.com>
Diffstat (limited to 'sc/source')
-rw-r--r-- | sc/source/ui/unoobj/styleuno.cxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/tabvwsha.cxx | 25 |
2 files changed, 32 insertions, 0 deletions
diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index f4280dd2a679..a97c12e3dec5 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -2025,6 +2025,13 @@ uno::Any ScStyleObj::getPropertyValue_Impl( std::u16string_view aPropertyName ) { if (!SvxUnoTextRangeBase::GetPropertyValueHelper(*pItemSet, pResultEntry, aAny)) aAny = SvxItemPropertySet_getPropertyValue(pResultEntry, *pItemSet); + + // since the sfx uint16 item now exports a sal_Int32, we may have to fix this here + if (pResultEntry->aType == ::cppu::UnoType<sal_Int16>::get() && + aAny.getValueType() == ::cppu::UnoType<sal_Int32>::get()) + { + aAny <<= static_cast<sal_Int16>(aAny.get<sal_Int32>()); + } } } } diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index a3eb7bd5403d..b309ac6156d5 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -40,6 +40,13 @@ #include <svl/stritem.hxx> #include <svl/whiter.hxx> #include <svx/numinf.hxx> +#include <svx/xbtmpit.hxx> +#include <svx/xlndsit.hxx> +#include <svx/xlnstit.hxx> +#include <svx/xlnedit.hxx> +#include <svx/xflgrit.hxx> +#include <svx/xflftrit.hxx> +#include <svx/xflhtit.hxx> #include <svx/zoomslideritem.hxx> #include <global.hxx> @@ -1587,6 +1594,24 @@ void ScTabViewShell::ExecStyle( SfxRequest& rReq ) SfxItemSet& rAttr = pStyleSheet->GetItemSet(); sdr::properties::CleanupFillProperties(rAttr); + // check for unique names of named items for xml + auto checkForUniqueItem = [&] (auto nWhichId) + { + if (auto pOldItem = rAttr.GetItemIfSet(nWhichId, false)) + { + if (auto pNewItem = pOldItem->checkForUniqueItem(&GetDrawView()->GetModel())) + rAttr.Put(std::move(pNewItem)); + } + }; + + checkForUniqueItem(XATTR_FILLBITMAP); + checkForUniqueItem(XATTR_LINEDASH); + checkForUniqueItem(XATTR_LINESTART); + checkForUniqueItem(XATTR_LINEEND); + checkForUniqueItem(XATTR_FILLGRADIENT); + checkForUniqueItem(XATTR_FILLFLOATTRANSPARENCE); + checkForUniqueItem(XATTR_FILLHATCH); + static_cast<SfxStyleSheet*>(pStyleSheet)->Broadcast(SfxHint(SfxHintId::DataChanged)); GetScDrawView()->InvalidateAttribs(); } |