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