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