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 
30 #include <comphelper/fileformat.h>
34 #include <vcl/errinf.hxx>
35 #include <sal/log.hxx>
36 #include <svx/xmlgrhlp.hxx>
37 #include <svx/xmleohlp.hxx>
38 #include <unotools/saveopt.hxx>
39 #include <svl/stritem.hxx>
40 #include <sfx2/frame.hxx>
41 #include <sfx2/docfile.hxx>
42 #include <sfx2/sfxsids.hrc>
43 #include <pam.hxx>
44 #include <doc.hxx>
45 #include <docfunc.hxx>
47 #include <IDocumentStatistics.hxx>
49 #include <rootfrm.hxx>
50 #include <docstat.hxx>
51 #include <docsh.hxx>
52 
54 #include <swerror.h>
55 #include "wrtxml.hxx"
56 #include <strings.hrc>
57 
59 #include <com/sun/star/rdf/XDocumentMetadataAccess.hpp>
60 
61 using namespace ::com::sun::star;
62 using namespace ::com::sun::star::uno;
63 using namespace ::com::sun::star::container;
64 using namespace ::com::sun::star::document;
65 using namespace ::com::sun::star::beans;
66 using namespace ::com::sun::star::lang;
67 
68 SwXMLWriter::SwXMLWriter( const OUString& rBaseURL )
69 {
70  SetBaseURL( rBaseURL );
71 }
72 
74 {
75 }
76 
77 ErrCode SwXMLWriter::Write_( const uno::Reference < task::XStatusIndicator >& xStatusIndicator,
78  const OUString& aDocHierarchicalName )
79 {
80  // Get service factory
81  uno::Reference< uno::XComponentContext > xContext =
83 
84  // Get data sink ...
85  uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
86  rtl::Reference<SvXMLGraphicHelper> xGraphicHelper ;
87  uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
89 
90  OSL_ENSURE( m_xStg.is(), "Where is my storage?" );
91  xGraphicHelper = SvXMLGraphicHelper::Create( m_xStg,
92  SvXMLGraphicHelperMode::Write );
93  xGraphicStorageHandler = xGraphicHelper.get();
94 
95  SfxObjectShell *pPersist = m_pDoc->GetPersist();
96  if( pPersist )
97  {
98  xObjectHelper = SvXMLEmbeddedObjectHelper::Create(
99  m_xStg, *pPersist,
100  SvXMLEmbeddedObjectHelperMode::Write );
101  xObjectResolver = xObjectHelper.get();
102  }
103 
104  // create and prepare the XPropertySet that gets passed through
105  // the components, and the XStatusIndicator that shows progress to
106  // the user.
107 
108  // create XPropertySet with three properties for status indicator
109  comphelper::PropertyMapEntry const aInfoMap[] =
110  {
111  { OUString("ProgressRange"), 0,
113  beans::PropertyAttribute::MAYBEVOID, 0},
114  { OUString("ProgressMax"), 0,
116  beans::PropertyAttribute::MAYBEVOID, 0},
117  { OUString("ProgressCurrent"), 0,
119  beans::PropertyAttribute::MAYBEVOID, 0},
120  { OUString("WrittenNumberStyles"), 0,
122  beans::PropertyAttribute::MAYBEVOID, 0},
123  { OUString("UsePrettyPrinting"), 0,
125  beans::PropertyAttribute::MAYBEVOID, 0},
126  { OUString("ShowChanges"), 0,
128  beans::PropertyAttribute::MAYBEVOID, 0 },
129  { OUString("RedlineProtectionKey"), 0,
131  beans::PropertyAttribute::MAYBEVOID, 0 },
132  { OUString("BaseURI"), 0,
134  beans::PropertyAttribute::MAYBEVOID, 0 },
135  { OUString("StreamRelPath"), 0,
137  beans::PropertyAttribute::MAYBEVOID, 0 },
138  { OUString("StreamName"), 0,
140  beans::PropertyAttribute::MAYBEVOID, 0 },
141  { OUString("AutoTextMode"), 0,
143  beans::PropertyAttribute::MAYBEVOID, 0 },
144  { OUString("StyleNames"), 0,
146  beans::PropertyAttribute::MAYBEVOID, 0 },
147  { OUString("StyleFamilies"), 0,
149  beans::PropertyAttribute::MAYBEVOID, 0 },
150  // #i69627#
151  { OUString("OutlineStyleAsNormalListStyle"), 0,
153  beans::PropertyAttribute::MAYBEVOID, 0 },
154  { OUString("TargetStorage"),0, cppu::UnoType<embed::XStorage>::get(),
155  css::beans::PropertyAttribute::MAYBEVOID, 0 },
156  { OUString(), 0, css::uno::Type(), 0, 0 }
157  };
158  uno::Reference< beans::XPropertySet > xInfoSet(
160  new comphelper::PropertySetInfo( aInfoMap ) ) );
161 
162  xInfoSet->setPropertyValue( "TargetStorage", Any( m_xStg ) );
163 
164  if (m_bShowProgress)
165  {
166  // set progress range and start status indicator
167  sal_Int32 nProgressRange(1000000);
168  if (xStatusIndicator.is())
169  {
170  xStatusIndicator->start(SwResId( STR_STATSTR_SWGWRITE),
171  nProgressRange);
172  }
173  xInfoSet->setPropertyValue("ProgressRange", Any(nProgressRange));
174 
175  xInfoSet->setPropertyValue("ProgressMax", Any(static_cast < sal_Int32 >( -1 )));
176  }
177 
178  SvtSaveOptions aSaveOpt;
179  xInfoSet->setPropertyValue( "UsePrettyPrinting", makeAny(aSaveOpt.IsPrettyPrinting()) );
180 
181  // save show redline mode ...
182  const OUString sShowChanges("ShowChanges");
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(sShowChanges, 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(
252  m_pDoc->GetDocShell()->GetModel(), UNO_QUERY );
253  OSL_ENSURE( xModelComp.is(), "XMLWriter::Write: got no model" );
254  if( !xModelComp.is() )
255  return ERR_SWG_WRITE_ERROR;
256 
259 
260  // properties
261  Sequence < PropertyValue > aProps( m_pOrigFileName ? 1 : 0 );
262  if( m_pOrigFileName )
263  {
264  PropertyValue *pProps = aProps.getArray();
265  pProps->Name = "FileName";
266  pProps->Value <<= *m_pOrigFileName;
267  }
268 
269  // export sub streams for package, else full stream into a file
270  bool bWarn = false;
271 
272  // RDF metadata: export if ODF >= 1.2
273  // N.B.: embedded documents have their own manifest.rdf!
274  if ( bOASIS )
275  {
276  const uno::Reference<beans::XPropertySet> xPropSet(m_xStg,
277  uno::UNO_QUERY_THROW);
278  try
279  {
280  OUString Version;
281  // ODF >= 1.2
282  if ((xPropSet->getPropertyValue("Version") >>= Version)
283  && Version != ODFVER_010_TEXT
284  && Version != ODFVER_011_TEXT)
285  {
286  const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(
287  xModelComp, uno::UNO_QUERY_THROW);
288  xDMA->storeMetadataToStorage(m_xStg);
289  }
290  }
291  catch (beans::UnknownPropertyException &)
292  { /* ignore */ }
293  catch (uno::Exception &)
294  {
295  bWarn = true;
296  }
297  }
298 
299  bool bStoreMeta = ( SfxObjectCreateMode::EMBEDDED != m_pDoc->GetDocShell()->GetCreateMode() );
300  if ( !bStoreMeta )
301  {
302  try
303  {
304  Reference< frame::XModule > xModule( xModelComp, UNO_QUERY );
305  if ( xModule.is() )
306  {
307  const OUString aModuleID = xModule->getIdentifier();
308  bStoreMeta = !aModuleID.isEmpty() &&
309  ( aModuleID == "com.sun.star.sdb.FormDesign" ||
310  aModuleID == "com.sun.star.sdb.TextReportDesign" );
311  }
312  }
313  catch( uno::Exception& )
314  {}
315  }
316 
317  OUString sWarnFile;
318  if( !m_bOrganizerMode && !m_bBlock && bStoreMeta )
319  {
321  xModelComp, "meta.xml", xContext,
322  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaExporter"
323  : "com.sun.star.comp.Writer.XMLMetaExporter"),
324  aEmptyArgs, aProps ) )
325  {
326  bWarn = true;
327  sWarnFile = "meta.xml";
328  }
329  }
330 
331  if( !m_bBlock )
332  {
334  xModelComp, "settings.xml", xContext,
335  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsExporter"
336  : "com.sun.star.comp.Writer.XMLSettingsExporter"),
337  aEmptyArgs, aProps ) )
338  {
339  if( !bWarn )
340  {
341  bWarn = true;
342  sWarnFile = "settings.xml";
343  }
344  }
345  }
346 
347  bool bErr = false;
348 
349  OUString sErrFile;
351  xModelComp, "styles.xml", xContext,
352  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesExporter"
353  : "com.sun.star.comp.Writer.XMLStylesExporter"),
354  aFilterArgs, aProps ) )
355  {
356  bErr = true;
357  sErrFile = "styles.xml";
358  }
359 
360  if( !m_bOrganizerMode && !bErr )
361  {
363  xModelComp, "content.xml", xContext,
364  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentExporter"
365  : "com.sun.star.comp.Writer.XMLContentExporter"),
366  aFilterArgs, aProps ) )
367  {
368  bErr = true;
369  sErrFile = "content.xml";
370  }
371  }
372 
374  !(m_bOrganizerMode || m_bBlock || bErr ||
375  // sw_redlinehide: disable layout cache for now
377  {
378  try
379  {
380  uno::Reference < io::XStream > xStm = m_xStg->openStreamElement( "layout-cache", embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
381  std::unique_ptr<SvStream> pStream = utl::UcbStreamHelper::CreateStream( xStm );
382  if( !pStream->GetError() )
383  {
384  uno::Reference < beans::XPropertySet > xSet( xStm, UNO_QUERY );
385  uno::Any aAny2;
386  aAny2 <<= OUString("application/binary");
387  xSet->setPropertyValue("MediaType", aAny2 );
388  m_pDoc->WriteLayoutCache( *pStream );
389  }
390  }
391  catch ( uno::Exception& )
392  {
393  }
394  }
395 
396  if( xGraphicHelper )
397  xGraphicHelper->dispose();
398  xGraphicHelper.clear();
399  xGraphicStorageHandler = nullptr;
400 
401  if( xObjectHelper )
402  xObjectHelper->dispose();
403  xObjectHelper.clear();
404  xObjectResolver = nullptr;
405 
406  // restore redline mode
407  nRedlineFlags = m_pDoc->getIDocumentRedlineAccess().GetRedlineFlags();
408  nRedlineFlags &= ~RedlineFlags::ShowMask;
409  nRedlineFlags |= RedlineFlags::ShowInsert;
410  nRedlineFlags |= nOrigRedlineFlags & RedlineFlags::ShowMask;
412 
413  if (xStatusIndicator.is())
414  {
415  xStatusIndicator->end();
416  }
417 
418  if( bErr )
419  {
420  if( !sErrFile.isEmpty() )
421  return *new StringErrorInfo( ERR_WRITE_ERROR_FILE, sErrFile,
422  DialogMask::ButtonsOk | DialogMask::MessageError );
423  return ERR_SWG_WRITE_ERROR;
424  }
425  else if( bWarn )
426  {
427  if( !sWarnFile.isEmpty() )
428  return *new StringErrorInfo( WARN_WRITE_ERROR_FILE, sWarnFile,
429  DialogMask::ButtonsOk | DialogMask::MessageError );
430  return WARN_SWG_FEATURES_LOST;
431  }
432 
433  return ERRCODE_NONE;
434 }
435 
437 {
438  return Write_( uno::Reference < task::XStatusIndicator >(), OUString() );
439 }
440 
442 {
443  uno::Reference < task::XStatusIndicator > xStatusIndicator;
444  OUString aName;
445  const SfxUnoAnyItem* pStatusBarItem = static_cast<const SfxUnoAnyItem*>(
446  aTargetMedium.GetItemSet()->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
447  if ( pStatusBarItem )
448  pStatusBarItem->GetValue() >>= xStatusIndicator;
449  const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
450  aTargetMedium.GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
451  if ( pDocHierarchItem )
452  aName = pDocHierarchItem->GetValue();
453 
454  return Write_( xStatusIndicator, aName );
455 }
456 
458  const OUString* pFileName )
459 {
460  return IsStgWriter()
461  ? static_cast<StgWriter *>(this)->Write( rPaM, rMed.GetOutputStorage(), pFileName, &rMed )
462  : static_cast<Writer *>(this)->Write( rPaM, *rMed.GetOutStream(), pFileName );
463 }
464 
466  const uno::Reference<XComponent> & xComponent,
467  const char* pStreamName,
468  const uno::Reference<uno::XComponentContext> & rxContext,
469  const char* pServiceName,
470  const Sequence<Any> & rArguments,
471  const Sequence<beans::PropertyValue> & rMediaDesc )
472 {
473  OSL_ENSURE( m_xStg.is(), "Need storage!" );
474  OSL_ENSURE( nullptr != pStreamName, "Need stream name!" );
475  OSL_ENSURE( nullptr != pServiceName, "Need service name!" );
476 
477  SAL_INFO( "sw.filter", "SwXMLWriter::WriteThroughComponent : stream " << pStreamName );
478  // open stream
479  bool bRet = false;
480  try
481  {
482  const OUString sStreamName = OUString::createFromAscii( pStreamName );
483  uno::Reference<io::XStream> xStream =
484  m_xStg->openStreamElement( sStreamName,
485  embed::ElementModes::READWRITE | embed::ElementModes::TRUNCATE );
486 
487  uno::Reference <beans::XPropertySet > xSet( xStream, uno::UNO_QUERY );
488  if( !xSet.is() )
489  return false;
490 
491  xSet->setPropertyValue("MediaType", Any(OUString("text/xml")) );
492 
493  // even plain stream should be encrypted in encrypted documents
494  xSet->setPropertyValue( "UseCommonStoragePasswordEncryption", makeAny(true) );
495 
496  // set buffer and create outputstream
497  uno::Reference< io::XOutputStream > xOutputStream = xStream->getOutputStream();
498 
499  // set Base URL
500  uno::Reference< beans::XPropertySet > xInfoSet;
501  if( rArguments.hasElements() )
502  rArguments.getConstArray()[0] >>= xInfoSet;
503  OSL_ENSURE( xInfoSet.is(), "missing property set" );
504  if( xInfoSet.is() )
505  {
506  xInfoSet->setPropertyValue( "StreamName", makeAny( sStreamName ) );
507  }
508 
509  // write the stuff
510  bRet = WriteThroughComponent(
511  xOutputStream, xComponent, rxContext,
512  pServiceName, rArguments, rMediaDesc );
513  }
514  catch ( uno::Exception& )
515  {
516  }
517 
518  return bRet;
519 
520 }
521 
523  const uno::Reference<io::XOutputStream> & xOutputStream,
524  const uno::Reference<XComponent> & xComponent,
525  const uno::Reference<XComponentContext> & rxContext,
526  const char* pServiceName,
527  const Sequence<Any> & rArguments,
528  const Sequence<PropertyValue> & rMediaDesc )
529 {
530  OSL_ENSURE( xOutputStream.is(), "I really need an output stream!" );
531  OSL_ENSURE( xComponent.is(), "Need component!" );
532  OSL_ENSURE( nullptr != pServiceName, "Need component name!" );
533 
534  // get component
535  uno::Reference< xml::sax::XWriter > xSaxWriter = xml::sax::Writer::create(rxContext);
536  SAL_INFO( "sw.filter", "SAX-Writer created" );
537  // connect XML writer to output stream
538  xSaxWriter->setOutputStream( xOutputStream );
539 
540  // prepare arguments (prepend doc handler to given arguments)
541  Sequence<Any> aArgs( 1 + rArguments.getLength() );
542  aArgs[0] <<= xSaxWriter;
543  std::copy(rArguments.begin(), rArguments.end(), std::next(aArgs.begin()));
544 
545  // get filter component
546  uno::Reference< document::XExporter > xExporter(
547  rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(
548  OUString::createFromAscii(pServiceName), aArgs, rxContext), UNO_QUERY);
549  OSL_ENSURE( xExporter.is(),
550  "can't instantiate export filter component" );
551  if( !xExporter.is() )
552  return false;
553  SAL_INFO( "sw.filter", pServiceName << " instantiated." );
554  // connect model and filter
555  xExporter->setSourceDocument( xComponent );
556 
557  // filter!
558  SAL_INFO( "sw.filter", "call filter()" );
559  uno::Reference<XFilter> xFilter( xExporter, UNO_QUERY );
560  return xFilter->filter( rMediaDesc );
561 }
562 
563 void GetXMLWriter( const OUString& /*rName*/, const OUString& rBaseURL, WriterRef& xRet )
564 {
565  xRet = new SwXMLWriter( rBaseURL );
566 }
567 
568 /* 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:563
#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:457
ErrCode Write_(const css::uno::Reference< css::task::XStatusIndicator > &, const OUString &)
Definition: wrtxml.cxx:77
#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:436
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:388
COMPHELPER_DLLPUBLIC css::uno::Reference< css::beans::XPropertySet > GenericPropertySet_CreateInstance(PropertySetInfo *pInfo)
const OUString & GetValue() const
SwXMLWriter(const OUString &rBaseURL)
Definition: wrtxml.cxx:68
void WriteLayoutCache(SvStream &rStream)
Definition: docnew.cxx:770
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:73
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:612
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:1995
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:441
bool m_bShowProgress
Definition: shellio.hxx:413
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)