LibreOffice Module sw (master)  1
docsh.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 <config_features.h>
21 
22 #include <officecfg/Office/Common.hxx>
23 #include <vcl/weld.hxx>
24 #include <vcl/svapp.hxx>
25 #include <vcl/syswin.hxx>
26 #include <vcl/jobset.hxx>
27 #include <svl/whiter.hxx>
28 #include <svl/zforlist.hxx>
29 #include <svl/eitem.hxx>
30 #include <svl/stritem.hxx>
31 #include <svl/PasswordHelper.hxx>
33 #include <sfx2/bindings.hxx>
34 #include <sfx2/docfile.hxx>
35 #include <sfx2/docfilt.hxx>
37 #include <sfx2/printer.hxx>
38 #include <sfx2/linkmgr.hxx>
39 #include <editeng/flstitem.hxx>
40 #include <comphelper/lok.hxx>
41 #include <comphelper/classids.hxx>
42 #include <basic/sbmod.hxx>
43 #include <node.hxx>
44 #include <swwait.hxx>
45 #include <printdata.hxx>
46 #include <view.hxx>
47 #include <edtwin.hxx>
48 #include <PostItMgr.hxx>
49 #include <wrtsh.hxx>
50 #include <docsh.hxx>
51 #include <viewopt.hxx>
52 #include <wdocsh.hxx>
53 #include <swmodule.hxx>
54 #include <globdoc.hxx>
55 #include <usrpref.hxx>
56 #include <shellio.hxx>
57 #include <docstyle.hxx>
58 #include <doc.hxx>
59 #include <docfunc.hxx>
60 #include <IDocumentUndoRedo.hxx>
66 #include <IDocumentStatistics.hxx>
67 #include <IDocumentState.hxx>
68 #include <pview.hxx>
69 #include <srcview.hxx>
70 #include <ndindex.hxx>
71 #include <ndole.hxx>
72 #include <txtftn.hxx>
73 #include <ftnidx.hxx>
74 #include <fldbas.hxx>
75 #include <docary.hxx>
76 #include <swerror.h>
77 #include <cmdid.h>
78 #include <strings.hrc>
79 
80 #include <unotools/fltrcfg.hxx>
81 #include <svtools/htmlcfg.hxx>
82 #include <sfx2/viewfrm.hxx>
83 #include <sfx2/objface.hxx>
84 
85 #define ShellClass_SwDocShell
86 #include <sfx2/msg.hxx>
87 #include <swslots.hxx>
88 #include <com/sun/star/document/UpdateDocMode.hpp>
89 
90 #include <com/sun/star/script/XLibraryContainer.hpp>
91 #include <com/sun/star/document/XDocumentProperties.hpp>
92 #include <com/sun/star/document/XDocumentPropertiesSupplier.hpp>
93 #include <com/sun/star/sdb/DatabaseContext.hpp>
94 #include <com/sun/star/sdb/XDocumentDataSource.hpp>
95 #include <com/sun/star/uri/UriReferenceFactory.hpp>
96 #include <com/sun/star/uri/VndSunStarPkgUrlReferenceFactory.hpp>
97 #include <com/sun/star/frame/XStorable.hpp>
98 #include <ooo/vba/XSinkCaller.hpp>
99 
100 #include <unotextrange.hxx>
101 
102 #include <dbmgr.hxx>
103 #include <iodetect.hxx>
104 
106 
107 using namespace ::com::sun::star;
108 using namespace ::com::sun::star::uno;
109 using namespace ::com::sun::star::script;
110 using namespace ::com::sun::star::container;
111 
113 
114 void SwDocShell::InitInterface_Impl()
115 {
116 }
117 
118 
119 SFX_IMPL_OBJECTFACTORY(SwDocShell, SvGlobalName(SO3_SW_CLASSID), "swriter" )
120 
121 bool SwDocShell::InsertGeneratedStream(SfxMedium & rMedium,
122  uno::Reference<text::XTextRange> const& xInsertPosition)
123 {
124  SwUnoInternalPaM aPam(*GetDoc()); // must have doc since called from SwView
125  if (!::sw::XTextRangeToSwPaM(aPam, xInsertPosition))
126  return false;
127  // similar to SwView::InsertMedium
128  SwReaderPtr pReader;
129  Reader *const pRead = StartConvertFrom(rMedium, pReader, nullptr, &aPam);
130  if (!pRead)
131  return false;
132  ErrCode const nError = pReader->Read(*pRead);
133  return ERRCODE_NONE == nError;
134 }
135 
136 // Prepare loading
138  SwCursorShell const *pCursorShell,
139  SwPaM* pPaM )
140 {
141  bool bAPICall = false;
142  const SfxPoolItem* pApiItem;
143  const SfxItemSet* pMedSet;
144  if( nullptr != ( pMedSet = rMedium.GetItemSet() ) && SfxItemState::SET ==
145  pMedSet->GetItemState( FN_API_CALL, true, &pApiItem ) )
146  bAPICall = static_cast<const SfxBoolItem*>(pApiItem)->GetValue();
147 
148  std::shared_ptr<const SfxFilter> pFlt = rMedium.GetFilter();
149  if( !pFlt )
150  {
151  if(!bAPICall)
152  {
153  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
154  VclMessageType::Info, VclButtonsType::Ok,
155  SwResId(STR_CANTOPEN)));
156  xInfoBox->run();
157  }
158  return nullptr;
159  }
160  OUString aFileName( rMedium.GetName() );
161  Reader* pRead = SwReaderWriter::GetReader( pFlt->GetUserData() );
162  if( !pRead )
163  return nullptr;
164 
165  if( rMedium.IsStorage()
166  ? SwReaderType::Storage & pRead->GetReaderType()
167  : SwReaderType::Stream & pRead->GetReaderType() )
168  {
169  if (pPaM)
170  rpRdr.reset(new SwReader( rMedium, aFileName, *pPaM ));
171  else if (pCursorShell)
172  rpRdr.reset(new SwReader( rMedium, aFileName, *pCursorShell->GetCursor() ));
173  else
174  rpRdr.reset(new SwReader( rMedium, aFileName, m_xDoc.get() ));
175  }
176  else
177  return nullptr;
178 
179  // #i30171# set the UpdateDocMode at the SwDocShell
180  const SfxUInt16Item* pUpdateDocItem = SfxItemSet::GetItem<SfxUInt16Item>(rMedium.GetItemSet(), SID_UPDATEDOCMODE, false);
181  m_nUpdateDocMode = pUpdateDocItem ? pUpdateDocItem->GetValue() : document::UpdateDocMode::NO_UPDATE;
182 
183  if (!pFlt->GetDefaultTemplate().isEmpty())
184  pRead->SetTemplateName( pFlt->GetDefaultTemplate() );
185 
186  if( pRead == ReadAscii && nullptr != rMedium.GetInStream() &&
187  pFlt->GetUserData() == FILTER_TEXT_DLG )
188  {
189  SwAsciiOptions aOpt;
190  const SfxItemSet* pSet;
191  const SfxPoolItem* pItem;
192  if( nullptr != ( pSet = rMedium.GetItemSet() ) && SfxItemState::SET ==
193  pSet->GetItemState( SID_FILE_FILTEROPTIONS, true, &pItem ) )
194  aOpt.ReadUserData( static_cast<const SfxStringItem*>(pItem)->GetValue() );
195 
196  pRead->GetReaderOpt().SetASCIIOpts( aOpt );
197  }
198 
199  return pRead;
200 }
201 
202 // Loading
204 {
205  SwReaderPtr pRdr;
206  Reader* pRead = StartConvertFrom(rMedium, pRdr);
207  if (!pRead)
208  return false; // #129881# return if no reader is found
209  tools::SvRef<SotStorage> pStg=pRead->getSotStorageRef(); // #i45333# save sot storage ref in case of recursive calls
210 
211  m_xDoc->setDocAccTitle(OUString());
212  if (const auto pFrame1 = SfxViewFrame::GetFirst(this))
213  {
214  if (auto pSysWin = pFrame1->GetWindow().GetSystemWindow())
215  {
216  pSysWin->SetAccessibleName(OUString());
217  }
218  }
219  SwWait aWait( *this, true );
220 
221  // Suppress SfxProgress, when we are Embedded
222  SW_MOD()->SetEmbeddedLoadSave(
223  SfxObjectCreateMode::EMBEDDED == GetCreateMode() );
224 
225  pRdr->GetDoc()->getIDocumentSettingAccess().set(DocumentSettingId::HTML_MODE, dynamic_cast< const SwWebDocShell *>( this ) != nullptr);
226 
227  // Restore the pool default if reading a saved document.
228  m_xDoc->RemoveAllFormatLanguageDependencies();
229 
230  ErrCode nErr = pRdr->Read( *pRead );
231 
232  // Maybe put away one old Doc
233  if (m_xDoc.get() != pRdr->GetDoc())
234  {
235  RemoveLink();
236  m_xDoc = pRdr->GetDoc();
237 
238  AddLink();
239 
240  if (!m_xBasePool.is())
241  m_xBasePool = new SwDocStyleSheetPool( *m_xDoc, SfxObjectCreateMode::ORGANIZER == GetCreateMode() );
242  }
243 
244  UpdateFontList();
245  InitDrawModelAndDocShell(this, m_xDoc ? m_xDoc->getIDocumentDrawModelAccess().GetDrawModel() : nullptr);
246 
247  pRdr.reset();
248 
249  SW_MOD()->SetEmbeddedLoadSave( false );
250 
251  SetError(nErr);
252  bool bOk = !nErr.IsError();
253 
254  if (bOk && !m_xDoc->IsInLoadAsynchron())
255  {
256  LoadingFinished();
257  }
258 
259  pRead->setSotStorageRef(pStg); // #i45333# save sot storage ref in case of recursive calls
260 
261  return bOk;
262 }
263 
264 // Saving the Default-Format, Stg present
266 {
267  //#i3370# remove quick help to prevent saving of autocorrection suggestions
268  if (m_pView)
270  SwWait aWait( *this, true );
271 
272  CalcLayoutForOLEObjects(); // format for OLE objects
273  // #i62875#
274  // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
275  if (m_pWrtShell && m_xDoc &&
276  m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
278  {
279  m_xDoc->getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
280  }
281 
282  ErrCode nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE;
283  if( SfxObjectShell::Save() )
284  {
285  switch( GetCreateMode() )
286  {
287  case SfxObjectCreateMode::INTERNAL:
288  nErr = ERRCODE_NONE;
289  break;
290 
291  case SfxObjectCreateMode::ORGANIZER:
292  {
293  WriterRef xWrt;
294  ::GetXMLWriter(OUString(), GetMedium()->GetBaseURL(true), xWrt);
295  xWrt->SetOrganizerMode( true );
296  SwWriter aWrt( *GetMedium(), *m_xDoc );
297  nErr = aWrt.Write( xWrt );
298  xWrt->SetOrganizerMode( false );
299  }
300  break;
301 
302  case SfxObjectCreateMode::EMBEDDED:
303  // Suppress SfxProgress, if we are Embedded
304  SW_MOD()->SetEmbeddedLoadSave( true );
305  [[fallthrough]];
306 
307  case SfxObjectCreateMode::STANDARD:
308  default:
309  {
310  if (m_xDoc->ContainsMSVBasic())
311  {
313  nVBWarning = GetSaveWarningOfMSVBAStorage( static_cast<SfxObjectShell&>(*this) );
314  m_xDoc->SetContainsMSVBasic( false );
315  }
316 
317  // End TableBox Edit!
318  if (m_pWrtShell)
320 
321  WriterRef xWrt;
322  ::GetXMLWriter(OUString(), GetMedium()->GetBaseURL(true), xWrt);
323 
324  bool bLockedView(false);
325  if (m_pWrtShell)
326  {
327  bLockedView = m_pWrtShell->IsViewLocked();
328  m_pWrtShell->LockView( true ); //lock visible section
329  }
330 
331  SwWriter aWrt( *GetMedium(), *m_xDoc );
332  nErr = aWrt.Write( xWrt );
333 
334  if (m_pWrtShell)
335  m_pWrtShell->LockView( bLockedView );
336  }
337  break;
338  }
339  SW_MOD()->SetEmbeddedLoadSave( false );
340  }
341  SetError(nErr ? nErr : nVBWarning);
342 
343  SfxViewFrame *const pFrame =
344  m_pWrtShell ? m_pWrtShell->GetView().GetViewFrame() : nullptr;
345  if( pFrame )
346  {
347  pFrame->GetBindings().SetState(SfxBoolItem(SID_DOC_MODIFIED, false));
348  }
349  return !nErr.IsError();
350 }
351 
353 {
354  if (!pViewShell)
355  return;
356  for (SwViewShell& rShell : pViewShell->GetRingContainer())
357  {
358  if (!rShell.IsViewLocked())
359  {
360  m_aViewWasUnLocked.push_back(&rShell);
361  rShell.LockView(true);
362  }
363  }
364 }
365 
367 {
368  for (SwViewShell* pShell : m_aViewWasUnLocked)
369  pShell->LockView(false);
370 }
371 
372 std::unique_ptr<SfxObjectShell::LockAllViewsGuard> SwDocShell::LockAllViews()
373 {
374  return std::make_unique<LockAllViewsGuard_Impl>(GetEditShell());
375 }
376 
377 // Save using the Defaultformat
379 {
380  SwWait aWait( *this, true );
381  //#i3370# remove quick help to prevent saving of autocorrection suggestions
382  if (m_pView)
384 
385  //#i91811# mod if we have an active margin window, write back the text
386  if (m_pView &&
387  m_pView->GetPostItMgr() &&
389  {
391  }
392 
393  if (m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::GLOBAL_DOCUMENT) &&
394  !m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::GLOBAL_DOCUMENT_SAVE_LINKS))
396 
397  if (GetMedium())
398  {
399  // Task 75666 - is the Document imported by our Microsoft-Filters?
400  std::shared_ptr<const SfxFilter> pOldFilter = GetMedium()->GetFilter();
401  if( pOldFilter &&
402  ( pOldFilter->GetUserData() == FILTER_WW8 ||
403  pOldFilter->GetUserData() == "CWW6" ||
404  pOldFilter->GetUserData() == "WW6" ) )
405  {
406  // when saving it in our own fileformat, then remove the template
407  // name from the docinfo.
408  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
409  GetModel(), uno::UNO_QUERY_THROW);
410  uno::Reference<document::XDocumentProperties> xDocProps
411  = xDPS->getDocumentProperties();
412  xDocProps->setTemplateName(OUString());
413  xDocProps->setTemplateURL(OUString());
414  xDocProps->setTemplateDate(::util::DateTime());
415  }
416  }
417 
418  CalcLayoutForOLEObjects(); // format for OLE objects
419 
420  const bool bURLChanged = GetMedium() && GetMedium()->GetURLObject() != rMedium.GetURLObject();
421  const SwDBManager* const pMgr = m_xDoc->GetDBManager();
422  const bool bHasEmbedded = pMgr && !pMgr->getEmbeddedName().isEmpty();
423  bool bSaveDS = bHasEmbedded && bURLChanged;
424  if (bSaveDS)
425  {
426  // Don't save data source in case a temporary is being saved for preview in MM wizard
427  if (const SfxBoolItem* pNoEmbDS
428  = SfxItemSet::GetItem(rMedium.GetItemSet(), SID_NO_EMBEDDED_DS, false))
429  bSaveDS = !pNoEmbDS->GetValue();
430  }
431  if (bSaveDS)
432  {
433  // We have an embedded data source definition, need to re-store it,
434  // otherwise relative references will break when the new file is in a
435  // different directory.
436 
437  OUString aURL(GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE));
438  if (aURL.isEmpty())
439  {
440  // No old URL - is this a new document created from a template with embedded DS?
441  // Try to get the template URL to reconstruct the embedded data source URL
442  const css::beans::PropertyValues& rArgs = GetMedium()->GetArgs();
443  const auto aURLIter = std::find_if(rArgs.begin(), rArgs.end(),
444  [](const auto& v) { return v.Name == "URL"; });
445  if (aURLIter != rArgs.end())
446  aURLIter->Value >>= aURL;
447  }
448 
449  if (!aURL.isEmpty())
450  {
452  auto xUri = css::uri::UriReferenceFactory::create(xContext)->parse(aURL);
453  assert(xUri.is());
454  xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
455  ->createVndSunStarPkgUrlReference(xUri);
456  assert(xUri.is());
457  aURL = xUri->getUriReference() + "/"
460 
461  bool bCopyTo = GetCreateMode() == SfxObjectCreateMode::EMBEDDED;
462  if (!bCopyTo)
463  {
464  if (const SfxBoolItem* pSaveToItem
465  = SfxItemSet::GetItem(rMedium.GetItemSet(), SID_SAVETO, false))
466  bCopyTo = pSaveToItem->GetValue();
467  }
468 
469  auto xDatabaseContext = sdb::DatabaseContext::create(xContext);
470  uno::Reference<sdb::XDocumentDataSource> xDataSource(xDatabaseContext->getByName(aURL),
471  uno::UNO_QUERY);
472  if (xDataSource)
473  {
474  uno::Reference<frame::XStorable> xStorable(xDataSource->getDatabaseDocument(),
475  uno::UNO_QUERY);
477  pMgr->getEmbeddedName(), rMedium.GetName(),
478  bCopyTo);
479  }
480  }
481  }
482 
483  // #i62875#
484  // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
485  if (m_pWrtShell &&
486  m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
488  {
489  m_xDoc->getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
490  }
491 
492  ErrCode nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE;
493  uno::Reference < embed::XStorage > xStor = rMedium.GetOutputStorage();
494  if( SfxObjectShell::SaveAs( rMedium ) )
495  {
496  if( GetDoc()->getIDocumentSettingAccess().get(DocumentSettingId::GLOBAL_DOCUMENT) && dynamic_cast< const SwGlobalDocShell *>( this ) == nullptr )
497  {
498  // The document is closed explicitly, but using SfxObjectShellLock is still more correct here
499  SfxObjectShellLock xDocSh =
500  new SwGlobalDocShell( SfxObjectCreateMode::INTERNAL );
501  // the global document can not be a template
502  xDocSh->SetupStorage( xStor, SotStorage::GetVersion( xStor ), false );
503  xDocSh->DoClose();
504  }
505 
506  if (m_xDoc->ContainsMSVBasic())
507  {
509  nVBWarning = GetSaveWarningOfMSVBAStorage( static_cast<SfxObjectShell&>(*this) );
510  m_xDoc->SetContainsMSVBasic( false );
511  }
512 
513  if (m_pWrtShell)
514  {
515  // End TableBox Edit!
517 
518  // Remove invalid signatures.
520 
522  }
523 
524  // Remember and preserve Modified-Flag without calling the Link
525  // (for OLE; after Statement from MM)
526  const bool bIsModified = m_xDoc->getIDocumentState().IsModified();
527  m_xDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition();
528  Link<bool,void> aOldOLELnk( m_xDoc->GetOle2Link() );
529  m_xDoc->SetOle2Link( Link<bool,void>() );
530 
531  // Suppress SfxProgress when we are Embedded
532  SW_MOD()->SetEmbeddedLoadSave(
533  SfxObjectCreateMode::EMBEDDED == GetCreateMode() );
534 
535  WriterRef xWrt;
536  ::GetXMLWriter(OUString(), rMedium.GetBaseURL(true), xWrt);
537 
538  bool bLockedView(false);
539  if (m_pWrtShell)
540  {
541  bLockedView = m_pWrtShell->IsViewLocked();
542  m_pWrtShell->LockView( true ); //lock visible section
543  }
544 
545  SwWriter aWrt( rMedium, *m_xDoc );
546  nErr = aWrt.Write( xWrt );
547 
548  if (m_pWrtShell)
549  m_pWrtShell->LockView( bLockedView );
550 
551  if( bIsModified )
552  {
553  m_xDoc->getIDocumentState().SetModified();
554  m_xDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition();
555  }
556  m_xDoc->SetOle2Link( aOldOLELnk );
557 
558  SW_MOD()->SetEmbeddedLoadSave( false );
559 
560  // Increase RSID
561  m_xDoc->setRsid( m_xDoc->getRsid() );
562 
563  m_xDoc->cleanupUnoCursorTable();
564  }
565  SetError(nErr ? nErr : nVBWarning);
566 
567  return !nErr.IsError();
568 }
569 
570 // Save all Formats
571 static SwSrcView* lcl_GetSourceView( SwDocShell const * pSh )
572 {
573  // are we in SourceView?
574  SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( pSh );
575  SfxViewShell* pViewShell = pVFrame ? pVFrame->GetViewShell() : nullptr;
576  return dynamic_cast<SwSrcView*>( pViewShell );
577 }
578 
580 {
581  std::shared_ptr<const SfxFilter> pFlt = rMedium.GetFilter();
582  if( !pFlt )
583  return false;
584 
585  WriterRef xWriter;
586  SwReaderWriter::GetWriter( pFlt->GetUserData(), rMedium.GetBaseURL( true ), xWriter );
587  if( !xWriter.is() )
588  { // Filter not available
589  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
590  VclMessageType::Info, VclButtonsType::Ok,
591  SwResId(STR_DLLNOTFOUND)));
592  xInfoBox->run();
593  return false;
594  }
595 
596  //#i3370# remove quick help to prevent saving of autocorrection suggestions
597  if (m_pView)
599 
600  //#i91811# mod if we have an active margin window, write back the text
601  if (m_pView &&
602  m_pView->GetPostItMgr() &&
604  {
606  }
607 
608  ErrCode nVBWarning = ERRCODE_NONE;
609 
610  if (m_xDoc->ContainsMSVBasic())
611  {
612  bool bSave = pFlt->GetUserData() == "CWW8"
614 
615  if ( bSave )
616  {
617  tools::SvRef<SotStorage> xStg = new SotStorage( rMedium.GetOutStream(), false );
618  OSL_ENSURE( !xStg->GetError(), "No storage available for storing VBA macros!" );
619  if ( !xStg->GetError() )
620  {
621  nVBWarning = SaveOrDelMSVBAStorage( static_cast<SfxObjectShell&>(*this), *xStg, bSave, "Macros" );
622  xStg->Commit();
623  m_xDoc->SetContainsMSVBasic( true );
624  }
625  }
626  }
627 
628  // End TableBox Edit!
629  if (m_pWrtShell)
631 
632  if( pFlt->GetUserData() == "HTML" )
633  {
634 #if HAVE_FEATURE_SCRIPTING
635  SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
636  if( !rHtmlOpt.IsStarBasic() && rHtmlOpt.IsStarBasicWarning() && HasBasic() )
637  {
638  uno::Reference< XLibraryContainer > xLibCont = GetBasicContainer();
639  uno::Reference< XNameAccess > xLib;
640  const Sequence<OUString> aNames = xLibCont->getElementNames();
641  for(const OUString& rName : aNames)
642  {
643  Any aLib = xLibCont->getByName(rName);
644  aLib >>= xLib;
645  if(xLib.is())
646  {
647  Sequence<OUString> aModNames = xLib->getElementNames();
648  if(aModNames.hasElements())
649  {
651  break;
652  }
653  }
654  }
655  }
656 #endif
657  }
658 
659  // #i76360# Update document statistics
660  if ( !rMedium.IsSkipImages() )
661  m_xDoc->getIDocumentStatistics().UpdateDocStat( false, true );
662 
663  CalcLayoutForOLEObjects(); // format for OLE objects
664  // #i62875#
665  // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
666  if (m_pWrtShell &&
667  m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
669  {
670  m_xDoc->getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
671  }
672 
673  if( xWriter->IsStgWriter() &&
674  ( pFlt->GetUserData() == FILTER_XML ||
675  pFlt->GetUserData() == FILTER_XMLV ||
676  pFlt->GetUserData() == FILTER_XMLVW ) )
677  {
678  // determine the own Type
679  sal_uInt8 nMyType = 0;
680  if( dynamic_cast< const SwWebDocShell *>( this ) != nullptr )
681  nMyType = 1;
682  else if( dynamic_cast< const SwGlobalDocShell *>( this ) != nullptr )
683  nMyType = 2;
684 
685  // determine the desired Type
686  sal_uInt8 nSaveType = 0;
687  SotClipboardFormatId nSaveClipId = pFlt->GetFormat();
688  if( SotClipboardFormatId::STARWRITERWEB_8 == nSaveClipId ||
689  SotClipboardFormatId::STARWRITERWEB_60 == nSaveClipId ||
690  SotClipboardFormatId::STARWRITERWEB_50 == nSaveClipId ||
691  SotClipboardFormatId::STARWRITERWEB_40 == nSaveClipId )
692  nSaveType = 1;
693  else if( SotClipboardFormatId::STARWRITERGLOB_8 == nSaveClipId ||
694  SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE == nSaveClipId ||
695  SotClipboardFormatId::STARWRITERGLOB_60 == nSaveClipId ||
696  SotClipboardFormatId::STARWRITERGLOB_50 == nSaveClipId ||
697  SotClipboardFormatId::STARWRITERGLOB_40 == nSaveClipId )
698  nSaveType = 2;
699 
700  // Change Flags of the Document accordingly
704  if( nMyType != nSaveType )
705  {
708  if( 2 != nSaveType )
710  }
711 
712  // if the target format is storage based, then the output storage must be already created
713  if ( rMedium.IsStorage() )
714  {
715  // set MediaType on target storage
716  // (MediaType will be queried during SaveAs)
717  try
718  {
719  // TODO/MBA: testing
720  uno::Reference < beans::XPropertySet > xSet( rMedium.GetStorage(), uno::UNO_QUERY );
721  if ( xSet.is() )
722  xSet->setPropertyValue("MediaType", uno::makeAny( SotExchange::GetFormatMimeType( nSaveClipId ) ) );
723  }
724  catch (const uno::Exception&)
725  {
726  }
727  }
728 
729  // Now normally save the Document
730  bool bRet = SaveAs( rMedium );
731 
732  if( nMyType != nSaveType )
733  {
737  }
738 
739  return bRet;
740  }
741 
742  if( pFlt->GetUserData() == FILTER_TEXT_DLG &&
743  (m_pWrtShell || !::lcl_GetSourceView(this)))
744  {
745  SwAsciiOptions aOpt;
746  OUString sItemOpt;
747  const SfxItemSet* pSet = rMedium.GetItemSet();
748  if( nullptr != pSet )
749  {
750  const SfxPoolItem* pItem;
751  if( SfxItemState::SET == pSet->GetItemState( SID_FILE_FILTEROPTIONS,
752  true, &pItem ) )
753  sItemOpt = static_cast<const SfxStringItem*>(pItem)->GetValue();
754  }
755  if(!sItemOpt.isEmpty())
756  aOpt.ReadUserData( sItemOpt );
757 
758  xWriter->SetAsciiOptions( aOpt );
759  }
760 
761  // Suppress SfxProgress when we are Embedded
762  SW_MOD()->SetEmbeddedLoadSave(
763  SfxObjectCreateMode::EMBEDDED == GetCreateMode());
764 
765  // Span Context in order to suppress the Selection's View
766  ErrCode nErrno;
767  const OUString aFileName( rMedium.GetName() );
768 
769  // No View, so the whole Document!
771  {
772  SwWait aWait( *this, true );
773  // #i106906#
774  const bool bFormerLockView = m_pWrtShell->IsViewLocked();
775  m_pWrtShell->LockView( true );
777  m_pWrtShell->Push();
778  SwWriter aWrt( rMedium, *m_pWrtShell, true );
779  nErrno = aWrt.Write( xWriter, &aFileName );
780  //JP 16.05.97: In case the SFX revokes the View while saving
781  if (m_pWrtShell)
782  {
785  // #i106906#
786  m_pWrtShell->LockView( bFormerLockView );
787  }
788  }
789  else
790  {
791  // are we in SourceView?
792  SwSrcView* pSrcView = ::lcl_GetSourceView( this );
793  if( pSrcView )
794  {
795  pSrcView->SaveContentTo(rMedium);
796  nErrno = ERRCODE_NONE;
797  }
798  else
799  {
800  SwWriter aWrt( rMedium, *m_xDoc );
801  nErrno = aWrt.Write( xWriter, &aFileName );
802  }
803  }
804 
805  SW_MOD()->SetEmbeddedLoadSave( false );
806  SetError(nErrno ? nErrno : nVBWarning);
807  if( !rMedium.IsStorage() )
808  rMedium.CloseOutStream();
809 
810  return ! nErrno.IsError();
811 }
812 
813 // Hands off
814 // do not yet activate, must deliver TRUE
815 bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor )
816 {
817  bool bRet = SfxObjectShell::SaveCompleted( xStor );
818  if( bRet )
819  {
820  // Do not decide until here, whether Saving was successful or not
821  if( IsModified() )
822  m_xDoc->getIDocumentState().SetModified();
823  else
824  m_xDoc->getIDocumentState().ResetModified();
825  }
826 
827  if (m_pOLEChildList)
828  {
829  bool bResetModified = IsEnableSetModified();
830  if( bResetModified )
831  EnableSetModified( false );
832 
833  uno::Sequence < OUString > aNames = m_pOLEChildList->GetObjectNames();
834  for( sal_Int32 n = aNames.getLength(); n; n-- )
835  {
836  if (!m_pOLEChildList->MoveEmbeddedObject(aNames[n-1], GetEmbeddedObjectContainer()))
837  {
838  OSL_FAIL("Copying of objects didn't work!" );
839  }
840  }
841 
842  m_pOLEChildList.reset();
843  if( bResetModified )
845  }
846  return bRet;
847 }
848 
849 // Draw()-Override for OLE2 (Sfx)
850 void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
851  sal_uInt16 nAspect )
852 {
853  //fix #25341# Draw should not affect the Modified
854  bool bResetModified = IsEnableSetModified();
855  if ( bResetModified )
856  EnableSetModified( false );
857 
858  // When there is a JobSetup connected to the Document, we copy it to
859  // reconnect it after PrtOle2. We don't use an empty JobSetup because
860  // that would only lead to questionable results after expensive
861  // reformatting (Preview!)
862  std::unique_ptr<JobSetup> pOrig;
863  if ( !rSetup.GetPrinterName().isEmpty() && ASPECT_THUMBNAIL != nAspect )
864  {
865  const JobSetup* pCurrentJobSetup = m_xDoc->getIDocumentDeviceAccess().getJobsetup();
866  if( pCurrentJobSetup ) // then we copy that
867  pOrig.reset(new JobSetup( *pCurrentJobSetup ));
868  m_xDoc->getIDocumentDeviceAccess().setJobsetup( rSetup );
869  }
870 
871  tools::Rectangle aRect( nAspect == ASPECT_THUMBNAIL ?
872  GetVisArea( nAspect ) : GetVisArea( ASPECT_CONTENT ) );
873 
874  pDev->Push();
875  pDev->SetFillColor();
876  pDev->SetLineColor();
877  pDev->SetBackground();
878  const bool bWeb = dynamic_cast< const SwWebDocShell *>( this ) != nullptr;
879  SwPrintData aOpts;
880  SwViewShell::PrtOle2(m_xDoc.get(), SW_MOD()->GetUsrPref(bWeb), aOpts, *pDev, aRect);
881  pDev->Pop();
882 
883  if( pOrig )
884  {
885  m_xDoc->getIDocumentDeviceAccess().setJobsetup( *pOrig );
886  }
887  if ( bResetModified )
889 }
890 
892 {
893  tools::Rectangle aRect( rRect );
894  if (m_pView)
895  {
896  Size aSz( m_pView->GetDocSz() );
897  aSz.AdjustWidth(DOCUMENTBORDER ); aSz.AdjustHeight(DOCUMENTBORDER );
898  long nMoveX = 0, nMoveY = 0;
899  if ( aRect.Right() > aSz.Width() )
900  nMoveX = aSz.Width() - aRect.Right();
901  if ( aRect.Bottom() > aSz.Height() )
902  nMoveY = aSz.Height() - aRect.Bottom();
903  aRect.Move( nMoveX, nMoveY );
904  nMoveX = aRect.Left() < 0 ? -aRect.Left() : 0;
905  nMoveY = aRect.Top() < 0 ? -aRect.Top() : 0;
906  aRect.Move( nMoveX, nMoveY );
907 
908  // Calls SfxInPlaceObject::SetVisArea()!
909  m_pView->SetVisArea( aRect );
910  }
911  else
913 }
914 
915 tools::Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
916 {
917  if ( nAspect == ASPECT_THUMBNAIL )
918  {
919  // Preview: set VisArea to the first page.
920  SwNodeIndex aIdx( m_xDoc->GetNodes().GetEndOfExtras(), 1 );
921  SwContentNode* pNd = m_xDoc->GetNodes().GoNext( &aIdx );
922 
923  const SwRect aPageRect = pNd->FindPageFrameRect();
924  if (aPageRect.IsEmpty())
925  return tools::Rectangle();
926  tools::Rectangle aRect(aPageRect.SVRect());
927 
928  // tdf#81219 sanitize - nobody is interested in a thumbnail where's
929  // nothing visible
930  if (aRect.GetHeight() > 2*aRect.GetWidth())
931  aRect.SetSize(Size(aRect.GetWidth(), 2*aRect.GetWidth()));
932  else if (aRect.GetWidth() > 2*aRect.GetHeight())
933  aRect.SetSize(Size(2*aRect.GetHeight(), aRect.GetHeight()));
934 
935  return aRect;
936  }
937  return SfxObjectShell::GetVisArea( nAspect );
938 }
939 
941 {
942  return m_xDoc->getIDocumentDeviceAccess().getPrinter( false );
943 }
944 
946 {
947  return m_xDoc->getIDocumentDeviceAccess().getReferenceDevice( false );
948 }
949 
951 {
952  if ( pNewPrinter )
954  else
955  GetDoc()->getIDocumentDeviceAccess().setPrinter( nullptr, true, true );
956 }
957 
958 // #i20883# Digital Signatures and Encryption
960 {
961  // get global state like HiddenInformation::DOCUMENTVERSIONS
963 
964  if ( nStates & HiddenInformation::RECORDEDCHANGES )
965  {
966  if ( !GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().empty() )
967  nState |= HiddenInformation::RECORDEDCHANGES;
968  }
969  if ( nStates & HiddenInformation::NOTES )
970  {
971  OSL_ENSURE( GetWrtShell(), "No SwWrtShell, no information" );
972  if(GetWrtShell() && GetWrtShell()->GetFieldType(SwFieldIds::Postit, OUString())->HasHiddenInformationNotes())
973  nState |= HiddenInformation::NOTES;
974  }
975 
976  return nState;
977 }
978 
980 {
981  SfxWhichIter aIter(rSet);
982  sal_uInt16 nWhich = aIter.FirstWhich();
983 
984  while (nWhich)
985  {
986  switch (nWhich)
987  {
988  case SID_PRINTPREVIEW:
989  {
990  bool bDisable = IsInPlaceActive();
991  // Disable "multiple layout"
992  if ( !bDisable )
993  {
994  SfxViewFrame *pTmpFrame = SfxViewFrame::GetFirst(this);
995  while (pTmpFrame) // Look for Preview
996  {
997  if ( dynamic_cast<SwView*>( pTmpFrame->GetViewShell() ) &&
998  static_cast<SwView*>(pTmpFrame->GetViewShell())->GetWrtShell().GetViewOptions()->getBrowseMode() )
999  {
1000  bDisable = true;
1001  break;
1002  }
1003  pTmpFrame = SfxViewFrame::GetNext(*pTmpFrame, this);
1004  }
1005  }
1006  // End of disabled "multiple layout"
1007  if ( bDisable )
1008  rSet.DisableItem( SID_PRINTPREVIEW );
1009  else
1010  {
1011  SfxBoolItem aBool( SID_PRINTPREVIEW, false );
1012  if( dynamic_cast<SwPagePreview*>( SfxViewShell::Current()) )
1013  aBool.SetValue( true );
1014  rSet.Put( aBool );
1015  }
1016  }
1017  break;
1018  case SID_AUTO_CORRECT_DLG:
1020  rSet.DisableItem( SID_AUTO_CORRECT_DLG );
1021  break;
1022  case SID_SOURCEVIEW:
1023  {
1024  SfxViewShell* pCurrView = GetView() ? static_cast<SfxViewShell*>(GetView())
1026  bool bSourceView = dynamic_cast<SwSrcView*>( pCurrView ) != nullptr;
1027  rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView));
1028  }
1029  break;
1030  case SID_HTML_MODE:
1031  rSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this)));
1032  break;
1033 
1035  case FN_OUTLINE_TO_IMPRESS:
1036  {
1037  SvtModuleOptions aMOpt;
1038  if (!aMOpt.IsImpress() || GetObjectShell()->isExportLocked())
1039  rSet.DisableItem( nWhich );
1040  }
1041  [[fallthrough]];
1042  case FN_ABSTRACT_NEWDOC:
1044  {
1045  if ( GetDoc()->GetNodes().GetOutLineNds().empty() )
1046  rSet.DisableItem( nWhich );
1047  }
1048  break;
1049  case SID_BROWSER_MODE:
1050  case FN_PRINT_LAYOUT:
1051  {
1053  if(FN_PRINT_LAYOUT == nWhich)
1054  bState = !bState;
1055  rSet.Put( SfxBoolItem( nWhich, bState));
1056  }
1057  break;
1058 
1059  case FN_NEW_GLOBAL_DOC:
1060  if (dynamic_cast<const SwGlobalDocShell*>(this) != nullptr
1062  rSet.DisableItem( nWhich );
1063  break;
1064 
1065  case FN_NEW_HTML_DOC:
1066  if (dynamic_cast<const SwWebDocShell*>(this) != nullptr
1068  rSet.DisableItem( nWhich );
1069  break;
1070 
1071  case FN_OPEN_FILE:
1072  if( dynamic_cast< const SwWebDocShell *>( this ) != nullptr )
1073  rSet.DisableItem( nWhich );
1074  break;
1075 
1076  case SID_ATTR_YEAR2000:
1077  {
1078  const SvNumberFormatter* pFormatr = m_xDoc->GetNumberFormatter(false);
1079  rSet.Put( SfxUInt16Item( nWhich,
1080  static_cast< sal_uInt16 >(
1081  pFormatr ? pFormatr->GetYear2000()
1083  }
1084  break;
1085  case SID_ATTR_CHAR_FONTLIST:
1086  {
1087  rSet.Put( SvxFontListItem(m_pFontList.get(), SID_ATTR_CHAR_FONTLIST) );
1088  }
1089  break;
1090  case SID_MAIL_PREPAREEXPORT:
1091  {
1092  //check if linked content or possibly hidden content is available
1093  //m_xDoc->UpdateFields( NULL, false );
1094  sfx2::LinkManager& rLnkMgr = m_xDoc->getIDocumentLinksAdministration().GetLinkManager();
1095  const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
1096  bool bRet = false;
1097  if( !rLnks.empty() )
1098  bRet = true;
1099  else
1100  {
1101  //sections with hidden flag, hidden character attribute, hidden paragraph/text or conditional text fields
1102  bRet = m_xDoc->HasInvisibleContent();
1103  }
1104  rSet.Put( SfxBoolItem( nWhich, bRet ) );
1105  }
1106  break;
1107  case SID_NOTEBOOKBAR:
1108  {
1109  SfxViewShell* pViewShell = GetView()? GetView(): SfxViewShell::Current();
1111  "modules/swriter/ui/");
1112  rSet.Put( SfxBoolItem( SID_NOTEBOOKBAR, bVisible ) );
1113  }
1114  break;
1115  case FN_REDLINE_ACCEPT_ALL:
1116  case FN_REDLINE_REJECT_ALL:
1117  {
1118  if (GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().empty() ||
1119  HasChangeRecordProtection()) // tdf#128229 Disable Accept / Reject all if redlines are password protected
1120  rSet.DisableItem(nWhich);
1121  }
1122  break;
1123 
1124  default: OSL_ENSURE(false,"You cannot get here!");
1125 
1126  }
1127  nWhich = aIter.NextWhich();
1128  }
1129 }
1130 
1131 // OLE-Hdls
1132 IMPL_LINK( SwDocShell, Ole2ModifiedHdl, bool, bNewStatus, void )
1133 {
1134  if( IsEnableSetModified() )
1135  SetModified( bNewStatus );
1136 }
1137 
1138 // return Pool here, because virtual
1140 {
1141  return m_xBasePool.get();
1142 }
1143 
1145 {
1146  return m_pStyleManager.get();
1147 }
1148 
1150 {
1151  SetViewShell_Impl(pVw);
1152  m_pView = pVw;
1153  if (m_pView)
1154  {
1156 
1157  // Set view-specific redline author.
1158  const OUString& rRedlineAuthor = m_pView->GetRedlineAuthor();
1159  if (!rRedlineAuthor.isEmpty())
1160  SW_MOD()->SetRedlineAuthor(m_pView->GetRedlineAuthor());
1161  }
1162  else
1163  m_pWrtShell = nullptr;
1164 }
1165 
1166 // #i59688#
1167 // linked graphics are now loaded on demand.
1168 // Thus, loading of linked graphics no longer needed and necessary for
1169 // the load of document being finished.
1171 {
1172  // #i38810#
1173  // Original fix fails after integration of cws xmlsec11:
1174  // interface <SfxObjectShell::EnableSetModified(..)> no longer works, because
1175  // <SfxObjectShell::FinishedLoading(..)> doesn't care about its status and
1176  // enables the document modification again.
1177  // Thus, manual modify the document, if it's modified and its links are updated
1178  // before <FinishedLoading(..)> is called.
1179  const bool bHasDocToStayModified( m_xDoc->getIDocumentState().IsModified() && m_xDoc->getIDocumentLinksAdministration().LinksUpdated() );
1180 
1181  FinishedLoading();
1182  SfxViewFrame* pVFrame = SfxViewFrame::GetFirst(this);
1183  if(pVFrame)
1184  {
1185  SfxViewShell* pShell = pVFrame->GetViewShell();
1186  if(auto pSrcView = dynamic_cast<SwSrcView*>( pShell) )
1187  pSrcView->Load(this);
1188  }
1189 
1190  // #i38810#
1191  if ( bHasDocToStayModified && !m_xDoc->getIDocumentState().IsModified() )
1192  {
1193  m_xDoc->getIDocumentState().SetModified();
1194  }
1195 }
1196 
1197 // a Transfer is cancelled (is called from SFX)
1199 {
1200  // Cancel all links from LinkManager
1201  m_xDoc->getIDocumentLinksAdministration().GetLinkManager().CancelTransfers();
1203 }
1204 
1206 {
1207  return m_pWrtShell;
1208 }
1209 
1211 {
1212  return m_pWrtShell;
1213 }
1214 
1216 {
1217  SwIterator<SwContentNode,SwFormatColl> aIter( *m_xDoc->GetDfltGrfFormatColl() );
1218  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
1219  {
1220  SwOLENode* pOLENd = pNd->GetOLENode();
1221  if( pOLENd && ( pOLENd->IsOLEObjectDeleted() ||
1222  pOLENd->IsInGlobalDocSection() ) )
1223  {
1224  if (!m_pOLEChildList)
1226 
1227  OUString aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
1229  }
1230  }
1231 }
1232 
1233 // When a document is loaded, SwDoc::PrtOLENotify is called to update
1234 // the sizes of math objects. However, for objects that do not have a
1235 // SwFrame at this time, only a flag is set (bIsOLESizeInvalid) and the
1236 // size change takes place later, while calculating the layout in the
1237 // idle handler. If this document is saved now, it is saved with invalid
1238 // sizes. For this reason, the layout has to be calculated before a document is
1239 // saved, but of course only id there are OLE objects with bOLESizeInvalid set.
1241 {
1242  if (!m_pWrtShell)
1243  return;
1244 
1245  if (m_pView && m_pView->GetIPClient())
1246  {
1247  // We have an active OLE edit: allow link updates, so an up to date replacement graphic can
1248  // be created.
1250  rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
1251  }
1252 
1253  SwIterator<SwContentNode,SwFormatColl> aIter( *m_xDoc->GetDfltGrfFormatColl() );
1254  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
1255  {
1256  SwOLENode* pOLENd = pNd->GetOLENode();
1257  if( pOLENd && pOLENd->IsOLESizeInvalid() )
1258  {
1260  break;
1261  }
1262  }
1263 }
1264 
1265 // #i42634# Overwrites SfxObjectShell::UpdateLinks
1266 // This new function is necessary to trigger update of links in docs
1267 // read by the binary filter:
1269 {
1271  // #i50703# Update footnote numbers
1273  SwNodeIndex aTmp( GetDoc()->GetNodes() );
1274  GetDoc()->GetFootnoteIdxs().UpdateFootnote( aTmp );
1275 }
1276 
1277 uno::Reference< frame::XController >
1279 {
1280  css::uno::Reference< css::frame::XController > aRet;
1281  // #i82346# No view in page preview
1282  if ( GetView() )
1283  aRet = GetView()->GetController();
1284  return aRet;
1285 }
1286 
1287 static const char* s_EventNames[] =
1288 {
1289  "OnPageCountChange",
1290  "OnMailMerge",
1291  "OnMailMergeFinished",
1292  "OnFieldMerge",
1293  "OnFieldMergeFinished",
1294  "OnLayoutFinished"
1295 };
1296 sal_Int32 const s_nEvents(SAL_N_ELEMENTS(s_EventNames));
1297 
1299 {
1301  sal_Int32 nLen = aRet.getLength();
1302  aRet.realloc(nLen + 6);
1303  OUString* pNames = aRet.getArray();
1304  pNames[nLen++] = GetEventName(0);
1305  pNames[nLen++] = GetEventName(1);
1306  pNames[nLen++] = GetEventName(2);
1307  pNames[nLen++] = GetEventName(3);
1308  pNames[nLen++] = GetEventName(4);
1309  pNames[nLen] = GetEventName(5);
1310 
1311  return aRet;
1312 }
1313 
1314 OUString SwDocShell::GetEventName( sal_Int32 nIndex )
1315 {
1316  if (nIndex < s_nEvents)
1317  {
1318  return OUString::createFromAscii(s_EventNames[nIndex]);
1319  }
1320  return OUString();
1321 }
1322 
1323 const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const
1324 {
1325  return m_xDoc ? &m_xDoc->GetXmlIdRegistry() : nullptr;
1326 }
1327 
1329 {
1330  if (!m_pWrtShell)
1331  return false;
1332  return bool(m_pWrtShell->GetRedlineFlags() & RedlineFlags::On);
1333 }
1334 
1336 {
1337  if (!m_pWrtShell)
1338  return false;
1339  return m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
1340 }
1341 
1342 void SwDocShell::SetChangeRecording( bool bActivate )
1343 {
1344  RedlineFlags nOn = bActivate ? RedlineFlags::On : RedlineFlags::NONE;
1347 }
1348 
1349 void SwDocShell::SetProtectionPassword( const OUString &rNewPassword )
1350 {
1351  const SfxAllItemSet aSet( GetPool() );
1352  const SfxPoolItem* pItem = nullptr;
1353 
1355  Sequence< sal_Int8 > aPasswd = rIDRA.GetRedlinePassword();
1356  if (SfxItemState::SET == aSet.GetItemState(FN_REDLINE_PROTECT, false, &pItem)
1357  && static_cast<const SfxBoolItem*>(pItem)->GetValue() == aPasswd.hasElements())
1358  return;
1359 
1360  if (!rNewPassword.isEmpty())
1361  {
1362  // when password protection is applied change tracking must always be active
1363  SetChangeRecording( true );
1364 
1365  Sequence< sal_Int8 > aNewPasswd;
1366  SvPasswordHelper::GetHashPassword( aNewPasswd, rNewPassword );
1367  rIDRA.SetRedlinePassword( aNewPasswd );
1368  }
1369  else
1370  {
1371  rIDRA.SetRedlinePassword( Sequence< sal_Int8 >() );
1372  }
1373 }
1374 
1375 bool SwDocShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash )
1376 {
1377  bool bRes = false;
1378 
1379  const SfxAllItemSet aSet( GetPool() );
1380  const SfxPoolItem* pItem = nullptr;
1381 
1383  const Sequence< sal_Int8 >& aPasswdHash( rIDRA.GetRedlinePassword() );
1384  if (SfxItemState::SET == aSet.GetItemState(FN_REDLINE_PROTECT, false, &pItem)
1385  && static_cast<const SfxBoolItem*>(pItem)->GetValue() == aPasswdHash.hasElements())
1386  return false;
1387  rPasswordHash = aPasswdHash;
1388  bRes = true;
1389 
1390  return bRes;
1391 }
1392 
1393 void SwDocShell::RegisterAutomationDocumentEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller)
1394 {
1396 }
1397 
1398 void SwDocShell::CallAutomationDocumentEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments)
1399 {
1401  mxAutomationDocumentEventsCaller->CallSinks(Method, Arguments);
1402 }
1403 
1404 void SwDocShell::RegisterAutomationDocumentObject(css::uno::Reference< ooo::vba::word::XDocument > const& xDocument)
1405 {
1406  mxAutomationDocumentObject = xDocument;
1407 }
1408 
1409 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
SfxViewFrame * GetViewFrame() const
SFX_IMPL_SUPERCLASS_INTERFACE(DrawDocShell, SfxObjectShell)
bool is() const
void GetXMLWriter(const OUString &, const OUString &rBaseURL, WriterRef &xRet)
Definition: wrtxml.cxx:562
#define FN_ABSTRACT_NEWDOC
Definition: cmdid.h:436
#define FN_API_CALL
Definition: cmdid.h:550
const tools::SvRef< SotStorage > & getSotStorageRef() const
Definition: shellio.hxx:272
bool IsSkipImages() const
virtual void SetVisArea(const tools::Rectangle &rVisArea)
#define FN_REDLINE_ACCEPT_ALL
Definition: cmdid.h:143
virtual void OnDocumentPrinterChanged(Printer *pNewPrinter) override
Definition: docsh.cxx:950
URL aURL
bool IsStarBasic() const
virtual void SetModified(bool=true) override
Definition: docsh2.cxx:1378
#define FN_REDLINE_REJECT_ALL
Definition: cmdid.h:144
#define FN_NEW_GLOBAL_DOC
Definition: cmdid.h:61
bool bVisible
static const char * s_EventNames[]
Definition: docsh.cxx:1287
std::vector< SwViewShell * > m_aViewWasUnLocked
Definition: docsh.hxx:328
SwPaM * GetCursor(bool bMakeTableCursor=true) const
Return pointer to the current shell cursor.
Definition: crsrsh.cxx:189
virtual void SetChangeRecording(bool bActivate) override
Definition: docsh.cxx:1342
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
long AdjustWidth(long n)
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
void SetState(const SfxItemSet &rSet)
#define ERR_SWG_WRITE_ERROR
Definition: swerror.h:30
std::string GetValue
ErrCode SaveOrDelMSVBAStorage(SfxObjectShell &rDoc, SotStorage &rStor, bool bSaveInto, const OUString &rStorageName)
Definition: fltini.cxx:702
void UpdateFontList()
Definition: docshini.cxx:410
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:237
virtual SAL_DLLPRIVATE bool ConvertTo(SfxMedium &rMedium) override
Definition: docsh.cxx:579
sal_Int32 GetVersion() const
std::unique_ptr< comphelper::EmbeddedObjectContainer > m_pOLEChildList
Definition: docsh.hxx:86
ErrCode GetError() const
const OUString & GetName() const
LockAllViewsGuard_Impl(SwViewShell *pViewShell)
Definition: docsh.cxx:352
void StopQuickHelp()
Definition: edtwin.cxx:5981
bool IsStarBasicWarning() const
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1718
sal_Int64 n
css::uno::Reference< ooo::vba::XSinkCaller > mxAutomationDocumentEventsCaller
Definition: docsh.hxx:94
const JobSetup & GetJobSetup() const
IDocumentLinksAdministration const & getIDocumentLinksAdministration() const
Definition: doc.cxx:259
sal_uInt16 GetValue() const
static SVL_DLLPUBLIC void GetHashPassword(css::uno::Sequence< sal_Int8 > &rPassHash, const char *pPass, sal_uInt32 nLen)
static void PrtOle2(SwDoc *pDoc, const SwViewOption *pOpt, const SwPrintData &rOptions, vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
Definition: vprint.cxx:570
#define FN_ABSTRACT_STARIMPRESS
Definition: cmdid.h:437
sal_uInt16 FirstWhich()
virtual bool SaveCompleted(const css::uno::Reference< css::embed::XStorage > &xStorage)
virtual bool SaveAs(SfxMedium &rMedium)
virtual css::uno::Sequence< OUString > GetEventNames() override
Definition: docsh.cxx:1298
virtual std::unique_ptr< LockAllViewsGuard > LockAllViews() override
Definition: docsh.cxx:372
SwEditWin & GetEditWin()
Definition: view.hxx:401
const OUString & GetRedlineAuthor() const
Definition: viewprt.cxx:281
static void StoreEmbeddedDataSource(const css::uno::Reference< css::frame::XStorable > &xStorable, const css::uno::Reference< css::embed::XStorage > &xStorage, const OUString &rStreamRelPath, const OUString &rOwnURL, bool bCopyTo=false)
Definition: dbmgr.cxx:2920
void SetViewShell_Impl(SfxViewShell *pView)
ErrCode Write(WriterRef const &rxWriter, const OUString *=nullptr)
Definition: shellio.cxx:730
virtual const ::sfx2::IXmlIdRegistry * GetXmlIdRegistry() const override
Definition: docsh.cxx:1323
SwEditShell * GetEditShell()
Definition: docsh.cxx:1205
css::uno::Reference< css::frame::XModel > GetModel() const
Of course Writer needs its own rectangles.
Definition: swrect.hxx:35
void SetRedlineFlagsAndCheckInsMode(RedlineFlags eMode)
Definition: select.cxx:680
void LoadingFinished()
linked graphics are now loaded on demand.
Definition: docsh.cxx:1170
std::unique_ptr< sfx2::StyleManager > m_pStyleManager
Definition: docsh.hxx:76
void EndAllAction()
Definition: edws.cxx:97
virtual HiddenInformation GetHiddenInformationState(HiddenInformation nStates) override
#i20883# Digital Signatures and Encryption
Definition: docsh.cxx:959
virtual OutputDevice * GetDocumentRefDev() override
Definition: docsh.cxx:945
bool Commit()
sal_uInt16 NextWhich()
void SetVisArea(const tools::Rectangle &, bool bUpdateScrollbar=true)
Definition: viewport.cxx:195
SwWrtShell & GetWrtShell() const
Definition: view.hxx:398
virtual void UpdateLinks() override
#i42634# Overwrites SfxObjectShell::UpdateLinks This new function is necessary to trigger update of l...
Definition: docsh.cxx:1268
RedlineFlags GetRedlineFlags() const
For Redlining.
Definition: edredln.cxx:26
void Move(long nHorzMoveDelta, long nVertMoveDelta)
void FinishedLoading(SfxLoadedFlags nWhich=SfxLoadedFlags::ALL)
bool IsStorage()
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
void SetBackground()
long Right() const
void CallAutomationDocumentEventSinks(const OUString &Method, css::uno::Sequence< css::uno::Any > &Arguments)
Definition: docsh.cxx:1398
const SwView & GetView() const
Definition: wrtsh.hxx:428
virtual void CancelTransfers()
virtual bool Save()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
bool getBrowseMode() const
Definition: viewopt.hxx:454
Reader * GetReader(const OUString &rFltName)
Return reader based on the name.
Definition: fltini.cxx:170
SW_DLLPUBLIC void UpdateDataOnActiveSidebarWin()
Definition: PostItMgr.cxx:2325
virtual SAL_DLLPRIVATE bool SaveAs(SfxMedium &rMedium) override
Definition: docsh.cxx:378
static SfxViewShell * Current()
SvStream * GetOutStream()
#define FILTER_XMLVW
XML filter.
Definition: iodetect.hxx:37
long Top() const
SotClipboardFormatId
RedlineFlags on.
SfxObjectCreateMode GetCreateMode() const
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
Definition: viewsh.cxx:2591
virtual sfx2::StyleManager * GetStyleManager() override
Definition: docsh.cxx:1144
bool IsEmpty() const
Definition: swrect.hxx:292
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange)
Definition: unoobj2.cxx:952
const OUString & GetCurrentPersistName() const
Definition: ndole.hxx:69
SfxItemPool & GetPool() const
virtual void SetProtectionPassword(const OUString &rPassword) override
Definition: docsh.cxx:1349
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
Definition: docsh.hxx:44
static SvxHtmlOptions & Get()
#define SAL_N_ELEMENTS(arr)
css::uno::Sequence< css::beans::PropertyValue > GetArgs() const
bool IsModified() const
virtual void CancelTransfers() override
Cancel transfer (called from SFX).
Definition: docsh.cxx:1198
virtual void UpdateLinks()=0
#i42634# Moved common code of SwReader::Read() and SwDocShell::UpdateLinks() to new SwDoc::UpdateLink...
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
PaM is Point and Mark: a selection of the document model.
Definition: pam.hxx:136
ErrCode GetSaveWarningOfMSVBAStorage(SfxObjectShell &rDocS)
Definition: fltini.cxx:714
void SetLineColor()
void SetView(SwView *pVw)
Set View for actions via Shell.
Definition: docsh.cxx:1149
virtual SAL_DLLPRIVATE void Draw(OutputDevice *, const JobSetup &, sal_uInt16 nAspect) override
OLE-stuff.
Definition: docsh.cxx:850
static SvtFilterOptions & Get()
#define SW_MOD()
Definition: swmodule.hxx:255
void CloseOutStream()
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SvBaseLinks & GetLinks() const
void ReadUserData(const OUString &)
Definition: fltini.cxx:548
virtual css::uno::Sequence< OUString > GetEventNames()
bool EndAllTableBoxEdit()
Definition: trvltbl.cxx:915
void InitDrawModelAndDocShell(SwDocShell *pSwDocShell, SwDrawModel *pSwDrawDocument)
Definition: docshdrw.cxx:32
virtual SfxObjectShell * GetObjectShell() override
void Push()
store a copy of the current cursor on the cursor stack
Definition: crsrsh.cxx:2236
SAL_DLLPRIVATE void RemoveLink()
Definition: docshini.cxx:425
virtual Printer * GetDocumentPrinter() override
Definition: docsh.cxx:940
void SetSize(const Size &rSize)
SfxBindings & GetBindings()
sal_Int32 const s_nEvents(SAL_N_ELEMENTS(s_EventNames))
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:337
static SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
void SetFillColor()
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
Definition: docsh.cxx:1139
long Bottom() const
OUString GetBaseURL(bool bForSaving=false)
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:224
bool HasBasic() const
SfxItemSet * GetItemSet() const
virtual comphelper::EmbeddedObjectContainer & getEmbeddedObjectContainer() const override
Marks a node in the document model.
Definition: ndindex.hxx:31
void RegisterAutomationDocumentObject(css::uno::Reference< ooo::vba::word::XDocument > const &xDocument)
Definition: docsh.cxx:1404
virtual void setJobsetup(const JobSetup &rJobSetup)=0
Sets the Jobsetup.
static bool StateMethod(SfxBindings &rBindings, const OUString &rUIFile, bool bReloadNotebookbar=false)
rtl::Reference< SwDoc > m_xDoc
Document.
Definition: docsh.hxx:71
ring_container GetRingContainer()
Definition: ring.hxx:240
OUString SwResId(const char *pId)
Definition: swmodule.cxx:165
Reader * StartConvertFrom(SfxMedium &rMedium, SwReaderPtr &rpRdr, SwCursorShell const *pCursorSh=nullptr, SwPaM *pPaM=nullptr)
For inserting document.
Definition: docsh.cxx:137
std::unique_ptr< FontList > m_pFontList
Current Fontlist.
Definition: docsh.hxx:73
const tools::Rectangle & GetVisArea() const
virtual HiddenInformation GetHiddenInformationState(HiddenInformation nStates)
static OUString GetFormatMimeType(SotClipboardFormatId nFormat)
#define ASPECT_CONTENT
SAL_DLLPRIVATE void CalcLayoutForOLEObjects()
Definition: docsh.cxx:1240
const std::shared_ptr< const SfxFilter > & GetFilter() const
virtual void setPrinter(SfxPrinter *pP, bool bDeleteOld, bool bCallPrtDataChanged)=0
Set the printer at the document.
SfxViewShell * GetViewShell() const
#define FILTER_TEXT_DLG
text filter with encoding dialog
Definition: iodetect.hxx:34
void SetValue(bool const bTheValue)
Reader * ReadAscii
Definition: fltini.cxx:48
#define FILTER_WW8
WinWord 97 filter.
Definition: iodetect.hxx:33
static SwSrcView * lcl_GetSourceView(SwDocShell const *pSh)
Definition: docsh.cxx:571
#define FN_OPEN_FILE
Definition: cmdid.h:62
bool IsOLEObjectDeleted() const
Definition: ndole.cxx:501
SW_DLLPUBLIC bool HasActiveSidebarWin() const
Definition: PostItMgr.cxx:2306
sal_uInt16 GetYear2000() const
rtl::Reference< SfxStyleSheetBasePool > m_xBasePool
Passing through for formats.
Definition: docsh.hxx:72
bool IsError() const
bool IsImpress() const
float v
void UpdateFootnote(const SwNodeIndex &rStt)
Definition: ftnidx.cxx:60
static void SetUniqueSeqRefNo(SwDoc &rDoc)
Set a unique sequential reference number for every footnote in the document.
Definition: atrftn.cxx:555
const Size & GetDocSz() const
Definition: view.hxx:438
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
bool AllDrawObjsOnPage(SwDoc &p_rDoc)
method to check, if given Writer document contains only drawing objects, which are completely on its ...
Definition: docdraw.cxx:572
SvStream * GetInStream()
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:334
SfxInPlaceClient * GetIPClient() const
void SaveContentTo(SfxMedium &rMed)
Definition: srcview.cxx:224
OUString const & GetPrinterName() const
SFX_IMPL_OBJECTFACTORY(DrawDocShell, SvGlobalName(SO3_SIMPRESS_CLASSID),"simpress") void DrawDocShell
void DisableItem(sal_uInt16 nWhich)
tools::Rectangle SVRect() const
Definition: swrect.hxx:280
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
static bool IsHeadlessModeEnabled()
SwView * m_pView
For "historical reasons" nothing can be done without the WrtShell.
Definition: docsh.hxx:83
void RegisterAutomationDocumentEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const &xCaller)
Definition: docsh.cxx:1393
#define ERRCODE_NONE
unsigned char sal_uInt8
void LockView(bool b)
Definition: viewsh.hxx:463
const SwViewOption * GetViewOptions() const
Definition: viewsh.hxx:424
css::uno::Reference< css::frame::XController > GetController()
Definition: docsh.cxx:1278
#define FN_OUTLINE_TO_CLIPBOARD
Definition: cmdid.h:65
#define FILTER_XML
XML filter.
Definition: iodetect.hxx:35
bool IsInPlaceActive() const
virtual bool HasChangeRecordProtection() const override
Definition: docsh.cxx:1335
#define FN_PRINT_LAYOUT
Definition: cmdid.h:168
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:175
SwNodes & GetNodes()
Definition: doc.hxx:403
SwWrtShell * m_pWrtShell
Definition: docsh.hxx:84
void ValidateAllParagraphSignatures(bool updateDontRemove)
Validate all paragraph signatures.
Definition: edfcol.cxx:1846
#define WARN_SWG_HTML_NO_MACROS
Definition: swerror.h:41
bool IsLoadWordBasicStorage() const
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:621
const INetURLObject & GetURLObject() const
void setSotStorageRef(const tools::SvRef< SotStorage > &pStgRef)
Definition: shellio.hxx:273
virtual bool IsChangeRecording() const override
passwword protection for Writer (derived from SfxObjectShell) see also: FN_REDLINE_ON, FN_REDLINE_ON
Definition: docsh.cxx:1328
Reference< XComponentContext > getProcessComponentContext()
css::uno::Reference< css::embed::XStorage > GetOutputStorage()
virtual void SetVisArea(const tools::Rectangle &rRect) override
OLE-stuff.
Definition: docsh.cxx:891
long Left() const
virtual bool get(DocumentSettingId id) const =0
Return the specified document setting.
virtual SAL_DLLPRIVATE bool ConvertFrom(SfxMedium &rMedium) override
Definition: docsh.cxx:203
static OUString GetEventName(sal_Int32 nId)
Definition: docsh.cxx:1314
SwFEShell * GetFEShell()
For Core - it knows the DocShell but not the WrtShell!
Definition: docsh.cxx:1210
virtual void CalcLayout() override
To enable set up of StartActions and EndActions.
Definition: edws.cxx:108
bool IsEnableSetModified() const
bool IsOLESizeInvalid() const
Definition: ndole.hxx:133
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:628
virtual bool GetProtectionHash(css::uno::Sequence< sal_Int8 > &rPasswordHash) override
Definition: docsh.cxx:1375
void SetupStorage(const css::uno::Reference< css::embed::XStorage > &xStorage, sal_Int32 nVersion, bool bTemplate) const
sal_Int16 m_nUpdateDocMode
contains the css::document::UpdateDocMode
Definition: docsh.hxx:87
void GetWriter(const OUString &rFltName, const OUString &rBaseURL, WriterRef &xRet)
Return writer based on the name.
Definition: fltini.cxx:160
const SwView * GetView() const
Definition: docsh.hxx:220
SAL_DLLPRIVATE void AddLink()
Methods for access to doc.
Definition: docshini.cxx:391
void EnableSetModified(bool bEnable=true)
virtual SAL_DLLPRIVATE bool SaveCompleted(const css::uno::Reference< css::embed::XStorage > &xStorage) override
Definition: docsh.cxx:815
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword)=0
SAL_DLLPRIVATE void RemoveOLEObjects()
Definition: docsh.cxx:1215
#define FILTER_XMLV
XML filter.
Definition: iodetect.hxx:36
#define DOCUMENTBORDER
Definition: swtypes.hxx:82
void StartAllAction()
For all views of this document.
Definition: edws.cxx:86
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
void Push(PushFlags nFlags=PushFlags::ALL)
HiddenInformation
IMPL_LINK(SwDocShell, Ole2ModifiedHdl, bool, bNewStatus, void)
Definition: docsh.cxx:1132
void ClassifyDocPerHighestParagraphClass()
Ensure that the classification of the doc is never lower than the paragraph with the highest classifi...
Definition: edfcol.cxx:2125
sal_Int32 nState
bool isExportLocked()
bool MoveEmbeddedObject(const OUString &rName, EmbeddedObjectContainer &)
#define ASPECT_THUMBNAIL
void SetError(ErrCode rErr)
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, bool bMobile=false)
virtual bool Save() override
global IO.
Definition: docsh.cxx:265
bool IsViewLocked() const
Definition: viewsh.hxx:462
no RedlineFlags
#define FN_NEW_HTML_DOC
Definition: cmdid.h:67
Definition: view.hxx:144
static OUString encode(OUString const &rText, Part ePart, EncodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
#define FN_OUTLINE_TO_IMPRESS
Definition: cmdid.h:64
css::uno::Reference< css::script::XLibraryContainer > GetBasicContainer()
css::uno::Reference< css::frame::XController > GetController() const
css::uno::Reference< ooo::vba::word::XDocument > mxAutomationDocumentObject
Definition: docsh.hxx:95
void GetState(SfxItemSet &)
Definition: docsh.cxx:979
const OUString & getEmbeddedName() const
Definition: dbmgr.cxx:3241
bool IsInGlobalDocSection() const
Definition: ndole.cxx:467
SfxMedium * GetMedium() const