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