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