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 const 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 const 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
398
399 // tdf#144532 if NoEmbDataSet was set, to indicate not to write an embedded
400 // database for the case of a temporary mail merge preview document, then
401 // also filter out the "EmbeddedDatabaseName" property from the document
402 // settings so that when the temp mailmerge preview document is closed it
403 // doesn't unregister the database of the same name which was registered by
404 // the document this is a copy of
405 Reference<XPropertySet> rInfoSet = getExportInfo();
406
407 if (!rInfoSet.is() || !rInfoSet->getPropertySetInfo()->hasPropertyByName(u"NoEmbDataSet"))
408 return;
409
410 Any aAny = rInfoSet->getPropertyValue(u"NoEmbDataSet");
411 bool bNoEmbDataSet = *o3tl::doAccess<bool>(aAny);
412 if (!bNoEmbDataSet)
413 return;
414
415 Sequence<PropertyValue> aFilteredProps(rProps.getLength());
416 auto aFilteredPropsRange = asNonConstRange(aFilteredProps);
417 sal_Int32 nFilteredPropLen = 0;
418 for (sal_Int32 i = 0; i < rProps.getLength(); ++i)
419 {
420 if (rProps[i].Name == "EmbeddedDatabaseName")
421 continue;
422 aFilteredPropsRange[nFilteredPropLen] = rProps[i];
423 ++nFilteredPropLen;
424 }
425 aFilteredProps.realloc(nFilteredPropLen);
426 std::swap(rProps, aFilteredProps);
427}
428
429sal_Int32 SwXMLExport::GetDocumentSpecificSettings( std::vector< SettingsGroup >& _out_rSettings )
430{
431 // the only doc-specific settings group we know so far are the XForms settings
432 uno::Sequence<beans::PropertyValue> aXFormsSettings;
433 Reference< XFormsSupplier > xXFormsSupp( GetModel(), UNO_QUERY );
434 Reference< XNameAccess > xXForms;
435 if ( xXFormsSupp.is() )
436 xXForms = xXFormsSupp->getXForms().get();
437 if ( xXForms.is() )
438 {
439 getXFormsSettings( xXForms, aXFormsSettings );
440 _out_rSettings.emplace_back( XML_XFORM_MODEL_SETTINGS, aXFormsSettings );
441 }
442
443 return aXFormsSettings.getLength() + SvXMLExport::GetDocumentSpecificSettings( _out_rSettings );
444}
445
447{
448 // export use of soft page breaks
449 SwDoc *pDoc = getDoc();
452 {
453 OUStringBuffer sBuffer;
454 ::sax::Converter::convertBool(sBuffer, true);
456 sBuffer.makeStringAndClear());
457 }
458}
459
461{
462 // export forms
463 Reference<XDrawPageSupplier> xDrawPageSupplier(GetModel(), UNO_QUERY);
464 if (xDrawPageSupplier.is())
465 {
466 // export only if we actually have elements
467 Reference<XDrawPage> xPage = xDrawPageSupplier->getDrawPage();
468 if (xPage.is())
469 {
470 // prevent export of form controls which are embedded in mute sections
471 GetTextParagraphExport()->PreventExportOfControlsInMuteSections(
472 xPage, GetFormExport() );
473
474 // #i36597#
475 if ( xmloff::OFormLayerXMLExport::pageContainsForms( xPage ) || GetFormExport()->documentContainsXForms() )
476 {
477 ::xmloff::OOfficeFormsExport aOfficeForms(*this);
478
479 GetFormExport()->exportXForms();
480
481 GetFormExport()->seekPage(xPage);
482 GetFormExport()->exportForms(xPage);
483 }
484 }
485 }
486
487 Reference<XPropertySet> xPropSet(GetModel(), UNO_QUERY);
488 if (xPropSet.is())
489 {
490 Any aAny = xPropSet->getPropertyValue( "TwoDigitYear" );
491 aAny <<= sal_Int16(1930);
492
493 sal_Int16 nYear = 0;
494 aAny >>= nYear;
495 if (nYear != 1930 )
496 {
497 AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, OUString::number(nYear));
498 SvXMLElementExport aCalcSettings(*this, XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, true, true);
499 }
500 }
501
502 GetTextParagraphExport()->exportTrackedChanges( false );
503 GetTextParagraphExport()->exportTextDeclarations();
504 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
505 Reference < XText > xText = xTextDoc->getText();
506
507 GetTextParagraphExport()->exportFramesBoundToPage( m_bShowProgress );
508 GetTextParagraphExport()->exportText( xText, m_bShowProgress );
509}
510
511const Sequence< sal_Int8 > & SwXMLExport::getUnoTunnelId() noexcept
512{
513 static const comphelper::UnoIdInit theSwXMLExportUnoTunnelId;
514 return theSwXMLExportUnoTunnelId.getSeq();
515}
516
517sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
518{
519 return comphelper::getSomethingImpl(rId, this,
521}
522
524{
525 if( m_pDoc != nullptr )
526 return m_pDoc;
527 Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
528 if (!xTextDoc)
529 {
530 SAL_WARN("sw.filter", "Problem of mismatching filter for export.");
531 return nullptr;
532 }
533
534 Reference < XText > xText = xTextDoc->getText();
535 Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
536 assert( xTextTunnel.is());
537 SwXText* pText = comphelper::getFromUnoTunnel<SwXText>(xTextTunnel);
538 assert( pText != nullptr );
539 m_pDoc = pText->GetDoc();
540 assert( m_pDoc != nullptr );
541 return m_pDoc;
542}
543
545{
546 return const_cast< SwXMLExport* >( this )->getDoc();
547}
548
549extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
551 css::uno::Sequence<css::uno::Any> const &)
552{
553 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLExporter",
554 SvXMLExportFlags::ALL));
555}
556
557extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
559 css::uno::Sequence<css::uno::Any> const &)
560{
561 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLStylesExporter",
562 SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
563 SvXMLExportFlags::FONTDECLS));
564}
565
566extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
568 css::uno::Sequence<css::uno::Any> const &)
569{
570 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLContentExporter",
571 SvXMLExportFlags::SCRIPTS | SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES |
572 SvXMLExportFlags::FONTDECLS));
573}
574
575extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
577 css::uno::Sequence<css::uno::Any> const &)
578{
579 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLMetaExporter",
580 SvXMLExportFlags::META));
581}
582
583extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
585 css::uno::Sequence<css::uno::Any> const &)
586{
587 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLSettingsExporter",
588 SvXMLExportFlags::SETTINGS));
589}
590
591extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
593 css::uno::Sequence<css::uno::Any> const &)
594{
595 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisExporter",
596 SvXMLExportFlags::ALL | SvXMLExportFlags::OASIS));
597}
598
599extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
601 css::uno::Sequence<css::uno::Any> const &)
602{
603 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisStylesExporter",
604 SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
605 SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS));
606}
607
608extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
610 css::uno::Sequence<css::uno::Any> const &)
611{
612 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisContentExporter",
613 SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::SCRIPTS |
614 SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS));
615}
616
617extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
619 css::uno::Sequence<css::uno::Any> const &)
620{
621 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisMetaExporter",
622 SvXMLExportFlags::META | SvXMLExportFlags::OASIS));
623}
624
625extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
627 css::uno::Sequence<css::uno::Any> const &)
628{
629 return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisSettingsExporter",
630 SvXMLExportFlags::SETTINGS | SvXMLExportFlags::OASIS));
631}
632
633/* 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)
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:914
Definition: doc.hxx:188
const SwCharFormats * GetCharFormats() const
Definition: doc.hxx:739
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:176
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:640
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:777
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:737
const SwAttrPool & GetAttrPool() const
Definition: doc.hxx:1318
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
SwDocShell * GetDocShell()
Definition: doc.hxx:1351
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:373
size_t size() const
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:82
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding).
Definition: rootfrm.hxx:421
size_t size() const
Definition: docary.hxx:87
sal_uInt16 GetPageCount() const
Definition: viewsh.cxx:2672
virtual void SetBodyAttributes() override
Definition: xmlexp.cxx:446
virtual XMLTextParagraphExport * CreateTextParagraphExport() override
Definition: xmlexp.cxx:306
std::unique_ptr< SwXMLTableLinesCache_Impl > m_pTableLines
Definition: xmlexp.hxx:54
virtual void ExportContent_() override
Definition: xmlexp.cxx:460
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 sal_Int64 SAL_CALL getSomething(const css::uno::Sequence< sal_Int8 > &aIdentifier) override
Definition: xmlexp.cxx:517
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept
Definition: xmlexp.cxx:511
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:64
const SwDoc * getDoc() const
Definition: xmlexp.cxx:544
bool m_bShowProgress
Definition: xmlexp.hxx:61
void FinitItemExport()
Definition: xmliteme.cxx:233
virtual sal_Int32 GetDocumentSpecificSettings(std::vector< SettingsGroup > &_out_rSettings) override
Definition: xmlexp.cxx:429
std::unique_ptr< SvXMLUnitConverter > m_pTwipUnitConverter
Definition: xmlexp.hxx:52
bool m_bBlock
Definition: xmlexp.hxx:60
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:1230
bool m_bSavedShowChanges
Definition: xmlexp.hxx:62
virtual ~SwXMLExport() override
Definition: xmlexp.cxx:324
const SwDoc * GetDoc() const
Definition: unotext.cxx:133
void seekShapes(const css::uno::Reference< css::drawing::XShapes > &xShapes) noexcept
static SvXMLExportPropertyMapper * CreateShapeExtPropMapper(SvXMLExport &rExport)
const css::uno::Sequence< sal_Int8 > & getSeq() const
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)
sal_Int64 getSomethingImpl(const css::uno::Sequence< sal_Int8 > &rId, T *pThis, FallbackToGetSomethingOf< Base >={})
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:256
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:558
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:609
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:626
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:618
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:600
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:576
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:584
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:592
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:567
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:550
SvXMLExportFlags
constexpr sal_uInt16 XML_NAMESPACE_OFFICE_EXT
constexpr sal_uInt16 XML_NAMESPACE_TEXT
constexpr sal_uInt16 XML_NAMESPACE_TABLE