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