summaryrefslogtreecommitdiff
path: root/filter
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-09-04 14:54:38 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2023-09-04 19:44:29 +0200
commita43f1ac6c964181cbaa4c889409688197cbf7a2b (patch)
tree1c6e1ef347e962c7c332961f4c52428f4a5a84b1 /filter
parent065609f86f730d4eedc6b7ae28382dc7daea11ac (diff)
tdf#48083 Import mso_fillBackground from ppt
Change-Id: Ic60fbc5fcfd7b38e7dd594690e5cfe784061a3d9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156517 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'filter')
-rw-r--r--filter/source/msfilter/msdffimp.cxx13
-rw-r--r--filter/source/msfilter/svdfppt.cxx17
2 files changed, 19 insertions, 11 deletions
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 8d6f9023ad16..bc28e62e2b16 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -74,6 +74,7 @@
#include <sfx2/fcontnr.hxx>
#include <svx/xbtmpit.hxx>
#include <svx/xsflclit.hxx>
+#include <svx/xfilluseslidebackgrounditem.hxx>
#include <svx/xflgrit.hxx>
#include <svx/xflftrit.hxx>
#include <svx/sdgcpitm.hxx>
@@ -1338,6 +1339,7 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
if ( nFillFlags & 0x10 )
{
auto eMSO_FillType = GetPropertyValue(DFF_Prop_fillType, mso_fillSolid);
+ bool bUseSlideBackground = false;
drawing::FillStyle eXFill = drawing::FillStyle_NONE;
switch( eMSO_FillType )
{
@@ -1366,7 +1368,10 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
case mso_fillShadeTitle : // special type - shade to title --- for PP
eXFill = drawing::FillStyle_GRADIENT;
break;
-// case mso_fillBackground : // Use the background fill color/pattern
+ case mso_fillBackground : // Use the background fill color/pattern
+ eXFill = drawing::FillStyle_NONE;
+ bUseSlideBackground = true;
+ break;
default: break;
}
rSet.Put( XFillStyleItem( eXFill ) );
@@ -1466,6 +1471,12 @@ void DffPropertyReader::ApplyFillAttributes( SvStream& rIn, SfxItemSet& rSet, co
}
}
}
+ else if (eXFill == drawing::FillStyle_BITMAP && bUseSlideBackground)
+ {
+ rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
+ XFillUseSlideBackgroundItem aFillBgItem(true);
+ rSet.Put(aFillBgItem);
+ }
}
else
rSet.Put( XFillStyleItem( drawing::FillStyle_NONE ) );
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index fa4c9c55d7dc..a4442cfb2393 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -53,6 +53,7 @@
#include <svx/svdopath.hxx>
#include <svx/svdotable.hxx>
#include <svx/xfillit0.hxx>
+#include <svx/xfilluseslidebackgrounditem.hxx>
#include <svx/xflbstit.hxx>
#include <svx/xflbmtit.hxx>
#include <svx/xflclit.hxx>
@@ -2930,17 +2931,13 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
{
if (!aProcessData.aBackgroundColoredObjects.empty())
{
- if (!rSlidePersist.pBObj)
+ for (auto const & pObject : aProcessData.aBackgroundColoredObjects)
{
- for (auto const & pObject : aProcessData.aBackgroundColoredObjects)
- {
- // The shape wants a background, but the slide doesn't have
- // one: default to white.
- SfxItemSet aNewSet(*pObject->GetMergedItemSet().GetPool());
- aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_SOLID));
- aNewSet.Put(XFillColorItem(OUString(), COL_WHITE));
- pObject->SetMergedItemSet(aNewSet);
- }
+ SfxItemSet aNewSet(*pObject->GetMergedItemSet().GetPool());
+ aNewSet.Put(XFillStyleItem(css::drawing::FillStyle_NONE));
+ XFillUseSlideBackgroundItem aFillBgItem(true);
+ aNewSet.Put(aFillBgItem);
+ pObject->SetMergedItemSet(aNewSet);
}
}
}