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