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/uno/RuntimeException.hpp>
26 #include <com/sun/star/xforms/XFormsSupplier.hpp>
27 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
28 
29 #include <o3tl/any.hxx>
30 #include <officecfg/Office/Common.hxx>
31 #include <sax/tools/converter.hxx>
32 #include <svx/svdmodel.hxx>
33 #include <svx/svdpage.hxx>
34 #include <svx/xmleohlp.hxx>
35 #include <svx/xmlgrhlp.hxx>
36 #include <editeng/eeitem.hxx>
37 #include <svx/svddef.hxx>
38 #include <xmloff/nmspmap.hxx>
39 #include <xmloff/xmlnmspe.hxx>
40 #include <editeng/xmlcnitm.hxx>
42 #include <xmloff/xmluconv.hxx>
43 #include <xmloff/xformsexport.hxx>
44 #include <drawdoc.hxx>
45 #include <pam.hxx>
46 #include <unofreg.hxx>
47 #include <doc.hxx>
48 #include <swmodule.hxx>
49 #include <docsh.hxx>
50 #include <viewsh.hxx>
51 #include <rootfrm.hxx>
52 #include <docstat.hxx>
53 #include <swerror.h>
54 #include <unotext.hxx>
55 #include "xmltexte.hxx"
56 #include "xmlexp.hxx"
57 #include "xmlexpit.hxx"
58 #include <sfx2/viewsh.hxx>
60 #include <docary.hxx>
61 #include <editeng/unolingu.hxx>
64 #include <vcl/svapp.hxx>
65 #include <osl/mutex.hxx>
69 #include <IDocumentStatistics.hxx>
71 
72 
73 #include <pausethreadstarting.hxx>
74 
75 using namespace ::com::sun::star;
76 using namespace ::com::sun::star::lang;
77 using namespace ::com::sun::star::xml::sax;
78 using namespace ::com::sun::star::uno;
79 using namespace ::com::sun::star::text;
80 using namespace ::com::sun::star::container;
81 using namespace ::com::sun::star::document;
82 using namespace ::com::sun::star::drawing;
83 using namespace ::com::sun::star::beans;
84 using namespace ::com::sun::star::i18n;
85 using namespace ::com::sun::star::xforms;
86 using namespace ::xmloff::token;
87 
89  const uno::Reference< uno::XComponentContext >& rContext,
90  OUString const & implementationName, SvXMLExportFlags nExportFlags)
91 : SvXMLExport( util::MeasureUnit::INCH, rContext, implementationName, XML_TEXT,
92  nExportFlags ),
93  m_bBlock( false ),
94  m_bShowProgress( true ),
95  m_bSavedShowChanges( false ),
96  m_pDoc( nullptr )
97 {
99 }
100 
102 {
103  if( !GetModel().is() )
104  return ERR_SWG_WRITE_ERROR;
105 
106  SwPauseThreadStarting aPauseThreadStarting; // #i73788#
107 
108  // from here, we use core interfaces -> lock Solar-Mutex
109  SolarMutexGuard aGuard;
110 
111  {
112  Reference<XPropertySet> rInfoSet = getExportInfo();
113  if( rInfoSet.is() )
114  {
115  const OUString sAutoTextMode("AutoTextMode");
116  if( rInfoSet->getPropertySetInfo()->hasPropertyByName(
117  sAutoTextMode ) )
118  {
119  Any aAny = rInfoSet->getPropertyValue(sAutoTextMode);
120  if( auto b = o3tl::tryAccess<bool>(aAny) )
121  {
122  if( *b )
123  m_bBlock = true;
124  }
125  }
126  }
127  }
128 
129  SwDoc *pDoc = getDoc();
130  if (!pDoc)
131  return ERR_SWG_WRITE_ERROR;
132 
133  if( getExportFlags() & (SvXMLExportFlags::FONTDECLS|SvXMLExportFlags::STYLES|
134  SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
135  {
137  {
141  XML_NAMESPACE_OFFICE_EXT);
142  }
143 
144  GetTextParagraphExport()->SetBlockMode( m_bBlock );
145 
146  const SfxItemPool& rPool = pDoc->GetAttrPool();
147  sal_uInt16 aWhichIds[5] = { RES_UNKNOWNATR_CONTAINER,
152 
153  const int nWhichIds = rPool.GetSecondaryPool() ? 5 : 2;
154  for( int j=0; j < nWhichIds; ++j )
155  {
156  const sal_uInt16 nWhichId = aWhichIds[j];
157  for (const SfxPoolItem* pItem : rPool.GetItemSurrogates(nWhichId))
158  {
159  auto pUnknown = dynamic_cast<const SvXMLAttrContainerItem*>( pItem );
160  OSL_ENSURE( pUnknown, "illegal attribute container item" );
161  if( pUnknown && (pUnknown->GetAttrCount() > 0) )
162  {
163  sal_uInt16 nIdx = pUnknown->GetFirstNamespaceIndex();
164  while( USHRT_MAX != nIdx )
165  {
166  GetNamespaceMap_().Add( pUnknown->GetPrefix( nIdx ),
167  pUnknown->GetNamespace( nIdx ) );
168  nIdx = pUnknown->GetNextNamespaceIndex( nIdx );
169  }
170  }
171  }
172  }
173  }
174 
175  sal_uInt16 const eUnit = SvXMLUnitConverter::GetMeasureUnit(
177  if (GetMM100UnitConverter().GetXMLMeasureUnit() != eUnit )
178  {
180  m_pTwipUnitConverter->SetXMLMeasureUnit( eUnit );
181  }
182 
183  if( getExportFlags() & SvXMLExportFlags::META)
184  {
185  // Update doc stat, so that correct values are exported and
186  // the progress works correctly.
187  pDoc->getIDocumentStatistics().UpdateDocStat( false, true );
188  }
189  if( m_bShowProgress )
190  {
192  if( -1 == pProgress->GetReference() )
193  {
194  // progress isn't initialized:
195  // We assume that the whole doc is exported, and the following
196  // durations:
197  // - meta information: 2
198  // - settings: 4 (TODO: not now!)
199  // - styles (except page styles): 2
200  // - page styles: 2 (TODO: not now!) + 2 for each paragraph
201  // - paragraph: 2 (1 for automatic styles and one for content)
202 
203  // count each item once, and then multiply by two to reach the
204  // figures given above
205  // The styles in pDoc also count the default style that never
206  // gets exported -> subtract one.
207  sal_Int32 nRef = 1; // meta.xml
208  nRef += pDoc->GetCharFormats()->size() - 1;
209  nRef += pDoc->GetFrameFormats()->size() - 1;
210  nRef += pDoc->GetTextFormatColls()->size() - 1;
211  nRef *= 2; // for the above styles, xmloff will increment by 2!
212  // #i93174#: count all paragraphs for the progress bar
213  nRef += pDoc->getIDocumentStatistics().GetUpdatedDocStat( false, true ).nAllPara; // 1: only content, no autostyle
214  pProgress->SetReference( nRef );
215  pProgress->SetValue( 0 );
216  }
217  }
218 
219  if( getExportFlags() & (SvXMLExportFlags::MASTERSTYLES|SvXMLExportFlags::CONTENT))
220  {
221  //We depend on the correctness of OrdNums.
223  if( pModel )
224  pModel->GetPage( 0 )->RecalcObjOrdNums();
225  }
226 
227  // adjust document class (eClass)
229  {
230  eClass = XML_TEXT_GLOBAL;
231 
232  // additionally, we take care of the save-linked-sections-thingy
234  }
235  // MIB: 03/26/04: The Label information is saved in the settings, so
236  // we don't need it here.
237  // else: keep default pClass that we received
238 
239  rtl::Reference<SvXMLGraphicHelper> xGraphicStorageHandler;
240  if (!GetGraphicStorageHandler().is())
241  {
242  xGraphicStorageHandler = SvXMLGraphicHelper::Create(SvXMLGraphicHelperMode::Write, GetImageFilterName());
243  SetGraphicStorageHandler(xGraphicStorageHandler.get());
244  }
245 
247  if( !GetEmbeddedResolver().is() )
248  {
249  SfxObjectShell *pPersist = pDoc->GetPersist();
250  if( pPersist )
251  {
252  xEmbeddedResolver = SvXMLEmbeddedObjectHelper::Create(
253  *pPersist,
254  SvXMLEmbeddedObjectHelperMode::Write );
255  SetEmbeddedResolver( Reference<XEmbeddedObjectResolver>( xEmbeddedResolver.get() ) );
256  }
257  }
258 
259  // set redline mode if we export STYLES or CONTENT, unless redline
260  // mode is taken care of outside (through info XPropertySet)
261  bool bSaveRedline =
262  bool( getExportFlags() & (SvXMLExportFlags::CONTENT|SvXMLExportFlags::STYLES) );
263  if( bSaveRedline )
264  {
265  // if the info property set has a ShowChanges property,
266  // then change tracking is taken care of on the outside,
267  // so we don't have to!
268  Reference<XPropertySet> rInfoSet = getExportInfo();
269  if( rInfoSet.is() )
270  {
271  bSaveRedline = ! rInfoSet->getPropertySetInfo()->hasPropertyByName(
272  "ShowChanges" );
273  }
274  }
275  RedlineFlags nRedlineFlags = RedlineFlags::NONE;
277  m_bSavedShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines();
278  if( bSaveRedline )
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 {
327  FinitItemExport();
328 }
329 
331 {
332  GetFontAutoStylePool(); // make sure the pool is created
334 }
335 
337 {
338  aProps.realloc(7);
339  // Currently exporting 9 properties
340  PropertyValue *pValue = aProps.getArray();
341 
342  Reference < XIndexContainer > xBox = IndexedPropertyValues::create( comphelper::getProcessComponentContext() );
343  pValue[0].Name = "Views";
344  pValue[0].Value <<= 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  const OUString sShowChanges( "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";
384  pValue[6].Value <<= pDoc->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE);
385 }
386 
388 {
389  Reference< XMultiServiceFactory > xFac( GetModel(), UNO_QUERY );
390  if( xFac.is() )
391  {
392  Reference< XPropertySet > xProps( xFac->createInstance("com.sun.star.document.Settings"), UNO_QUERY );
393  if( xProps.is() )
394  SvXMLUnitConverter::convertPropertySet( rProps, xProps );
395  }
396 }
397 
398 sal_Int32 SwXMLExport::GetDocumentSpecificSettings( std::vector< SettingsGroup >& _out_rSettings )
399 {
400  // the only doc-specific settings group we know so far are the XForms settings
401  uno::Sequence<beans::PropertyValue> aXFormsSettings;
402  Reference< XFormsSupplier > xXFormsSupp( GetModel(), UNO_QUERY );
403  Reference< XNameAccess > xXForms;
404  if ( xXFormsSupp.is() )
405  xXForms = xXFormsSupp->getXForms().get();
406  if ( xXForms.is() )
407  {
408  getXFormsSettings( xXForms, aXFormsSettings );
409  _out_rSettings.emplace_back( XML_XFORM_MODEL_SETTINGS, aXFormsSettings );
410  }
411 
412  return aXFormsSettings.getLength() + SvXMLExport::GetDocumentSpecificSettings( _out_rSettings );
413 }
414 
416 {
417  // export use of soft page breaks
418  SwDoc *pDoc = getDoc();
421  {
422  OUStringBuffer sBuffer;
423  ::sax::Converter::convertBool(sBuffer, true);
424  AddAttribute(XML_NAMESPACE_TEXT, XML_USE_SOFT_PAGE_BREAKS,
425  sBuffer.makeStringAndClear());
426  }
427 }
428 
430 {
431  // export forms
432  Reference<XDrawPageSupplier> xDrawPageSupplier(GetModel(), UNO_QUERY);
433  if (xDrawPageSupplier.is())
434  {
435  // export only if we actually have elements
436  Reference<XDrawPage> xPage = xDrawPageSupplier->getDrawPage();
437  if (xPage.is())
438  {
439  // prevent export of form controls which are embedded in mute sections
440  GetTextParagraphExport()->PreventExportOfControlsInMuteSections(
441  xPage, GetFormExport() );
442 
443  // #i36597#
444  if ( xmloff::OFormLayerXMLExport::pageContainsForms( xPage ) || GetFormExport()->documentContainsXForms() )
445  {
446  ::xmloff::OOfficeFormsExport aOfficeForms(*this);
447 
448  GetFormExport()->exportXForms();
449 
450  GetFormExport()->seekPage(xPage);
451  GetFormExport()->exportForms(xPage);
452  }
453  }
454  }
455 
456  Reference<XPropertySet> xPropSet(GetModel(), UNO_QUERY);
457  if (xPropSet.is())
458  {
459  Any aAny = xPropSet->getPropertyValue( "TwoDigitYear" );
460  aAny <<= sal_Int16(1930);
461 
462  sal_Int16 nYear = 0;
463  aAny >>= nYear;
464  if (nYear != 1930 )
465  {
466  AddAttribute(XML_NAMESPACE_TABLE, XML_NULL_YEAR, OUString::number(nYear));
467  SvXMLElementExport aCalcSettings(*this, XML_NAMESPACE_TABLE, XML_CALCULATION_SETTINGS, true, true);
468  }
469  }
470 
471  GetTextParagraphExport()->exportTrackedChanges( false );
472  GetTextParagraphExport()->exportTextDeclarations();
473  Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
474  Reference < XText > xText = xTextDoc->getText();
475 
476  GetTextParagraphExport()->exportFramesBoundToPage( m_bShowProgress );
477  GetTextParagraphExport()->exportText( xText, m_bShowProgress );
478 }
479 
480 namespace
481 {
482  class theSwXMLExportUnoTunnelId : public rtl::Static< UnoTunnelIdInit, theSwXMLExportUnoTunnelId > {};
483 }
484 
486 {
487  return theSwXMLExportUnoTunnelId::get().getSeq();
488 }
489 
490 sal_Int64 SAL_CALL SwXMLExport::getSomething( const Sequence< sal_Int8 >& rId )
491 {
492  if( rId.getLength() == 16
493  && 0 == memcmp( getUnoTunnelId().getConstArray(),
494  rId.getConstArray(), 16 ) )
495  {
496  return sal::static_int_cast< sal_Int64 >( reinterpret_cast< sal_IntPtr >(this) );
497  }
498  return SvXMLExport::getSomething( rId );
499 }
500 
502 {
503  if( m_pDoc != nullptr )
504  return m_pDoc;
505  Reference < XTextDocument > xTextDoc( GetModel(), UNO_QUERY );
506  if (!xTextDoc)
507  {
508  SAL_WARN("sw.filter", "Problem of mismatching filter for export.");
509  return nullptr;
510  }
511 
512  Reference < XText > xText = xTextDoc->getText();
513  Reference<XUnoTunnel> xTextTunnel( xText, UNO_QUERY);
514  assert( xTextTunnel.is());
515  SwXText *pText = reinterpret_cast< SwXText *>(
516  sal::static_int_cast< sal_IntPtr >( xTextTunnel->getSomething( SwXText::getUnoTunnelId() )));
517  assert( pText != nullptr );
518  m_pDoc = pText->GetDoc();
519  assert( m_pDoc != nullptr );
520  return m_pDoc;
521 }
522 
524 {
525  return const_cast< SwXMLExport* >( this )->getDoc();
526 }
527 
528 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
529 com_sun_star_comp_Writer_XMLExporter_get_implementation(css::uno::XComponentContext* context,
530  css::uno::Sequence<css::uno::Any> const &)
531 {
532  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLExporter",
533  SvXMLExportFlags::ALL));
534 }
535 
536 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
538  css::uno::Sequence<css::uno::Any> const &)
539 {
540  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLStylesExporter",
541  SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
542  SvXMLExportFlags::FONTDECLS));
543 }
544 
545 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
547  css::uno::Sequence<css::uno::Any> const &)
548 {
549  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLContentExporter",
550  SvXMLExportFlags::SCRIPTS | SvXMLExportFlags::CONTENT | SvXMLExportFlags::AUTOSTYLES |
551  SvXMLExportFlags::FONTDECLS));
552 }
553 
554 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
556  css::uno::Sequence<css::uno::Any> const &)
557 {
558  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLMetaExporter",
559  SvXMLExportFlags::META));
560 }
561 
562 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
564  css::uno::Sequence<css::uno::Any> const &)
565 {
566  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLSettingsExporter",
567  SvXMLExportFlags::SETTINGS));
568 }
569 
570 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
572  css::uno::Sequence<css::uno::Any> const &)
573 {
574  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisExporter",
575  SvXMLExportFlags::ALL | SvXMLExportFlags::OASIS));
576 }
577 
578 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
580  css::uno::Sequence<css::uno::Any> const &)
581 {
582  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisStylesExporter",
583  SvXMLExportFlags::STYLES | SvXMLExportFlags::MASTERSTYLES | SvXMLExportFlags::AUTOSTYLES |
584  SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS));
585 }
586 
587 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
589  css::uno::Sequence<css::uno::Any> const &)
590 {
591  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisContentExporter",
592  SvXMLExportFlags::AUTOSTYLES | SvXMLExportFlags::CONTENT | SvXMLExportFlags::SCRIPTS |
593  SvXMLExportFlags::FONTDECLS | SvXMLExportFlags::OASIS));
594 }
595 
596 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
598  css::uno::Sequence<css::uno::Any> const &)
599 {
600  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisMetaExporter",
601  SvXMLExportFlags::META | SvXMLExportFlags::OASIS));
602 }
603 
604 extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface*
606  css::uno::Sequence<css::uno::Any> const &)
607 {
608  return cppu::acquire(new SwXMLExport(context, "com.sun.star.comp.Writer.XMLOasisSettingsExporter",
609  SvXMLExportFlags::SETTINGS | SvXMLExportFlags::OASIS));
610 }
611 
612 /* 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:405
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:537
static bool convertBool(bool &rBool, const OUString &rString)
virtual const SwRootFrame * GetCurrentLayout() const =0
SwDocShell * GetDocShell()
Definition: doc.hxx:1340
#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:555
#define RES_TXTATR_UNKNOWN_CONTAINER
Definition: hintids.hxx:144
sal_Int32 GetReference()
void SetXMLMeasureUnit(sal_Int16 const eXMLMeasureUnit)
SwXMLExport(const css::uno::Reference< css::uno::XComponentContext > &rContext, OUString const &implementationName, SvXMLExportFlags nExportFlags)
Definition: xmlexp.cxx:88
void InitItemExport()
Definition: xmliteme.cxx:208
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:387
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:546
virtual ErrCode exportDoc(enum::xmloff::token::XMLTokenEnum eClass=::xmloff::token::XML_TOKEN_INVALID)
static const css::uno::Sequence< sal_Int8 > & getUnoTunnelId()
Definition: unotext.cxx:1206
#define RES_UNKNOWNATR_CONTAINER
Definition: hintids.hxx:267
show all inserts
void AddAttribute(sal_uInt16 nPrefix, const sal_Char *pName, const OUString &rValue)
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:187
virtual XMLShapeExport * CreateShapeExport() override
Definition: xmlexp.cxx:311
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:588
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:563
void DeleteTableLines()
Definition: xmltble.cxx:1192
XMLTokenEnum
void FinitItemExport()
Definition: xmliteme.cxx:220
#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:490
XML_N_OFFICE_EXT
virtual tools::Rectangle GetVisArea(sal_uInt16 nAspect) const override
Definition: docsh.cxx:929
#define SW_MOD()
Definition: swmodule.hxx:255
sal_uInt16 GetPageCount() const
Definition: viewsh.cxx:2500
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:523
#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:398
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:579
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:101
#define ASPECT_CONTENT
virtual XMLTextParagraphExport * CreateTextParagraphExport() override
Definition: xmlexp.cxx:306
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:437
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:367
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:605
virtual void ExportFontDecls_() override
Definition: xmlexp.cxx:330
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:773
virtual void ExportContent_() override
Definition: xmlexp.cxx:429
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:597
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
const OUString & GetXMLToken(enum XMLTokenEnum eToken)
rtl::Reference< SvXMLAutoStylePoolP > const & GetAutoStylePool()
rtl::Reference< XMLFontAutoStylePool > const & GetFontAutoStylePool()
virtual void SetBodyAttributes() override
Definition: xmlexp.cxx:415
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
MapUnit GetMapUnit() const
virtual ~SwXMLExport() override
Definition: xmlexp.cxx:324
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:208
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:529
Item2Range GetItemSurrogates(sal_uInt16 nWhich) const
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:634
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:336
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:571
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:485
const SwFrameFormats * GetFrameFormats() const
Definition: doc.hxx:732
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:1307
std::unique_ptr< SwXMLTableLinesCache_Impl > m_pTableLines
Definition: xmlexp.hxx:52