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  css::uno::Any ex( cppu::getCaughtException() );
252  SAL_WARN( "sw", "uno exception caught while importing: " << exceptionToString(ex) );
254  }
255  catch(const io::IOException&)
256  {
257  css::uno::Any ex( cppu::getCaughtException() );
258  SAL_WARN( "sw", "uno exception caught while importing: " << exceptionToString(ex) );
259  return ERR_SWG_READ_ERROR;
260  }
261  catch(const uno::Exception&)
262  {
263  css::uno::Any ex( cppu::getCaughtException() );
264  SAL_WARN( "sw", "uno exception caught while importing: " << exceptionToString(ex) );
265  return ERR_SWG_READ_ERROR;
266  }
267 
268  // success!
269  return ERRCODE_NONE;
270 }
271 
272 // read a component (storage version)
273 ErrCode ReadThroughComponent(
274  uno::Reference<embed::XStorage> const & xStorage,
275  uno::Reference<XComponent> const & xModelComponent,
276  const sal_Char* pStreamName,
277  const sal_Char* pCompatibilityStreamName,
278  uno::Reference<uno::XComponentContext> const & rxContext,
279  const sal_Char* pFilterName,
280  const Sequence<Any>& rFilterArguments,
281  const OUString& rName,
282  bool bMustBeSuccessfull)
283 {
284  OSL_ENSURE(xStorage.is(), "Need storage!");
285  OSL_ENSURE(nullptr != pStreamName, "Please, please, give me a name!");
286 
287  // open stream (and set parser input)
288  OUString sStreamName = OUString::createFromAscii(pStreamName);
289  bool bContainsStream = false;
290  try
291  {
292  bContainsStream = xStorage->isStreamElement(sStreamName);
293  }
294  catch( container::NoSuchElementException& )
295  {
296  }
297 
298  if (!bContainsStream )
299  {
300  // stream name not found! Then try the compatibility name.
301  // if no stream can be opened, return immediately with OK signal
302 
303  // do we even have an alternative name?
304  if ( nullptr == pCompatibilityStreamName )
305  return ERRCODE_NONE;
306 
307  // if so, does the stream exist?
308  sStreamName = OUString::createFromAscii(pCompatibilityStreamName);
309  try
310  {
311  bContainsStream = xStorage->isStreamElement(sStreamName);
312  }
313  catch( container::NoSuchElementException& )
314  {
315  }
316 
317  if (! bContainsStream )
318  return ERRCODE_NONE;
319  }
320 
321  // set Base URL
322  uno::Reference< beans::XPropertySet > xInfoSet;
323  if( rFilterArguments.hasElements() )
324  rFilterArguments.getConstArray()[0] >>= xInfoSet;
325  OSL_ENSURE( xInfoSet.is(), "missing property set" );
326  if( xInfoSet.is() )
327  {
328  xInfoSet->setPropertyValue( "StreamName", makeAny( sStreamName ) );
329  }
330 
331  try
332  {
333  // get input stream
334  uno::Reference <io::XStream> xStream = xStorage->openStreamElement( sStreamName, embed::ElementModes::READ );
335  uno::Reference <beans::XPropertySet > xProps( xStream, uno::UNO_QUERY );
336 
337  Any aAny = xProps->getPropertyValue("Encrypted");
338 
339  auto b = o3tl::tryAccess<bool>(aAny);
340  bool bEncrypted = b && *b;
341 
342  uno::Reference <io::XInputStream> xInputStream = xStream->getInputStream();
343 
344  // read from the stream
345  return ReadThroughComponent(
346  xInputStream, xModelComponent, sStreamName, rxContext,
347  pFilterName, rFilterArguments,
348  rName, bMustBeSuccessfull, bEncrypted );
349  }
350  catch ( packages::WrongPasswordException& )
351  {
353  }
354  catch( packages::zip::ZipIOException& )
355  {
357  }
358  catch ( uno::Exception& )
359  {
360  OSL_FAIL( "Error on import" );
361  // TODO/LATER: error handling
362  }
363 
364  return ERR_SWG_READ_ERROR;
365 }
366 
367 }
368 
369 // #i44177#
371 {
372  // array containing the names of the default outline styles ('Heading 1',
373  // 'Heading 2', ..., 'Heading 10')
374  OUString aDefOutlStyleNames[ MAXLEVEL ];
375  {
376  OUString sStyleName;
377  for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
378  {
379  sStyleName =
381  sStyleName );
382  aDefOutlStyleNames[i] = sStyleName;
383  }
384  }
385 
386  // array indicating, which outline level already has a style assigned.
387  bool aOutlineLevelAssigned[ MAXLEVEL ];
388  // array of the default outline styles, which are created for the document.
389  SwTextFormatColl* aCreatedDefaultOutlineStyles[ MAXLEVEL ];
390 
391  {
392  for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
393  {
394  aOutlineLevelAssigned[ i ] = false;
395  aCreatedDefaultOutlineStyles[ i ] = nullptr;
396  }
397  }
398 
399  // determine, which outline level has already a style assigned and
400  // which of the default outline styles is created.
401  const SwTextFormatColls& rColls = *(_rDoc.GetTextFormatColls());
402  for ( size_t n = 1; n < rColls.size(); ++n )
403  {
404  SwTextFormatColl* pColl = rColls[ n ];
406  {
407  aOutlineLevelAssigned[ pColl->GetAssignedOutlineStyleLevel() ] = true;
408  }
409 
410  for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
411  {
412  if ( aCreatedDefaultOutlineStyles[ i ] == nullptr &&
413  pColl->GetName() == aDefOutlStyleNames[i] )
414  {
415  aCreatedDefaultOutlineStyles[ i ] = pColl;
416  break;
417  }
418  }
419  }
420 
421  // assign already created default outline style to outline level, which
422  // doesn't have a style assigned to it.
423  const SwNumRule* pOutlineRule = _rDoc.GetOutlineNumRule();
424  for ( sal_uInt8 i = 0; i < MAXLEVEL; ++i )
425  {
426  // #i73361#
427  // Do not change assignment of already created default outline style
428  // to a certain outline level.
429  if ( !aOutlineLevelAssigned[ i ] &&
430  aCreatedDefaultOutlineStyles[ i ] != nullptr &&
431  ! aCreatedDefaultOutlineStyles[ i ]->IsAssignedToListLevelOfOutlineStyle() )
432  {
433  // apply outline level at created default outline style
434  aCreatedDefaultOutlineStyles[ i ]->AssignToListLevelOfOutlineStyle(i);
435 
436  // apply outline numbering rule, if none is set.
437  const SfxPoolItem& rItem =
438  aCreatedDefaultOutlineStyles[ i ]->GetFormatAttr( RES_PARATR_NUMRULE, false );
439  if ( static_cast<const SwNumRuleItem&>(rItem).GetValue().isEmpty() )
440  {
441  SwNumRuleItem aItem( pOutlineRule->GetName() );
442  aCreatedDefaultOutlineStyles[ i ]->SetFormatAttr( aItem );
443  }
444  }
445  }
446 }
447 
449 {
450  if ( _rDoc.getIDocumentDrawModelAccess().GetDrawModel() &&
452  {
453  const SdrPage& rSdrPage( *(_rDoc.getIDocumentDrawModelAccess().GetDrawModel()->GetPage( 0 )) );
454 
455  // iterate recursive with group objects over all shapes on the draw page
456  SdrObjListIter aIter( &rSdrPage );
457  while( aIter.IsMore() )
458  {
459  SdrOle2Obj* pOle2Obj = dynamic_cast< SdrOle2Obj* >( aIter.Next() );
460  if( pOle2Obj )
461  {
462  // found an ole2 shape
463  SdrObjList* pObjList = pOle2Obj->getParentSdrObjListFromSdrObject();
464 
465  // get its graphic
466  Graphic aGraphic;
467  pOle2Obj->Connect();
468  const Graphic* pGraphic = pOle2Obj->GetGraphic();
469  if( pGraphic )
470  aGraphic = *pGraphic;
471  pOle2Obj->Disconnect();
472 
473  // create new graphic shape with the ole graphic and shape size
474  SdrGrafObj* pGraphicObj = new SdrGrafObj(
475  pOle2Obj->getSdrModelFromSdrObject(),
476  aGraphic,
477  pOle2Obj->GetCurrentBoundRect());
478 
479  // apply layer of ole2 shape at graphic shape
480  pGraphicObj->SetLayer( pOle2Obj->GetLayer() );
481 
482  // replace ole2 shape with the new graphic object and delete the ol2 shape
483  SdrObject* pReplaced = pObjList->ReplaceObject( pGraphicObj, pOle2Obj->GetOrdNum() );
484  SdrObject::Free( pReplaced );
485  }
486  }
487  }
488 }
489 
490 ErrCode XMLReader::Read( SwDoc &rDoc, const OUString& rBaseURL, SwPaM &rPaM, const OUString & rName )
491 {
492  // needed for relative URLs, but in clipboard copy/paste there may be none
493  // and also there is the SwXMLTextBlocks special case
494  SAL_INFO_IF(rBaseURL.isEmpty(), "sw.filter", "sw::XMLReader: no base URL");
495 
496  // Get service factory
497  uno::Reference< uno::XComponentContext > xContext =
499 
500  uno::Reference<document::XGraphicStorageHandler> xGraphicStorageHandler;
501  rtl::Reference<SvXMLGraphicHelper> xGraphicHelper;
502  uno::Reference< document::XEmbeddedObjectResolver > xObjectResolver;
504 
505  // get the input stream (storage or stream)
506  uno::Reference<embed::XStorage> xStorage;
507  if( m_pMedium )
508  xStorage = m_pMedium->GetStorage();
509  else
510  xStorage = m_xStorage;
511 
512  if( !xStorage.is() )
513  return ERR_SWG_READ_ERROR;
514 
515  xGraphicHelper = SvXMLGraphicHelper::Create( xStorage,
516  SvXMLGraphicHelperMode::Read );
517  xGraphicStorageHandler = xGraphicHelper.get();
518  SfxObjectShell *pPersist = rDoc.GetPersist();
519  if( pPersist )
520  {
521  xObjectHelper = SvXMLEmbeddedObjectHelper::Create(
522  xStorage, *pPersist,
523  SvXMLEmbeddedObjectHelperMode::Read );
524  xObjectResolver = xObjectHelper.get();
525  }
526 
527  // Get the docshell, the model, and finally the model's component
528  SwDocShell *pDocSh = rDoc.GetDocShell();
529  OSL_ENSURE( pDocSh, "XMLReader::Read: got no doc shell" );
530  if( !pDocSh )
531  return ERR_SWG_READ_ERROR;
532  uno::Reference< lang::XComponent > xModelComp( pDocSh->GetModel(), UNO_QUERY );
533  OSL_ENSURE( xModelComp.is(),
534  "XMLReader::Read: got no model" );
535  if( !xModelComp.is() )
536  return ERR_SWG_READ_ERROR;
537 
538  // create and prepare the XPropertySet that gets passed through
539  // the components, and the XStatusIndicator that shows progress to
540  // the user.
541 
542  // create XPropertySet with three properties for status indicator
543  comphelper::PropertyMapEntry const aInfoMap[] =
544  {
545  { OUString("ProgressRange"), 0,
547  beans::PropertyAttribute::MAYBEVOID, 0},
548  { OUString("ProgressMax"), 0,
550  beans::PropertyAttribute::MAYBEVOID, 0},
551  { OUString("ProgressCurrent"), 0,
553  beans::PropertyAttribute::MAYBEVOID, 0},
554  { OUString("NumberStyles"), 0,
556  beans::PropertyAttribute::MAYBEVOID, 0},
557  { OUString("RecordChanges"), 0,
559  beans::PropertyAttribute::MAYBEVOID, 0 },
560  { OUString("ShowChanges"), 0,
562  beans::PropertyAttribute::MAYBEVOID, 0 },
563  { OUString("RedlineProtectionKey"), 0,
565  beans::PropertyAttribute::MAYBEVOID, 0 },
566  { OUString("PrivateData"), 0,
568  beans::PropertyAttribute::MAYBEVOID, 0 },
569  { OUString("BaseURI"), 0,
571  beans::PropertyAttribute::MAYBEVOID, 0 },
572  { OUString("StreamRelPath"), 0,
574  beans::PropertyAttribute::MAYBEVOID, 0 },
575  { OUString("StreamName"), 0,
577  beans::PropertyAttribute::MAYBEVOID, 0 },
578  // properties for insert modes
579  { OUString("StyleInsertModeFamilies"), 0,
581  beans::PropertyAttribute::MAYBEVOID, 0 },
582  { OUString("StyleInsertModeOverwrite"), 0,
584  beans::PropertyAttribute::MAYBEVOID, 0 },
585  { OUString("TextInsertModeRange"), 0,
587  beans::PropertyAttribute::MAYBEVOID, 0},
588  { OUString("AutoTextMode"), 0,
590  beans::PropertyAttribute::MAYBEVOID, 0 },
591  { OUString("OrganizerMode"), 0,
593  beans::PropertyAttribute::MAYBEVOID, 0 },
594 
595  // #i28749# - Add property, which indicates, if the
596  // shape position attributes are given in horizontal left-to-right layout.
597  // This is the case for the OpenOffice.org file format.
598  { OUString("ShapePositionInHoriL2R"), 0,
600  beans::PropertyAttribute::MAYBEVOID, 0 },
601 
602  { OUString("BuildId"), 0,
604  beans::PropertyAttribute::MAYBEVOID, 0 },
605 
606  // Add property, which indicates, if a text document in OpenOffice.org
607  // file format is read.
608  // Note: Text documents read via the binary filter are also finally
609  // read using the OpenOffice.org file format. Thus, e.g. for text
610  // documents in StarOffice 5.2 binary file format this property
611  // will be true.
612  { OUString("TextDocInOOoFileFormat"), 0,
614  beans::PropertyAttribute::MAYBEVOID, 0 },
615  { OUString("SourceStorage"), 0, cppu::UnoType<embed::XStorage>::get(),
616  css::beans::PropertyAttribute::MAYBEVOID, 0 },
617  { OUString(), 0, css::uno::Type(), 0, 0 }
618  };
619  uno::Reference< beans::XPropertySet > xInfoSet(
621  new comphelper::PropertySetInfo( aInfoMap ) ) );
622 
623  // get BuildId from parent container if available
624  uno::Reference< container::XChild > xChild( xModelComp, uno::UNO_QUERY );
625  if( xChild.is() )
626  {
627  uno::Reference< beans::XPropertySet > xParentSet( xChild->getParent(), uno::UNO_QUERY );
628  if( xParentSet.is() )
629  {
630  uno::Reference< beans::XPropertySetInfo > xPropSetInfo( xParentSet->getPropertySetInfo() );
631  const OUString sPropName("BuildId" );
632  if( xPropSetInfo.is() && xPropSetInfo->hasPropertyByName(sPropName) )
633  {
634  xInfoSet->setPropertyValue( sPropName, xParentSet->getPropertyValue(sPropName) );
635  }
636  }
637  }
638 
639  // try to get an XStatusIndicator from the Medium
640  uno::Reference<task::XStatusIndicator> xStatusIndicator;
641 
642  if (pDocSh->GetMedium())
643  {
644  SfxItemSet* pSet = pDocSh->GetMedium()->GetItemSet();
645  if (pSet)
646  {
647  const SfxUnoAnyItem* pItem = static_cast<const SfxUnoAnyItem*>(
648  pSet->GetItem(SID_PROGRESS_STATUSBAR_CONTROL) );
649  if (pItem)
650  {
651  pItem->GetValue() >>= xStatusIndicator;
652  }
653  }
654  }
655 
656  // set progress range and start status indicator
657  sal_Int32 nProgressRange(1000000);
658  if (xStatusIndicator.is())
659  {
660  xStatusIndicator->start(SvxResId(RID_SVXSTR_DOC_LOAD), nProgressRange);
661  }
662  uno::Any aProgRange;
663  aProgRange <<= nProgressRange;
664  xInfoSet->setPropertyValue("ProgressRange", aProgRange);
665 
666  Reference< container::XNameAccess > xLateInitSettings( document::NamedPropertyValues::create(xContext), UNO_QUERY_THROW );
667  beans::NamedValue aLateInitSettings( "LateInitSettings", makeAny( xLateInitSettings ) );
668 
669  xInfoSet->setPropertyValue( "SourceStorage", Any( xStorage ) );
670 
671  // prepare filter arguments, WARNING: the order is important!
672  Sequence<Any> aFilterArgs{ Any(xInfoSet),
673  Any(xStatusIndicator),
674  Any(xGraphicStorageHandler),
675  Any(xObjectResolver),
676  Any(aLateInitSettings) };
677 
678  Sequence<Any> aEmptyArgs{ Any(xInfoSet),
679  Any(xStatusIndicator) };
680 
681  // prepare for special modes
682  if( m_aOption.IsFormatsOnly() )
683  {
684  sal_Int32 nCount =
685  (m_aOption.IsFrameFormats() ? 1 : 0) +
686  (m_aOption.IsPageDescs() ? 1 : 0) +
687  (m_aOption.IsTextFormats() ? 2 : 0) +
688  (m_aOption.IsNumRules() ? 1 : 0);
689 
690  Sequence< OUString> aFamiliesSeq( nCount );
691  OUString *pSeq = aFamiliesSeq.getArray();
692  if( m_aOption.IsFrameFormats() )
693  // SfxStyleFamily::Frame;
694  *pSeq++ = "FrameStyles";
695  if( m_aOption.IsPageDescs() )
696  // SfxStyleFamily::Page;
697  *pSeq++ = "PageStyles";
698  if( m_aOption.IsTextFormats() )
699  {
700  // (SfxStyleFamily::Char|SfxStyleFamily::Para);
701  *pSeq++ = "CharacterStyles";
702  *pSeq++ = "ParagraphStyles";
703  }
704  if( m_aOption.IsNumRules() )
705  // SfxStyleFamily::Pseudo;
706  *pSeq++ = "NumberingStyles";
707 
708  xInfoSet->setPropertyValue( "StyleInsertModeFamilies",
709  makeAny(aFamiliesSeq) );
710 
711  xInfoSet->setPropertyValue( "StyleInsertModeOverwrite", makeAny(!m_aOption.IsMerge()) );
712  }
713  else if( m_bInsertMode )
714  {
715  const uno::Reference<text::XTextRange> xInsertTextRange =
716  SwXTextRange::CreateXTextRange(rDoc, *rPaM.GetPoint(), nullptr);
717  xInfoSet->setPropertyValue( "TextInsertModeRange",
718  makeAny(xInsertTextRange) );
719  }
720  else
721  {
722  rPaM.GetBound().nContent.Assign(nullptr, 0);
723  rPaM.GetBound(false).nContent.Assign(nullptr, 0);
724  }
725 
726  if( IsBlockMode() )
727  {
728  xInfoSet->setPropertyValue( "AutoTextMode", makeAny(true) );
729  }
730  if( IsOrganizerMode() )
731  {
732  xInfoSet->setPropertyValue( "OrganizerMode", makeAny(true) );
733  }
734 
735  // Set base URI
736  // there is ambiguity which medium should be used here
737  // for now the own medium has a preference
738  SfxMedium* pMedDescrMedium = m_pMedium ? m_pMedium : pDocSh->GetMedium();
739  OSL_ENSURE( pMedDescrMedium, "There is no medium to get MediaDescriptor from!" );
740 
741  xInfoSet->setPropertyValue( "BaseURI", makeAny( rBaseURL ) );
742 
743  // TODO/LATER: separate links from usual embedded objects
744  OUString StreamPath;
745  if( SfxObjectCreateMode::EMBEDDED == rDoc.GetDocShell()->GetCreateMode() )
746  {
747  if ( pMedDescrMedium && pMedDescrMedium->GetItemSet() )
748  {
749  const SfxStringItem* pDocHierarchItem = static_cast<const SfxStringItem*>(
750  pMedDescrMedium->GetItemSet()->GetItem(SID_DOC_HIERARCHICALNAME) );
751  if ( pDocHierarchItem )
752  StreamPath = pDocHierarchItem->GetValue();
753  }
754  else
755  {
756  StreamPath = "dummyObjectName";
757  }
758 
759  if( !StreamPath.isEmpty() )
760  {
761  xInfoSet->setPropertyValue( "StreamRelPath", makeAny( StreamPath ) );
762  }
763  }
764 
765  rtl::Reference<SwDoc> aHoldRef(&rDoc); // prevent deletion
766  ErrCode nRet = ERRCODE_NONE;
767 
768  // save redline mode into import info property set
769  const OUString sShowChanges("ShowChanges");
770  const OUString sRecordChanges("RecordChanges");
771  const OUString sRedlineProtectionKey("RedlineProtectionKey");
772  xInfoSet->setPropertyValue( sShowChanges,
774  xInfoSet->setPropertyValue( sRecordChanges,
776  xInfoSet->setPropertyValue( sRedlineProtectionKey,
778 
779  // force redline mode to "none"
781 
782  const bool bOASIS = ( SotStorage::GetVersion( xStorage ) > SOFFICE_FILEFORMAT_60 );
783  // #i28749# - set property <ShapePositionInHoriL2R>
784  {
785  const bool bShapePositionInHoriL2R = !bOASIS;
786  xInfoSet->setPropertyValue(
787  "ShapePositionInHoriL2R",
788  makeAny( bShapePositionInHoriL2R ) );
789  }
790  {
791  const bool bTextDocInOOoFileFormat = !bOASIS;
792  xInfoSet->setPropertyValue(
793  "TextDocInOOoFileFormat",
794  makeAny( bTextDocInOOoFileFormat ) );
795  }
796 
797  ErrCode nWarnRDF = ERRCODE_NONE;
798  if ( !(IsOrganizerMode() || IsBlockMode() || m_aOption.IsFormatsOnly() ||
799  m_bInsertMode) )
800  {
801  // RDF metadata - must be read before styles/content
802  // N.B.: embedded documents have their own manifest.rdf!
803  try
804  {
805  const uno::Reference<rdf::XDocumentMetadataAccess> xDMA(xModelComp,
806  uno::UNO_QUERY_THROW);
807  const uno::Reference<frame::XModel> xModel(xModelComp,
808  uno::UNO_QUERY_THROW);
809  const uno::Reference<rdf::XURI> xBaseURI( ::sfx2::createBaseURI(
810  xContext, xModel, rBaseURL, StreamPath) );
811  const uno::Reference<task::XInteractionHandler> xHandler(
812  pDocSh->GetMedium()->GetInteractionHandler() );
813  xDMA->loadMetadataFromStorage(xStorage, xBaseURI, xHandler);
814  }
815  catch (const lang::WrappedTargetException & e)
816  {
817  ucb::InteractiveAugmentedIOException iaioe;
818  if (e.TargetException >>= iaioe)
819  {
820  // import error that was not ignored by InteractionHandler!
821  nWarnRDF = ERR_SWG_READ_ERROR;
822  }
823  else
824  {
825  nWarnRDF = WARN_SWG_FEATURES_LOST; // uhh... something wrong?
826  }
827  }
828  catch (uno::Exception &)
829  {
830  nWarnRDF = WARN_SWG_FEATURES_LOST; // uhh... something went wrong?
831  }
832  }
833 
834  // read storage streams
835 
836  // #i103539#: always read meta.xml for generator
837  ErrCode const nWarn = ReadThroughComponent(
838  xStorage, xModelComp, "meta.xml", "Meta.xml", xContext,
839  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisMetaImporter"
840  : "com.sun.star.comp.Writer.XMLMetaImporter"),
841  aEmptyArgs, rName, false );
842 
843  ErrCode nWarn2 = ERRCODE_NONE;
845  m_bInsertMode) )
846  {
847  nWarn2 = ReadThroughComponent(
848  xStorage, xModelComp, "settings.xml", nullptr, xContext,
849  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisSettingsImporter"
850  : "com.sun.star.comp.Writer.XMLSettingsImporter"),
851  aFilterArgs, rName, false );
852  }
853 
854  nRet = ReadThroughComponent(
855  xStorage, xModelComp, "styles.xml", nullptr, xContext,
856  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisStylesImporter"
857  : "com.sun.star.comp.Writer.XMLStylesImporter"),
858  aFilterArgs, rName, true );
859 
860  if( !nRet && !(IsOrganizerMode() || m_aOption.IsFormatsOnly()) )
861  nRet = ReadThroughComponent(
862  xStorage, xModelComp, "content.xml", "Content.xml", xContext,
863  (bOASIS ? "com.sun.star.comp.Writer.XMLOasisContentImporter"
864  : "com.sun.star.comp.Writer.XMLContentImporter"),
865  aFilterArgs, rName, true );
866 
867  if( !(IsOrganizerMode() || IsBlockMode() || m_bInsertMode ||
869  // sw_redlinehide: disable layout cache for now
870  !*o3tl::doAccess<bool>(xInfoSet->getPropertyValue(sShowChanges))))
871  {
872  try
873  {
874  uno::Reference < io::XStream > xStm = xStorage->openStreamElement( "layout-cache", embed::ElementModes::READ );
875  std::unique_ptr<SvStream> pStrm2 = utl::UcbStreamHelper::CreateStream( xStm );
876  if( !pStrm2->GetError() )
877  rDoc.ReadLayoutCache( *pStrm2 );
878  }
879  catch (const uno::Exception&)
880  {
881  }
882  }
883 
884  // Notify math objects
885  if( m_bInsertMode )
886  rDoc.PrtOLENotify( false );
887  else if ( rDoc.IsOLEPrtNotifyPending() )
888  rDoc.PrtOLENotify( true );
889 
890  nRet = nRet ? nRet : (nWarn ? nWarn : (nWarn2 ? nWarn2 : nWarnRDF ) );
891 
893 
894  // redline password
895  Any aAny = xInfoSet->getPropertyValue( sRedlineProtectionKey );
896  Sequence<sal_Int8> aKey;
897  aAny >>= aKey;
899 
900  // restore redline mode from import info property set
901  RedlineFlags nRedlineFlags = RedlineFlags::ShowInsert;
902  aAny = xInfoSet->getPropertyValue( sShowChanges );
903  if ( *o3tl::doAccess<bool>(aAny) )
904  nRedlineFlags |= RedlineFlags::ShowDelete;
905  aAny = xInfoSet->getPropertyValue( sRecordChanges );
906  if ( *o3tl::doAccess<bool>(aAny) || aKey.hasElements() )
907  nRedlineFlags |= RedlineFlags::On;
908 
909  // ... restore redline mode
910  // (First set bogus mode to make sure the mode in getIDocumentRedlineAccess().SetRedlineFlags()
911  // is different from its previous mode.)
912  rDoc.getIDocumentRedlineAccess().SetRedlineFlags_intern( ~nRedlineFlags );
913  // must set flags to show delete so that CompressRedlines works
915  // tdf#83260 ensure that the first call of CompressRedlines after loading
916  // the document is a no-op by calling it now
918  // can't set it on the layout or view shell because it doesn't exist yet
920 
921  lcl_EnsureValidPam( rPaM ); // move Pam into valid content
922 
923  if( xGraphicHelper )
924  xGraphicHelper->dispose();
925  xGraphicHelper.clear();
926  xGraphicStorageHandler = nullptr;
927  if( xObjectHelper )
928  xObjectHelper->dispose();
929  xObjectHelper.clear();
930  xObjectResolver = nullptr;
931  aHoldRef.clear();
932 
933  if ( !bOASIS )
934  {
935  // #i44177# - assure that for documents in OpenOffice.org
936  // file format the relation between outline numbering rule and styles is
937  // filled-up accordingly.
938  // Note: The OpenOffice.org file format, which has no content that applies
939  // a certain style, which is related to the outline numbering rule,
940  // has lost the information, that this certain style is related to
941  // the outline numbering rule.
942  // #i70748# - only for templates
943  if ( m_pMedium && m_pMedium->GetFilter() &&
944  m_pMedium->GetFilter()->IsOwnTemplateFormat() )
945  {
947  }
948  // Fix #i58251#: Unfortunately is the static default different to SO7 behaviour,
949  // so we have to set a dynamic default after importing SO7
950  rDoc.SetDefault(SwFormatRowSplit(false));
951  }
952 
953  rDoc.PropagateOutlineRule();
954 
955  // #i62875#
957  {
959  }
960 
961  // Convert all instances of <SdrOle2Obj> into <SdrGrafObj>, because the
962  // Writer doesn't support such objects.
964 
965  // set BuildId on XModel for later OLE object loading
966  if( xInfoSet.is() )
967  {
968  uno::Reference< beans::XPropertySet > xModelSet( xModelComp, uno::UNO_QUERY );
969  if( xModelSet.is() )
970  {
971  uno::Reference< beans::XPropertySetInfo > xModelSetInfo( xModelSet->getPropertySetInfo() );
972  const OUString sName("BuildId" );
973  if( xModelSetInfo.is() && xModelSetInfo->hasPropertyByName(sName) )
974  {
975  xModelSet->setPropertyValue( sName, xInfoSet->getPropertyValue(sName) );
976  }
977  }
978  }
979 
980  if (xStatusIndicator.is())
981  {
982  xStatusIndicator->end();
983  }
984 
985  rDoc.GetIStyleAccess().clearCaches(); // Clear Automatic-Style-Caches(shared_pointer!)
986  return nRet;
987 }
988 
989  // read the sections of the document, which is equal to the medium.
990  // returns the count of it
992  std::vector<OUString>& rStrings) const
993 {
994  uno::Reference< uno::XComponentContext > xContext =
996  uno::Reference < embed::XStorage > xStg2;
997  if( ( xStg2 = rMedium.GetStorage() ).is() )
998  {
999  try
1000  {
1001  xml::sax::InputSource aParserInput;
1002  const OUString sDocName( "content.xml" );
1003  aParserInput.sSystemId = sDocName;
1004 
1005  uno::Reference < io::XStream > xStm = xStg2->openStreamElement( sDocName, embed::ElementModes::READ );
1006  aParserInput.aInputStream = xStm->getInputStream();
1007 
1008  // get filter
1009  uno::Reference< xml::sax::XDocumentHandler > xFilter = new SwXMLSectionList( xContext, rStrings );
1010 
1011  // connect parser and filter
1012  uno::Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(xContext);
1013  xParser->setDocumentHandler( xFilter );
1014 
1015  // parse
1016  xParser->parseStream( aParserInput );
1017  }
1018  catch( xml::sax::SAXParseException& )
1019  {
1020  // re throw ?
1021  }
1022  catch( xml::sax::SAXException& )
1023  {
1024  // re throw ?
1025  }
1026  catch( io::IOException& )
1027  {
1028  // re throw ?
1029  }
1030  catch( packages::WrongPasswordException& )
1031  {
1032  // re throw ?
1033  }
1034  }
1035  return rStrings.size();
1036 }
1037 
1038 /* 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:448
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:130
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:121
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:118
bool IsFormatsOnly() const
Definition: shellio.hxx:116
#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:490
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:221
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:991
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
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:127
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:253
bool IsTextFormats() const
Definition: shellio.hxx:124
const std::shared_ptr< const SfxFilter > & GetFilter() const
show all deletes
SwReaderType
Definition: shellio.hxx:182
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:215
virtual SdrObject * ReplaceObject(SdrObject *pNewObj, size_t nObjNum)
void ResetAllFormatsOnly()
Definition: shellio.hxx:115
#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:213
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:212
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:1135
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:256
static void lcl_AdjustOutlineStylesForOOo(SwDoc &_rDoc)
Definition: swxml.cxx:370
no RedlineFlags
const Graphic * GetGraphic() const
SwNumRule * GetOutlineNumRule() const
Definition: doc.hxx:1013
bool m_bInsertMode
Definition: shellio.hxx:216
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)