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