LibreOffice Module sw (master)  1
swxml.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 <svl/style.hxx>
21 #include <com/sun/star/embed/XStorage.hpp>
22 #include <com/sun/star/embed/ElementModes.hpp>
24 #include <com/sun/star/xml/sax/InputSource.hpp>
25 #include <com/sun/star/xml/sax/Parser.hpp>
26 #include <com/sun/star/xml/sax/SAXParseException.hpp>
27 #include <com/sun/star/text/XTextRange.hpp>
28 #include <com/sun/star/container/XChild.hpp>
29 #include <com/sun/star/document/NamedPropertyValues.hpp>
30 #include <com/sun/star/beans/XPropertySetInfo.hpp>
31 #include <com/sun/star/beans/PropertyValue.hpp>
32 #include <com/sun/star/beans/NamedValue.hpp>
33 #include <com/sun/star/beans/PropertyAttribute.hpp>
34 #include <com/sun/star/io/XActiveDataSource.hpp>
35 #include <com/sun/star/packages/zip/ZipIOException.hpp>
36 #include <com/sun/star/packages/WrongPasswordException.hpp>
37 #include <com/sun/star/ucb/InteractiveAugmentedIOException.hpp>
38 #include <com/sun/star/task/XStatusIndicator.hpp>
39 #include <com/sun/star/frame/XModel.hpp>
40 #include <officecfg/Office/Common.hxx>
41 #include <o3tl/any.hxx>
42 #include <vcl/errinf.hxx>
43 #include <sfx2/docfile.hxx>
44 #include <svtools/sfxecode.hxx>
45 #include <svl/stritem.hxx>
46 #include <unotools/streamwrap.hxx>
47 #include <svx/dialmgr.hxx>
48 #include <svx/strings.hrc>
49 #include <svx/xmlgrhlp.hxx>
50 #include <svx/xmleohlp.hxx>
51 #include <comphelper/fileformat.h>
54 #include <rtl/strbuf.hxx>
55 #include <sal/log.hxx>
56 #include <sfx2/frame.hxx>
58 #include <swerror.h>
59 #include <fltini.hxx>
60 #include <drawdoc.hxx>
61 #include <doc.hxx>
62 #include <docfunc.hxx>
67 #include <docary.hxx>
68 #include <docsh.hxx>
69 #include <unotextrange.hxx>
70 #include <swmodule.hxx>
71 #include <SwXMLSectionList.hxx>
72 
73 #include <SwStyleNameMapper.hxx>
74 #include <poolfmt.hxx>
75 #include <numrule.hxx>
76 #include <paratr.hxx>
77 #include <fmtrowsplt.hxx>
78 
79 #include <svx/svdmodel.hxx>
80 #include <svx/svdpage.hxx>
81 #include <svx/svditer.hxx>
82 #include <svx/svdoole2.hxx>
83 #include <svx/svdograf.hxx>
84 #include <sfx2/docfilt.hxx>
85 #include <sfx2/sfxsids.hrc>
86 #include <istyleaccess.hxx>
87 
89 #include <tools/diagnose_ex.h>
90 
91 using namespace ::com::sun::star;
92 using namespace ::com::sun::star::uno;
93 using namespace ::com::sun::star::text;
94 using namespace ::com::sun::star::container;
95 using namespace ::com::sun::star::document;
96 using namespace ::com::sun::star::lang;
97 
98 static void lcl_EnsureValidPam( SwPaM& rPam )
99 {
100  if( rPam.GetContentNode() != nullptr )
101  {
102  // set proper point content
103  if( rPam.GetContentNode() != rPam.GetPoint()->nContent.GetIdxReg() )
104  {
105  rPam.GetPoint()->nContent.Assign( rPam.GetContentNode(), 0 );
106  }
107  // else: point was already valid
108 
109  // if mark is invalid, we delete it
110  if( ( rPam.GetContentNode( false ) == nullptr ) ||
111  ( rPam.GetContentNode( false ) != rPam.GetMark()->nContent.GetIdxReg() ) )
112  {
113  rPam.DeleteMark();
114  }
115  }
116  else
117  {
118  // point is not valid, so move it into the first content
119  rPam.DeleteMark();
120  rPam.GetPoint()->nNode =
122  ++ rPam.GetPoint()->nNode;
123  rPam.Move( fnMoveForward, GoInContent ); // go into content
124  }
125 }
126 
128 {
129 }
130 
132 {
133  return SwReaderType::Storage;
134 }
135 
136 namespace
137 {
138 
140 ErrCode ReadThroughComponent(
141  uno::Reference<io::XInputStream> const & xInputStream,
142  uno::Reference<XComponent> const & xModelComponent,
143  const OUString& rStreamName,
144  uno::Reference<uno::XComponentContext> const & rxContext,
145  const sal_Char* pFilterName,
146  const Sequence<Any>& rFilterArguments,
147  const OUString& rName,
148  bool bMustBeSuccessfull,
149  bool bEncrypted )
150 {
151  OSL_ENSURE(xInputStream.is(), "input stream missing");
152  OSL_ENSURE(xModelComponent.is(), "document missing");
153  OSL_ENSURE(rxContext.is(), "factory missing");
154  OSL_ENSURE(nullptr != pFilterName,"I need a service name for the component!");
155 
156  // prepare ParserInputSrouce
157  xml::sax::InputSource aParserInput;
158  aParserInput.sSystemId = rName;
159  aParserInput.aInputStream = xInputStream;
160 
161  // get parser
162  uno::Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(rxContext);
163  SAL_INFO( "sw.filter", "parser created" );
164  // get filter
165  const OUString aFilterName(OUString::createFromAscii(pFilterName));
166  uno::Reference< xml::sax::XDocumentHandler > xFilter(
167  rxContext->getServiceManager()->createInstanceWithArgumentsAndContext(aFilterName, rFilterArguments, rxContext),
168  UNO_QUERY);
169  SAL_WARN_IF(!xFilter.is(), "sw.filter", "Can't instantiate filter component: " << aFilterName);
170  if( !xFilter.is() )
171  return ERR_SWG_READ_ERROR;
172  SAL_INFO( "sw.filter", "" << pFilterName << " created" );
173  // connect parser and filter
174  xParser->setDocumentHandler( xFilter );
175 
176  // connect model and filter
177  uno::Reference < XImporter > xImporter( xFilter, UNO_QUERY );
178  xImporter->setTargetDocument( xModelComponent );
179  uno::Reference< xml::sax::XFastParser > xFastParser = dynamic_cast<
180  xml::sax::XFastParser* >( xFilter.get() );
181 
182  // finally, parser the stream
183  try
184  {
185  if( xFastParser.is() )
186  xFastParser->parseStream( aParserInput );
187  else
188  xParser->parseStream( aParserInput );
189  }
190  catch( xml::sax::SAXParseException& r)
191  {
192  css::uno::Any ex( cppu::getCaughtException() );
193  // sax parser sends wrapped exceptions,
194  // try to find the original one
195  xml::sax::SAXException aSaxEx = *static_cast<xml::sax::SAXException*>(&r);
196  bool bTryChild = true;
197 
198  while( bTryChild )
199  {
200  xml::sax::SAXException aTmp;
201  if ( aSaxEx.WrappedException >>= aTmp )
202  aSaxEx = aTmp;
203  else
204  bTryChild = false;
205  }
206 
207  packages::zip::ZipIOException aBrokenPackage;
208  if ( aSaxEx.WrappedException >>= aBrokenPackage )
210 
211  if( bEncrypted )
213 
214  SAL_WARN( "sw", "SAX parse exception caught while importing: " << exceptionToString(ex) );
215 
216  const OUString sErr( OUString::number( r.LineNumber )
217  + ","
218  + OUString::number( r.ColumnNumber ) );
219 
220  if( !rStreamName.isEmpty() )
221  {
222  return *new TwoStringErrorInfo(
223  (bMustBeSuccessfull ? ERR_FORMAT_FILE_ROWCOL
225  rStreamName, sErr,
226  DialogMask::ButtonsOk | DialogMask::MessageError );
227  }
228  else
229  {
230  OSL_ENSURE( bMustBeSuccessfull, "Warnings are not supported" );
231  return *new StringErrorInfo( ERR_FORMAT_ROWCOL, sErr,
232  DialogMask::ButtonsOk | DialogMask::MessageError );
233  }
234  }
235  catch(const xml::sax::SAXException& r)
236  {
237  css::uno::Any ex( cppu::getCaughtException() );
238  packages::zip::ZipIOException aBrokenPackage;
239  if ( r.WrappedException >>= aBrokenPackage )
241 
242  if( bEncrypted )
244 
245  SAL_WARN( "sw", "uno exception caught while importing: " << exceptionToString(ex) );
246  return ERR_SWG_READ_ERROR;
247  }
248  catch(const packages::zip::ZipIOException&)
249  {
250  TOOLS_WARN_EXCEPTION( "sw", "uno exception caught while importing" );
252  }
253  catch(const io::IOException&)
254  {
255  TOOLS_WARN_EXCEPTION( "sw", "uno exception caught while importing" );
256  return ERR_SWG_READ_ERROR;
257  }
258  catch(const uno::Exception&)
259  {
260  TOOLS_WARN_EXCEPTION( "sw", "uno exception caught while importing" );
261  return ERR_SWG_READ_ERROR;
262  }
263 
264  // success!
265  return ERRCODE_NONE;
266 }
267 
268 // read a component (storage version)
269 ErrCode ReadThroughComponent(
270  uno::Reference<embed::XStorage> const & xStorage,
271  uno::Reference<XComponent> const & xModelComponent,
272  const sal_Char* pStreamName,
273  const sal_Char* pCompatibilityStreamName,
274  uno::Reference<uno::XComponentContext> const & rxContext,
275  const sal_Char* pFilterName,
276  const Sequence<Any>& rFilterArguments,
277  const OUString& rName,
278  bool bMustBeSuccessfull)
279 {
280  OSL_ENSURE(xStorage.is(), "Need storage!");
281  OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!");
282 
283  // open stream (and set parser input)
284  OUString sStreamName = OUString::createFromAscii(pStreamName);
285  bool bContainsStream = false;
286  try
287  {
288  bContainsStream = xStorage->isStreamElement(sStreamName);
289  }
290  catch( container::NoSuchElementException& )
291  {
292  }
293 
294  if (!bContainsStream )
295  {
296  // stream name not found! Then try the compatibility name.
297  // if no stream can be opened, return immediately with OK signal
298 
299  // do we even have an alternative name?
300  if ( nullptr == pCompatibilityStreamName )
301  return ERRCODE_NONE;
302 
303  // if so, does the stream exist?
304  sStreamName = OUString::createFromAscii(pCompatibilityStreamName);
305  try
306  {
307  bContainsStream = xStorage->isStreamElement(sStreamName);
308  }
309  catch( container::NoSuchElementException& )
310  {
311  }
312 
313  if (! bContainsStream )
314  return ERRCODE_NONE;
315  }
316 
317  // set Base URL
318  uno::Reference< beans::XPropertySet > xInfoSet;
319  if( rFilterArguments.hasElements() )
320  rFilterArguments.getConstArray()[0] >>= xInfoSet;
321  OSL_ENSURE( xInfoSet.is(), "missing property set" );
322  if( xInfoSet.is() )
323  {
324  xInfoSet->setPropertyValue( "StreamName", makeAny( sStreamName ) );
325  }
326 
327  try
328  {
329  // get input stream
330  uno::Reference <io::XStream> xStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
331  uno::Reference <beans::XPropertySet > xProps( xStream, uno::UNO_QUERY );
332 
333  Any aAny = xProps->getPropertyValue("Encrypted");
334 
335  auto b = o3tl::tryAccess<bool>(aAny);
336  bool bEncrypted = b && *b;
337 
338  uno::Reference <io::XInputStream> xInputStream = xStream->getInputStream();
339 
340  // read from the stream
341  return ReadThroughComponent(
342  xInputStream, xModelComponent, sStreamName, rxContext,
343  pFilterName, rFilterArguments,
344  rName, bMustBeSuccessfull, bEncrypted );
345  }
346  catch ( packages::WrongPasswordException& )
347  {
349  }
350  catch( packages::zip::ZipIOException& )
351  {
353  }
354  catch ( uno::Exception& )
355  {
356  OSL_FAIL( "Error on import" );
357  // TODO/LATER: error handling
358  }
359 
360  return ERR_SWG_READ_ERROR;
361 }
362 
363 }
364 
365 // #i44177#
367 {
368  // array containing the names of the default outline styles ('Heading 1',
369  // 'Heading 2', ..., 'Heading 10')
370  OUString aDefOutlStyleNames[ MAXLEVEL ];
371  {
372  OUString sStyleName;
373  for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
374  {
375  sStyleName =
377  sStyleName );
378  aDefOutlStyleNames[i] = sStyleName;
379  }
380  }
381 
382  // array indicating, which outline level already has a style assigned.
383  bool aOutlineLevelAssigned[ MAXLEVEL ];
384  // array of the default outline styles, which are created for the document.
385  SwTextFormatColl* aCreatedDefaultOutlineStyles[ MAXLEVEL ];
386 
387  {
388  for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
389  {
390  aOutlineLevelAssigned[ i ] = false;
391  aCreatedDefaultOutlineStyles[ i ] = nullptr;
392  }
393  }
394 
395  // determine, which outline level has already a style assigned and
396  // which of the default outline styles is created.
397  const SwTextFormatColls& rColls = *(_rDoc.GetTextFormatColls());
398  for ( size_t n = 1; n < rColls.size(); ++n )
399  {
400  SwTextFormatColl* pColl = rColls[ n ];
402  {
403  aOutlineLevelAssigned[ pColl->GetAssignedOutlineStyleLevel() ] = true;
404  }
405 
406  for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
407  {
408  if ( aCreatedDefaultOutlineStyles[ i ] == nullptr &&
409  pColl->GetName() == aDefOutlStyleNames[i] )
410  {
411  aCreatedDefaultOutlineStyles[ i ] = pColl;
412  break;
413  }
414  }
415  }
416 
417  // assign already created default outline style to outline level, which
418  // doesn't have a style assigned to it.
419  const SwNumRule* pOutlineRule = _rDoc.GetOutlineNumRule();
420  for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
421  {
422  // #i73361#
423  // Do not change assignment of already created default outline style
424  // to a certain outline level.
425  if ( !aOutlineLevelAssigned[ i ] &&
426  aCreatedDefaultOutlineStyles[ i ] != nullptr &&
427  ! aCreatedDefaultOutlineStyles[ i ]->IsAssignedToListLevelOfOutlineStyle() )
428  {
429  // apply outline level at created default outline style
430  aCreatedDefaultOutlineStyles[ i ]->AssignToListLevelOfOutlineStyle(i);
431 
432  // apply outline numbering rule, if none is set.
433  const SfxPoolItem& rItem =
434  aCreatedDefaultOutlineStyles[ i ]->GetFormatAttr( RES_PARATR_NUMRULE, false );
435  if ( static_cast<const SwNumRuleItem&>(rItem).GetValue().isEmpty() )
436  {
437  SwNumRuleItem aItem( pOutlineRule->GetName() );
438  aCreatedDefaultOutlineStyles[ i ]->SetFormatAttr( aItem );
439  }
440  }
441  }
442 }
443 
445 {
446  if ( _rDoc.getIDocumentDrawModelAccess().GetDrawModel() &&
448  {
449  const SdrPage& rSdrPage( *(_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->GetPage( 0 )) );
450 
451  // iterate recursive with group objects over all shapes on the draw page
452  SdrObjListIter aIter( &rSdrPage );
453  while( aIter.IsMore() )
454  {
455  SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( aIter.Next() );
456  if( pOle2Obj )
457  {
458  // found an ole2 shape
459  SdrObjList* pObjList = pOle2Obj->getParentSdrObjListFromSdrObject();
460 
461  // get its graphic
462  Graphic aGraphic;
463  pOle2Obj->Connect();
464  const Graphic* pGraphic = pOle2Obj->GetGraphic();
465  if( pGraphic )
466  aGraphic = *pGraphic;
467  pOle2Obj->Disconnect();
468 
469  // create new graphic shape with the ole graphic and shape size
470  SdrGrafObj* pGraphicObj = new SdrGrafObj(
471  pOle2Obj->getSdrModelFromSdrObject(),
472  aGraphic,
473  pOle2Obj->GetCurrentBoundRect());
474 
475  // apply layer of ole2 shape at graphic shape
476  pGraphicObj->SetLayer( pOle2Obj->GetLayer() );
477 
478  // replace ole2 shape with the new graphic object and delete the ol2 shape
479  SdrObject* pReplaced = pObjList->ReplaceObject( pGraphicObj, pOle2Obj->GetOrdNum() );
480  SdrObject::Free( pReplaced );
481  }
482  }
483  }
484 }
485 
486 ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, const OUString & rName )
487 {
488  // needed for relative URLs, but in clipboard copy/paste there may be none
489  // and also there is the SwXMLTextBlocks special case
490  SAL_INFO_IF(rBaseURL.isEmpty(), "sw.filter", "sw::XMLReader: no base URL");
491 
492  // Get service factory
493  uno::Reference< uno::XComponentContext > xContext =
495 
496  uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
497  rtl::Reference<SvXMLGraphicHelper> xGraphicHelper;
498  uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
500 
501  // get the input stream (storage or stream)
502  uno::Reference<embed::XStorage> xStorage;
503  if( m_pMedium )
504  xStorage = m_pMedium->GetStorage();
505  else
506  xStorage = m_xStorage;
507 
508  if( !xStorage.is() )
509  return ERR_SWG_READ_ERROR;
510 
511  xGraphicHelper = SvXMLGraphicHelper::Create( xStorage,
512  SvXMLGraphicHelperMode::Read );
513  xGraphicStorageHandler = xGraphicHelper.get();
514  SfxObjectShell *pPersist = rDoc.GetPersist();
515  if( pPersist )
516  {
517  xObjectHelper = SvXMLEmbeddedObjectHelper::Create(
518  xStorage, *pPersist,
519  SvXMLEmbeddedObjectHelperMode::Read );
520  xObjectResolver = xObjectHelper.get();
521  }
522 
523  // Get the docshell, the model, and finally the model's component
524  SwDocShell *pDocSh = rDoc.GetDocShell();
525  OSL_ENSURE( pDocSh, "XMLReader::Read: got no doc shell" );
526  if( !pDocSh )
527  return ERR_SWG_READ_ERROR;
528  uno::Reference< lang::XComponent > xModelComp = pDocSh->GetModel();
529  OSL_ENSURE( xModelComp.is(),
530  "XMLReader::Read: got no model" );
531  if( !xModelComp.is() )
532  return ERR_SWG_READ_ERROR;
533 
534  // create and prepare the XPropertySet that gets passed through
535  // the components, and the XStatusIndicator that shows progress to
536  // the user.
537 
538  // create XPropertySet with three properties for status indicator
539  comphelper::PropertyMapEntry const aInfoMap[] =
540  {
541  { OUString("ProgressRange"), 0,
543  beans::PropertyAttribute::MAYBEVOID, 0},
544  { OUString("ProgressMax"), 0,
546  beans::PropertyAttribute::MAYBEVOID, 0},
547  { OUString("ProgressCurrent"), 0,
549  beans::PropertyAttribute::MAYBEVOID, 0},
550  { OUString("NumberStyles"), 0,
552  beans::PropertyAttribute::MAYBEVOID, 0},
553  { OUString("RecordChanges"), 0,
555  beans::PropertyAttribute::MAYBEVOID, 0 },
556  { OUString("ShowChanges"), 0,
558  beans::PropertyAttribute::MAYBEVOID, 0 },
559  { OUString("RedlineProtectionKey"), 0,
561  beans::PropertyAttribute::MAYBEVOID, 0 },
562  { OUString("PrivateData"), 0,
564  beans::PropertyAttribute::MAYBEVOID, 0 },
565  { OUString("BaseURI"), 0,
567  beans::PropertyAttribute::MAYBEVOID, 0 },
568  { OUString("StreamRelPath"), 0,
570  beans::PropertyAttribute::MAYBEVOID, 0 },
571  { OUString("StreamName"), 0,
573  beans::PropertyAttribute::MAYBEVOID, 0 },
574  // properties for insert modes
575  { OUString("StyleInsertModeFamilies"), 0,
577  beans::PropertyAttribute::MAYBEVOID, 0 },
578  { OUString("StyleInsertModeOverwrite"), 0,
580  beans::PropertyAttribute::MAYBEVOID, 0 },
581  { OUString("TextInsertModeRange"), 0,
583  beans::PropertyAttribute::MAYBEVOID, 0},
584  { OUString("AutoTextMode"), 0,
586  beans::PropertyAttribute::MAYBEVOID, 0 },
587  { OUString("OrganizerMode"), 0,
589  beans::PropertyAttribute::MAYBEVOID, 0 },
590 
591  // #i28749# - Add property, which indicates, if the
592  // shape position attributes are given in horizontal left-to-right layout.
593  // This is the case for the OpenOffice.org file format.
594  { OUString("ShapePositionInHoriL2R"), 0,
596  beans::PropertyAttribute::MAYBEVOID, 0 },
597 
598  { OUString("BuildId"), 0,
600  beans::PropertyAttribute::MAYBEVOID, 0 },
601 
602  // Add property, which indicates, if a text document in OpenOffice.org
603  // file format is read.
604  // Note: Text documents read via the binary filter are also finally
605  // read using the OpenOffice.org file format. Thus, e.g. for text
606  // documents in StarOffice 5.2 binary file format this property
607  // will be true.
608  { OUString("TextDocInOOoFileFormat"), 0,
610  beans::PropertyAttribute::MAYBEVOID, 0 },
611  { OUString("SourceStorage"), 0, cppu::UnoType<embed::XStorage>::get(),
612  css::beans::PropertyAttribute::MAYBEVOID, 0 },
613  { OUString(), 0, css::uno::Type(), 0, 0 }
614  };
615  uno::Reference< beans::XPropertySet > xInfoSet(
617  new comphelper::PropertySetInfo( aInfoMap ) ) );
618 
619  // get BuildId from parent container if available
620  uno::Reference< container::XChild > xChild( xModelComp, uno::UNO_QUERY );
621  if( xChild.is() )
622  {
623  uno::Reference< beans::XPropertySet > xParentSet( xChild->getParent(), uno::UNO_QUERY );
624  if( xParentSet.is() )
625  {
626  uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xParentSet->getPropertySetInfo() );
627  const OUString sPropName("BuildId" );
628  if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(sPropName) )
629  {
630  xInfoSet->setPropertyValue( sPropName, xParentSet->getPropertyValue(sPropName) );
631  }
632  }
633  }
634 
635  // try to get an XStatusIndicator from the Medium
636  uno::Reference<task::XStatusIndicator> xStatusIndicator;
637 
638  if (pDocSh->GetMedium())
639  {
640  SfxItemSet* pSet = pDocSh->GetMedium()->GetItemSet();
641  if (pSet)
642  {
643  const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>(
644  pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
645  if (pItem)
646  {
647  pItem->GetValue() >>= xStatusIndicator;
648  }
649  }
650  }
651 
652  // set progress range and start status indicator
653  sal_Int32 nProgressRange(1000000);
654  if (xStatusIndicator.is())
655  {
656  xStatusIndicator->start(SvxResId(RID_SVXSTR_DOC_LOAD), nProgressRange);
657  }
658  uno::Any aProgRange;
659  aProgRange <<= nProgressRange;
660  xInfoSet->setPropertyValue("ProgressRange", aProgRange);
661 
662  Reference< container::XNameAccess > xLateInitSettings( document::NamedPropertyValues::create(xContext), UNO_QUERY_THROW );
663  beans::NamedValue aLateInitSettings( "LateInitSettings", makeAny( xLateInitSettings ) );
664 
665  xInfoSet->setPropertyValue( "SourceStorage", Any( xStorage ) );
666 
667  // prepare filter arguments, WARNING: the order is important!
668  Sequence<Any> aFilterArgs{ Any(xInfoSet),
669  Any(xStatusIndicator),
670  Any(xGraphicStorageHandler),
671  Any(xObjectResolver),
672  Any(aLateInitSettings) };
673 
674  Sequence<Any> aEmptyArgs{ Any(xInfoSet),
675  Any(xStatusIndicator) };
676 
677  // prepare for special modes
678  if( m_aOption.IsFormatsOnly() )
679  {
680  sal_Int32 nCount =
681  (m_aOption.IsFrameFormats() ? 1 : 0) +
682  (m_aOption.IsPageDescs() ? 1 : 0) +
683  (m_aOption.IsTextFormats() ? 2 : 0) +
684  (m_aOption.IsNumRules() ? 1 : 0);
685 
686  Sequence< OUString> aFamiliesSeq( nCount );
687  OUString *pSeq = aFamiliesSeq.getArray();
688  if( m_aOption.IsFrameFormats() )
689  // SfxStyleFamily::Frame;
690  *pSeq++ = "FrameStyles";
691  if( m_aOption.IsPageDescs() )
692  // SfxStyleFamily::Page;
693  *pSeq++ = "PageStyles";
694  if( m_aOption.IsTextFormats() )
695  {
696  // (SfxStyleFamily::Char|SfxStyleFamily::Para);
697  *pSeq++ = "CharacterStyles";
698  *pSeq++ = "ParagraphStyles";
699  }
700  if( m_aOption.IsNumRules() )
701  // SfxStyleFamily::Pseudo;
702  *pSeq++ = "NumberingStyles";
703 
704  xInfoSet->setPropertyValue( "StyleInsertModeFamilies",
705  makeAny(aFamiliesSeq) );
706 
707  xInfoSet->setPropertyValue( "StyleInsertModeOverwrite", makeAny(!m_aOption.IsMerge()) );
708  }
709  else if( m_bInsertMode )
710  {
711  const uno::Reference<text::XTextRange> xInsertTextRange =
712  SwXTextRange::CreateXTextRange(rDoc, *rPaM.GetPoint(), nullptr);
713  xInfoSet->setPropertyValue( "TextInsertModeRange",
714  makeAny(xInsertTextRange) );
715  }
716  else
717  {
718  rPaM.GetBound().nContent.Assign(nullptr, 0);
719  rPaM.GetBound(false).nContent.Assign(nullptr, 0);
720  }
721 
722  if( IsBlockMode() )
723  {
724  xInfoSet->setPropertyValue( "AutoTextMode", makeAny(true) );
725  }
726  if( IsOrganizerMode() )
727  {
728  xInfoSet->setPropertyValue( "OrganizerMode", makeAny(true) );
729  }
730 
731  // Set base URI
732  // there is ambiguity which medium should be used here
733  // for now the own medium has a preference
734  SfxMedium* pMedDescrMedium = m_pMedium ? m_pMedium : pDocSh->GetMedium();
735  OSL_ENSURE( pMedDescrMedium, "There is no medium to get MediaDescriptor from!" );
736 
737  xInfoSet->setPropertyValue( "BaseURI", makeAny( rBaseURL ) );
738 
739  // TODO/LATER: separate links from usual embedded objects
740  OUString StreamPath;
741  if( SfxObjectCreateMode::EMBEDDED == rDoc.GetDocShell()->GetCreateMode() )
742  {
743  if ( pMedDescrMedium && pMedDescrMedium->GetItemSet() )
744  {
745  const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
746  pMedDescrMedium->GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
747  if ( pDocHierarchItem )
748  StreamPath = pDocHierarchItem->GetValue();
749  }
750  else
751  {
752  StreamPath = "dummyObjectName";
753  }
754 
755  if( !StreamPath.isEmpty() )
756  {
757  xInfoSet->setPropertyValue( "StreamRelPath", makeAny( StreamPath ) );
758  }
759  }
760 
761  rtl::Reference<SwDoc> aHoldRef(&rDoc); // prevent deletion
762  ErrCode nRet = ERRCODE_NONE;
763 
764  // save redline mode into import info property set
765  const OUString sShowChanges("ShowChanges");
766  const OUString sRecordChanges("RecordChanges");
767  const OUString sRedlineProtectionKey("RedlineProtectionKey");
768  xInfoSet->setPropertyValue( sShowChanges,
770  xInfoSet->setPropertyValue( sRecordChanges,
772  xInfoSet->setPropertyValue( sRedlineProtectionKey,
774 
775  // force redline mode to "none"
777 
778  const bool bOASIS = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
779  // #i28749# - set property <ShapePositionInHoriL2R>
780  {
781  const bool bShapePositionInHoriL2R = !bOASIS;
782  xInfoSet->setPropertyValue(
783  "ShapePositionInHoriL2R",
784  makeAny( bShapePositionInHoriL2R ) );
785  }
786  {
787  const bool bTextDocInOOoFileFormat = !bOASIS;
788  xInfoSet->setPropertyValue(
789  "TextDocInOOoFileFormat",
790  makeAny( bTextDocInOOoFileFormat ) );
791  }
792 
793  ErrCode nWarnRDF = ERRCODE_NONE;
794  if ( !(IsOrganizerMode() || IsBlockMode() || m_aOption.IsFormatsOnly() ||
795  m_bInsertMode) )
796  {
797  // RDF metadata - must be read before styles/content
798  // N.B.: embedded documents have their own manifest.rdf!
799  try
800  {
801  const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(xModelComp,
802  uno::UNO_QUERY_THROW);
803  const uno::Reference<frame::XModel> xModel(xModelComp,
804  uno::UNO_QUERY_THROW);
805  const uno::Reference<rdf::XURI> xBaseURI( ::sfx2::createBaseURI(
806  xContext, xModel, rBaseURL, StreamPath) );
807  const uno::Reference<task::XInteractionHandler> xHandler(
808  pDocSh->GetMedium()->GetInteractionHandler() );
809  xDMA->loadMetadataFromStorage(xStorage, xBaseURI, xHandler);
810  }
811  catch (const lang::WrappedTargetException & e)
812  {
813  ucb::InteractiveAugmentedIOException iaioe;
814  if (e.TargetException >>= iaioe)
815  {
816  // import error that was not ignored by InteractionHandler!
817  nWarnRDF = ERR_SWG_READ_ERROR;
818  }
819  else
820  {
821  nWarnRDF = WARN_SWG_FEATURES_LOST; // uhh... something wrong?
822  }
823  }
824  catch (uno::Exception &)
825  {
826  nWarnRDF = WARN_SWG_FEATURES_LOST; // uhh... something went wrong?
827  }
828  }
829 
830  // read storage streams
831 
832  // #i103539#: always read meta.xml for generator
833  ErrCode const nWarn = ReadThroughComponent(
834  xStorage, xModelComp, "meta.xml", "Meta.xml", xContext,
835  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter"
836  : "com.sun.star.comp.Writer.XMLMetaImporter"),
837  aEmptyArgs, rName, false );
838 
839  ErrCode nWarn2 = ERRCODE_NONE;
841  m_bInsertMode) )
842  {
843  nWarn2 = ReadThroughComponent(
844  xStorage, xModelComp, "settings.xml", nullptr, xContext,
845  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsImporter"
846  : "com.sun.star.comp.Writer.XMLSettingsImporter"),
847  aFilterArgs, rName, false );
848  }
849 
850  nRet = ReadThroughComponent(
851  xStorage, xModelComp, "styles.xml", nullptr, xContext,
852  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesImporter"
853  : "com.sun.star.comp.Writer.XMLStylesImporter"),
854  aFilterArgs, rName, true );
855 
856  if( !nRet && !(IsOrganizerMode() || m_aOption.IsFormatsOnly()) )
857  nRet = ReadThroughComponent(
858  xStorage, xModelComp, "content.xml", "Content.xml", xContext,
859  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentImporter"
860  : "com.sun.star.comp.Writer.XMLContentImporter"),
861  aFilterArgs, rName, true );
862 
863  if( !(IsOrganizerMode() || IsBlockMode() || m_bInsertMode ||
865  // sw_redlinehide: disable layout cache for now
866  !*o3tl::doAccess<bool>(xInfoSet->getPropertyValue(sShowChanges))))
867  {
868  try
869  {
870  uno::Reference < io::XStream > xStm = xStorage->openStreamElement( "layout-cache", embed::ElementModes::READ );
871  std::unique_ptr<SvStream> pStrm2 = utl::UcbStreamHelper::CreateStream( xStm );
872  if( !pStrm2->GetError() )
873  rDoc.ReadLayoutCache( *pStrm2 );
874  }
875  catch (const uno::Exception&)
876  {
877  }
878  }
879 
880  // Notify math objects
881  if( m_bInsertMode )
882  rDoc.PrtOLENotify( false );
883  else if ( rDoc.IsOLEPrtNotifyPending() )
884  rDoc.PrtOLENotify( true );
885 
886  nRet = nRet ? nRet : (nWarn ? nWarn : (nWarn2 ? nWarn2 : nWarnRDF ) );
887 
889 
890  // redline password
891  Any aAny = xInfoSet->getPropertyValue( sRedlineProtectionKey );
892  Sequence<sal_Int8> aKey;
893  aAny >>= aKey;
895 
896  // restore redline mode from import info property set
897  RedlineFlags nRedlineFlags = RedlineFlags::ShowInsert;
898  aAny = xInfoSet->getPropertyValue( sShowChanges );
899  if ( *o3tl::doAccess<bool>(aAny) )
900  nRedlineFlags |= RedlineFlags::ShowDelete;
901  aAny = xInfoSet->getPropertyValue( sRecordChanges );
902  if ( *o3tl::doAccess<bool>(aAny) || aKey.hasElements() )
903  nRedlineFlags |= RedlineFlags::On;
904 
905  // ... restore redline mode
906  // (First set bogus mode to make sure the mode in getIDocumentRedlineAccess().SetRedlineFlags()
907  // is different from its previous mode.)
908  rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( ~nRedlineFlags );
909  // must set flags to show delete so that CompressRedlines works
911  // tdf#83260 ensure that the first call of CompressRedlines after loading
912  // the document is a no-op by calling it now
914  // can't set it on the layout or view shell because it doesn't exist yet
916 
917  lcl_EnsureValidPam( rPaM ); // move Pam into valid content
918 
919  if( xGraphicHelper )
920  xGraphicHelper->dispose();
921  xGraphicHelper.clear();
922  xGraphicStorageHandler = nullptr;
923  if( xObjectHelper )
924  xObjectHelper->dispose();
925  xObjectHelper.clear();
926  xObjectResolver = nullptr;
927  aHoldRef.clear();
928 
929  if ( !bOASIS )
930  {
931  // #i44177# - assure that for documents in OpenOffice.org
932  // file format the relation between outline numbering rule and styles is
933  // filled-up accordingly.
934  // Note: The OpenOffice.org file format, which has no content that applies
935  // a certain style, which is related to the outline numbering rule,
936  // has lost the information, that this certain style is related to
937  // the outline numbering rule.
938  // #i70748# - only for templates
939  if ( m_pMedium && m_pMedium->GetFilter() &&
940  m_pMedium->GetFilter()->IsOwnTemplateFormat() )
941  {
943  }
944  // Fix #i58251#: Unfortunately is the static default different to SO7 behaviour,
945  // so we have to set a dynamic default after importing SO7
946  rDoc.SetDefault(SwFormatRowSplit(false));
947  }
948 
949  rDoc.PropagateOutlineRule();
950 
951  // #i62875#
953  {
955  }
956 
957  // Convert all instances of <SdrOle2Obj> into <SdrGrafObj>, because the
958  // Writer doesn't support such objects.
960 
961  // set BuildId on XModel for later OLE object loading
962  if( xInfoSet.is() )
963  {
964  uno::Reference< beans::XPropertySet > xModelSet( xModelComp, uno::UNO_QUERY );
965  if( xModelSet.is() )
966  {
967  uno::Reference< beans::XPropertySetInfo > xModelSetInfo( xModelSet->getPropertySetInfo() );
968  const OUString sName("BuildId" );
969  if( xModelSetInfo.is() && xModelSetInfo->hasPropertyByName(sName) )
970  {
971  xModelSet->setPropertyValue( sName, xInfoSet->getPropertyValue(sName) );
972  }
973  }
974  }
975 
976  if (xStatusIndicator.is())
977  {
978  xStatusIndicator->end();
979  }
980 
981  rDoc.GetIStyleAccess().clearCaches(); // Clear Automatic-Style-Caches(shared_pointer!)
982  return nRet;
983 }
984 
985  // read the sections of the document, which is equal to the medium.
986  // returns the count of it
988  std::vector<OUString>& rStrings) const
989 {
990  uno::Reference< uno::XComponentContext > xContext =
992  uno::Reference < embed::XStorage > xStg2;
993  if( ( xStg2 = rMedium.GetStorage() ).is() )
994  {
995  try
996  {
997  xml::sax::InputSource aParserInput;
998  const OUString sDocName( "content.xml" );
999  aParserInput.sSystemId = sDocName;
1000 
1001  uno::Reference < io::XStream > xStm = xStg2->openStreamElement( sDocName, embed::ElementModes::READ );
1002  aParserInput.aInputStream = xStm->getInputStream();
1003 
1004  // get filter
1005  rtl::Reference< SwXMLSectionList > xImport = new SwXMLSectionList( xContext, rStrings );
1006 
1007  // parse
1008  xImport->parseStream( aParserInput );
1009  }
1010  catch( xml::sax::SAXParseException& )
1011  {
1012  // re throw ?
1013  }
1014  catch( xml::sax::SAXException& )
1015  {
1016  // re throw ?
1017  }
1018  catch( io::IOException& )
1019  {
1020  // re throw ?
1021  }
1022  catch( packages::WrongPasswordException& )
1023  {
1024  // re throw ?
1025  }
1026  }
1027  return rStrings.size();
1028 }
1029 
1030 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
bool ExistsDrawObjs(SwDoc &p_rDoc)
method to check, if given Writer document contains at least one drawing object
Definition: docdraw.cxx:546
#define WARN_SWG_FEATURES_LOST
Definition: swerror.h:39
void DeleteMark()
Definition: pam.hxx:177
void Disconnect()
bool GoInContent(SwPaM &rPam, SwMoveFnCollection const &fnMove)
Definition: pam.cxx:915
static void lcl_ConvertSdrOle2ObjsToSdrGrafObjs(SwDoc &_rDoc)
Definition: swxml.cxx:444
int GetAssignedOutlineStyleLevel() const
Definition: fmtcol.cxx:587
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
virtual const tools::Rectangle & GetCurrentBoundRect() const
bool IsMerge() const
Definition: shellio.hxx:131
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
SwDocShell * GetDocShell()
Definition: doc.hxx:1342
std::string GetValue
bool IsPageDescs() const
Definition: shellio.hxx:122
virtual void SetRedlineFlags_intern(RedlineFlags eMode)=0
Set a new redline mode.
sal_Int32 GetVersion() const
virtual SwReaderType GetReaderType() override
Definition: swxml.cxx:131
SwNodeIndex nNode
Definition: pam.hxx:37
bool IsFrameFormats() const
Definition: shellio.hxx:119
bool IsFormatsOnly() const
Definition: shellio.hxx:117
#define ERRCODE_SFX_WRONGPASSWORD
#define SAL_INFO_IF(condition, area, stream)
virtual ErrCode Read(SwDoc &, const OUString &rBaseURL, SwPaM &, const OUString &) override
Definition: swxml.cxx:486
const SwPosition * GetMark() const
Definition: pam.hxx:209
void Connect()
sal_Int64 n
Definition: doc.hxx:185
::sw::DocumentRedlineManager const & GetDocumentRedlineManager() const
Definition: doc.cxx:344
const OUString & GetName() const
Definition: numrule.hxx:222
SwPosition & GetBound(bool bOne=true)
Definition: pam.hxx:245
css::uno::Reference< css::frame::XModel > GetModel() const
XMLReader()
Definition: swxml.cxx:127
static void Free(SdrObject *&_rpObject)
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:329
static bool IsShowChanges(const RedlineFlags eM)
show all inserts
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:154
SwContentNode * GetContentNode(bool bPoint=true) const
Definition: pam.hxx:229
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:109
Reference< XInputStream > xStream
static std::unique_ptr< SvStream > CreateStream(const OUString &rFileName, StreamMode eOpenMode, css::uno::Reference< css::awt::XWindow > xParentWin=nullptr)
bool IsMore() const
SwIndex nContent
Definition: pam.hxx:38
OUString SvxResId(const char *pId)
Any SAL_CALL getCaughtException()
void PrtOLENotify(bool bAll)
Definition: docdesc.cxx:686
void ReadLayoutCache(SvStream &rStream)
SwDoc: Reading and writing of the layout cache.
Definition: docnew.cxx:757
char sal_Char
const OUString & GetName() const
Definition: format.hxx:111
int nCount
const sal_uInt8 MAXLEVEL
Definition: swtypes.hxx:95
void PropagateOutlineRule()
Definition: docnum.cxx:161
#define RES_PARATR_NUMRULE
Definition: hintids.hxx:171
const css::uno::Any & GetValue() const
RedlineFlags on.
SfxObjectCreateMode GetCreateMode() const
const char * sName
css::uno::Reference< css::task::XInteractionHandler > GetInteractionHandler(bool bGetAlways=false)
#define WARN_FORMAT_FILE_ROWCOL
Definition: swerror.h:43
SwNode & GetEndOfContent() const
Regular ContentSection (i.e. the BodyText).
Definition: ndarr.hxx:163
virtual void CompressRedlines()=0
virtual size_t GetSectionList(SfxMedium &rMedium, std::vector< OUString > &rStrings) const override
Definition: swxml.cxx:987
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
bool Move(SwMoveFnCollection const &fnMove=fnMoveForward, SwGoInDoc fnGo=GoInContent)
Movement of cursor.
Definition: pam.cxx:495
virtual void SetLayer(SdrLayerID nLayer)
#define SOFFICE_FILEFORMAT_60
#define TOOLS_WARN_EXCEPTION(area, stream)
bool IsOLEPrtNotifyPending() const
Definition: doc.hxx:555
const SwStartNode * StartOfSectionNode() const
Definition: node.hxx:131
const SwPosition * GetPoint() const
Definition: pam.hxx:207
SwIndex & Assign(SwIndexReg *, sal_Int32)
Definition: index.cxx:198
bool IsNumRules() const
Definition: shellio.hxx:128
static rtl::Reference< SvXMLEmbeddedObjectHelper > Create(const css::uno::Reference< css::embed::XStorage > &,::comphelper::IEmbeddedHelper &rDocPersist, SvXMLEmbeddedObjectHelperMode eCreateMode)
COMPHELPER_DLLPUBLIC css::uno::Reference< css::beans::XPropertySet > GenericPropertySet_CreateInstance(PropertySetInfo *pInfo)
int i
const OUString & GetValue() const
const SdrPage * GetPage(sal_uInt16 nPgNum) const
SwDoc * GetDoc() const
Definition: pam.hxx:243
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
size_t size() const
Definition: docary.hxx:91
void SetHideRedlines(bool const bHideRedlines)
SdrModel & getSdrModelFromSdrObject() const
sal_uInt32 GetOrdNum() const
SfxItemSet * GetItemSet() const
css::uno::Type const & get()
bool IsBlockMode() const
Definition: shellio.hxx:255
bool IsTextFormats() const
Definition: shellio.hxx:125
const std::shared_ptr< const SfxFilter > & GetFilter() const
show all deletes
SwReaderType
Definition: shellio.hxx:183
OString exceptionToString(const css::uno::Any &caught)
virtual SdrLayerID GetLayer() const
#define ERRCODE_IO_BROKENPACKAGE
void AssignToListLevelOfOutlineStyle(const int nAssignedListLevel)
Definition: fmtcol.cxx:594
SdrObject * Next()
void SetDefault(const SfxPoolItem &)
Set attribute as new default attribute in current document.
Definition: docfmt.cxx:524
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:334
SwgReaderOption m_aOption
Definition: shellio.hxx:217
virtual SdrObject * ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
void ResetAllFormatsOnly()
Definition: shellio.hxx:116
#define ERR_FORMAT_ROWCOL
Definition: swerror.h:27
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
#define SAL_WARN_IF(condition, area, stream)
#define ERRCODE_NONE
const SwTextFormatColls * GetTextFormatColls() const
Definition: doc.hxx:774
unsigned char sal_uInt8
virtual void clearCaches()=0
To release the cached styles (shared_pointer!)
SwMoveFnCollection const & fnMoveForward
SwPam::Move()/Find() default argument.
Definition: paminit.cxx:59
virtual void SetRedlineFlags(RedlineFlags eMode)=0
Set a new redline mode.
#define SAL_INFO(area, stream)
virtual bool IsRedlineOn() const =0
Query if redlining is on.
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:175
SwNodes & GetNodes()
Definition: doc.hxx:402
#define ERR_FORMAT_FILE_ROWCOL
Definition: swerror.h:29
SfxObjectShell * GetPersist() const
Definition: docnew.cxx:611
Reference< XComponentContext > getProcessComponentContext()
SfxMedium * m_pMedium
Definition: shellio.hxx:215
const SfxPoolItem & GetFormatAttr(sal_uInt16 nWhich, bool bInParents=true) const
If bInParents is FALSE, search only in this format for attribute.
Definition: format.cxx:377
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
#define ERR_SWG_READ_ERROR
Definition: swerror.h:25
virtual RedlineFlags GetRedlineFlags() const =0
Query the currently set redline mode.
#define SAL_WARN(area, stream)
css::uno::Reference< css::embed::XStorage > m_xStorage
Definition: shellio.hxx:214
Reference< XModel > xModel
detail::Optional< bool >::type tryAccess< bool >(css::uno::Any const &any)
static rtl::Reference< SvXMLGraphicHelper > Create(const css::uno::Reference< css::embed::XStorage > &rXMLStorage, SvXMLGraphicHelperMode eCreateMode)
SdrObjList * getParentSdrObjListFromSdrObject() const
uno::Reference< rdf::XURI > createBaseURI(uno::Reference< uno::XComponentContext > const &i_xContext, uno::Reference< frame::XModel > const &i_xModel, OUString const &i_rPkgURI, OUString const &i_rSubDocument)
static css::uno::Reference< css::text::XTextRange > CreateXTextRange(SwDoc &rDoc, const SwPosition &rPos, const SwPosition *const pMark)
Definition: unoobj2.cxx:1053
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword)=0
const SwIndexReg * GetIdxReg() const
Definition: index.hxx:101
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
IStyleAccess & GetIStyleAccess()
Definition: doc.hxx:750
bool IsOrganizerMode() const
Definition: shellio.hxx:258
static void lcl_AdjustOutlineStylesForOOo(SwDoc &_rDoc)
Definition: swxml.cxx:366
no RedlineFlags
const Graphic * GetGraphic() const
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1015
bool m_bInsertMode
Definition: shellio.hxx:218
static void lcl_EnsureValidPam(SwPaM &rPam)
Definition: swxml.cxx:98
static const OUString & GetProgName(const OUString &rName, SwGetPoolIdFromName)
SfxMedium * GetMedium() const
css::uno::Any SAL_CALL makeAny(const SharedUNOComponent< INTERFACE, COMPONENT > &value)