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>
68 m_bIsFillStyleAlreadyConverted(false)
78 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
94 sal_Int32 nStartIndex (-1);
95 sal_Int32 nEndIndex (-1);
99 while ( nIndex < rMapper->GetEntryCount() && !bEnd)
106 nStartIndex = nIndex;
119 GetProperties(), xImpPrMap, nStartIndex, nEndIndex, bHeader);
130 sal_Int32 nEndIndex (-1);
133 sal_Int16 nContextID;
134 while ( nIndex < rMapper->GetEntryCount() && !bEnd)
136 nContextID = rMapper->GetEntryContextId( nIndex );
150 xImpPrMap, 0, nEndIndex,
Page);
163 const uno::Reference<beans::XPropertySet> & xPropSet,
170 static OUString s_FillStyle(
"FillStyle");
171 static OUString s_HeaderFillStyle(
"HeaderFillStyle");
172 static OUString s_FooterFillStyle(
"FooterFillStyle");
234 xImpPrMap->FillPropertySet(
GetProperties(), xPropSet, aContextIDs);
238 Reference< XPropertySetInfo > xInfo;
274 const OUString& rPropertyName = rMapper->GetEntryAPIName(rState.
mnIndex);
278 xInfo = xPropSet->getPropertySetInfo();
281 if(xInfo->hasPropertyByName(rPropertyName))
283 xPropSet->setPropertyValue(rPropertyName,
Any(sStyleName));
286 catch(css::lang::IllegalArgumentException& e)
291 aSeq,e.Message,
nullptr);
301 OSL_ENSURE(xImpPrMap.is(),
"Got no SvXMLImportPropertyMapper (!)");
305 if (pDrawingPageStyle)
315 bool isFullSize(
true);
316 drawing::FillStyle fillStyle{drawing::FillStyle_NONE};
317 xPropSet->getPropertyValue(
"FillStyle") >>= fillStyle;
323 if (fillStyle != drawing::FillStyle_NONE)
337 case drawing::FillStyle_NONE:
339 case drawing::FillStyle_SOLID:
340 case drawing::FillStyle_GRADIENT:
341 case drawing::FillStyle_HATCH:
344 case drawing::FillStyle_BITMAP:
346 drawing::BitmapMode bitmapMode{};
347 xPropSet->getPropertyValue(
"FillBitmapMode") >>= bitmapMode;
350 case drawing::BitmapMode_REPEAT:
353 case drawing::BitmapMode_STRETCH:
354 case drawing::BitmapMode_NO_REPEAT:
369 SAL_INFO(
"xmloff.style",
"FillPropertySet_PageStyle: Heuristically resetting BackgroundFullSize");
370 xPropSet->setPropertyValue(
"BackgroundFullSize", uno::makeAny(isFullSize));
382 xPropSet->setPropertyValue(
"PageStyleLayout", aPageUsage);
408 Reference < XMultiServiceFactory >
xFactory (
GetImport().GetModel(), UNO_QUERY);
411 Reference < XInterface > xInt = xFactory->createInstance(
"com.sun.star.text.Defaults" );
413 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
SvXMLImport & GetImport()
bool m_bIsFillStyleAlreadyConverted
bool IsDefaultStyle() const
css::uno::Any const & rValue
static const sal_uInt16 LO_7x
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
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