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