29 #include <com/sun/star/frame/XModel.hpp>
30 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
31 #include <osl/diagnose.h>
34 #include <com/sun/star/beans/XPropertySet.hpp>
35 #include <com/sun/star/beans/XPropertySetInfo.hpp>
36 #include <com/sun/star/drawing/FillStyle.hpp>
37 #include <com/sun/star/drawing/BitmapMode.hpp>
50 const OUString& rValue )
67 m_bIsFillStyleAlreadyConverted(
false)
77 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
93 sal_Int32 nStartIndex (-1);
94 sal_Int32 nEndIndex (-1);
98 while ( nIndex < rMapper->GetEntryCount() && !bEnd)
105 nStartIndex = nIndex;
118 GetProperties(), xImpPrMap, nStartIndex, nEndIndex, bHeader);
129 sal_Int32 nEndIndex (-1);
132 sal_Int16 nContextID;
133 while ( nIndex < rMapper->GetEntryCount() && !bEnd)
135 nContextID = rMapper->GetEntryContextId( nIndex );
149 xImpPrMap, 0, nEndIndex,
Page);
162 const uno::Reference<beans::XPropertySet> & xPropSet,
169 static constexpr OUStringLiteral s_FillStyle(
u"FillStyle");
170 static constexpr OUStringLiteral s_HeaderFillStyle(
u"HeaderFillStyle");
171 static constexpr OUStringLiteral s_FooterFillStyle(
u"FooterFillStyle");
220 {-1, -1, drawing::FillStyle::FillStyle_GRADIENT}
233 xImpPrMap->FillPropertySet(
GetProperties(), xPropSet, aContextIDs);
237 Reference<XPropertySetInfo>
const xInfo(xPropSet->getPropertySetInfo());
244 if (xInfo->hasPropertyByName(
"FillStyle"))
246 xPropSet->getPropertyValue(
"FillStyle") >>= fillStyle;
247 xPropSet->getPropertyValue(
"HeaderFillStyle") >>= fillStyleHeader;
248 xPropSet->getPropertyValue(
"FooterFillStyle") >>= fillStyleFooter;
265 pFillStyle = &fillStyle;
271 if (!pFillStyle) { pFillStyle = &fillStyleHeader; }
278 if (!pFillStyle) { pFillStyle = &fillStyleFooter; }
283 if (aContextIDs[
i].nExpectedFillStyle != drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE
284 && aContextIDs[
i].nExpectedFillStyle != *pFillStyle)
286 SAL_INFO(
"xmloff.style",
"PageStyleContext: dropping fill named item: " << sStyleName);
295 const OUString& rPropertyName = rMapper->GetEntryAPIName(rState.
mnIndex);
297 if(xInfo->hasPropertyByName(rPropertyName))
299 xPropSet->setPropertyValue(rPropertyName,
Any(sStyleName));
302 catch(css::lang::IllegalArgumentException& e)
307 aSeq,e.Message,
nullptr);
317 OSL_ENSURE(xImpPrMap.is(),
"Got no SvXMLImportPropertyMapper (!)");
321 if (pDrawingPageStyle)
331 bool isFullSize(
true);
333 xPropSet->getPropertyValue(
"FillStyle") >>= fillStyle;
339 if (fillStyle != drawing::FillStyle_NONE)
353 case drawing::FillStyle_NONE:
355 case drawing::FillStyle_SOLID:
356 case drawing::FillStyle_GRADIENT:
357 case drawing::FillStyle_HATCH:
360 case drawing::FillStyle_BITMAP:
362 drawing::BitmapMode bitmapMode{};
363 xPropSet->getPropertyValue(
"FillBitmapMode") >>= bitmapMode;
366 case drawing::BitmapMode_REPEAT:
369 case drawing::BitmapMode_STRETCH:
370 case drawing::BitmapMode_NO_REPEAT:
385 SAL_INFO(
"xmloff.style",
"FillPropertySet_PageStyle: Heuristically resetting BackgroundFullSize");
386 xPropSet->setPropertyValue(
"BackgroundFullSize",
uno::Any(isFullSize));
398 xPropSet->setPropertyValue(
"PageStyleLayout", aPageUsage);
409 {-1, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE}
424 Reference < XMultiServiceFactory >
xFactory (
GetImport().GetModel(), UNO_QUERY);
427 Reference < XInterface > xInt = xFactory->createInstance(
"com.sun.star.text.Defaults" );
429 if ( xProperties.is() )
XmlStyleFamily GetFamily() const
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
#define XML_TYPE_PROP_PAGE_LAYOUT
#define CTF_PM_HEADERFILLTRANSNAME
#define CTF_PM_FILLGRADIENTNAME
static const OldFillStyleDefinitionSet & getStandardSet()
#define CTF_PM_HEADERFILLHATCHNAME
#define CTF_PM_HEADERFILLBITMAPNAME
enum SAL_DLLPUBLIC_RTTI FillStyle
SvXMLImport & GetImport()
bool m_bIsFillStyleAlreadyConverted
bool IsDefaultStyle() const
static const sal_uInt16 LO_7x
PageStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, bool bDefaultStyle)
#define CTF_PM_FOOTERFILLBITMAPNAME
static const sal_uInt16 AOO_4x
#define CTF_PM_FOOTERFILLGRADIENTNAME
#define XMLERROR_FLAG_WARNING
bool doNewDrawingLayerFillStyleDefinitionsExist(const OUString &rFillStyleTag) const
#define CTF_PM_FILLBITMAPNAME
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
static const sal_uInt16 LO_63x
void deactivateOldFillStyleDefinitions(const OldFillStyleDefinitionSet &rHashSetOfTags)
XmlStyleFamily const g_MasterPageFamilies[]
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
#define XMLERROR_STYLE_PROP_VALUE
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
#define CTF_PM_HEADERFILLGRADIENTNAME
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
::std::vector< XMLPropertyState > & GetProperties()
virtual bool importXML(const OUString &rStrImpValue, css::uno::Any &rValue, const SvXMLUnitConverter &rUnitConverter) const override
Imports the given value according to the XML-data-type corresponding to the derived class...
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
#define CTF_PM_HEADERFLAG
#define CTF_PM_FILLHATCHNAME
#define CTF_PM_FOOTERFILLTRANSNAME
#define CTF_PM_FOOTERFILLHATCHNAME
static const OldFillStyleDefinitionSet & getHeaderSet()
static const OldFillStyleDefinitionSet & getFooterSet()
void FillPropertySet_PageStyle(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, XMLPropStyleContext *pDrawingPageStyle)
OUString GetStyleDisplayName(XmlStyleFamily nFamily, const OUString &rName) const
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
ContextID_Index_Pair const g_MasterPageContextIDs[]
Handling of tokens in XML:
#define SAL_INFO(area, stream)
#define XML_ELEMENT(prefix, name)
Smart struct to transport an Any with an index to the appropriate property-name.
void SetError(sal_Int32 nId, const css::uno::Sequence< OUString > &rMsgParams, const OUString &rExceptionMessage, const css::uno::Reference< css::xml::sax::XLocator > &rLocator)
Record an error condition that occurred during import.
Sequence< sal_Int8 > aSeq
SvXMLStylesContext * GetStyles()
This struct is used as an optional parameter to the static _FillPropertySet() methods.
Reference< XSingleServiceFactory > xFactory
#define CTF_PM_FOOTERFLAG
#define CTF_PM_FILLTRANSNAME
virtual void SetDefaults() override
virtual ~PageStyleContext() override
bool m_bDetectedRangeSegmentation false