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