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