20#include <com/sun/star/text/XTextDocument.hpp>
36#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
37#include <com/sun/star/beans/XPropertySet.hpp>
38#include <com/sun/star/util/Color.hpp>
41#include <osl/diagnose.h>
60 ::std::optional<OUString>
const oStyleName)
72 bool bEncoded =
false;
73 OUString
const name(oStyleName ? *oStyleName : rFormat.
GetName());
83#if OSL_DEBUG_LEVEL > 0
87 OSL_ENSURE( !pParent || pParent->
IsDefault(),
"unexpected parent" );
89 OSL_ENSURE( USHRT_MAX == rFormat.
GetPoolFormatId(),
"pool ids aren't supported" );
90 OSL_ENSURE( USHRT_MAX == rFormat.
GetPoolHelpId(),
"help ids aren't supported" );
102 const SwPageDesc *pPageDesc = pItem->GetPageDesc();
120 sal_Int32 nFormat =
static_cast<sal_Int32
>(pItem->GetValue());
129 if( !sDataStyleName.isEmpty() )
185 uno::Reference<drawing::XDrawPageSupplier> xDrawPageSupplier(
GetModel(), UNO_QUERY);
186 if (xDrawPageSupplier.is())
188 uno::Reference<drawing::XDrawPage> xPage = xDrawPageSupplier->getDrawPage();
203 SAL_WARN_IF(!pPage,
"oox",
"Can't get SdrPage from XDrawPage");
212 if (!pTheme->GetName().isEmpty())
216 auto pColorSet = pTheme->getColorSet();
217 if (!pColorSet->getName().isEmpty())
242 auto nColor = size_t(eThemeColorType);
244 OUStringBuffer sValue;
261 if(
getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT) )
283 Reference<XDrawPageSupplier> xDrawPageSupplier(
GetModel(), UNO_QUERY );
286 Reference<XDrawPage> xPage = xDrawPageSupplier->getDrawPage();
322 SvXMLExportFlags nContentAutostyles = SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES;
323 if ( (
getExportFlags() & nContentAutostyles ) == nContentAutostyles )
343 const OUString m_sListStyleName;
344 const OUString m_sMasterPageName;
351 const std::vector< XMLPropertyState >& rProperties,
358 explicit SwXMLAutoStylePoolP(
SvXMLExport& rExport );
363void SwXMLAutoStylePoolP::exportStyleAttributes(
366 const std::vector< XMLPropertyState >& rProperties,
374 if( XmlStyleFamily::TEXT_PARAGRAPH != nFamily )
377 for(
const auto& rProperty : rProperties )
379 if (rProperty.mnIndex != -1)
382 GetEntryContextId( rProperty.mnIndex ) )
387 rProperty.maValue >>= sStyleName;
389 if( !sStyleName.isEmpty() )
391 OUString sTmp = m_rExport.GetTextParagraphExport()->GetListAutoStylePool().Find( sStyleName );
392 if( !sTmp.isEmpty() )
395 GetExport().AddAttribute( XML_NAMESPACE_STYLE,
397 GetExport().EncodeStyleName( sStyleName ) );
403 rProperty.maValue >>= sStyleName;
404 GetExport().AddAttribute( XML_NAMESPACE_STYLE,
406 GetExport().EncodeStyleName( sStyleName ) );
414SwXMLAutoStylePoolP::SwXMLAutoStylePoolP(
SvXMLExport& rExp ) :
424 return new SwXMLAutoStylePoolP( *
this );
constexpr sal_uInt32 getSwDefaultTextFormat()
The number formatter's default locale's @ Text format.
std::shared_ptr< model::Theme > const & GetTheme() const
SdrPageProperties & getSdrPageProperties()
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
virtual void exportStyleAttributes(comphelper::AttributeList &rAttrList, XmlStyleFamily nFamily, const ::std::vector< XMLPropertyState > &rProperties, const SvXMLExportPropertyMapper &rPropExp, const SvXMLUnitConverter &rUnitConverter, const SvXMLNamespaceMap &rNamespaceMap) const
const rtl::Reference< XMLPropertySetMapper > & getPropertySetMapper() const
virtual void ExportStyles_(bool bUsed)
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
bool mbAutoStylesCollected
SvXMLExportFlags getExportFlags() const
void collectDataStyles(bool bFromUsedStyles)
virtual void exportDataStyles()
const css::uno::Reference< css::frame::XModel > & GetModel() const
virtual OUString getDataStyleName(const sal_Int32 nNumberFormat, bool bTimeFormat=false) const
rtl::Reference< XMLPageExport > const & GetPageExport()
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
virtual void exportAutoDataStyles()
rtl::Reference< XMLShapeExport > const & GetShapeExport()
OUString EncodeStyleName(const OUString &rName, bool *pEncoded=nullptr) const
virtual void addDataStyle(const sal_Int32 nNumberFormat, bool bTimeFormat=false)
virtual void collectAutoStyles()
rtl::Reference< xmloff::OFormLayerXMLExport > const & GetFormExport()
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
const OUString & GetName() const
static void FillProgName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
SvXMLItemMapEntriesRef m_xTableCellItemMap
virtual SvXMLAutoStylePoolP * CreateAutoStylePool() override
SvXMLItemMapEntriesRef m_xTableItemMap
const SvXMLUnitConverter & GetTwipUnitConverter() const
virtual void ExportMasterStyles_() override
bool IsShowProgress() const
void ExportFormat(const SwFormat &rFormat, enum ::xmloff::token::XMLTokenEnum eClass, ::std::optional< OUString > const oStyleName)
SvXMLItemMapEntriesRef m_xTableRowItemMap
virtual void ExportStyles_(bool bUsed) override
virtual XMLPageExport * CreatePageExport() override
std::unique_ptr< SvXMLExportItemMapper > m_pTableItemMapper
virtual void ExportAutoStyles_() override
void ExportThemeElement(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage)
void collectAutoStyles() override
static bool convertColor(sal_Int32 &rColor, std::u16string_view rValue)
constexpr TypedWhichId< SwFormatPageDesc > RES_PAGEDESC(99)
constexpr TypedWhichId< SwTableBoxNumFormat > RES_BOXATR_FORMAT(RES_BOXATR_BEGIN)
constexpr TypedWhichId< SwFrameFormat > RES_FRMFMT(161)
#define SAL_WARN_IF(condition, area, stream)
XML_TABLE_CELL_PROPERTIES
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
#define CTF_NUMBERINGSTYLENAME
SVXCORE_DLLPUBLIC SdrPage * GetSdrPageFromXDrawPage(const css::uno::Reference< css::drawing::XDrawPage > &xDrawPage) noexcept
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_STYLE