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 <osl/diagnose.h>
29 #include <o3tl/any.hxx>
30 #include <sax/tools/converter.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>
36 #include <xmloff/namespacemap.hxx>
37 #include <xmloff/xmlnamespace.hxx>
38 #include <editeng/xmlcnitm.hxx>
40 #include <xmloff/xmluconv.hxx>
41 #include <xmloff/xformsexport.hxx>
42 #include <drawdoc.hxx>
43 #include <doc.hxx>
44 #include <swmodule.hxx>
45 #include <docsh.hxx>
46 #include <viewsh.hxx>
47 #include <rootfrm.hxx>
48 #include <docstat.hxx>
49 #include <swerror.h>
50 #include <unotext.hxx>
51 #include "xmltexte.hxx"
52 #include "xmlexp.hxx"
53 #include "xmlexpit.hxx"
54 #include "zorder.hxx"
56 #include <docary.hxx>
57 #include <frameformats.hxx>
59 #include <vcl/svapp.hxx>
63 #include <IDocumentStatistics.hxx>
65 
66 
67 #include <pausethreadstarting.hxx>
68 
69 using namespace ::com::sun::star;
70 using namespace ::com::sun::star::lang;
71 using namespace ::com::sun::star::xml::sax;
72 using namespace ::com::sun::star::uno;
73 using namespace ::com::sun::star::text;
74 using namespace ::com::sun::star::container;
75 using namespace ::com::sun::star::document;
76 using namespace ::com::sun::star::drawing;
77 using namespace ::com::sun::star::beans;
78 using namespace ::com::sun::star::i18n;
79 using namespace ::com::sun::star::xforms;
80 using namespace ::xmloff::token;
81 
83  const uno::Reference< uno::XComponentContext >& rContext,
84  OUString const & implementationName, SvXMLExportFlags nExportFlags)
85 : SvXMLExport( rContext, implementationName, util::MeasureUnit::INCH, XML_TEXT,
86  nExportFlags ),
87  m_bBlock( false ),
88  m_bShowProgress( true ),
89  m_bSavedShowChanges( false ),
90  m_pDoc( nullptr )
91 {
93 }
94 
96 {
97  if( !GetModel().is() )
98  return ERR_SWG_WRITE_ERROR;
99 
100  SwPauseThreadStarting aPauseThreadStarting; // #i73788#
101 
102  // from here, we use core interfaces -> lock Solar-Mutex
103  SolarMutexGuard aGuard;
104 
105  {
107  if( rInfoSet.is() )
108  {
109  static const OUStringLiteral sAutoTextMode(u"AutoTextMode");
110  if( rInfoSet->getPropertySetInfo()->hasPropertyByName(
111  sAutoTextMode ) )
112  {
113  Any aAny = rInfoSet->getPropertyValue(sAutoTextMode);
114  if( auto b = o3tl::tryAccess<bool>(aAny) )
115  {
116  if( *b )
117  m_bBlock = true;
118  }
119  }
120  }
121  }
122 
123  SwDoc *pDoc = getDoc();
124  if (!pDoc)
125  return ERR_SWG_WRITE_ERROR;
126 
127  if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
128  SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
129  {
131  {
136  }
137 
138  GetTextParagraphExport()->SetBlockMode( m_bBlock );
139 
140  const SfxItemPool& rPool = pDoc->GetAttrPool();
141  sal_uInt16 aWhichIds[5] = { RES_UNKNOWNATR_CONTAINER,
146 
147  const int nWhichIds = rPool.GetSecondaryPool() ? 5 : 2;
148  for( int j=0; j < nWhichIds; ++j )
149  {
150  const sal_uInt16 nWhichId = aWhichIds[j];
151  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nWhichId))
152  {
153  auto pUnknown = dynamic_cast<const SvXMLAttrContainerItem*>( pItem );
154  OSL_ENSURE( pUnknown, "illegal attribute container item" );
155  if( pUnknown && (pUnknown->GetAttrCount() > 0) )
156  {
157  sal_uInt16 nIdx = pUnknown->GetFirstNamespaceIndex();
158  while( USHRT_MAX != nIdx )
159  {
160  GetNamespaceMap_().Add( pUnknown->GetPrefix( nIdx ),
161  pUnknown->GetNamespace( nIdx ) );
162  nIdx = pUnknown->GetNextNamespaceIndex( nIdx );
163  }
164  }
165  }
166  }
167  }
168 
169  sal_uInt16 const eUnit = SvXMLUnitConverter::GetMeasureUnit(
171  if (GetMM100UnitConverter().GetXMLMeasureUnit() != eUnit )
172  {
174  m_pTwipUnitConverter->SetXMLMeasureUnit( eUnit );
175  }
176 
177  if( getExportFlags() & SvXMLExportFlags::META)
178  {
179  // Update doc stat, so that correct values are exported and
180  // the progress works correctly.
181  pDoc->getIDocumentStatistics().UpdateDocStat( false, true );
182  }
183  if( m_bShowProgress )
184  {
186  if( -1 == pProgress->GetReference() )
187  {
188  // progress isn't initialized:
189  // We assume that the whole doc is exported, and the following
190  // durations:
191  // - meta information: 2
192  // - settings: 4 (TODO: not now!)
193  // - styles (except page styles): 2
194  // - page styles: 2 (TODO: not now!) + 2 for each paragraph
195  // - paragraph: 2 (1 for automatic styles and one for content)
196 
197  // count each item once, and then multiply by two to reach the
198  // figures given above
199  // The styles in pDoc also count the default style that never
200  // gets exported -> subtract one.
201  sal_Int32 nRef = 1; // meta.xml
202  nRef += pDoc->GetCharFormats()->size() - 1;
203  nRef += pDoc->GetFrameFormats()->size() - 1;
204  nRef += pDoc->GetTextFormatColls()->size() - 1;
205  nRef *= 2; // for the above styles, xmloff will increment by 2!
206  // #i93174#: count all paragraphs for the progress bar
207  nRef += pDoc->getIDocumentStatistics().GetUpdatedDocStat( false, true ).nAllPara; // 1: only content, no autostyle
208  pProgress->SetReference( nRef );
209  pProgress->SetValue( 0 );
210  }
211  }
212 
213  if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
214  {
215  //We depend on the correctness of OrdNums.
217  if( pModel )
218  pModel->GetPage( 0 )->RecalcObjOrdNums();
219  }
220 
221  // adjust document class (eClass)
223  {
224  eClass = XML_TEXT_GLOBAL;
225 
226  // additionally, we take care of the save-linked-sections-thingy
228  }
229  // MIB: 03/26/04: The Label information is saved in the settings, so
230  // we don't need it here.
231  // else: keep default pClass that we received
232 
233  rtl::Reference<SvXMLGraphicHelper> xGraphicStorageHandler;
234  if (!GetGraphicStorageHandler().is())
235  {
236  xGraphicStorageHandler = SvXMLGraphicHelper::Create(SvXMLGraphicHelperMode::Write, GetImageFilterName());
237  SetGraphicStorageHandler(xGraphicStorageHandler);
238  }
239 
241  if( !GetEmbeddedResolver().is() )
242  {
243  SfxObjectShell *pPersist = pDoc->GetPersist();
244  if( pPersist )
245  {
246  xEmbeddedResolver = SvXMLEmbeddedObjectHelper::Create(
247  *pPersist,
248  SvXMLEmbeddedObjectHelperMode::Write );
249  SetEmbeddedResolver( xEmbeddedResolver );
250  }
251  }
252 
253  // set redline mode if we export STYLES or CONTENT, unless redline
254  // mode is taken care of outside (through info XPropertySet)
255  bool bSaveRedline =
256  bool( getExportFlags() & (SvXMLExportFlags::CONTENT|SvXMLExportFlags::STYLES) );
257  if( bSaveRedline )
258  {
259  // if the info property set has a ShowChanges property,
260  // then change tracking is taken care of on the outside,
261  // so we don't have to!
263  if( rInfoSet.is() )
264  {
265  bSaveRedline = ! rInfoSet->getPropertySetInfo()->hasPropertyByName(
266  "ShowChanges" );
267  }
268  }
269  RedlineFlags nRedlineFlags = RedlineFlags::NONE;
271  m_bSavedShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines();
272  if( bSaveRedline )
273  {
274  // tdf#133487 call this once in flat-ODF case
275  uno::Reference<drawing::XDrawPageSupplier> const xDPS(GetModel(), uno::UNO_QUERY);
276  assert(xDPS.is());
278 
279  // now save and switch redline mode
280  nRedlineFlags = pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
282  ( nRedlineFlags & RedlineFlags::ShowMask ) | RedlineFlags::ShowInsert );
283  }
284 
285  ErrCode nRet = SvXMLExport::exportDoc( eClass );
286 
287  // now we can restore the redline mode (if we changed it previously)
288  if( bSaveRedline )
289  {
290  pDoc->getIDocumentRedlineAccess().SetRedlineFlags( nRedlineFlags );
291  }
292 
293  if (xGraphicStorageHandler)
294  xGraphicStorageHandler->dispose();
295  xGraphicStorageHandler.clear();
296  if( xEmbeddedResolver )
297  xEmbeddedResolver->dispose();
298  xEmbeddedResolver.clear();
299 
300  OSL_ENSURE( !m_pTableLines, "there are table columns infos left" );
301 
302  return nRet;
303 }
304 
306 {
307  return new SwXMLTextParagraphExport(*this, *GetAutoStylePool());
308 }
309 
311 {
313  Reference < XDrawPageSupplier > xDPS( GetModel(), UNO_QUERY );
314  if( xDPS.is() )
315  {
316  Reference < XShapes > xShapes = xDPS->getDrawPage();
317  pShapeExport->seekShapes( xShapes );
318  }
319 
320  return pShapeExport;
321 }
322 
324 {
326  FinitItemExport();
327 }
328 
330 {
331  GetFontAutoStylePool(); // make sure the pool is created
333 }
334 
335 void SwXMLExport::GetViewSettings(Sequence<PropertyValue>& aProps)
336 {
337  aProps.realloc(7);
338  // Currently exporting 9 properties
339  PropertyValue *pValue = aProps.getArray();
340 
341  Reference < XIndexContainer > xBox = IndexedPropertyValues::create( comphelper::getProcessComponentContext() );
342  pValue[0].Name = "Views";
343  pValue[0].Value <<= xBox;
344 
345  SwDoc *pDoc = getDoc();
346  const tools::Rectangle rRect =
348  bool bTwip = pDoc->GetDocShell()->GetMapUnit ( ) == MapUnit::MapTwip;
349 
350  OSL_ENSURE( bTwip, "Map unit for visible area is not in TWIPS!" );
351 
352  pValue[1].Name = "ViewAreaTop";
353  pValue[1].Value <<= bTwip ? convertTwipToMm100 ( rRect.Top() ) : rRect.Top();
354 
355  pValue[2].Name = "ViewAreaLeft";
356  pValue[2].Value <<= bTwip ? convertTwipToMm100 ( rRect.Left() ) : rRect.Left();
357 
358  pValue[3].Name = "ViewAreaWidth";
359  pValue[3].Value <<= bTwip ? convertTwipToMm100 ( rRect.GetWidth() ) : rRect.GetWidth();
360 
361  pValue[4].Name = "ViewAreaHeight";
362  pValue[4].Value <<= bTwip ? convertTwipToMm100 ( rRect.GetHeight() ) : rRect.GetHeight();
363 
364  // "show redline mode" cannot simply be read from the document
365  // since it gets changed during execution. If it's in the info
366  // XPropertySet, we take it from there.
367  bool bShowRedlineChanges = m_bSavedShowChanges;
369  if ( xInfoSet.is() )
370  {
371  static const OUStringLiteral sShowChanges( u"ShowChanges" );
372  if( xInfoSet->getPropertySetInfo()->hasPropertyByName( sShowChanges ) )
373  {
374  bShowRedlineChanges = *o3tl::doAccess<bool>(xInfoSet->
375  getPropertyValue( sShowChanges ));
376  }
377  }
378 
379  pValue[5].Name = "ShowRedlineChanges";
380  pValue[5].Value <<= bShowRedlineChanges;
381 
382  pValue[6].Name = "InBrowseMode";
383  pValue[6].Value <<= pDoc->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE);
384 }
385 
386 void SwXMLExport::GetConfigurationSettings( Sequence < PropertyValue >& rProps)
387 {
388  Reference< XMultiServiceFactory > xFac( GetModel(), UNO_QUERY );
389  if (!xFac.is())
390  return;
391 
392  Reference< XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY );
393  if (!xProps.is())
394  return;
395 
396  SvXMLUnitConverter::convertPropertySet( rProps, xProps );
397 
398  // tdf#144532 if NoEmbDataSet was set, to indicate not to write an embedded
399  // database for the case of a temporary mail merge preview document, then
400  // also filter out the "EmbeddedDatabaseName" property from the document
401  // settings so that when the temp mailmerge preview document is closed it
402  // doesn't unregister the database of the same name which was registered by
403  // the document this is a copy of
405 
406  if (!rInfoSet.is() || !rInfoSet->getPropertySetInfo()->hasPropertyByName(u"NoEmbDataSet"))
407  return;
408 
409  Any aAny = rInfoSet->getPropertyValue(u"NoEmbDataSet");
410  bool bNoEmbDataSet = *o3tl::doAccess<bool>(aAny);
411  if (!bNoEmbDataSet)
412  return;
413 
414  Sequence<PropertyValue> aFilteredProps(rProps.getLength());
415  auto aFilteredPropsRange = asNonConstRange(aFilteredProps);
416  sal_Int32 nFilteredPropLen = 0;
417  for (sal_Int32 i = 0; i < rProps.getLength(); ++i)
418  {
419  if (rProps[i].Name == "EmbeddedDatabaseName")
420  continue;
421  aFilteredPropsRange[nFilteredPropLen] = rProps[i];
422  ++nFilteredPropLen;
423  }
424  aFilteredProps.realloc(nFilteredPropLen);
425  std::swap(rProps, aFilteredProps);
426 }
427 
428 sal_Int32 SwXMLExport::GetDocumentSpecificSettings( std::vector< SettingsGroup >& _out_rSettings )
429 {
430  // the only doc-specific settings group we know so far are the XForms settings
431  uno::Sequence<beans::PropertyValue> aXFormsSettings;
432  Reference< XFormsSupplier > xXFormsSupp( GetModel(), UNO_QUERY );
433  Reference< XNameAccess > xXForms;
434  if ( xXFormsSupp.is() )
435  xXForms = xXFormsSupp->getXForms().get();
436  if ( xXForms.is() )
437  {
438  getXFormsSettings( xXForms, aXFormsSettings );
439  _out_rSettings.emplace_back( XML_XFORM_MODEL_SETTINGS, aXFormsSettings );
440  }
441 
442  return aXFormsSettings.getLength() + SvXMLExport::GetDocumentSpecificSettings( _out_rSettings );
443 }
444 
446 {
447  // export use of soft page breaks
448  SwDoc *pDoc = getDoc();
451  {
452  OUStringBuffer sBuffer;
453  ::sax::Converter::convertBool(sBuffer, true);
455  sBuffer.makeStringAndClear());
456  }
457 }
458 
460 {
461  // export forms
462  Reference<XDrawPageSupplier> xDrawPageSupplier(GetModel(), UNO_QUERY);
463  if (xDrawPageSupplier.is())
464  {
465  // export only if we actually have elements
466  Reference<XDrawPage> xPage = xDrawPageSupplier->getDrawPage();
467  if (xPage.is())
468  {
469  // prevent export of form controls which are embedded in mute sections
470  GetTextParagraphExport()->PreventExportOfControlsInMuteSections(
471  xPage, GetFormExport() );
472 
473  // #i36597#
474  if ( xmloff::OFormLayerXMLExport::pageContainsForms( xPage ) || GetFormExport()->documentContainsXForms() )
475  {
476  ::xmloff::OOfficeFormsExport aOfficeForms(*this);
477 
478  GetFormExport()->exportXForms();
479 
480  GetFormExport()->seekPage(xPage);
481  GetFormExport()->exportForms(xPage);
482  }
483  }
484  }
485 
486  Reference<XPropertySet> xPropSet(GetModel(), UNO_QUERY);
487  if (xPropSet.is())
488  {
489  Any aAny = xPropSet->getPropertyValue( "TwoDigitYear" );
490  aAny <<= sal_Int16(1930);
491 
492  sal_Int16 nYear = 0;
493  aAny >>= nYear;
494  if (nYear != 1930 )
495  {
496  AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, OUString::number(nYear));
497  SvXMLElementExport aCalcSettings(*this, XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, true, true);
498  }
499  }
500 
501  GetTextParagraphExport()->exportTrackedChanges( false );
502  GetTextParagraphExport()->exportTextDeclarations();
503  Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
504  Reference < XText > xText = xTextDoc->getText();
505 
506  GetTextParagraphExport()->exportFramesBoundToPage( m_bShowProgress );
507  GetTextParagraphExport()->exportText( xText, m_bShowProgress );
508 }
509 
510 const Sequence< sal_Int8 > & SwXMLExport::getUnoTunnelId() noexcept
511 {
512  static const comphelper::UnoIdInit theSwXMLExportUnoTunnelId;
513  return theSwXMLExportUnoTunnelId.getSeq();
514 }
515 
516 sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
517 {
518  return comphelper::getSomethingImpl(rId, this,
520 }
521 
523 {
524  if( m_pDoc != nullptr )
525  return m_pDoc;
526  Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
527  if (!xTextDoc)
528  {
529  SAL_WARN("sw.filter", "Problem of mismatching filter for export.");
530  return nullptr;
531  }
532 
533  Reference < XText > xText = xTextDoc->getText();
534  Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
535  assert( xTextTunnel.is());
536  SwXText* pText = comphelper::getFromUnoTunnel<SwXText>(xTextTunnel);
537  assert( pText != nullptr );
538  m_pDoc = pText->GetDoc();
539  assert( m_pDoc != nullptr );
540  return m_pDoc;
541 }
542 
544 {
545  return const_cast< SwXMLExport* >( this )->getDoc();
546 }
547 
548 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
549 com_sun_star_comp_Writer_XMLExporter_get_implementation(css::uno::XComponentContext* context,
550  css::uno::Sequence<css::uno::Any> const &)
551 {
552  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLExporter",
553  SvXMLExportFlags::ALL));
554 }
555 
556 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
558  css::uno::Sequence<css::uno::Any> const &)
559 {
560  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLStylesExporter",
561  SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
562  SvXMLExportFlags::FONTDECLS));
563 }
564 
565 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
567  css::uno::Sequence<css::uno::Any> const &)
568 {
569  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLContentExporter",
570  SvXMLExportFlags::SCRIPTS | SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES |
571  SvXMLExportFlags::FONTDECLS));
572 }
573 
574 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
576  css::uno::Sequence<css::uno::Any> const &)
577 {
578  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLMetaExporter",
579  SvXMLExportFlags::META));
580 }
581 
582 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
584  css::uno::Sequence<css::uno::Any> const &)
585 {
586  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLSettingsExporter",
587  SvXMLExportFlags::SETTINGS));
588 }
589 
590 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
592  css::uno::Sequence<css::uno::Any> const &)
593 {
594  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisExporter",
595  SvXMLExportFlags::ALL | SvXMLExportFlags::OASIS));
596 }
597 
598 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
600  css::uno::Sequence<css::uno::Any> const &)
601 {
602  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisStylesExporter",
603  SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
604  SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS));
605 }
606 
607 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
609  css::uno::Sequence<css::uno::Any> const &)
610 {
611  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisContentExporter",
612  SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::SCRIPTS |
613  SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS));
614 }
615 
616 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
618  css::uno::Sequence<css::uno::Any> const &)
619 {
620  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisMetaExporter",
621  SvXMLExportFlags::META | SvXMLExportFlags::OASIS));
622 }
623 
624 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
626  css::uno::Sequence<css::uno::Any> const &)
627 {
628  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisSettingsExporter",
629  SvXMLExportFlags::SETTINGS | SvXMLExportFlags::OASIS));
630 }
631 
632 /* 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:557
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:575
void SetXMLMeasureUnit(sal_Int16 const eXMLMeasureUnit)
SwXMLExport(const css::uno::Reference< css::uno::XComponentContext > &rContext, OUString const &implementationName, SvXMLExportFlags nExportFlags)
Definition: xmlexp.cxx:82
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:386
OUString Name
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:566
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:310
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:608
void AddAttribute(sal_uInt16 nPrefix, const OUString &rName, 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:583
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:516
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:2662
int i
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:543
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:428
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:599
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:95
#define ASPECT_CONTENT
virtual XMLTextParagraphExport * CreateTextParagraphExport() override
Definition: xmlexp.cxx:305
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId() noexcept
Definition: xmlexp.cxx:510
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:625
virtual void ExportFontDecls_() override
Definition: xmlexp.cxx:329
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:459
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:617
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:445
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
MapUnit GetMapUnit() const
virtual ~SwXMLExport() override
Definition: xmlexp.cxx:323
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:549
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:642
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:335
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:591
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