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