25#include <com/sun/star/frame/XModel.hpp>
26#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
27#include <com/sun/star/style/XStyle.hpp>
28#include <com/sun/star/beans/XPropertySet.hpp>
29#include <com/sun/star/lang/XMultiServiceFactory.hpp>
49bool findPageMasterNameEntry(
50 ::std::vector<XMLPageExportNameEntry>
const& aNameVector,
53 auto pEntry = std::find_if(aNameVector.cbegin(), aNameVector.cend(),
56 if( pEntry != aNameVector.cend() )
68 const Reference < XPropertySet > & rPropSet,
75 if( !aPropStates.empty())
86 ::std::vector<XMLPropertyState> aPropStates(
88 if (!aPropStates.empty())
100 const Reference < XPropertySet > &,
107 const Reference< XStyle >& rStyle,
110 Reference< XPropertySet > xPropSet( rStyle, UNO_QUERY );
111 Reference< XPropertySetInfo > xPropSetInfo = xPropSet->getPropertySetInfo();
118 if( !*o3tl::doAccess<bool>(aAny) )
133 OUString
sName( rStyle->getName() );
134 bool bEncoded =
false;
138 if ( xPropSetInfo->hasPropertyByName(
"Hidden" ) )
140 uno::Any aValue = xPropSet->getPropertyValue(
"Hidden" );
141 bool bHidden =
false;
142 if ((aValue >>= bHidden) && bHidden
164 Reference<XPropertySetInfo> xInfo = xPropSet->getPropertySetInfo();
170 if(
sName != sNextName && !sNextName.isEmpty() )
173 GetExport().EncodeStyleName( sNextName ) );
191 m_xPageMasterPropHdlFactory))
193 m_xPageMasterPropSetMapper, rExp))
196 m_xPageMasterPropHdlFactory))
199 m_xPageMasterDrawingPagePropSetMapper, rExp))
206 Reference< XStyleFamiliesSupplier > xFamiliesSupp(
GetExport().GetModel(),
209 "No XStyleFamiliesSupplier from XModel for export!" );
210 if( !xFamiliesSupp.is() )
213 Reference< XNameAccess > xFamilies( xFamiliesSupp->getStyleFamilies() );
215 "getStyleFamilies() from XModel failed for export!" );
218 static constexpr OUStringLiteral aPageStyleName(
u"PageStyles");
220 if( xFamilies->hasByName( aPageStyleName ) )
222 m_xPageStyles.set(xFamilies->getByName( aPageStyleName ),uno::UNO_QUERY);
225 "Page Styles not found for export!" );
232 uno::Reference<lang::XMultiServiceFactory> xFac(
GetExport().GetModel(), uno::UNO_QUERY);
236 uno::Reference<beans::XPropertySet> xProps(
237 xFac->createInstance(
"com.sun.star.document.Settings"), uno::UNO_QUERY);
242 xProps->getPropertyValue(
"GutterAtTop") >>= bGutterAtTop;
246 ->SetGutterAtTop(
true);
259 for(
const auto& rName :
aSeq)
261 Reference< XStyle > xStyle(
m_xPageStyles->getByName( rName ),uno::UNO_QUERY);
262 if( !bUsed || xStyle->isInUse() )
278 Reference < lang::XMultiServiceFactory >
xFactory (
GetExport().GetModel(), UNO_QUERY);
282 Reference < XPropertySet > xPropSet (
xFactory->createInstance (
"com.sun.star.text.Defaults" ), UNO_QUERY);
289 ::std::vector< XMLPropertyState > aPropStates =
292 bool bExport =
false;
294 for(
const auto& rProp : aPropStates )
296 sal_Int16 nContextId = aPropMapper->GetEntryContextId( rProp.mnIndex );
307 assert(
GetExport().getSaneDefaultVersion()
XMLPropertyMapEntry const g_XMLPageMasterDrawingPageStyleMap[]
const XMLPropertyMapEntry aXMLPageMasterStyleMap[]
#define CTF_PM_STANDARD_MODE
constexpr OUStringLiteral gsIsPhysical(u"IsPhysical")
constexpr OUStringLiteral gsFollowStyle(u"FollowStyle")
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
rtl::Reference< SvXMLAutoStylePoolP > const & GetAutoStylePool()
void collectPageMasterAutoStyle(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, XMLPageExportNameEntry &rEntry)
virtual void exportMasterPageContent(const css::uno::Reference< css::beans::XPropertySet > &rPropSet, bool bAutoStyles)
void exportDefaultStyle()
css::uno::Reference< css::container::XNameAccess > m_xPageStyles
rtl::Reference< XMLPropertySetMapper > m_xPageMasterPropSetMapper
::std::vector< XMLPageExportNameEntry > m_aNameVector
virtual ~XMLPageExport() override
rtl::Reference< SvXMLExportPropertyMapper > m_xPageMasterExportPropMapper
SvXMLExport & GetExport()
void exportStyles(bool bUsed, bool bAutoStyles)
rtl::Reference< SvXMLExportPropertyMapper > m_xPageMasterDrawingPageExportPropMapper
XMLPageExport(SvXMLExport &rExp)
bool exportStyle(const css::uno::Reference< css::style::XStyle > &rStyle, bool bAutoStyles)
Reference< XSingleServiceFactory > xFactory
constexpr OUStringLiteral XML_STYLE_FAMILY_PAGE_MASTER_PREFIX
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_DRAWINGPAGE_PREFIX
constexpr OUStringLiteral XML_STYLE_FAMILY_SD_DRAWINGPAGE_NAME
constexpr OUStringLiteral XML_STYLE_FAMILY_PAGE_MASTER_NAME
These defines determine the unique ids for XML style-families used in the SvXMLAutoStylePoolP.
Sequence< sal_Int8 > aSeq
#define SAL_WARN_IF(condition, area, stream)
Handling of tokens in XML:
@ XML_DEFAULT_PAGE_LAYOUT
OUString sDrawingPageStyleName
constexpr sal_uInt16 XML_NAMESPACE_DRAW
constexpr sal_uInt16 XML_NAMESPACE_LO_EXT
constexpr sal_uInt16 XML_NAMESPACE_STYLE