LibreOffice Module sw (master) 1
xmlexp.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <com/sun/star/text/XTextDocument.hpp>
21#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
22#include <com/sun/star/beans/XPropertySet.hpp>
23#include <com/sun/star/container/XIndexContainer.hpp>
24#include <com/sun/star/xforms/XFormsSupplier.hpp>
25#include <com/sun/star/lang/XMultiServiceFactory.hpp>
26
28#include <osl/diagnose.h>
29#include <o3tl/any.hxx>
31#include <svx/svdpage.hxx>
32#include <svx/xmleohlp.hxx>
33#include <svx/xmlgrhlp.hxx>
34#include <editeng/eeitem.hxx>
35#include <svx/svddef.hxx>
39#include <editeng/xmlcnitm.hxx>
41#include <xmloff/xmluconv.hxx>
43#include <drawdoc.hxx>
44#include <doc.hxx>
45#include <swmodule.hxx>
46#include <docsh.hxx>
47#include <viewsh.hxx>
48#include <rootfrm.hxx>
49#include <docstat.hxx>
50#include <swerror.h>
51#include <unotext.hxx>
52#include "xmltexte.hxx"
53#include "xmlexp.hxx"
54#include "xmlexpit.hxx"
55#include "zorder.hxx"
57#include <docary.hxx>
58#include <frameformats.hxx>
60#include <vcl/svapp.hxx>
66
67
69
70using namespace ::com::sun::star;
71using namespace ::com::sun::star::lang;
72using namespace ::com::sun::star::xml::sax;
73using namespace ::com::sun::star::uno;
74using namespace ::com::sun::star::text;
75using namespace ::com::sun::star::container;
76using namespace ::com::sun::star::document;
77using namespace ::com::sun::star::drawing;
78using namespace ::com::sun::star::beans;
79using namespace ::com::sun::star::i18n;
80using namespace ::com::sun::star::xforms;
81using namespace ::xmloff::token;
82
84 const uno::Reference< uno::XComponentContext >& rContext,
85 OUString const & implementationName, SvXMLExportFlags nExportFlags)
86: SvXMLExport( rContext, implementationName, util::MeasureUnit::INCH, XML_TEXT,
87 nExportFlags ),
88 m_bBlock( false ),
89 m_bShowProgress( true ),
90 m_bSavedShowChanges( false ),
91 m_pDoc( nullptr )
92{
94}
95
97{
98 if( !GetModel().is() )
100
101 SwPauseThreadStarting aPauseThreadStarting; // #i73788#
102
103 // from here, we use core interfaces -> lock Solar-Mutex
104 SolarMutexGuard aGuard;
105
106 {
107 Reference<XPropertySet> rInfoSet = getExportInfo();
108 if( rInfoSet.is() )
109 {
110 static constexpr OUStringLiteral sAutoTextMode(u"AutoTextMode");
111 if( rInfoSet->getPropertySetInfo()->hasPropertyByName(
112 sAutoTextMode ) )
113 {
114 Any aAny = rInfoSet->getPropertyValue(sAutoTextMode);
115 if( auto b = o3tl::tryAccess<bool>(aAny) )
116 {
117 if( *b )
118 m_bBlock = true;
119 }
120 }
121 }
122 }
123
124 SwDoc *pDoc = getDoc();
125 if (!pDoc)
126 return ERR_SWG_WRITE_ERROR;
127
128 if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
129 SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
130 {
132 {
137 }
138
139 GetTextParagraphExport()->SetBlockMode( m_bBlock );
140
141 const SfxItemPool& rPool = pDoc->GetAttrPool();
142 sal_uInt16 aWhichIds[5] = { RES_UNKNOWNATR_CONTAINER,
147
148 const int nWhichIds = rPool.GetSecondaryPool() ? 5 : 2;
149 for( int j=0; j < nWhichIds; ++j )
150 {
151 const sal_uInt16 nWhichId = aWhichIds[j];
152 for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nWhichId))
153 {
154 auto pUnknown = dynamic_cast<const SvXMLAttrContainerItem*>( pItem );
155 OSL_ENSURE( pUnknown, "illegal attribute container item" );
156 if( pUnknown && (pUnknown->GetAttrCount() > 0) )
157 {
158 sal_uInt16 nIdx = pUnknown->GetFirstNamespaceIndex();
159 while( USHRT_MAX != nIdx )
160 {
161 GetNamespaceMap_().Add( pUnknown->GetPrefix( nIdx ),
162 pUnknown->GetNamespace( nIdx ) );
163 nIdx = pUnknown->GetNextNamespaceIndex( nIdx );
164 }
165 }
166 }
167 }
168 }
169
170 sal_uInt16 const eUnit = SvXMLUnitConverter::GetMeasureUnit(
172 if (GetMM100UnitConverter().GetXMLMeasureUnit() != eUnit )
173 {
175 m_pTwipUnitConverter->SetXMLMeasureUnit( eUnit );
176 }
177
178 if( getExportFlags() & SvXMLExportFlags::META)
179 {
180 // Update doc stat, so that correct values are exported and
181 // the progress works correctly.
182 pDoc->getIDocumentStatistics().UpdateDocStat( false, true );
183 }
184 if( m_bShowProgress )
185 {
187 if( -1 == pProgress->GetReference() )
188 {
189 // progress isn't initialized:
190 // We assume that the whole doc is exported, and the following
191 // durations:
192 // - meta information: 2
193 // - settings: 4 (TODO: not now!)
194 // - styles (except page styles): 2
195 // - page styles: 2 (TODO: not now!) + 2 for each paragraph
196 // - paragraph: 2 (1 for automatic styles and one for content)
197
198 // count each item once, and then multiply by two to reach the
199 // figures given above
200 // The styles in pDoc also count the default style that never
201 // gets exported -> subtract one.
202 sal_Int32 nRef = 1; // meta.xml
203 nRef += pDoc->GetCharFormats()->size() - 1;
204 nRef += pDoc->GetFrameFormats()->size() - 1;
205 nRef += pDoc->GetTextFormatColls()->size() - 1;
206 nRef *= 2; // for the above styles, xmloff will increment by 2!
207 // #i93174#: count all paragraphs for the progress bar
208 nRef += pDoc->getIDocumentStatistics().GetUpdatedDocStat( false, true ).nAllPara; // 1: only content, no autostyle
209 pProgress->SetReference( nRef );
210 pProgress->SetValue( 0 );
211 }
212 }
213
214 if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
215 {
216 //We depend on the correctness of OrdNums.
218 if( pModel )
219 pModel->GetPage( 0 )->RecalcObjOrdNums();
220 }
221
222 // adjust document class (eClass)
224 {
225 eClass = XML_TEXT_GLOBAL;
226
227 // additionally, we take care of the save-linked-sections-thingy
229 }
230 // MIB: 03/26/04: The Label information is saved in the settings, so
231 // we don't need it here.
232 // else: keep default pClass that we received
233
234 rtl::Reference<SvXMLGraphicHelper> xGraphicStorageHandler;
235 if (!GetGraphicStorageHandler().is())
236 {
237 xGraphicStorageHandler = SvXMLGraphicHelper::Create(SvXMLGraphicHelperMode::Write, GetImageFilterName());
238 SetGraphicStorageHandler(xGraphicStorageHandler);
239 }
240
242 if( !GetEmbeddedResolver().is() )
243 {
244 SfxObjectShell *pPersist = pDoc->GetPersist();
245 if( pPersist )
246 {
247 xEmbeddedResolver = SvXMLEmbeddedObjectHelper::Create(
248 *pPersist,
249 SvXMLEmbeddedObjectHelperMode::Write );
250 SetEmbeddedResolver( xEmbeddedResolver );
251 }
252 }
253
254 // set redline mode if we export STYLES or CONTENT, unless redline
255 // mode is taken care of outside (through info XPropertySet)
256 bool bSaveRedline =
257 bool( getExportFlags() & (SvXMLExportFlags::CONTENT|SvXMLExportFlags::STYLES) );
258 if( bSaveRedline )
259 {
260 // if the info property set has a ShowChanges property,
261 // then change tracking is taken care of on the outside,
262 // so we don't have to!
263 Reference<XPropertySet> rInfoSet = getExportInfo();
264 if( rInfoSet.is() )
265 {
266 bSaveRedline = ! rInfoSet->getPropertySetInfo()->hasPropertyByName(
267 "ShowChanges" );
268 }
269 }
270 RedlineFlags nRedlineFlags = RedlineFlags::NONE;
272 m_bSavedShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines();
273 if( bSaveRedline )
274 {
275 // tdf#133487 call this once in flat-ODF case
276 uno::Reference<drawing::XDrawPageSupplier> const xDPS(GetModel(), uno::UNO_QUERY);
277 assert(xDPS.is());
279
280 // now save and switch redline mode
281 nRedlineFlags = pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
283 ( nRedlineFlags & RedlineFlags::ShowMask ) | RedlineFlags::ShowInsert );
284 }
285
286 ErrCode nRet = SvXMLExport::exportDoc( eClass );
287
288 // now we can restore the redline mode (if we changed it previously)
289 if( bSaveRedline )
290 {
291 pDoc->getIDocumentRedlineAccess().SetRedlineFlags( nRedlineFlags );
292 }
293
294 if (xGraphicStorageHandler)
295 xGraphicStorageHandler->dispose();
296 xGraphicStorageHandler.clear();
297 if( xEmbeddedResolver )
298 xEmbeddedResolver->dispose();
299 xEmbeddedResolver.clear();
300
301 OSL_ENSURE( !m_pTableLines, "there are table columns infos left" );
302
303 return nRet;
304}
305
307{
308 return new SwXMLTextParagraphExport(*this, *GetAutoStylePool());
309}
310
312{
314 Reference < XDrawPageSupplier > xDPS( GetModel(), UNO_QUERY );
315 if( xDPS.is() )
316 {
317 Reference < XShapes > xShapes = xDPS->getDrawPage();
318 pShapeExport->seekShapes( xShapes );
319 }
320
321 return pShapeExport;
322}
323
325{
328}
329
331{
332 GetFontAutoStylePool(); // make sure the pool is created
334}
335
336void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
337{
338 aProps.realloc(7);
339 // Currently exporting 9 properties
340 PropertyValue *pValue = aProps.getArray();
341
343 pValue[0].Name = "Views";
344 pValue[0].Value <<= uno::Reference< container::XIndexContainer >(xBox);
345
346 SwDoc *pDoc = getDoc();
347 const tools::Rectangle rRect =
349 bool bTwip = pDoc->GetDocShell()->GetMapUnit ( ) == MapUnit::MapTwip;
350
351 OSL_ENSURE( bTwip, "Map unit for visible area is not in TWIPS!" );
352
353 pValue[1].Name = "ViewAreaTop";
354 pValue[1].Value <<= bTwip ? convertTwipToMm100 ( rRect.Top() ) : rRect.Top();
355
356 pValue[2].Name = "ViewAreaLeft";
357 pValue[2].Value <<= bTwip ? convertTwipToMm100 ( rRect.Left() ) : rRect.Left();
358
359 pValue[3].Name = "ViewAreaWidth";
360 pValue[3].Value <<= bTwip ? convertTwipToMm100 ( rRect.GetWidth() ) : rRect.GetWidth();
361
362 pValue[4].Name = "ViewAreaHeight";
363 pValue[4].Value <<= bTwip ? convertTwipToMm100 ( rRect.GetHeight() ) : rRect.GetHeight();
364
365 // "show redline mode" cannot simply be read from the document
366 // since it gets changed during execution. If it's in the info
367 // XPropertySet, we take it from there.
368 bool bShowRedlineChanges = m_bSavedShowChanges;
369 Reference<XPropertySet> xInfoSet( getExportInfo() );
370 if ( xInfoSet.is() )
371 {
372 static constexpr OUStringLiteral sShowChanges( u"ShowChanges" );
373 if( xInfoSet->getPropertySetInfo()->hasPropertyByName( sShowChanges ) )
374 {
375 bShowRedlineChanges = *o3tl::doAccess<bool>(xInfoSet->
376 getPropertyValue( sShowChanges ));
377 }
378 }
379
380 pValue[5].Name = "ShowRedlineChanges";
381 pValue[5].Value <<= bShowRedlineChanges;
382
383 pValue[6].Name = "InBrowseMode";
385}
386
387void SwXMLExport::GetConfigurationSettings( Sequence < PropertyValue >& rProps)
388{
389 Reference< XMultiServiceFactory > xFac( GetModel(), UNO_QUERY );
390 if (!xFac.is())
391 return;
392
393 Reference< XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY );
394 if (!xProps.is())
395 return;
396
397 static const std::initializer_list<std::u16string_view> vOmitFalseValues = {
398 u"DoNotBreakWrappedTables",
399 };
400 SvXMLUnitConverter::convertPropertySet( rProps, xProps, &vOmitFalseValues );
401
402 // tdf#144532 if NoEmbDataSet was set, to indicate not to write an embedded
403 // database for the case of a temporary mail merge preview document, then
404 // also filter out the "EmbeddedDatabaseName" property from the document
405 // settings so that when the temp mailmerge preview document is closed it
406 // doesn't unregister the database of the same name which was registered by
407 // the document this is a copy of
408 Reference<XPropertySet> rInfoSet = getExportInfo();
409
410 if (!rInfoSet.is() || !rInfoSet->getPropertySetInfo()->hasPropertyByName(u"NoEmbDataSet"))
411 return;
412
413 Any aAny = rInfoSet->getPropertyValue(u"NoEmbDataSet");
414 bool bNoEmbDataSet = *o3tl::doAccess<bool>(aAny);
415 if (!bNoEmbDataSet)
416 return;
417
418 Sequence<PropertyValue> aFilteredProps(rProps.getLength());
419 auto aFilteredPropsRange = asNonConstRange(aFilteredProps);
420 sal_Int32 nFilteredPropLen = 0;
421 for (sal_Int32 i = 0; i < rProps.getLength(); ++i)
422 {
423 if (rProps[i].Name == "EmbeddedDatabaseName")
424 continue;
425 aFilteredPropsRange[nFilteredPropLen] = rProps[i];
426 ++nFilteredPropLen;
427 }
428 aFilteredProps.realloc(nFilteredPropLen);
429 std::swap(rProps, aFilteredProps);
430}
431
432sal_Int32 SwXMLExport::GetDocumentSpecificSettings( std::vector< SettingsGroup >& _out_rSettings )
433{
434 // the only doc-specific settings group we know so far are the XForms settings
435 uno::Sequence<beans::PropertyValue> aXFormsSettings;
436 Reference< XFormsSupplier > xXFormsSupp( GetModel(), UNO_QUERY );
437 Reference< XNameAccess > xXForms;
438 if ( xXFormsSupp.is() )
439 xXForms = xXFormsSupp->getXForms().get();
440 if ( xXForms.is() )
441 {
442 getXFormsSettings( xXForms, aXFormsSettings );
443 _out_rSettings.emplace_back( XML_XFORM_MODEL_SETTINGS, aXFormsSettings );
444 }
445
446 return aXFormsSettings.getLength() + SvXMLExport::GetDocumentSpecificSettings( _out_rSettings );
447}
448
450{
451 // export use of soft page breaks
452 SwDoc *pDoc = getDoc();
455 {
456 OUStringBuffer sBuffer;
457 ::sax::Converter::convertBool(sBuffer, true);
459 sBuffer.makeStringAndClear());
460 }
461}
462
464{
465 // export forms
466 Reference<XDrawPageSupplier> xDrawPageSupplier(GetModel(), UNO_QUERY);
467 if (xDrawPageSupplier.is())
468 {
469 // export only if we actually have elements
470 Reference<XDrawPage> xPage = xDrawPageSupplier->getDrawPage();
471 if (xPage.is())
472 {
473 // prevent export of form controls which are embedded in mute sections
474 GetTextParagraphExport()->PreventExportOfControlsInMuteSections(
475 xPage, GetFormExport() );
476
477 // #i36597#
478 if ( xmloff::OFormLayerXMLExport::pageContainsForms( xPage ) || GetFormExport()->documentContainsXForms() )
479 {
480 ::xmloff::OOfficeFormsExport aOfficeForms(*this);
481
482 GetFormExport()->exportXForms();
483
484 GetFormExport()->seekPage(xPage);
485 GetFormExport()->exportForms(xPage);
486 }
487 }
488 }
489
490 Reference<XPropertySet> xPropSet(GetModel(), UNO_QUERY);
491 if (xPropSet.is())
492 {
493 Any aAny = xPropSet->getPropertyValue( "TwoDigitYear" );
494 aAny <<= sal_Int16(1930);
495
496 sal_Int16 nYear = 0;
497 aAny >>= nYear;
498 if (nYear != 1930 )
499 {
500 AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, OUString::number(nYear));
501 SvXMLElementExport aCalcSettings(*this, XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, true, true);
502 }
503 }
504
505 GetTextParagraphExport()->exportTrackedChanges( false );
506 GetTextParagraphExport()->exportTextDeclarations();
507 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
508 Reference < XText > xText = xTextDoc->getText();
509
510 GetTextParagraphExport()->exportFramesBoundToPage( m_bShowProgress );
511 GetTextParagraphExport()->exportText( xText, m_bShowProgress );
512}
513
515{
516 if( m_pDoc != nullptr )
517 return m_pDoc;
518 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
519 if (!xTextDoc)
520 {
521 SAL_WARN("sw.filter", "Problem of mismatching filter for export.");
522 return nullptr;
523 }
524
525 Reference < XText > xText = xTextDoc->getText();
526 SwXText* pText = dynamic_cast<SwXText*>(xText.get());
527 assert( pText != nullptr );
528 m_pDoc = pText->GetDoc();
529 assert( m_pDoc != nullptr );
530 return m_pDoc;
531}
532
534{
535 return const_cast< SwXMLExport* >( this )->getDoc();
536}
537
538extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
540 css::uno::Sequence<css::uno::Any> const &)
541{
542 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLExporter",
543 SvXMLExportFlags::ALL));
544}
545
546extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
548 css::uno::Sequence<css::uno::Any> const &)
549{
550 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLStylesExporter",
551 SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
552 SvXMLExportFlags::FONTDECLS));
553}
554
555extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
557 css::uno::Sequence<css::uno::Any> const &)
558{
559 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLContentExporter",
560 SvXMLExportFlags::SCRIPTS | SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES |
561 SvXMLExportFlags::FONTDECLS));
562}
563
564extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
566 css::uno::Sequence<css::uno::Any> const &)
567{
568 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLMetaExporter",
569 SvXMLExportFlags::META));
570}
571
572extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
574 css::uno::Sequence<css::uno::Any> const &)
575{
576 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLSettingsExporter",
577 SvXMLExportFlags::SETTINGS));
578}
579
580extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
582 css::uno::Sequence<css::uno::Any> const &)
583{
584 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisExporter",
585 SvXMLExportFlags::ALL | SvXMLExportFlags::OASIS));
586}
587
588extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
590 css::uno::Sequence<css::uno::Any> const &)
591{
592 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisStylesExporter",
593 SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
594 SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS));
595}
596
597extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
599 css::uno::Sequence<css::uno::Any> const &)
600{
601 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisContentExporter",
602 SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::SCRIPTS |
603 SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS));
604}
605
606extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
608 css::uno::Sequence<css::uno::Any> const &)
609{
610 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisMetaExporter",
611 SvXMLExportFlags::META | SvXMLExportFlags::OASIS));
612}
613
614extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
616 css::uno::Sequence<css::uno::Any> const &)
617{
618 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisSettingsExporter",
619 SvXMLExportFlags::SETTINGS | SvXMLExportFlags::OASIS));
620}
621
622/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
@ ShowInsert
show all inserts
@ NONE
no RedlineFlags
constexpr auto convertTwipToMm100(N n)
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
virtual const SwRootFrame * GetCurrentLayout() const =0
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual void UpdateDocStat(bool bCompleteAsync, bool bFields)=0
Updates the internal document's statistics.
virtual const SwDocStat & GetUpdatedDocStat(bool bCompleteAsync, bool bFields)=0
Updates the document statistics if the document has been modified and returns a reference to the resu...
void SetValue(sal_Int32 nValue)
void SetReference(sal_Int32 nVal)
sal_Int32 GetReference() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
void RecalcObjOrdNums()
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
SfxItemPool * GetSecondaryPool() const
MapUnit GetMapUnit() const
static rtl::Reference< SvXMLEmbeddedObjectHelper > Create(const css::uno::Reference< css::embed::XStorage > &, ::comphelper::IEmbeddedHelper &rDocPersist, SvXMLEmbeddedObjectHelperMode eCreateMode)
ProgressBarHelper * GetProgressBarHelper()
virtual ErrCode exportDoc(enum ::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID)
rtl::Reference< XMLTextParagraphExport > const & GetTextParagraphExport()
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, const OUString &rValue)
SvXMLExportFlags getExportFlags() const
SvXMLNamespaceMap & GetNamespaceMap_()
const css::uno::Reference< css::frame::XModel > & GetModel() const
virtual sal_Int32 GetDocumentSpecificSettings(::std::vector< SettingsGroup > &_out_rSettings)
rtl::Reference< XMLFontAutoStylePool > const & GetFontAutoStylePool()
virtual void ExportFontDecls_()
SvtSaveOptions::ODFSaneDefaultVersion getSaneDefaultVersion() const
rtl::Reference< SvXMLAutoStylePoolP > const & GetAutoStylePool()
const css::uno::Reference< css::document::XEmbeddedObjectResolver > & GetEmbeddedResolver() const
OUString const & GetImageFilterName() const
const css::uno::Reference< css::beans::XPropertySet > & getExportInfo() const
rtl::Reference< xmloff::OFormLayerXMLExport > const & GetFormExport()
const SvXMLUnitConverter & GetMM100UnitConverter() const
void SetEmbeddedResolver(css::uno::Reference< css::document::XEmbeddedObjectResolver > const &_xEmbeddedResolver)
const css::uno::Reference< css::document::XGraphicStorageHandler > & GetGraphicStorageHandler() const
bool mbSaveLinkedSections
void SetGraphicStorageHandler(css::uno::Reference< css::document::XGraphicStorageHandler > const &rxGraphicStorageHandler)
static rtl::Reference< SvXMLGraphicHelper > Create(const css::uno::Reference< css::embed::XStorage > &rXMLStorage, SvXMLGraphicHelperMode eCreateMode)
sal_uInt16 Add(const OUString &rPrefix, const OUString &rName, sal_uInt16 nKey=XML_NAMESPACE_UNKNOWN)
static void convertPropertySet(css::uno::Sequence< css::beans::PropertyValue > &rProps, const css::uno::Reference< css::beans::XPropertySet > &aProperties, const std::initializer_list< std::u16string_view > *pOmitFalseValues=nullptr)
void SetXMLMeasureUnit(sal_Int16 const eXMLMeasureUnit)
static sal_Int16 GetMeasureUnit(FieldUnit const nFieldUnit)
size_t size() const
Definition: charformats.hxx:71
virtual tools::Rectangle GetVisArea(sal_uInt16 nAspect) const override
Definition: docsh.cxx:912
Definition: doc.hxx:197
const sw::FrameFormats< SwFrameFormat * > * GetFrameFormats() const
Definition: doc.hxx:753
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:755
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:349
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:419
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:190
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:653
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:793
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1337
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:169
SwDocShell * GetDocShell()
Definition: doc.hxx:1370
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:387
Helper class to pause starting of threads during existence of an instance of this class.
The root element of a Writer document layout.
Definition: rootfrm.hxx:85
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
Definition: rootfrm.hxx:434
size_t size() const
Definition: docary.hxx:88
sal_uInt16 GetPageCount() const
Definition: viewsh.cxx:2674
virtual void SetBodyAttributes() override
Definition: xmlexp.cxx:449
virtual XMLTextParagraphExport * CreateTextParagraphExport() override
Definition: xmlexp.cxx:306
std::unique_ptr< SwXMLTableLinesCache_Impl > m_pTableLines
Definition: xmlexp.hxx:55
virtual void ExportContent_() override
Definition: xmlexp.cxx:463
virtual ErrCode exportDoc(enum ::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID) override
Definition: xmlexp.cxx:96
virtual XMLShapeExport * CreateShapeExport() override
Definition: xmlexp.cxx:311
virtual void GetViewSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: xmlexp.cxx:336
SwXMLExport(const css::uno::Reference< css::uno::XComponentContext > &rContext, OUString const &implementationName, SvXMLExportFlags nExportFlags)
Definition: xmlexp.cxx:83
SwDoc * m_pDoc
Definition: xmlexp.hxx:65
const SwDoc * getDoc() const
Definition: xmlexp.cxx:533
bool m_bShowProgress
Definition: xmlexp.hxx:62
void FinitItemExport()
Definition: xmliteme.cxx:233
virtual sal_Int32 GetDocumentSpecificSettings(std::vector< SettingsGroup > &_out_rSettings) override
Definition: xmlexp.cxx:432
std::unique_ptr< SvXMLUnitConverter > m_pTwipUnitConverter
Definition: xmlexp.hxx:53
bool m_bBlock
Definition: xmlexp.hxx:61
void InitItemExport()
Definition: xmliteme.cxx:220
virtual void ExportFontDecls_() override
Definition: xmlexp.cxx:330
virtual void GetConfigurationSettings(css::uno::Sequence< css::beans::PropertyValue > &aProps) override
Definition: xmlexp.cxx:387
void DeleteTableLines()
Definition: xmltble.cxx:1265
bool m_bSavedShowChanges
Definition: xmlexp.hxx:63
virtual ~SwXMLExport() override
Definition: xmlexp.cxx:324
const SwDoc * GetDoc() const
Definition: unotext.cxx:134
void seekShapes(const css::uno::Reference< css::drawing::XShapes > &xShapes) noexcept
static SvXMLExportPropertyMapper * CreateShapeExtPropMapper(SvXMLExport &rExport)
static bool convertBool(bool &rBool, std::u16string_view rString)
constexpr tools::Long GetWidth() const
constexpr tools::Long Top() const
constexpr tools::Long GetHeight() const
constexpr tools::Long Left() const
static bool pageContainsForms(const css::uno::Reference< css::drawing::XDrawPage > &_rxDrawPage)
float u
constexpr TypedWhichId< SvXMLAttrContainerItem > EE_PARA_XMLATTRIBS(EE_PARA_START+1)
constexpr TypedWhichId< SvXMLAttrContainerItem > EE_CHAR_XMLATTRIBS(EE_CHAR_START+28)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_UNKNOWNATR_CONTAINER(RES_UNKNOWNATR_BEGIN)
constexpr TypedWhichId< SvXMLAttrContainerItem > RES_TXTATR_UNKNOWN_CONTAINER(54)
sal_Int32 nRef
#define SAL_WARN(area, stream)
int i
constexpr OUStringLiteral implementationName
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
bool getPropertyValue(ValueType &rValue, css::uno::Reference< css::beans::XPropertySet > const &xPropSet, OUString const &propName)
XMLTokenEnum
XML_NULL_YEAR
XML_USE_SOFT_PAGE_BREAKS
XML_TEXT_GLOBAL
XML_TEXT
XML_N_OFFICE_EXT
XML_XFORM_MODEL_SETTINGS
XML_NP_OFFICE_EXT
XML_CALCULATION_SETTINGS
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
void FixZOrder(uno::Reference< drawing::XShapes > const &xShapes, std::function< unsigned int(uno::Reference< beans::XPropertySet > const &)> const &rGetLayer)
#define ASPECT_CONTENT
sal_uLong nAllPara
all paragraphs, including empty/hidden ones
Definition: docstat.hxx:34
constexpr TypedWhichId< SvXMLAttrContainerItem > SDRATTR_XMLATTRIBUTES(SDRATTR_MISC_FIRST+22)
#define ERR_SWG_WRITE_ERROR
Definition: swerror.h:30
#define SW_MOD()
Definition: swmodule.hxx:254
OUString Name
void XMLOFF_DLLPUBLIC getXFormsSettings(const css::uno::Reference< css::container::XNameAccess > &_rXForms, css::uno::Sequence< css::beans::PropertyValue > &_out_rSettings)
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLStylesExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:547
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLOasisContentExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:598
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLOasisSettingsExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:615
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLOasisMetaExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:607
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLOasisStylesExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:589
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLMetaExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:565
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLSettingsExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:573
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLOasisExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:581
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLContentExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:556
SAL_DLLPUBLIC_EXPORT css::uno::XInterface * com_sun_star_comp_Writer_XMLExporter_get_implementation(css::uno::XComponentContext *context, css::uno::Sequence< css::uno::Any > const &)
Definition: xmlexp.cxx:539
SvXMLExportFlags
constexpr sal_uInt16 XML_NAMESPACE_OFFICE_EXT
constexpr sal_uInt16 XML_NAMESPACE_TEXT
constexpr sal_uInt16 XML_NAMESPACE_TABLE