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