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