25#include <com/sun/star/drawing/FillStyle.hpp>
26#include <com/sun/star/drawing/XControlShape.hpp>
27#include <com/sun/star/beans/XPropertySet.hpp>
28#include <com/sun/star/beans/XPropertySetInfo.hpp>
29#include <com/sun/star/lang/IllegalArgumentException.hpp>
30#include <com/sun/star/container/XIndexReplace.hpp>
54 m_bIsNumRuleAlreadyConverted( false )
89 const css::uno::Reference< css::xml::sax::XFastAttributeList >& xAttrList )
95 sal_uInt32 nFamily = 0;
127 ::std::vector< XMLPropertyState > &rProperties =
GetProperties();
128 ::std::vector< XMLPropertyState >::iterator
end( rProperties.end() );
132 auto property = std::find_if(rProperties.begin(),
end, [&rMapper](
XMLPropertyState& rProp) {
134 return (rProp.mnIndex != -1) && (rMapper->GetEntryContextId( rProp.mnIndex ) == CTF_SD_NUMBERINGRULES_NAME); });
142 SAL_WARN_IF( -1 ==
nIndex,
"xmloff",
"can't find numbering rules property entry, can't set numbering rule!" );
145 rProperties.push_back( aNewState );
146 end = rProperties.end();
161 SAL_WARN_IF( !pListStyle,
"xmloff",
"list-style not found for shape style" );
166 property->maValue <<= xNumRule;
170 property->mnIndex = -1;
177 {
CTF_DASHNAME, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
179 {
CTF_LINEENDNAME, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE },
188 { -1, -1, drawing::FillStyle::FillStyle_MAKE_FIXED_SIZE }
203 SAL_WARN_IF( !xImpPrMap.is(),
"xmloff",
"There is the import prop mapper" );
205 xImpPrMap->FillPropertySet(
GetProperties(), rPropSet, aContextIDs );
207 Reference< XPropertySetInfo > xInfo;
227 sStyleName =
GetImport().GetStyleDisplayName( aFamilies[
i], sStyleName );
232 if (sStyleName.isEmpty() &&
238 Sequence<OUString>
const seq{ sStyleName };
241 seq,
"empty style name reference",
nullptr );
247 SAL_INFO(
"xmloff.style",
"ShapeStyleContext: dropping fill named item: " << sStyleName);
255 const OUString& rPropertyName = xPropMapper->GetEntryAPIName(rState.
mnIndex);
257 xInfo = rPropSet->getPropertySetInfo();
258 if ( xInfo->hasPropertyByName( rPropertyName ) )
260 rPropSet->setPropertyValue( rPropertyName,
Any( sStyleName ) );
263 catch (
const css::lang::IllegalArgumentException& e )
265 Sequence<OUString>
aSeq { sStyleName };
268 aSeq, e.Message,
nullptr );
278 const OUString& rPropertyName = xPropMapper->GetEntryAPIName(rState.
mnIndex);
282 xInfo = rPropSet->getPropertySetInfo();
283 if ( xInfo->hasPropertyByName( rPropertyName ) )
285 rPropSet->setPropertyValue( rPropertyName, rState.
maValue );
288 catch (
const css::lang::IllegalArgumentException& e )
290 Sequence<OUString>
aSeq;
293 aSeq, e.Message,
nullptr );
306 uno::Reference< drawing::XControlShape > xControlShape(rPropSet, uno::UNO_QUERY);
307 DBG_ASSERT(xControlShape.is(),
"XMLShapeStyleContext::FillPropertySet: data style for a non-control shape!");
308 if (xControlShape.is())
310 uno::Reference< beans::XPropertySet > xControlModel(xControlShape->getControl(), uno::UNO_QUERY);
311 DBG_ASSERT(xControlModel.is(),
"XMLShapeStyleContext::FillPropertySet: no control model for the shape!");
312 if (xControlModel.is())
SvXMLImport & GetImport()
const OUString & GetName() const
XmlStyleFamily GetFamily() const
const OUString & GetDisplayName() const
virtual rtl::Reference< SvXMLImportPropertyMapper > GetImportPropertyMapper(XmlStyleFamily nFamily) const
void FillUnoNumRule(const css::uno::Reference< css::container::XIndexReplace > &rNumRule) const
static css::uno::Reference< css::container::XIndexReplace > CreateNumRule(const css::uno::Reference< css::frame::XModel > &rModel)
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()
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
virtual void FillPropertySet(const css::uno::Reference< css::beans::XPropertySet > &rPropSet) override
XMLShapeStyleContext(SvXMLImport &rImport, SvXMLStylesContext &rStyles, XmlStyleFamily nFamily)
virtual css::uno::Reference< css::xml::sax::XFastContextHandler > SAL_CALL createFastChildContext(sal_Int32 nElement, const css::uno::Reference< css::xml::sax::XFastAttributeList > &AttrList) override
OUString m_sListStyleName
OUString m_sControlDataStyleName
virtual void Finish(bool bOverwrite) override
virtual void SetAttribute(sal_Int32 nElement, const OUString &rValue) override
bool m_bIsNumRuleAlreadyConverted
virtual ~XMLShapeStyleContext() override
#define CTF_SD_NUMBERINGRULES_NAME
#define DBG_ASSERT(sCon, aError)
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
#define SAL_INFO(area, stream)
Handling of tokens in XML:
@ XML_PARAGRAPH_PROPERTIES
bool IsIgnoreFillStyleNamedItem(css::uno::Reference< css::beans::XPropertySet > const &xProps, drawing::FillStyle const nExpectedFillStyle)
This struct is used as an optional parameter to the static _FillPropertySet() methods.
Smart struct to transport an Any with an index to the appropriate property-name.
#define XMLERROR_STYLE_PROP_VALUE
#define XMLERROR_FLAG_WARNING
#define XML_ELEMENT(prefix, name)
constexpr bool IsTokenInNamespace(sal_Int32 nToken, sal_uInt16 nNamespacePrefix)
constexpr sal_Int32 TOKEN_MASK
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_STYLE
#define CTF_SD_OLE_VIS_AREA_IMPORT_HEIGHT
#define CTF_SD_OLE_VIS_AREA_IMPORT_LEFT
#define CTF_FILLBITMAPNAME
#define CTF_FILLGRADIENTNAME
#define CTF_LINESTARTNAME
#define CTF_SD_OLE_VIS_AREA_IMPORT_TOP
#define CTF_FILLTRANSNAME
#define CTF_FILLHATCHNAME
#define CTF_SD_OLE_VIS_AREA_IMPORT_WIDTH
#define XML_TYPE_PROP_GRAPHIC
#define XML_TYPE_PROP_PARAGRAPH
#define XML_TYPE_PROP_TEXT