LibreOffice Module sw (master)  1
wrtxml.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/embed/XStorage.hpp>
21 #include <com/sun/star/embed/ElementModes.hpp>
22 #include <com/sun/star/beans/PropertyAttribute.hpp>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/task/XStatusIndicator.hpp>
25 #include <com/sun/star/xml/sax/Writer.hpp>
26 #include <com/sun/star/drawing/XDrawPageSupplier.hpp>
27 #include <com/sun/star/document/XExporter.hpp>
28 #include <com/sun/star/document/XFilter.hpp>
29 #include <com/sun/star/frame/XModule.hpp>
30 
31 #include <officecfg/Office/Common.hxx>
32 #include <comphelper/fileformat.h>
36 #include <vcl/errinf.hxx>
37 #include <osl/diagnose.h>
38 #include <sal/log.hxx>
39 #include <svx/xmlgrhlp.hxx>
40 #include <svx/xmleohlp.hxx>
41 #include <svl/stritem.hxx>
42 #include <sfx2/frame.hxx>
43 #include <sfx2/docfile.hxx>
44 #include <sfx2/sfxsids.hrc>
45 #include <pam.hxx>
46 #include <doc.hxx>
47 #include <docfunc.hxx>
49 #include <IDocumentMarkAccess.hxx>
50 #include <IDocumentStatistics.hxx>
52 #include <rootfrm.hxx>
53 #include <docstat.hxx>
54 #include <docsh.hxx>
55 
56 #include <xmloff/shapeexport.hxx>
58 #include <swerror.h>
59 #include "wrtxml.hxx"
60 #include "zorder.hxx"
61 #include <strings.hrc>
62 
64 #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
65 
66 using namespace ::com::sun::star;
67 using namespace ::com::sun::star::uno;
68 using namespace ::com::sun::star::container;
69 using namespace ::com::sun::star::document;
70 using namespace ::com::sun::star::beans;
71 using namespace ::com::sun::star::lang;
72 
73 SwXMLWriter::SwXMLWriter( const OUString& rBaseURL )
74 {
75  SetBaseURL( rBaseURL );
76 }
77 
79 {
80 }
81 
82 ErrCode SwXMLWriter::Write_(const SfxItemSet* pMediumItemSet)
83 {
84  uno::Reference<task::XStatusIndicator> xStatusIndicator;
85  OUString aDocHierarchicalName;
86  bool bNoEmbDS(false);
87 
88  if (pMediumItemSet)
89  {
90  const SfxUnoAnyItem* pStatusBarItem =
91  pMediumItemSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL);
92  if (pStatusBarItem)
93  pStatusBarItem->GetValue() >>= xStatusIndicator;
94  const SfxStringItem* pDocHierarchItem =
95  pMediumItemSet->GetItem(SID_DOC_HIERARCHICALNAME);
96  if (pDocHierarchItem)
97  aDocHierarchicalName = pDocHierarchItem->GetValue();
98  const SfxBoolItem* pNoEmbDS = pMediumItemSet->GetItem(SID_NO_EMBEDDED_DS);
99  if (pNoEmbDS)
100  bNoEmbDS = pNoEmbDS->GetValue();
101  }
102 
103  // Get service factory
104  uno::Reference< uno::XComponentContext > xContext =
106 
107  // Get data sink ...
108  uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
109  rtl::Reference<SvXMLGraphicHelper> xGraphicHelper ;
110  uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
112 
113  OSL_ENSURE( m_xStg.is(), "Where is my storage?" );
114  xGraphicHelper = SvXMLGraphicHelper::Create( m_xStg,
115  SvXMLGraphicHelperMode::Write );
116  xGraphicStorageHandler = xGraphicHelper.get();
117 
118  SfxObjectShell *pPersist = m_pDoc->GetPersist();
119  if( pPersist )
120  {
121  xObjectHelper = SvXMLEmbeddedObjectHelper::Create(
122  m_xStg, *pPersist,
123  SvXMLEmbeddedObjectHelperMode::Write );
124  xObjectResolver = xObjectHelper.get();
125  }
126 
127  // create and prepare the XPropertySet that gets passed through
128  // the components, and the XStatusIndicator that shows progress to
129  // the user.
130 
131  // create XPropertySet with three properties for status indicator
132  comphelper::PropertyMapEntry const aInfoMap[] =
133  {
134  { OUString("ProgressRange"), 0,
136  beans::PropertyAttribute::MAYBEVOID, 0},
137  { OUString("ProgressMax"), 0,
139  beans::PropertyAttribute::MAYBEVOID, 0},
140  { OUString("ProgressCurrent"), 0,
142  beans::PropertyAttribute::MAYBEVOID, 0},
143  { OUString("WrittenNumberStyles"), 0,
145  beans::PropertyAttribute::MAYBEVOID, 0},
146  { OUString("UsePrettyPrinting"), 0,
148  beans::PropertyAttribute::MAYBEVOID, 0},
149  { OUString("ShowChanges"), 0,
151  beans::PropertyAttribute::MAYBEVOID, 0 },
152  { OUString("RedlineProtectionKey"), 0,
154  beans::PropertyAttribute::MAYBEVOID, 0 },
155  { OUString("BaseURI"), 0,
157  beans::PropertyAttribute::MAYBEVOID, 0 },
158  { OUString("StreamRelPath"), 0,
160  beans::PropertyAttribute::MAYBEVOID, 0 },
161  { OUString("StreamName"), 0,
163  beans::PropertyAttribute::MAYBEVOID, 0 },
164  { OUString("AutoTextMode"), 0,
166  beans::PropertyAttribute::MAYBEVOID, 0 },
167  { OUString("StyleNames"), 0,
169  beans::PropertyAttribute::MAYBEVOID, 0 },
170  { OUString("StyleFamilies"), 0,
172  beans::PropertyAttribute::MAYBEVOID, 0 },
173  // #i69627#
174  { OUString("OutlineStyleAsNormalListStyle"), 0,
176  beans::PropertyAttribute::MAYBEVOID, 0 },
177  { OUString("TargetStorage"),0, cppu::UnoType<embed::XStorage>::get(),
178  css::beans::PropertyAttribute::MAYBEVOID, 0 },
179  // tdf#144532
180  { OUString("NoEmbDataSet"), 0,
182  beans::PropertyAttribute::MAYBEVOID, 0 },
183  { OUString(), 0, css::uno::Type(), 0, 0 }
184  };
185  uno::Reference< beans::XPropertySet > xInfoSet(
187  new comphelper::PropertySetInfo( aInfoMap ) ) );
188 
189  xInfoSet->setPropertyValue( "TargetStorage", Any( m_xStg ) );
190 
191  xInfoSet->setPropertyValue("NoEmbDataSet", Any(bNoEmbDS));
192 
193  if (m_bShowProgress)
194  {
195  // set progress range and start status indicator
196  sal_Int32 nProgressRange(1000000);
197  if (xStatusIndicator.is())
198  {
199  xStatusIndicator->start(SwResId( STR_STATSTR_SWGWRITE),
200  nProgressRange);
201  }
202  xInfoSet->setPropertyValue("ProgressRange", Any(nProgressRange));
203 
204  xInfoSet->setPropertyValue("ProgressMax", Any(static_cast < sal_Int32 >( -1 )));
205  }
206 
207  xInfoSet->setPropertyValue( "UsePrettyPrinting", Any(officecfg::Office::Common::Save::Document::PrettyPrinting::get()) );
208 
209  uno::Reference<lang::XComponent> const xModelComp(m_pDoc->GetDocShell()->GetModel());
210  uno::Reference<drawing::XDrawPageSupplier> const xDPS(xModelComp, uno::UNO_QUERY);
211  assert(xDPS.is());
213 
214  // save show redline mode ...
215  RedlineFlags const nOrigRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
216  RedlineFlags nRedlineFlags(nOrigRedlineFlags);
217  bool isShowChanges;
218  // TODO: ideally this would be stored per-view...
220  isShowChanges = pLayout == nullptr || !pLayout->IsHideRedlines();
221  xInfoSet->setPropertyValue("ShowChanges", Any(isShowChanges));
222  // ... and hide redlines for export
223  nRedlineFlags &= ~RedlineFlags::ShowMask;
224  nRedlineFlags |= RedlineFlags::ShowInsert;
226 
227  // Set base URI
228  xInfoSet->setPropertyValue( "BaseURI", Any( GetBaseURL() ) );
229 
230  if( SfxObjectCreateMode::EMBEDDED == m_pDoc->GetDocShell()->GetCreateMode() )
231  {
232  const OUString aName( !aDocHierarchicalName.isEmpty()
233  ? aDocHierarchicalName
234  : OUString( "dummyObjectName" ) );
235 
236  xInfoSet->setPropertyValue( "StreamRelPath", Any( aName ) );
237  }
238 
239  if( m_bBlock )
240  {
241  xInfoSet->setPropertyValue( "AutoTextMode", Any(true) );
242  }
243 
244  // #i69627#
245  const bool bOASIS = ( SotStorage::GetVersion( m_xStg ) > SOFFICE_FILEFORMAT_60 );
246  if ( bOASIS &&
248  {
249  xInfoSet->setPropertyValue( "OutlineStyleAsNormalListStyle", Any( true ) );
250  }
251 
252  // filter arguments
253  // - graphics + object resolver for styles + content
254  // - status indicator
255  // - info property set
256  // - else empty
257  sal_Int32 nArgs = 1;
258  if( xStatusIndicator.is() )
259  nArgs++;
260 
261  Sequence < Any > aEmptyArgs( nArgs );
262  Any *pArgs = aEmptyArgs.getArray();
263  *pArgs++ <<= xInfoSet;
264  if( xStatusIndicator.is() )
265  *pArgs++ <<= xStatusIndicator;
266 
267  if( xGraphicStorageHandler.is() )
268  nArgs++;
269  if( xObjectResolver.is() )
270  nArgs++;
271 
272  Sequence < Any > aFilterArgs( nArgs );
273  pArgs = aFilterArgs.getArray();
274  *pArgs++ <<= xInfoSet;
275  if( xGraphicStorageHandler.is() )
276  *pArgs++ <<= xGraphicStorageHandler;
277  if( xObjectResolver.is() )
278  *pArgs++ <<= xObjectResolver;
279  if( xStatusIndicator.is() )
280  *pArgs++ <<= xStatusIndicator;
281 
284 
285  // properties
286  Sequence < PropertyValue > aProps( m_pOrigFileName ? 1 : 0 );
287  if( m_pOrigFileName )
288  {
289  PropertyValue *pProps = aProps.getArray();
290  pProps->Name = "FileName";
291  pProps->Value <<= *m_pOrigFileName;
292  }
293 
294  // export sub streams for package, else full stream into a file
295  bool bWarn = false;
296 
297  // RDF metadata: export if ODF >= 1.2
298  // N.B.: embedded documents have their own manifest.rdf!
299  if ( bOASIS )
300  {
301  const uno::Reference<beans::XPropertySet> xPropSet(m_xStg,
302  uno::UNO_QUERY_THROW);
303  try
304  {
305  OUString Version;
306  // ODF >= 1.2
307  if ((xPropSet->getPropertyValue("Version") >>= Version)
308  && Version != ODFVER_010_TEXT
309  && Version != ODFVER_011_TEXT)
310  {
311  const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
312  xModelComp, uno::UNO_QUERY_THROW);
313  xDMA->storeMetadataToStorage(m_xStg);
314  }
315  }
316  catch (beans::UnknownPropertyException &)
317  { /* ignore */ }
318  catch (uno::Exception &)
319  {
320  bWarn = true;
321  }
322  }
323 
324  bool bStoreMeta = ( SfxObjectCreateMode::EMBEDDED != m_pDoc->GetDocShell()->GetCreateMode() );
325  if ( !bStoreMeta )
326  {
327  try
328  {
329  Reference< frame::XModule > xModule( xModelComp, UNO_QUERY );
330  if ( xModule.is() )
331  {
332  const OUString aModuleID = xModule->getIdentifier();
333  bStoreMeta = !aModuleID.isEmpty() &&
334  ( aModuleID == "com.sun.star.sdb.FormDesign" ||
335  aModuleID == "com.sun.star.sdb.TextReportDesign" );
336  }
337  }
338  catch( uno::Exception& )
339  {}
340  }
341 
342  OUString sWarnFile;
343  if( !m_bOrganizerMode && !m_bBlock && bStoreMeta )
344  {
346  xModelComp, "meta.xml", xContext,
347  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaExporter"
348  : "com.sun.star.comp.Writer.XMLMetaExporter"),
349  aEmptyArgs, aProps ) )
350  {
351  bWarn = true;
352  sWarnFile = "meta.xml";
353  }
354  }
355 
356  if( !m_bBlock )
357  {
359  xModelComp, "settings.xml", xContext,
360  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter"
361  : "com.sun.star.comp.Writer.XMLSettingsExporter"),
362  aEmptyArgs, aProps ) )
363  {
364  if( !bWarn )
365  {
366  bWarn = true;
367  sWarnFile = "settings.xml";
368  }
369  }
370  }
371 
372  bool bErr = false;
373 
374  OUString sErrFile;
376  xModelComp, "styles.xml", xContext,
377  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesExporter"
378  : "com.sun.star.comp.Writer.XMLStylesExporter"),
379  aFilterArgs, aProps ) )
380  {
381  bErr = true;
382  sErrFile = "styles.xml";
383  }
384 
385  if( !m_bOrganizerMode && !bErr )
386  {
388  xModelComp, "content.xml", xContext,
389  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentExporter"
390  : "com.sun.star.comp.Writer.XMLContentExporter"),
391  aFilterArgs, aProps ) )
392  {
393  bErr = true;
394  sErrFile = "content.xml";
395  }
396  }
397 
399  !(m_bOrganizerMode || m_bBlock || bErr ||
400  // sw_redlinehide: disable layout cache for now
402  {
403  try
404  {
405  uno::Reference < io::XStream > xStm = m_xStg->openStreamElement( "layout-cache", embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
406  std::unique_ptr<SvStream> pStream = utl::UcbStreamHelper::CreateStream( xStm );
407  if( !pStream->GetError() )
408  {
409  uno::Reference < beans::XPropertySet > xSet( xStm, UNO_QUERY );
410  uno::Any aAny2;
411  aAny2 <<= OUString("application/binary");
412  xSet->setPropertyValue("MediaType", aAny2 );
413  m_pDoc->WriteLayoutCache( *pStream );
414  }
415  }
416  catch ( uno::Exception& )
417  {
418  }
419  }
420 
421  if( xGraphicHelper )
422  xGraphicHelper->dispose();
423  xGraphicHelper.clear();
424  xGraphicStorageHandler = nullptr;
425 
426  if( xObjectHelper )
427  xObjectHelper->dispose();
428  xObjectHelper.clear();
429  xObjectResolver = nullptr;
430 
431  // restore redline mode
432  nRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
433  nRedlineFlags &= ~RedlineFlags::ShowMask;
434  nRedlineFlags |= RedlineFlags::ShowInsert;
435  nRedlineFlags |= nOrigRedlineFlags & RedlineFlags::ShowMask;
437 
438  // tdf#115815 restore annotation ranges collapsed by hide redlines
440 
441  if (xStatusIndicator.is())
442  {
443  xStatusIndicator->end();
444  }
445 
446  if( bErr )
447  {
448  if( !sErrFile.isEmpty() )
449  return *new StringErrorInfo( ERR_WRITE_ERROR_FILE, sErrFile,
450  DialogMask::ButtonsOk | DialogMask::MessageError );
451  return ERR_SWG_WRITE_ERROR;
452  }
453  else if( bWarn )
454  {
455  if( !sWarnFile.isEmpty() )
456  return *new StringErrorInfo( WARN_WRITE_ERROR_FILE, sWarnFile,
457  DialogMask::ButtonsOk | DialogMask::MessageError );
458  return WARN_SWG_FEATURES_LOST;
459  }
460 
461  return ERRCODE_NONE;
462 }
463 
465 {
466  return Write_(nullptr);
467 }
468 
470 {
471  return Write_(aTargetMedium.GetItemSet());
472 }
473 
475  const OUString* pFileName )
476 {
477  return IsStgWriter()
478  ? static_cast<StgWriter *>(this)->Write( rPaM, rMed.GetOutputStorage(), pFileName, &rMed )
479  : static_cast<Writer *>(this)->Write( rPaM, *rMed.GetOutStream(), pFileName );
480 }
481 
483  const uno::Reference<XComponent> & xComponent,
484  const char* pStreamName,
485  const uno::Reference<uno::XComponentContext> & rxContext,
486  const char* pServiceName,
487  const Sequence<Any> & rArguments,
488  const Sequence<beans::PropertyValue> & rMediaDesc )
489 {
490  OSL_ENSURE( m_xStg.is(), "Need storage!" );
491  OSL_ENSURE( nullptr != pStreamName, "Need stream name!" );
492  OSL_ENSURE( nullptr != pServiceName, "Need service name!" );
493 
494  SAL_INFO( "sw.filter", "SwXMLWriter::WriteThroughComponent : stream " << pStreamName );
495  // open stream
496  bool bRet = false;
497  try
498  {
499  const OUString sStreamName = OUString::createFromAscii( pStreamName );
500  uno::Reference<io::XStream> xStream =
501  m_xStg->openStreamElement( sStreamName,
502  embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
503 
504  uno::Reference <beans::XPropertySet > xSet( xStream, uno::UNO_QUERY );
505  if( !xSet.is() )
506  return false;
507 
508  xSet->setPropertyValue("MediaType", Any(OUString("text/xml")) );
509 
510  // even plain stream should be encrypted in encrypted documents
511  xSet->setPropertyValue( "UseCommonStoragePasswordEncryption", Any(true) );
512 
513  // set buffer and create outputstream
514  uno::Reference< io::XOutputStream > xOutputStream = xStream->getOutputStream();
515 
516  // set Base URL
517  uno::Reference< beans::XPropertySet > xInfoSet;
518  if( rArguments.hasElements() )
519  rArguments.getConstArray()[0] >>= xInfoSet;
520  OSL_ENSURE( xInfoSet.is(), "missing property set" );
521  if( xInfoSet.is() )
522  {
523  xInfoSet->setPropertyValue( "StreamName", Any( sStreamName ) );
524  }
525 
526  // write the stuff
527  bRet = WriteThroughComponent(
528  xOutputStream, xComponent, rxContext,
529  pServiceName, rArguments, rMediaDesc );
530  }
531  catch ( uno::Exception& )
532  {
533  }
534 
535  return bRet;
536 
537 }
538 
540  const uno::Reference<io::XOutputStream> & xOutputStream,
541  const uno::Reference<XComponent> & xComponent,
542  const uno::Reference<XComponentContext> & rxContext,
543  const char* pServiceName,
544  const Sequence<Any> & rArguments,
545  const Sequence<PropertyValue> & rMediaDesc )
546 {
547  OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" );
548  OSL_ENSURE( xComponent.is(), "Need component!" );
549  OSL_ENSURE( nullptr != pServiceName, "Need component name!" );
550 
551  // get component
552  uno::Reference< xml::sax::XWriter > xSaxWriter = xml::sax::Writer::create(rxContext);
553  SAL_INFO( "sw.filter", "SAX-Writer created" );
554  // connect XML writer to output stream
555  xSaxWriter->setOutputStream( xOutputStream );
556 
557  // prepare arguments (prepend doc handler to given arguments)
558  Sequence<Any> aArgs( 1 + rArguments.getLength() );
559  auto pArgs = aArgs.getArray();
560  *pArgs <<= xSaxWriter;
561  std::copy(rArguments.begin(), rArguments.end(), std::next(pArgs));
562 
563  // get filter component
564  uno::Reference< document::XExporter > xExporter(
565  rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(
566  OUString::createFromAscii(pServiceName), aArgs, rxContext), UNO_QUERY);
567  OSL_ENSURE( xExporter.is(),
568  "can't instantiate export filter component" );
569  if( !xExporter.is() )
570  return false;
571  SAL_INFO( "sw.filter", pServiceName << " instantiated." );
572  // connect model and filter
573  xExporter->setSourceDocument( xComponent );
574 
575  // filter!
576  SAL_INFO( "sw.filter", "call filter()" );
577  uno::Reference<XFilter> xFilter( xExporter, UNO_QUERY );
578  return xFilter->filter( rMediaDesc );
579 }
580 
582  [[maybe_unused]] std::u16string_view /*rName*/, const OUString& rBaseURL, WriterRef& xRet )
583 {
584  xRet = new SwXMLWriter( rBaseURL );
585 }
586 
587 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
bool GetValue() const
#define WARN_SWG_FEATURES_LOST
Definition: swerror.h:39
const OUString & GetBaseURL() const
Definition: shellio.hxx:444
IDocumentStatistics const & getIDocumentStatistics() const
Definition: doc.cxx:373
virtual const SwRootFrame * GetCurrentLayout() const =0
SwDocShell * GetDocShell()
Definition: doc.hxx:1351
#define ERR_SWG_WRITE_ERROR
Definition: swerror.h:30
void GetXMLWriter([[maybe_unused]] std::u16string_view, const OUString &rBaseURL, WriterRef &xRet)
Definition: wrtxml.cxx:581
sal_Int32 GetVersion() const
#define WARN_WRITE_ERROR_FILE
Definition: swerror.h:42
constexpr OUStringLiteral ODFVER_011_TEXT
css::uno::Reference< css::frame::XModel3 > GetModel() const
virtual ErrCode Write(SwPaM &, SfxMedium &, const OUString *) override
Definition: wrtxml.cxx:474
virtual void restoreAnnotationMarks(bool bDelete=true)=0
#define ERR_WRITE_ERROR_FILE
Definition: swerror.h:32
IDocumentMarkAccess * getIDocumentMarkAccess()
Definition: docbm.cxx:1792
The root element of a Writer document layout.
Definition: rootfrm.hxx:81
show all inserts
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:155
OUString SwResId(TranslateId aId)
Definition: swmodule.cxx:164
bool m_bOrganizerMode
Definition: shellio.hxx:422
Reference< XInputStream > xStream
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
ErrCode Write_(const SfxItemSet *pMediumItemSet)
Definition: wrtxml.cxx:82
SvStream * GetOutStream()
css::uno::Reference< css::embed::XStorage > m_xStg
Definition: shellio.hxx:482
const css::uno::Any & GetValue() const
SfxObjectCreateMode GetCreateMode() const
void SetBaseURL(const OUString &rURL)
Definition: shellio.hxx:399
virtual ErrCode WriteStorage() override
Definition: wrtxml.cxx:464
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:137
#define SOFFICE_FILEFORMAT_60
void PutNumFormatFontsInAttrPool()
Definition: writer.cxx:345
static rtl::Reference< SvXMLEmbeddedObjectHelper > Create(const css::uno::Reference< css::embed::XStorage > &,::comphelper::IEmbeddedHelper &rDocPersist, SvXMLEmbeddedObjectHelperMode eCreateMode)
void PutEditEngFontsInAttrPool()
Definition: writer.cxx:387
COMPHELPER_DLLPUBLIC css::uno::Reference< css::beans::XPropertySet > GenericPropertySet_CreateInstance(PropertySetInfo *pInfo)
const OUString & GetValue() const
SwXMLWriter(const OUString &rBaseURL)
Definition: wrtxml.cxx:73
void WriteLayoutCache(SvStream &rStream)
Definition: docnew.cxx:801
virtual bool IsStgWriter() const override
Definition: fltini.cxx:190
SfxItemSet * GetItemSet() const
css::uno::Type const & get()
bool m_bBlock
Definition: shellio.hxx:421
IDocumentLayoutAccess const & getIDocumentLayoutAccess() const
Definition: doc.cxx:405
sal_uLong nPage
Definition: docstat.hxx:30
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
#define ERRCODE_NONE
virtual const SwViewShell * GetCurrentViewShell() const =0
Returns the layout set at the document.
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
virtual const SwDocStat & GetDocStat() const =0
Document - Statistics.
#define SAL_INFO(area, stream)
OUString aName
virtual ~SwXMLWriter() override
Definition: wrtxml.cxx:78
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:640
Reference< XComponentContext > getProcessComponentContext()
css::uno::Reference< css::embed::XStorage > GetOutputStorage()
bool IsHideRedlines() const
Replacement for sw::DocumentRedlineManager::GetRedlineFlags() (this is layout-level redline hiding)...
Definition: rootfrm.hxx:421
bool HasOutlineStyleToBeWrittenAsNormalListStyle(SwDoc &rDoc)
method to check, if the outline style has to written as a normal list style
Definition: docfmt.cxx:2024
const OUString * m_pOrigFileName
Definition: shellio.hxx:390
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
bool HasMergedParas() const
Definition: rootfrm.hxx:425
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 SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
constexpr OUStringLiteral ODFVER_010_TEXT
bool WriteThroughComponent(const css::uno::Reference< css::lang::XComponent > &xComponent, const char *pStreamName, const css::uno::Reference< css::uno::XComponentContext > &rFactory, const char *pServiceName, const css::uno::Sequence< css::uno::Any > &rArguments, const css::uno::Sequence< css::beans::PropertyValue > &rMediaDesc)
SwDoc * m_pDoc
Definition: shellio.hxx:408
virtual ErrCode WriteMedium(SfxMedium &aTargetMedium) override
Definition: wrtxml.cxx:469
bool m_bShowProgress
Definition: shellio.hxx:412