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 <osl/diagnose.h>
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 &&
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<SfxObjectShell::LockAllViewsGuard> SwDocShell::LockAllViews()
374 {
375  return std::make_unique<LockAllViewsGuard_Impl>(GetEditShell());
376 }
377 
378 // Save using the Defaultformat
380 {
381  SwWait aWait( *this, true );
382  //#i3370# remove quick help to prevent saving of autocorrection suggestions
383  if (m_pView)
385 
386  //#i91811# mod if we have an active margin window, write back the text
387  if (m_pView &&
388  m_pView->GetPostItMgr() &&
390  {
392  }
393 
394  if (m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::GLOBAL_DOCUMENT) &&
395  !m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::GLOBAL_DOCUMENT_SAVE_LINKS))
397 
398  if (GetMedium())
399  {
400  // Task 75666 - is the Document imported by our Microsoft-Filters?
401  std::shared_ptr<const SfxFilter> pOldFilter = GetMedium()->GetFilter();
402  if( pOldFilter &&
403  ( pOldFilter->GetUserData() == FILTER_WW8 ||
404  pOldFilter->GetUserData() == "CWW6" ||
405  pOldFilter->GetUserData() == "WW6" ) )
406  {
407  // when saving it in our own fileformat, then remove the template
408  // name from the docinfo.
409  uno::Reference<document::XDocumentPropertiesSupplier> xDPS(
410  GetModel(), uno::UNO_QUERY_THROW);
411  uno::Reference<document::XDocumentProperties> xDocProps
412  = xDPS->getDocumentProperties();
413  xDocProps->setTemplateName(OUString());
414  xDocProps->setTemplateURL(OUString());
415  xDocProps->setTemplateDate(::util::DateTime());
416  }
417  }
418 
419  CalcLayoutForOLEObjects(); // format for OLE objects
420 
421  const bool bURLChanged = GetMedium() && GetMedium()->GetURLObject() != rMedium.GetURLObject();
422  const SwDBManager* const pMgr = m_xDoc->GetDBManager();
423  const bool bHasEmbedded = pMgr && !pMgr->getEmbeddedName().isEmpty();
424  bool bSaveDS = bHasEmbedded && bURLChanged;
425  if (bSaveDS)
426  {
427  // Don't save data source in case a temporary is being saved for preview in MM wizard
428  if (const SfxBoolItem* pNoEmbDS
429  = SfxItemSet::GetItem(rMedium.GetItemSet(), SID_NO_EMBEDDED_DS, false))
430  bSaveDS = !pNoEmbDS->GetValue();
431  }
432  if (bSaveDS)
433  {
434  // We have an embedded data source definition, need to re-store it,
435  // otherwise relative references will break when the new file is in a
436  // different directory.
437 
438  OUString aURL(GetMedium()->GetURLObject().GetMainURL(INetURLObject::DecodeMechanism::NONE));
439  if (aURL.isEmpty())
440  {
441  // No old URL - is this a new document created from a template with embedded DS?
442  // Try to get the template URL to reconstruct the embedded data source URL
443  const css::beans::PropertyValues& rArgs = GetMedium()->GetArgs();
444  const auto aURLIter = std::find_if(rArgs.begin(), rArgs.end(),
445  [](const auto& v) { return v.Name == "URL"; });
446  if (aURLIter != rArgs.end())
447  aURLIter->Value >>= aURL;
448  }
449 
450  if (!aURL.isEmpty())
451  {
453  auto xUri = css::uri::UriReferenceFactory::create(xContext)->parse(aURL);
454  assert(xUri.is());
455  xUri = css::uri::VndSunStarPkgUrlReferenceFactory::create(xContext)
456  ->createVndSunStarPkgUrlReference(xUri);
457  assert(xUri.is());
458  aURL = xUri->getUriReference() + "/"
461 
462  bool bCopyTo = GetCreateMode() == SfxObjectCreateMode::EMBEDDED;
463  if (!bCopyTo)
464  {
465  if (const SfxBoolItem* pSaveToItem
466  = SfxItemSet::GetItem(rMedium.GetItemSet(), SID_SAVETO, false))
467  bCopyTo = pSaveToItem->GetValue();
468  }
469 
470  auto xDatabaseContext = sdb::DatabaseContext::create(xContext);
471  uno::Reference<sdb::XDocumentDataSource> xDataSource(xDatabaseContext->getByName(aURL),
472  uno::UNO_QUERY);
473  if (xDataSource)
474  {
475  uno::Reference<frame::XStorable> xStorable(xDataSource->getDatabaseDocument(),
476  uno::UNO_QUERY);
478  pMgr->getEmbeddedName(), rMedium.GetName(),
479  bCopyTo);
480  }
481  }
482  }
483 
484  // #i62875#
485  // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
486  if (m_pWrtShell &&
487  m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
489  {
490  m_xDoc->getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
491  }
492 
493  ErrCode nErr = ERR_SWG_WRITE_ERROR, nVBWarning = ERRCODE_NONE;
494  uno::Reference < embed::XStorage > xStor = rMedium.GetOutputStorage();
495  if( SfxObjectShell::SaveAs( rMedium ) )
496  {
497  if( GetDoc()->getIDocumentSettingAccess().get(DocumentSettingId::GLOBAL_DOCUMENT) && dynamic_cast< const SwGlobalDocShell *>( this ) == nullptr )
498  {
499  // The document is closed explicitly, but using SfxObjectShellLock is still more correct here
500  SfxObjectShellLock xDocSh =
501  new SwGlobalDocShell( SfxObjectCreateMode::INTERNAL );
502  // the global document can not be a template
503  xDocSh->SetupStorage( xStor, SotStorage::GetVersion( xStor ), false );
504  xDocSh->DoClose();
505  }
506 
507  if (m_xDoc->ContainsMSVBasic())
508  {
510  nVBWarning = GetSaveWarningOfMSVBAStorage( static_cast<SfxObjectShell&>(*this) );
511  m_xDoc->SetContainsMSVBasic( false );
512  }
513 
514  if (m_pWrtShell)
515  {
516  // End TableBox Edit!
518 
519  // Remove invalid signatures.
521 
523  }
524 
525  // Remember and preserve Modified-Flag without calling the Link
526  // (for OLE; after Statement from MM)
527  const bool bIsModified = m_xDoc->getIDocumentState().IsModified();
528  m_xDoc->GetIDocumentUndoRedo().LockUndoNoModifiedPosition();
529  Link<bool,void> aOldOLELnk( m_xDoc->GetOle2Link() );
530  m_xDoc->SetOle2Link( Link<bool,void>() );
531 
532  // Suppress SfxProgress when we are Embedded
533  SW_MOD()->SetEmbeddedLoadSave(
534  SfxObjectCreateMode::EMBEDDED == GetCreateMode() );
535 
536  WriterRef xWrt;
537  ::GetXMLWriter(OUString(), rMedium.GetBaseURL(true), xWrt);
538 
539  bool bLockedView(false);
540  if (m_pWrtShell)
541  {
542  bLockedView = m_pWrtShell->IsViewLocked();
543  m_pWrtShell->LockView( true ); //lock visible section
544  }
545 
546  SwWriter aWrt( rMedium, *m_xDoc );
547  nErr = aWrt.Write( xWrt );
548 
549  if (m_pWrtShell)
550  m_pWrtShell->LockView( bLockedView );
551 
552  if( bIsModified )
553  {
554  m_xDoc->getIDocumentState().SetModified();
555  m_xDoc->GetIDocumentUndoRedo().UnLockUndoNoModifiedPosition();
556  }
557  m_xDoc->SetOle2Link( aOldOLELnk );
558 
559  SW_MOD()->SetEmbeddedLoadSave( false );
560 
561  // Increase RSID
562  m_xDoc->setRsid( m_xDoc->getRsid() );
563 
564  m_xDoc->cleanupUnoCursorTable();
565  }
566  SetError(nErr ? nErr : nVBWarning);
567 
568  return !nErr.IsError();
569 }
570 
571 // Save all Formats
572 static SwSrcView* lcl_GetSourceView( SwDocShell const * pSh )
573 {
574  // are we in SourceView?
575  SfxViewFrame* pVFrame = SfxViewFrame::GetFirst( pSh );
576  SfxViewShell* pViewShell = pVFrame ? pVFrame->GetViewShell() : nullptr;
577  return dynamic_cast<SwSrcView*>( pViewShell );
578 }
579 
581 {
582  std::shared_ptr<const SfxFilter> pFlt = rMedium.GetFilter();
583  if( !pFlt )
584  return false;
585 
586  WriterRef xWriter;
587  SwReaderWriter::GetWriter( pFlt->GetUserData(), rMedium.GetBaseURL( true ), xWriter );
588  if( !xWriter.is() )
589  { // Filter not available
590  std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(nullptr,
591  VclMessageType::Info, VclButtonsType::Ok,
592  SwResId(STR_DLLNOTFOUND)));
593  xInfoBox->run();
594  return false;
595  }
596 
597  //#i3370# remove quick help to prevent saving of autocorrection suggestions
598  if (m_pView)
600 
601  //#i91811# mod if we have an active margin window, write back the text
602  if (m_pView &&
603  m_pView->GetPostItMgr() &&
605  {
607  }
608 
609  ErrCode nVBWarning = ERRCODE_NONE;
610 
611  if (m_xDoc->ContainsMSVBasic())
612  {
613  bool bSave = pFlt->GetUserData() == "CWW8"
615 
616  if ( bSave )
617  {
618  tools::SvRef<SotStorage> xStg = new SotStorage( rMedium.GetOutStream(), false );
619  OSL_ENSURE( !xStg->GetError(), "No storage available for storing VBA macros!" );
620  if ( !xStg->GetError() )
621  {
622  nVBWarning = SaveOrDelMSVBAStorage( static_cast<SfxObjectShell&>(*this), *xStg, bSave, "Macros" );
623  xStg->Commit();
624  m_xDoc->SetContainsMSVBasic( true );
625  }
626  }
627  }
628 
629  // End TableBox Edit!
630  if (m_pWrtShell)
632 
633  if( pFlt->GetUserData() == "HTML" )
634  {
635 #if HAVE_FEATURE_SCRIPTING
636  SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
637  if( !rHtmlOpt.IsStarBasic() && rHtmlOpt.IsStarBasicWarning() && HasBasic() )
638  {
639  uno::Reference< XLibraryContainer > xLibCont = GetBasicContainer();
640  uno::Reference< XNameAccess > xLib;
641  const Sequence<OUString> aNames = xLibCont->getElementNames();
642  for(const OUString& rName : aNames)
643  {
644  Any aLib = xLibCont->getByName(rName);
645  aLib >>= xLib;
646  if(xLib.is())
647  {
648  Sequence<OUString> aModNames = xLib->getElementNames();
649  if(aModNames.hasElements())
650  {
652  break;
653  }
654  }
655  }
656  }
657 #endif
658  }
659 
660  // #i76360# Update document statistics
661  if ( !rMedium.IsSkipImages() )
662  m_xDoc->getIDocumentStatistics().UpdateDocStat( false, true );
663 
664  CalcLayoutForOLEObjects(); // format for OLE objects
665  // #i62875#
666  // reset compatibility flag <DoNotCaptureDrawObjsOnPage>, if possible
667  if (m_pWrtShell &&
668  m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE) &&
670  {
671  m_xDoc->getIDocumentSettingAccess().set(DocumentSettingId::DO_NOT_CAPTURE_DRAW_OBJS_ON_PAGE, false);
672  }
673 
674  if( xWriter->IsStgWriter() &&
675  ( pFlt->GetUserData() == FILTER_XML ||
676  pFlt->GetUserData() == FILTER_XMLV ||
677  pFlt->GetUserData() == FILTER_XMLVW ) )
678  {
679  // determine the own Type
680  sal_uInt8 nMyType = 0;
681  if( dynamic_cast< const SwWebDocShell *>( this ) != nullptr )
682  nMyType = 1;
683  else if( dynamic_cast< const SwGlobalDocShell *>( this ) != nullptr )
684  nMyType = 2;
685 
686  // determine the desired Type
687  sal_uInt8 nSaveType = 0;
688  SotClipboardFormatId nSaveClipId = pFlt->GetFormat();
689  if( SotClipboardFormatId::STARWRITERWEB_8 == nSaveClipId ||
690  SotClipboardFormatId::STARWRITERWEB_60 == nSaveClipId ||
691  SotClipboardFormatId::STARWRITERWEB_50 == nSaveClipId ||
692  SotClipboardFormatId::STARWRITERWEB_40 == nSaveClipId )
693  nSaveType = 1;
694  else if( SotClipboardFormatId::STARWRITERGLOB_8 == nSaveClipId ||
695  SotClipboardFormatId::STARWRITERGLOB_8_TEMPLATE == nSaveClipId ||
696  SotClipboardFormatId::STARWRITERGLOB_60 == nSaveClipId ||
697  SotClipboardFormatId::STARWRITERGLOB_50 == nSaveClipId ||
698  SotClipboardFormatId::STARWRITERGLOB_40 == nSaveClipId )
699  nSaveType = 2;
700 
701  // Change Flags of the Document accordingly
705  if( nMyType != nSaveType )
706  {
709  if( 2 != nSaveType )
711  }
712 
713  // if the target format is storage based, then the output storage must be already created
714  if ( rMedium.IsStorage() )
715  {
716  // set MediaType on target storage
717  // (MediaType will be queried during SaveAs)
718  try
719  {
720  // TODO/MBA: testing
721  uno::Reference < beans::XPropertySet > xSet( rMedium.GetStorage(), uno::UNO_QUERY );
722  if ( xSet.is() )
723  xSet->setPropertyValue("MediaType", uno::makeAny( SotExchange::GetFormatMimeType( nSaveClipId ) ) );
724  }
725  catch (const uno::Exception&)
726  {
727  }
728  }
729 
730  // Now normally save the Document
731  bool bRet = SaveAs( rMedium );
732 
733  if( nMyType != nSaveType )
734  {
738  }
739 
740  return bRet;
741  }
742 
743  if( pFlt->GetUserData() == FILTER_TEXT_DLG &&
744  (m_pWrtShell || !::lcl_GetSourceView(this)))
745  {
746  SwAsciiOptions aOpt;
747  OUString sItemOpt;
748  const SfxItemSet* pSet = rMedium.GetItemSet();
749  if( nullptr != pSet )
750  {
751  const SfxPoolItem* pItem;
752  if( SfxItemState::SET == pSet->GetItemState( SID_FILE_FILTEROPTIONS,
753  true, &pItem ) )
754  sItemOpt = static_cast<const SfxStringItem*>(pItem)->GetValue();
755  }
756  if(!sItemOpt.isEmpty())
757  aOpt.ReadUserData( sItemOpt );
758 
759  xWriter->SetAsciiOptions( aOpt );
760  }
761 
762  // Suppress SfxProgress when we are Embedded
763  SW_MOD()->SetEmbeddedLoadSave(
764  SfxObjectCreateMode::EMBEDDED == GetCreateMode());
765 
766  // Span Context in order to suppress the Selection's View
767  ErrCode nErrno;
768  const OUString aFileName( rMedium.GetName() );
769 
770  // No View, so the whole Document!
772  {
773  SwWait aWait( *this, true );
774  // #i106906#
775  const bool bFormerLockView = m_pWrtShell->IsViewLocked();
776  m_pWrtShell->LockView( true );
778  m_pWrtShell->Push();
779  SwWriter aWrt( rMedium, *m_pWrtShell, true );
780  nErrno = aWrt.Write( xWriter, &aFileName );
781  //JP 16.05.97: In case the SFX revokes the View while saving
782  if (m_pWrtShell)
783  {
786  // #i106906#
787  m_pWrtShell->LockView( bFormerLockView );
788  }
789  }
790  else
791  {
792  // are we in SourceView?
793  SwSrcView* pSrcView = ::lcl_GetSourceView( this );
794  if( pSrcView )
795  {
796  pSrcView->SaveContentTo(rMedium);
797  nErrno = ERRCODE_NONE;
798  }
799  else
800  {
801  SwWriter aWrt( rMedium, *m_xDoc );
802  nErrno = aWrt.Write( xWriter, &aFileName );
803  }
804  }
805 
806  SW_MOD()->SetEmbeddedLoadSave( false );
807  SetError(nErrno ? nErrno : nVBWarning);
808  if( !rMedium.IsStorage() )
809  rMedium.CloseOutStream();
810 
811  return ! nErrno.IsError();
812 }
813 
814 // Hands off
815 // do not yet activate, must deliver TRUE
816 bool SwDocShell::SaveCompleted( const uno::Reference < embed::XStorage >& xStor )
817 {
818  bool bRet = SfxObjectShell::SaveCompleted( xStor );
819  if( bRet )
820  {
821  // Do not decide until here, whether Saving was successful or not
822  if( IsModified() )
823  m_xDoc->getIDocumentState().SetModified();
824  else
825  m_xDoc->getIDocumentState().ResetModified();
826  }
827 
828  if (m_pOLEChildList)
829  {
830  bool bResetModified = IsEnableSetModified();
831  if( bResetModified )
832  EnableSetModified( false );
833 
834  uno::Sequence < OUString > aNames = m_pOLEChildList->GetObjectNames();
835  for( sal_Int32 n = aNames.getLength(); n; n-- )
836  {
837  if (!m_pOLEChildList->MoveEmbeddedObject(aNames[n-1], GetEmbeddedObjectContainer()))
838  {
839  OSL_FAIL("Copying of objects didn't work!" );
840  }
841  }
842 
843  m_pOLEChildList.reset();
844  if( bResetModified )
846  }
847  return bRet;
848 }
849 
850 // Draw()-Override for OLE2 (Sfx)
851 void SwDocShell::Draw( OutputDevice* pDev, const JobSetup& rSetup,
852  sal_uInt16 nAspect )
853 {
854  //fix #25341# Draw should not affect the Modified
855  bool bResetModified = IsEnableSetModified();
856  if ( bResetModified )
857  EnableSetModified( false );
858 
859  // When there is a JobSetup connected to the Document, we copy it to
860  // reconnect it after PrtOle2. We don't use an empty JobSetup because
861  // that would only lead to questionable results after expensive
862  // reformatting (Preview!)
863  std::unique_ptr<JobSetup> pOrig;
864  if ( !rSetup.GetPrinterName().isEmpty() && ASPECT_THUMBNAIL != nAspect )
865  {
866  const JobSetup* pCurrentJobSetup = m_xDoc->getIDocumentDeviceAccess().getJobsetup();
867  if( pCurrentJobSetup ) // then we copy that
868  pOrig.reset(new JobSetup( *pCurrentJobSetup ));
869  m_xDoc->getIDocumentDeviceAccess().setJobsetup( rSetup );
870  }
871 
872  tools::Rectangle aRect( nAspect == ASPECT_THUMBNAIL ?
873  GetVisArea( nAspect ) : GetVisArea( ASPECT_CONTENT ) );
874 
875  pDev->Push();
876  pDev->SetFillColor();
877  pDev->SetLineColor();
878  pDev->SetBackground();
879  const bool bWeb = dynamic_cast< const SwWebDocShell *>( this ) != nullptr;
880  SwPrintData aOpts;
881  SwViewShell::PrtOle2(m_xDoc.get(), SW_MOD()->GetUsrPref(bWeb), aOpts, *pDev, aRect);
882  pDev->Pop();
883 
884  if( pOrig )
885  {
886  m_xDoc->getIDocumentDeviceAccess().setJobsetup( *pOrig );
887  }
888  if ( bResetModified )
890 }
891 
893 {
894  tools::Rectangle aRect( rRect );
895  if (m_pView)
896  {
897  Size aSz( m_pView->GetDocSz() );
898  aSz.AdjustWidth(DOCUMENTBORDER ); aSz.AdjustHeight(DOCUMENTBORDER );
899  tools::Long nMoveX = 0, nMoveY = 0;
900  if ( aRect.Right() > aSz.Width() )
901  nMoveX = aSz.Width() - aRect.Right();
902  if ( aRect.Bottom() > aSz.Height() )
903  nMoveY = aSz.Height() - aRect.Bottom();
904  aRect.Move( nMoveX, nMoveY );
905  nMoveX = aRect.Left() < 0 ? -aRect.Left() : 0;
906  nMoveY = aRect.Top() < 0 ? -aRect.Top() : 0;
907  aRect.Move( nMoveX, nMoveY );
908 
909  // Calls SfxInPlaceObject::SetVisArea()!
910  m_pView->SetVisArea( aRect );
911  }
912  else
914 }
915 
916 tools::Rectangle SwDocShell::GetVisArea( sal_uInt16 nAspect ) const
917 {
918  if ( nAspect == ASPECT_THUMBNAIL )
919  {
920  // Preview: set VisArea to the first page.
921  SwNodeIndex aIdx( m_xDoc->GetNodes().GetEndOfExtras(), 1 );
922  SwContentNode* pNd = m_xDoc->GetNodes().GoNext( &aIdx );
923 
924  const SwRect aPageRect = pNd->FindPageFrameRect();
925  if (aPageRect.IsEmpty())
926  return tools::Rectangle();
927  tools::Rectangle aRect(aPageRect.SVRect());
928 
929  // tdf#81219 sanitize - nobody is interested in a thumbnail where's
930  // nothing visible
931  if (aRect.GetHeight() > 2*aRect.GetWidth())
932  aRect.SetSize(Size(aRect.GetWidth(), 2*aRect.GetWidth()));
933  else if (aRect.GetWidth() > 2*aRect.GetHeight())
934  aRect.SetSize(Size(2*aRect.GetHeight(), aRect.GetHeight()));
935 
936  return aRect;
937  }
938  return SfxObjectShell::GetVisArea( nAspect );
939 }
940 
942 {
943  return m_xDoc->getIDocumentDeviceAccess().getPrinter( false );
944 }
945 
947 {
948  return m_xDoc->getIDocumentDeviceAccess().getReferenceDevice( false );
949 }
950 
952 {
953  if ( pNewPrinter )
955  else
956  GetDoc()->getIDocumentDeviceAccess().setPrinter( nullptr, true, true );
957 }
958 
959 // #i20883# Digital Signatures and Encryption
961 {
962  // get global state like HiddenInformation::DOCUMENTVERSIONS
964 
965  if ( nStates & HiddenInformation::RECORDEDCHANGES )
966  {
967  if ( !GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().empty() )
968  nState |= HiddenInformation::RECORDEDCHANGES;
969  }
970  if ( nStates & HiddenInformation::NOTES )
971  {
972  OSL_ENSURE( GetWrtShell(), "No SwWrtShell, no information" );
973  if(GetWrtShell() && GetWrtShell()->GetFieldType(SwFieldIds::Postit, OUString())->HasHiddenInformationNotes())
974  nState |= HiddenInformation::NOTES;
975  }
976 
977  return nState;
978 }
979 
981 {
982  SfxWhichIter aIter(rSet);
983  sal_uInt16 nWhich = aIter.FirstWhich();
984 
985  while (nWhich)
986  {
987  switch (nWhich)
988  {
989  case SID_PRINTPREVIEW:
990  {
991  bool bDisable = IsInPlaceActive();
992  // Disable "multiple layout"
993  if ( !bDisable )
994  {
995  SfxViewFrame *pTmpFrame = SfxViewFrame::GetFirst(this);
996  while (pTmpFrame) // Look for Preview
997  {
998  if ( auto pSwView = dynamic_cast<SwView*>( pTmpFrame->GetViewShell() ) )
999  if (pSwView->GetWrtShell().GetViewOptions()->getBrowseMode())
1000  {
1001  bDisable = true;
1002  break;
1003  }
1004  pTmpFrame = SfxViewFrame::GetNext(*pTmpFrame, this);
1005  }
1006  }
1007  // End of disabled "multiple layout"
1008  if ( bDisable )
1009  rSet.DisableItem( SID_PRINTPREVIEW );
1010  else
1011  {
1012  SfxBoolItem aBool( SID_PRINTPREVIEW, false );
1013  if( dynamic_cast<SwPagePreview*>( SfxViewShell::Current()) )
1014  aBool.SetValue( true );
1015  rSet.Put( aBool );
1016  }
1017  }
1018  break;
1019  case SID_AUTO_CORRECT_DLG:
1021  rSet.DisableItem( SID_AUTO_CORRECT_DLG );
1022  break;
1023  case SID_SOURCEVIEW:
1024  {
1025  SfxViewShell* pCurrView = GetView() ? static_cast<SfxViewShell*>(GetView())
1027  bool bSourceView = dynamic_cast<SwSrcView*>( pCurrView ) != nullptr;
1028  rSet.Put(SfxBoolItem(SID_SOURCEVIEW, bSourceView));
1029  }
1030  break;
1031  case SID_HTML_MODE:
1032  rSet.Put(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this)));
1033  break;
1034 
1036  case FN_OUTLINE_TO_IMPRESS:
1037  {
1038  SvtModuleOptions aMOpt;
1039  if (!aMOpt.IsImpress() || GetObjectShell()->isExportLocked())
1040  rSet.DisableItem( nWhich );
1041  }
1042  [[fallthrough]];
1043  case FN_ABSTRACT_NEWDOC:
1045  {
1046  if ( GetDoc()->GetNodes().GetOutLineNds().empty() )
1047  rSet.DisableItem( nWhich );
1048  }
1049  break;
1050  case SID_BROWSER_MODE:
1051  case FN_PRINT_LAYOUT:
1052  {
1054  if(FN_PRINT_LAYOUT == nWhich)
1055  bState = !bState;
1056  rSet.Put( SfxBoolItem( nWhich, bState));
1057  }
1058  break;
1059 
1060  case FN_NEW_GLOBAL_DOC:
1061  if (dynamic_cast<const SwGlobalDocShell*>(this) != nullptr
1063  rSet.DisableItem( nWhich );
1064  break;
1065 
1066  case FN_NEW_HTML_DOC:
1067  if (dynamic_cast<const SwWebDocShell*>(this) != nullptr
1069  rSet.DisableItem( nWhich );
1070  break;
1071 
1072  case FN_OPEN_FILE:
1073  if( dynamic_cast< const SwWebDocShell *>( this ) != nullptr )
1074  rSet.DisableItem( nWhich );
1075  break;
1076 
1077  case SID_ATTR_YEAR2000:
1078  {
1079  const SvNumberFormatter* pFormatr = m_xDoc->GetNumberFormatter(false);
1080  rSet.Put( SfxUInt16Item( nWhich,
1081  static_cast< sal_uInt16 >(
1082  pFormatr ? pFormatr->GetYear2000()
1084  }
1085  break;
1086  case SID_ATTR_CHAR_FONTLIST:
1087  {
1088  rSet.Put( SvxFontListItem(m_pFontList.get(), SID_ATTR_CHAR_FONTLIST) );
1089  }
1090  break;
1091  case SID_MAIL_PREPAREEXPORT:
1092  {
1093  //check if linked content or possibly hidden content is available
1094  //m_xDoc->UpdateFields( NULL, false );
1095  sfx2::LinkManager& rLnkMgr = m_xDoc->getIDocumentLinksAdministration().GetLinkManager();
1096  const ::sfx2::SvBaseLinks& rLnks = rLnkMgr.GetLinks();
1097  bool bRet = false;
1098  if( !rLnks.empty() )
1099  bRet = true;
1100  else
1101  {
1102  //sections with hidden flag, hidden character attribute, hidden paragraph/text or conditional text fields
1103  bRet = m_xDoc->HasInvisibleContent();
1104  }
1105  rSet.Put( SfxBoolItem( nWhich, bRet ) );
1106  }
1107  break;
1108  case SID_NOTEBOOKBAR:
1109  {
1110  SfxViewShell* pViewShell = GetView()? GetView(): SfxViewShell::Current();
1112  u"modules/swriter/ui/");
1113  rSet.Put( SfxBoolItem( SID_NOTEBOOKBAR, bVisible ) );
1114  }
1115  break;
1116  case FN_REDLINE_ACCEPT_ALL:
1117  case FN_REDLINE_REJECT_ALL:
1118  {
1119  if (GetDoc()->getIDocumentRedlineAccess().GetRedlineTable().empty() ||
1120  HasChangeRecordProtection()) // tdf#128229 Disable Accept / Reject all if redlines are password protected
1121  rSet.DisableItem(nWhich);
1122  }
1123  break;
1124 
1125  default: OSL_ENSURE(false,"You cannot get here!");
1126 
1127  }
1128  nWhich = aIter.NextWhich();
1129  }
1130 }
1131 
1132 // OLE-Hdls
1133 IMPL_LINK( SwDocShell, Ole2ModifiedHdl, bool, bNewStatus, void )
1134 {
1135  if( IsEnableSetModified() )
1136  SetModified( bNewStatus );
1137 }
1138 
1139 // return Pool here, because virtual
1141 {
1142  return m_xBasePool.get();
1143 }
1144 
1146 {
1147  return m_pStyleManager.get();
1148 }
1149 
1151 {
1152  SetViewShell_Impl(pVw);
1153  m_pView = pVw;
1154  if (m_pView)
1155  {
1157 
1158  // Set view-specific redline author.
1159  const OUString& rRedlineAuthor = m_pView->GetRedlineAuthor();
1160  if (!rRedlineAuthor.isEmpty())
1161  SW_MOD()->SetRedlineAuthor(m_pView->GetRedlineAuthor());
1162  }
1163  else
1164  m_pWrtShell = nullptr;
1165 }
1166 
1167 // #i59688#
1168 // linked graphics are now loaded on demand.
1169 // Thus, loading of linked graphics no longer needed and necessary for
1170 // the load of document being finished.
1172 {
1173  // #i38810#
1174  // Original fix fails after integration of cws xmlsec11:
1175  // interface <SfxObjectShell::EnableSetModified(..)> no longer works, because
1176  // <SfxObjectShell::FinishedLoading(..)> doesn't care about its status and
1177  // enables the document modification again.
1178  // Thus, manual modify the document, if it's modified and its links are updated
1179  // before <FinishedLoading(..)> is called.
1180  const bool bHasDocToStayModified( m_xDoc->getIDocumentState().IsModified() && m_xDoc->getIDocumentLinksAdministration().LinksUpdated() );
1181 
1182  FinishedLoading();
1183  SfxViewFrame* pVFrame = SfxViewFrame::GetFirst(this);
1184  if(pVFrame)
1185  {
1186  SfxViewShell* pShell = pVFrame->GetViewShell();
1187  if(auto pSrcView = dynamic_cast<SwSrcView*>( pShell) )
1188  pSrcView->Load(this);
1189  }
1190 
1191  // #i38810#
1192  if ( bHasDocToStayModified && !m_xDoc->getIDocumentState().IsModified() )
1193  {
1194  m_xDoc->getIDocumentState().SetModified();
1195  }
1196 }
1197 
1198 // a Transfer is cancelled (is called from SFX)
1200 {
1201  // Cancel all links from LinkManager
1202  m_xDoc->getIDocumentLinksAdministration().GetLinkManager().CancelTransfers();
1204 }
1205 
1207 {
1208  return m_pWrtShell;
1209 }
1210 
1212 {
1213  return m_pWrtShell;
1214 }
1215 
1217 {
1218  SwIterator<SwContentNode,SwFormatColl> aIter( *m_xDoc->GetDfltGrfFormatColl() );
1219  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
1220  {
1221  SwOLENode* pOLENd = pNd->GetOLENode();
1222  if( pOLENd && ( pOLENd->IsOLEObjectDeleted() ||
1223  pOLENd->IsInGlobalDocSection() ) )
1224  {
1225  if (!m_pOLEChildList)
1227 
1228  OUString aObjName = pOLENd->GetOLEObj().GetCurrentPersistName();
1230  }
1231  }
1232 }
1233 
1234 // When a document is loaded, SwDoc::PrtOLENotify is called to update
1235 // the sizes of math objects. However, for objects that do not have a
1236 // SwFrame at this time, only a flag is set (bIsOLESizeInvalid) and the
1237 // size change takes place later, while calculating the layout in the
1238 // idle handler. If this document is saved now, it is saved with invalid
1239 // sizes. For this reason, the layout has to be calculated before a document is
1240 // saved, but of course only id there are OLE objects with bOLESizeInvalid set.
1242 {
1243  if (!m_pWrtShell)
1244  return;
1245 
1246  if (m_pView && m_pView->GetIPClient())
1247  {
1248  // We have an active OLE edit: allow link updates, so an up to date replacement graphic can
1249  // be created.
1251  rEmbeddedObjectContainer.setUserAllowsLinkUpdate(true);
1252  }
1253 
1254  SwIterator<SwContentNode,SwFormatColl> aIter( *m_xDoc->GetDfltGrfFormatColl() );
1255  for( SwContentNode* pNd = aIter.First(); pNd; pNd = aIter.Next() )
1256  {
1257  SwOLENode* pOLENd = pNd->GetOLENode();
1258  if( pOLENd && pOLENd->IsOLESizeInvalid() )
1259  {
1261  break;
1262  }
1263  }
1264 }
1265 
1266 // #i42634# Overwrites SfxObjectShell::UpdateLinks
1267 // This new function is necessary to trigger update of links in docs
1268 // read by the binary filter:
1270 {
1272  // #i50703# Update footnote numbers
1274  SwNodeIndex aTmp( GetDoc()->GetNodes() );
1275  GetDoc()->GetFootnoteIdxs().UpdateFootnote( aTmp );
1276 }
1277 
1278 uno::Reference< frame::XController >
1280 {
1281  css::uno::Reference< css::frame::XController > aRet;
1282  // #i82346# No view in page preview
1283  if ( GetView() )
1284  aRet = GetView()->GetController();
1285  return aRet;
1286 }
1287 
1288 static const char* s_EventNames[] =
1289 {
1290  "OnPageCountChange",
1291  "OnMailMerge",
1292  "OnMailMergeFinished",
1293  "OnFieldMerge",
1294  "OnFieldMergeFinished",
1295  "OnLayoutFinished"
1296 };
1297 sal_Int32 const s_nEvents(SAL_N_ELEMENTS(s_EventNames));
1298 
1300 {
1302  sal_Int32 nLen = aRet.getLength();
1303  aRet.realloc(nLen + 6);
1304  OUString* pNames = aRet.getArray();
1305  pNames[nLen++] = GetEventName(0);
1306  pNames[nLen++] = GetEventName(1);
1307  pNames[nLen++] = GetEventName(2);
1308  pNames[nLen++] = GetEventName(3);
1309  pNames[nLen++] = GetEventName(4);
1310  pNames[nLen] = GetEventName(5);
1311 
1312  return aRet;
1313 }
1314 
1315 OUString SwDocShell::GetEventName( sal_Int32 nIndex )
1316 {
1317  if (nIndex < s_nEvents)
1318  {
1319  return OUString::createFromAscii(s_EventNames[nIndex]);
1320  }
1321  return OUString();
1322 }
1323 
1324 const ::sfx2::IXmlIdRegistry* SwDocShell::GetXmlIdRegistry() const
1325 {
1326  return m_xDoc ? &m_xDoc->GetXmlIdRegistry() : nullptr;
1327 }
1328 
1330 {
1331  if (!m_pWrtShell)
1332  return false;
1333  return bool(m_pWrtShell->GetRedlineFlags() & RedlineFlags::On);
1334 }
1335 
1337 {
1338  if (!m_pWrtShell)
1339  return false;
1340  return m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().hasElements();
1341 }
1342 
1343 void SwDocShell::SetChangeRecording( bool bActivate, bool bLockAllViews )
1344 {
1345  RedlineFlags nOn = bActivate ? RedlineFlags::On : RedlineFlags::NONE;
1347  if (bLockAllViews)
1348  {
1349  // tdf#107870: prevent jumping to cursor
1350  auto aViewGuard(LockAllViews());
1352  }
1353  else
1354  {
1356  }
1357 }
1358 
1359 void SwDocShell::SetProtectionPassword( const OUString &rNewPassword )
1360 {
1361  const SfxAllItemSet aSet( GetPool() );
1362  const SfxPoolItem* pItem = nullptr;
1363 
1365  Sequence< sal_Int8 > aPasswd = rIDRA.GetRedlinePassword();
1366  if (SfxItemState::SET == aSet.GetItemState(FN_REDLINE_PROTECT, false, &pItem)
1367  && static_cast<const SfxBoolItem*>(pItem)->GetValue() == aPasswd.hasElements())
1368  return;
1369 
1370  if (!rNewPassword.isEmpty())
1371  {
1372  // when password protection is applied change tracking must always be active
1373  SetChangeRecording( true );
1374 
1375  Sequence< sal_Int8 > aNewPasswd;
1376  SvPasswordHelper::GetHashPassword( aNewPasswd, rNewPassword );
1377  rIDRA.SetRedlinePassword( aNewPasswd );
1378  }
1379  else
1380  {
1381  rIDRA.SetRedlinePassword( Sequence< sal_Int8 >() );
1382  }
1383 }
1384 
1385 bool SwDocShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > &rPasswordHash )
1386 {
1387  bool bRes = false;
1388 
1389  const SfxAllItemSet aSet( GetPool() );
1390  const SfxPoolItem* pItem = nullptr;
1391 
1393  const Sequence< sal_Int8 >& aPasswdHash( rIDRA.GetRedlinePassword() );
1394  if (SfxItemState::SET == aSet.GetItemState(FN_REDLINE_PROTECT, false, &pItem)
1395  && static_cast<const SfxBoolItem*>(pItem)->GetValue() == aPasswdHash.hasElements())
1396  return false;
1397  rPasswordHash = aPasswdHash;
1398  bRes = true;
1399 
1400  return bRes;
1401 }
1402 
1403 void SwDocShell::RegisterAutomationDocumentEventsCaller(css::uno::Reference< ooo::vba::XSinkCaller > const& xCaller)
1404 {
1406 }
1407 
1408 void SwDocShell::CallAutomationDocumentEventSinks(const OUString& Method, css::uno::Sequence< css::uno::Any >& Arguments)
1409 {
1411  mxAutomationDocumentEventsCaller->CallSinks(Method, Arguments);
1412 }
1413 
1414 void SwDocShell::RegisterAutomationDocumentObject(css::uno::Reference< ooo::vba::word::XDocument > const& xDocument)
1415 {
1416  mxAutomationDocumentObject = xDocument;
1417 }
1418 
1419 /* 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
#define FN_ABSTRACT_NEWDOC
Definition: cmdid.h:437
#define FN_API_CALL
Definition: cmdid.h:551
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:951
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:1288
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:194
SwOLENode * GetOLENode()
Inline methods from Node.hxx.
Definition: ndole.hxx:161
virtual const css::uno::Sequence< sal_Int8 > & GetRedlinePassword() const =0
const SwOLEObj & GetOLEObj() const
Definition: ndole.hxx:112
virtual void SetChangeRecording(bool bActivate, bool bLockAllViews=false) override
Definition: docsh.cxx:1343
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:701
void UpdateFontList()
Definition: docshini.cxx:410
IDocumentDeviceAccess const & getIDocumentDeviceAccess() const
Definition: doc.cxx:238
virtual SAL_DLLPRIVATE bool ConvertTo(SfxMedium &rMedium) override
Definition: docsh.cxx:580
sal_Int32 GetVersion() const
std::unique_ptr< comphelper::EmbeddedObjectContainer > m_pOLEChildList
Definition: docsh.hxx:86
ErrCode GetError() const
const OUString & GetName() const
long Long
LockAllViewsGuard_Impl(SwViewShell *pViewShell)
Definition: docsh.cxx:353
void StopQuickHelp()
Definition: edtwin.cxx:6015
bool IsStarBasicWarning() const
bool Pop(SwCursorShell::PopMode=SwCursorShell::PopMode::DeleteStack)
Definition: wrtsh1.cxx:1715
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:260
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:571
#define FN_ABSTRACT_STARIMPRESS
Definition: cmdid.h:438
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:1299
virtual std::unique_ptr< LockAllViewsGuard > LockAllViews() override
Definition: docsh.cxx:373
SwEditWin & GetEditWin()
Definition: view.hxx:416
const OUString & GetRedlineAuthor() const
Definition: viewprt.cxx:282
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:2839
void SetViewShell_Impl(SfxViewShell *pView)
ErrCode Write(WriterRef const &rxWriter, const OUString *=nullptr)
Definition: shellio.cxx:731
virtual const ::sfx2::IXmlIdRegistry * GetXmlIdRegistry() const override
Definition: docsh.cxx:1324
SwEditShell * GetEditShell()
Definition: docsh.cxx:1206
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:681
void LoadingFinished()
linked graphics are now loaded on demand.
Definition: docsh.cxx:1171
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:960
virtual OutputDevice * GetDocumentRefDev() override
Definition: docsh.cxx:946
bool Commit()
sal_uInt16 NextWhich()
void SetVisArea(const tools::Rectangle &, bool bUpdateScrollbar=true)
Definition: viewport.cxx:196
SwWrtShell & GetWrtShell() const
Definition: view.hxx:413
virtual void UpdateLinks() override
#i42634# Overwrites SfxObjectShell::UpdateLinks This new function is necessary to trigger update of l...
Definition: docsh.cxx:1269
RedlineFlags GetRedlineFlags() const
For Redlining.
Definition: edredln.cxx:27
void FinishedLoading(SfxLoadedFlags nWhich=SfxLoadedFlags::ALL)
bool IsStorage()
virtual void set(DocumentSettingId id, bool value)=0
Set the specified document setting.
void SetBackground()
void CallAutomationDocumentEventSinks(const OUString &Method, css::uno::Sequence< css::uno::Any > &Arguments)
Definition: docsh.cxx:1408
const SwView & GetView() const
Definition: wrtsh.hxx:429
virtual void CancelTransfers()
tools::Long Left() const
virtual bool Save()
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
Reader * GetReader(const OUString &rFltName)
Return reader based on the name.
Definition: fltini.cxx:169
SW_DLLPUBLIC void UpdateDataOnActiveSidebarWin()
Definition: PostItMgr.cxx:2371
virtual SAL_DLLPRIVATE bool SaveAs(SfxMedium &rMedium) override
Definition: docsh.cxx:379
tools::Long Bottom() const
static SfxViewShell * Current()
SvStream * GetOutStream()
#define FILTER_XMLVW
XML filter.
Definition: iodetect.hxx:37
SotClipboardFormatId
RedlineFlags on.
SfxObjectCreateMode GetCreateMode() const
const IDocumentRedlineAccess & getIDocumentRedlineAccess() const
Provides access to the document redline interface.
Definition: viewsh.cxx:2668
virtual sfx2::StyleManager * GetStyleManager() override
Definition: docsh.cxx:1145
bool IsEmpty() const
Definition: swrect.hxx:292
const OUString & GetCurrentPersistName() const
Definition: ndole.hxx:69
SfxItemPool & GetPool() const
virtual void SetProtectionPassword(const OUString &rPassword) override
Definition: docsh.cxx:1359
std::unique_ptr< SwReader, o3tl::default_delete< SwReader > > SwReaderPtr
Definition: docsh.hxx:44
static SvxHtmlOptions & Get()
#define SAL_N_ELEMENTS(arr)
bool IsModified() const
virtual void CancelTransfers() override
Cancel transfer (called from SFX).
Definition: docsh.cxx:1199
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:713
void SetLineColor()
void SetView(SwView *pVw)
Set View for actions via Shell.
Definition: docsh.cxx:1150
virtual SAL_DLLPRIVATE void Draw(OutputDevice *, const JobSetup &, sal_uInt16 nAspect) override
OLE-stuff.
Definition: docsh.cxx:851
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:547
virtual css::uno::Sequence< OUString > GetEventNames()
bool EndAllTableBoxEdit()
Definition: trvltbl.cxx:916
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:2237
SAL_DLLPRIVATE void RemoveLink()
Definition: docshini.cxx:425
virtual Printer * GetDocumentPrinter() override
Definition: docsh.cxx:941
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:354
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:1140
float u
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:1414
virtual void setJobsetup(const JobSetup &rJobSetup)=0
Sets the Jobsetup.
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:166
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
tools::Long Top() const
virtual HiddenInformation GetHiddenInformationState(HiddenInformation nStates)
const css::uno::Sequence< css::beans::PropertyValue > & GetArgs() const
static OUString GetFormatMimeType(SotClipboardFormatId nFormat)
#define ASPECT_CONTENT
SAL_DLLPRIVATE void CalcLayoutForOLEObjects()
Definition: docsh.cxx:1241
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:46
bool XTextRangeToSwPaM(SwUnoInternalPaM &rToFill, const uno::Reference< text::XTextRange > &xTextRange,::sw::TextRangeMode const eMode)
Definition: unoobj2.cxx:1096
#define FILTER_WW8
WinWord 97 filter.
Definition: iodetect.hxx:33
static SwSrcView * lcl_GetSourceView(SwDocShell const *pSh)
Definition: docsh.cxx:572
#define FN_OPEN_FILE
Definition: cmdid.h:62
bool IsOLEObjectDeleted() const
Definition: ndole.cxx:503
SW_DLLPUBLIC bool HasActiveSidebarWin() const
Definition: PostItMgr.cxx:2352
sal_uInt16 GetYear2000() const
rtl::Reference< SfxStyleSheetBasePool > m_xBasePool
Passing through for formats.
Definition: docsh.hxx:72
bool isExportLocked() const
static bool StateMethod(SfxBindings &rBindings, std::u16string_view rUIFile, bool bReloadNotebookbar=false)
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:559
const Size & GetDocSz() const
Definition: view.hxx:453
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:574
SvStream * GetInStream()
comphelper::EmbeddedObjectContainer & GetEmbeddedObjectContainer() const
IDocumentRedlineAccess const & getIDocumentRedlineAccess() const
Definition: doc.cxx:335
SfxInPlaceClient * GetIPClient() const
void SaveContentTo(SfxMedium &rMed)
Definition: srcview.cxx:223
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:1403
#define ERRCODE_NONE
unsigned char sal_uInt8
void LockView(bool b)
Definition: viewsh.hxx:462
css::uno::Reference< css::frame::XController > GetController()
Definition: docsh.cxx:1279
#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:1336
#define FN_PRINT_LAYOUT
Definition: cmdid.h:166
IDocumentSettingAccess const & getIDocumentSettingAccess() const
Definition: doc.cxx:176
SwNodes & GetNodes()
Definition: doc.hxx:408
tools::Long AdjustWidth(tools::Long n)
SwWrtShell * m_pWrtShell
Definition: docsh.hxx:84
void ValidateAllParagraphSignatures(bool updateDontRemove)
Validate all paragraph signatures.
Definition: edfcol.cxx:1854
#define WARN_SWG_HTML_NO_MACROS
Definition: swerror.h:41
bool IsLoadWordBasicStorage() const
SwPostItMgr * GetPostItMgr()
Definition: view.hxx:642
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:1329
void GetXMLWriter([[maybe_unused]] const OUString &, const OUString &rBaseURL, WriterRef &xRet)
Definition: wrtxml.cxx:569
Reference< XComponentContext > getProcessComponentContext()
css::uno::Reference< css::embed::XStorage > GetOutputStorage()
virtual void SetVisArea(const tools::Rectangle &rRect) override
OLE-stuff.
Definition: docsh.cxx:892
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:1315
SwFEShell * GetFEShell()
For Core - it knows the DocShell but not the WrtShell!
Definition: docsh.cxx:1211
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
void Move(tools::Long nHorzMoveDelta, tools::Long nVertMoveDelta)
static SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
SwFootnoteIdxs & GetFootnoteIdxs()
Definition: doc.hxx:633
virtual bool GetProtectionHash(css::uno::Sequence< sal_Int8 > &rPasswordHash) override
Definition: docsh.cxx:1385
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:159
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:816
virtual void SetRedlinePassword(const css::uno::Sequence< sal_Int8 > &rNewPassword)=0
SAL_DLLPRIVATE void RemoveOLEObjects()
Definition: docsh.cxx:1216
#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:1133
void ClassifyDocPerHighestParagraphClass()
Ensure that the classification of the doc is never lower than the paragraph with the highest classifi...
Definition: edfcol.cxx:2135
sal_Int32 nState
bool MoveEmbeddedObject(const OUString &rName, EmbeddedObjectContainer &)
#define ASPECT_THUMBNAIL
void SetError(ErrCode rErr)
tools::Long Right() const
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:266
bool IsViewLocked() const
Definition: viewsh.hxx:461
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:980
const OUString & getEmbeddedName() const
Definition: dbmgr.cxx:3160
bool IsInGlobalDocSection() const
Definition: ndole.cxx:469
SfxMedium * GetMedium() const