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