22#include <com/sun/star/beans/XPropertySet.hpp>
23#include <com/sun/star/frame/XModel.hpp>
24#include <com/sun/star/lang/XMultiServiceFactory.hpp>
62 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
68 sal_uInt32 nFamily = 0;
88struct XMLPropertyByIndex {
89 sal_Int32
const m_nIndex;
90 explicit XMLPropertyByIndex(sal_Int32
const nIndex) : m_nIndex(
nIndex) {}
92 return m_nIndex == rProp.
mnIndex;
101 Reference< XMultiServiceFactory > xFact(
GetImport().GetModel(), UNO_QUERY );
105 Reference< XPropertySet > xDefaults( xFact->createInstance(
"com.sun.star.drawing.Defaults" ), UNO_QUERY );
106 if( !xDefaults.is() )
109 bool bWordWrapDefault =
true;
111 sal_Int32 nBuild( 0 );
112 const bool bBuildIdFound =
GetImport().getBuildIds( nUPD, nBuild );
113 if ( bBuildIdFound && (
114 ((nUPD >= 600) && (nUPD < 700))
116 ((nUPD == 300) && (nBuild <= 9535))
118 ((nUPD > 300) && (nUPD <= 330))
120 bWordWrapDefault =
false;
122 static constexpr OUStringLiteral sTextWordWrap(
u"TextWordWrap" );
123 Reference< XPropertySetInfo > xInfo( xDefaults->getPropertySetInfo() );
124 if ( xInfo->hasPropertyByName( sTextWordWrap ) )
125 xDefaults->setPropertyValue( sTextWordWrap,
Any( bWordWrapDefault ) );
128 && xInfo->hasPropertyByName(
"IsFollowingTextFlow"))
132 xDefaults->setPropertyValue(
"IsFollowingTextFlow",
uno::Any(
true));
141 GetImport().getGeneratorVersion() >= SvXMLImport::AOO_40x
142 &&
GetImport().getGeneratorVersion() <= SvXMLImport::AOO_4x);
145 if (
GetImport().isGeneratorVersionOlderThan(
146 SvXMLImport::AOO_40x, SvXMLImport::LO_42x)
154 ->getPropertySetMapper());
155 sal_Int32
const nStrokeIndex(
158 XMLPropertyByIndex(nStrokeIndex)))
162 xDefaults->setPropertyValue(
"LineColor",
Any(nStroke));
164 Color const nFillColor( bIsAOO4
165 ?
Color(0xCF, 0xE7, 0xF5) :
Color(153, 204, 255));
166 sal_Int32
const nFillIndex(
169 XMLPropertyByIndex(nFillIndex)))
171 xDefaults->setPropertyValue(
"FillColor",
Any(nFillColor));
173 if (xInfo->hasPropertyByName(
"FillColor2"))
175 sal_Int32
const nFill2Index(pImpPrMap->GetEntryIndex(
178 XMLPropertyByIndex(nFill2Index)))
180 xDefaults->setPropertyValue(
"FillColor2",
Any(sal_Int32(nFillColor)));
SvXMLImport & GetImport()
XmlStyleFamily GetFamily() const
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
virtual void SetDefaults() override
virtual ~XMLGraphicsDefaultStyle() override
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
XMLGraphicsDefaultStyle(SvXMLImport &rImport, SvXMLStylesContext &rStyles)
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
::std::vector< XMLPropertyState > & GetProperties()
SvXMLStylesContext * GetStyles()
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
enumrange< T >::Iterator begin(enumrange< T >)
@ XML_PARAGRAPH_PROPERTIES
Smart struct to transport an Any with an index to the appropriate property-name.
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
constexpr sal_Int32 TOKEN_MASK
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_SVG
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_STYLE
#define XML_TYPE_PROP_GRAPHIC
#define XML_TYPE_PROP_PARAGRAPH
#define XML_TYPE_PROP_TEXT