summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael Stahl <michael.stahl@allotropia.de>2021-07-14 19:50:18 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2021-07-19 01:53:55 +0200
commit6511448b408887811f5026ccdd1b170e3731afd8 (patch)
treebc74f0d7e2e1ac1c35e0d3fb96355d56fa4e96a4 /include
parentb7b21c2d622672dc7f9bddbd1d685ef5db65b106 (diff)
tdf#92796 ODF import: remove unused bitmap fills
With CWS impress64 a partial fix for this was implemented to drop unreferenced named items including all non-color fills after ODF import, but this is only done in sd so move the code that does that to svx and call it from sc and sw as well. Implement some UNO interface for this, it's at least better than a magic string, and not obvious how a better solution would look like since it's known only at the end of the import if a bitmap is used or not. Another problem: when the Area tab is used to change to a different kind of fill, the items with the details for the previous fill aren't cleared, and so they are written to ODF files. Hence bitmaps in the file can be referenced even if they aren't actually used, and bloat up the files. Fix this by dropping all unused draw:fill-image-name attributes in ODF import. Also do the same for Gradient and Hatch fills; Transparency gradients can be combined with anything so leave them as they are. Change-Id: I0b591fd9f963d974d0c3e7208b99621ad61dd93c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118950 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> (cherry picked from commit 86c0f58b6f9f392865196606173d1b98a6897f32) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119036 Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'include')
-rw-r--r--include/svx/xmlgrhlp.hxx4
-rw-r--r--include/xmloff/xmlimppr.hxx12
2 files changed, 15 insertions, 1 deletions
diff --git a/include/svx/xmlgrhlp.hxx b/include/svx/xmlgrhlp.hxx
index 966339451c2f..c733ce5318bb 100644
--- a/include/svx/xmlgrhlp.hxx
+++ b/include/svx/xmlgrhlp.hxx
@@ -122,6 +122,10 @@ public:
virtual OUString SAL_CALL resolveOutputStream( const css::uno::Reference< css::io::XOutputStream >& rxBinaryStream ) override;
};
+namespace svx {
+ SVXCORE_DLLPUBLIC void DropUnusedNamedItems(css::uno::Reference<css::uno::XInterface> const& xModel);
+}
+
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/xmloff/xmlimppr.hxx b/include/xmloff/xmlimppr.hxx
index c5e32d064998..8ce28dd5c7df 100644
--- a/include/xmloff/xmlimppr.hxx
+++ b/include/xmloff/xmlimppr.hxx
@@ -39,6 +39,7 @@ namespace com::sun::star::uno { template <typename > class Reference; }
namespace com::sun::star::uno { template <typename > class Sequence; }
namespace com::sun::star::xml::sax { class XAttributeList; }
namespace com::sun::star::xml::sax { class XFastAttributeList; }
+namespace com::sun::star::drawing { enum class SAL_DLLPUBLIC_RTTI FillStyle; }
struct XMLPropertyState;
class XMLPropertySetMapper;
@@ -55,8 +56,9 @@ class SvXMLImport;
*/
struct ContextID_Index_Pair
{
- sal_Int16 nContextID;
+ sal_Int16 /*const*/ nContextID;
sal_Int32 nIndex;
+ css::drawing::FillStyle /*const*/ nExpectedFillStyle;
};
class XMLOFF_DLLPUBLIC SvXMLImportPropertyMapper : public salhelper::SimpleReferenceObject
@@ -197,6 +199,14 @@ inline const rtl::Reference< XMLPropertySetMapper >&
return maPropMapper;
}
+namespace xmloff {
+
+bool IsIgnoreFillStyleNamedItem(
+ css::uno::Reference<css::beans::XPropertySet> const& xProps,
+ css::drawing::FillStyle nExpectedFillStyle);
+
+}
+
#endif // INCLUDED_XMLOFF_XMLIMPPR_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */