LibreOffice Module sfx2 (master) 1
objxtor.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#include <config_fuzzers.h>
22
23#include <map>
24
27
28#include <com/sun/star/util/XCloseable.hpp>
29#include <com/sun/star/frame/XComponentLoader.hpp>
30#include <com/sun/star/frame/Desktop.hpp>
31#include <com/sun/star/util/XCloseListener.hpp>
32#include <com/sun/star/beans/XPropertySet.hpp>
33#include <com/sun/star/frame/XTitle.hpp>
34#include <osl/file.hxx>
35#include <sal/log.hxx>
36#include <vcl/weld.hxx>
37#include <vcl/svapp.hxx>
38#include <svl/eitem.hxx>
39#include <basic/sbstar.hxx>
40#include <svl/stritem.hxx>
42#include <unotools/eventcfg.hxx>
43
44#include <sfx2/objsh.hxx>
47
50
51#include <com/sun/star/document/XStorageBasedDocument.hpp>
52#include <com/sun/star/script/DocumentDialogLibraryContainer.hpp>
53#include <com/sun/star/script/DocumentScriptLibraryContainer.hpp>
54#include <com/sun/star/document/XEmbeddedScripts.hpp>
55#include <com/sun/star/document/XScriptInvocationContext.hpp>
56#include <com/sun/star/ucb/ContentCreationException.hpp>
57#include <com/sun/star/lang/XMultiServiceFactory.hpp>
58
61#include <tools/globname.hxx>
62#include <tools/debug.hxx>
63
64#include <sfx2/app.hxx>
65#include <sfx2/bindings.hxx>
66#include <sfx2/docfile.hxx>
67#include <sfx2/event.hxx>
68#include <sfx2/viewsh.hxx>
69#include <sfx2/viewfrm.hxx>
70#include <sfx2/sfxresid.hxx>
71#include <objshimp.hxx>
72#include <sfx2/strings.hrc>
73#include <sfx2/sfxsids.hrc>
74#include <basic/basmgr.hxx>
76#include <appbaslib.hxx>
77#include <sfx2/sfxbasemodel.hxx>
78#include <sfx2/sfxuno.hxx>
80#include <sfx2/infobar.hxx>
81
83
84using namespace ::com::sun::star;
85using namespace ::com::sun::star::uno;
86using namespace ::com::sun::star::script;
87using namespace ::com::sun::star::frame;
88using namespace ::com::sun::star::document;
89
90using ::basic::BasicManagerRepository;
91
92namespace {
93
94WeakReference< XInterface > theCurrentComponent;
95
96#if HAVE_FEATURE_SCRIPTING
97
98// remember all registered components for VBA compatibility, to be able to remove them on disposing the model
99typedef ::std::map< XInterface*, OUString > VBAConstantNameMap;
100VBAConstantNameMap s_aRegisteredVBAConstants;
101
102OUString lclGetVBAGlobalConstName( const Reference< XInterface >& rxComponent )
103{
104 OSL_ENSURE( rxComponent.is(), "lclGetVBAGlobalConstName - missing component" );
105
106 VBAConstantNameMap::iterator aIt = s_aRegisteredVBAConstants.find( rxComponent.get() );
107 if( aIt != s_aRegisteredVBAConstants.end() )
108 return aIt->second;
109
110 uno::Reference< beans::XPropertySet > xProps( rxComponent, uno::UNO_QUERY );
111 if( xProps.is() ) try
112 {
113 OUString aConstName;
114 xProps->getPropertyValue("VBAGlobalConstantName") >>= aConstName;
115 return aConstName;
116 }
117 catch (const uno::Exception&) // not supported
118 {
119 }
120 return OUString();
121}
122
123#endif
124
125class SfxModelListener_Impl : public ::cppu::WeakImplHelper< css::util::XCloseListener >
126{
127 SfxObjectShell* mpDoc;
128public:
129 explicit SfxModelListener_Impl( SfxObjectShell* pDoc ) : mpDoc(pDoc) {};
130 virtual void SAL_CALL queryClosing( const css::lang::EventObject& aEvent, sal_Bool bDeliverOwnership ) override ;
131 virtual void SAL_CALL notifyClosing( const css::lang::EventObject& aEvent ) override ;
132 virtual void SAL_CALL disposing( const css::lang::EventObject& aEvent ) override ;
133
134};
135
136} // namespace
137
138void SAL_CALL SfxModelListener_Impl::queryClosing( const css::lang::EventObject& , sal_Bool )
139{
140}
141
142void SAL_CALL SfxModelListener_Impl::notifyClosing( const css::lang::EventObject& )
143{
144 SolarMutexGuard aSolarGuard;
145 mpDoc->Broadcast( SfxHint(SfxHintId::Deinitializing) );
146}
147
148void SAL_CALL SfxModelListener_Impl::disposing( const css::lang::EventObject& _rEvent )
149{
150 // am I ThisComponent in AppBasic?
151 SolarMutexGuard aSolarGuard;
152 if ( SfxObjectShell::GetCurrentComponent() == _rEvent.Source )
153 {
154 // remove ThisComponent reference from AppBasic
155 SfxObjectShell::SetCurrentComponent( Reference< XInterface >() );
156 }
157
158#if HAVE_FEATURE_SCRIPTING
159 /* Remove VBA component from AppBasic. As every application registers its
160 own current component, the disposed component may not be the "current
161 component" of the SfxObjectShell. */
162 if ( _rEvent.Source.is() )
163 {
164 VBAConstantNameMap::iterator aIt = s_aRegisteredVBAConstants.find( _rEvent.Source.get() );
165 if ( aIt != s_aRegisteredVBAConstants.end() )
166 {
168 pAppMgr->SetGlobalUNOConstant( aIt->second, Any( Reference< XInterface >() ) );
169 s_aRegisteredVBAConstants.erase( aIt );
170 }
171 }
172#endif
173
174 if ( !mpDoc->Get_Impl()->bClosing )
175 // GCC crashes when already in the destructor, so first query the Flag
176 mpDoc->DoClose();
177}
178
179
181 :rDocShell( _rDocShell )
182 ,aMacroMode( *this )
183 ,pProgress( nullptr)
184 ,nTime( DateTime::SYSTEM )
185 ,nVisualDocumentNumber( USHRT_MAX)
186 ,nDocumentSignatureState( SignatureState::UNKNOWN )
187 ,nScriptingSignatureState( SignatureState::UNKNOWN )
188 ,bClosing( false)
189 ,bIsSaving( false)
190 ,bIsNamedVisible( false)
191 ,bIsAbortingImport ( false)
192 ,bInPrepareClose( false )
193 ,bPreparedForClose( false )
194 ,bForbidReload( false )
195 ,bBasicInitialized( false )
196 ,bIsPrintJobCancelable( true )
197 ,bOwnsStorage( true )
198 ,bInitialized( false )
199 ,bModelInitialized( false )
200 ,bPreserveVersions( true )
201 ,m_bMacroSignBroken( false )
202 ,m_bNoBasicCapabilities( false )
203 ,m_bDocRecoverySupport( true )
204 ,bQueryLoadTemplate( true )
205 ,bLoadReadonly( false )
206 ,bUseUserData( true )
207 ,bUseThumbnailSave( true )
208 ,bSaveVersionOnClose( false )
209 ,m_bSharedXMLFlag( false )
210 ,m_bAllowShareControlFileClean( true )
211 ,m_bConfigOptionsChecked( false )
212 ,m_bMacroCallsSeenWhileLoading( false )
213 ,lErr(ERRCODE_NONE)
214 ,nEventId ( SfxEventHintId::NONE )
215 ,nLoadedFlags ( SfxLoadedFlags::ALL )
216 ,nFlagsInProgress( SfxLoadedFlags::NONE )
217 ,bModalMode( false )
218 ,bRunningMacro( false )
219 ,bReadOnlyUI( false )
220 ,nStyleFilter( 0 )
221 ,m_bEnableSetModified( true )
222 ,m_bIsModified( false )
223 ,m_nMapUnit( MapUnit::Map100thMM )
224 ,m_bCreateTempStor( false )
225 ,m_bIsInit( false )
226 ,m_bIncomplEncrWarnShown( false )
227 ,m_nModifyPasswordHash( 0 )
228 ,m_bModifyPasswordEntered( false )
229 ,m_bSavingForSigning( false )
230 ,m_bAllowModifiedBackAfterSigning( false )
231{
232 SfxObjectShell* pDoc = &_rDocShell;
233 std::vector<SfxObjectShell*> &rArr = SfxGetpApp()->GetObjectShells_Impl();
234 rArr.push_back( pDoc );
235}
236
237
239{
240}
241
242
244 : pImpl(new SfxObjectShell_Impl(*this))
245 , pMedium(nullptr)
246 , eCreateMode(SfxObjectCreateMode::STANDARD)
247 , bHasName(false)
248 , bIsInGenerateThumbnail (false)
249 , mbAvoidRecentDocs(false)
250 , bRememberSignature(false)
251{
252 if (i_nCreationFlags & SfxModelFlags::EMBEDDED_OBJECT)
254 else if (i_nCreationFlags & SfxModelFlags::EXTERNAL_LINK)
256
257 const bool bScriptSupport = ( i_nCreationFlags & SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS ) == SfxModelFlags::NONE;
258 if ( !bScriptSupport )
259 pImpl->m_bNoBasicCapabilities = true;
260
261 const bool bDocRecovery = ( i_nCreationFlags & SfxModelFlags::DISABLE_DOCUMENT_RECOVERY ) == SfxModelFlags::NONE;
262 if ( !bDocRecovery )
263 pImpl->m_bDocRecoverySupport = false;
264}
265
274 : pImpl(new SfxObjectShell_Impl(*this))
275 , pMedium(nullptr)
276 , eCreateMode(eMode)
277 , bHasName(false)
278 , bIsInGenerateThumbnail(false)
279 , mbAvoidRecentDocs(false)
280 , bRememberSignature(false)
281{
282}
283
285{
286
287 if ( IsEnableSetModified() )
288 EnableSetModified( false );
289
291 pImpl->pBaseModel.set( nullptr );
292
293 pImpl->pReloadTimer.reset();
294
295 SfxApplication *pSfxApp = SfxGetpApp();
296 if ( USHRT_MAX != pImpl->nVisualDocumentNumber && pSfxApp )
297 pSfxApp->ReleaseIndex(pImpl->nVisualDocumentNumber);
298
299 // Destroy Basic-Manager
300 pImpl->aBasicManager.reset(nullptr);
301
302 if ( pSfxApp && pSfxApp->GetDdeService() )
303 pSfxApp->RemoveDdeTopic( this );
304
305 pImpl->pBaseModel.set( nullptr );
306
307 // don't call GetStorage() here, in case of Load Failure it's possible that a storage was never assigned!
308 if ( pMedium && pMedium->HasStorage_Impl() && pMedium->GetStorage( false ) == pImpl->m_xDocStorage )
310
311 if ( pImpl->mxObjectContainer )
312 {
313 pImpl->mxObjectContainer->CloseEmbeddedObjects();
314 pImpl->mxObjectContainer.reset();
315 }
316
317 if ( pImpl->bOwnsStorage && pImpl->m_xDocStorage.is() )
318 pImpl->m_xDocStorage->dispose();
319
320 if ( pMedium )
321 {
323
324#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
325 if (IsDocShared())
327#endif
328 delete pMedium;
329 pMedium = nullptr;
330 }
331
332 // The removing of the temporary file must be done as the latest step in the document destruction
333 if ( !pImpl->aTempName.isEmpty() )
334 {
335 OUString aTmp;
336 osl::FileBase::getFileURLFromSystemPath( pImpl->aTempName, aTmp );
337 ::utl::UCBContentHelper::Kill( aTmp );
338 }
339}
340
341
343{
344 pImpl->bIsPrintJobCancelable = bState;
345}
346
347
349{
350 return pImpl->bIsPrintJobCancelable;
351}
352
353
354// closes the Object and all its views
355
357{
358 SfxObjectShellRef xKeepAlive(this);
359 return CloseInternal();
360}
361
362// variant that does not take a reference to itself, so we can call it during object destruction
364{
365 if ( !pImpl->bClosing )
366 {
367 // Do not close if a progress is still running
368 if ( GetProgress() )
369 return false;
370
371 pImpl->bClosing = true;
372 Reference< util::XCloseable > xCloseable( GetBaseModel(), UNO_QUERY );
373
374 if ( xCloseable.is() )
375 {
376 try
377 {
378 xCloseable->close( true );
379 }
380 catch (const Exception&)
381 {
382 pImpl->bClosing = false;
383 }
384 }
385
386 if ( pImpl->bClosing )
387 {
388 // remove from Document list
389 // If there is no App, there is no document to remove
390 // no need to call GetOrCreate here
392 if(pSfxApp)
393 {
394 std::vector<SfxObjectShell*> &rDocs = pSfxApp->GetObjectShells_Impl();
395 auto it = std::find( rDocs.begin(), rDocs.end(), this );
396 if ( it != rDocs.end() )
397 rDocs.erase( it );
398 }
399 }
400 }
401
402 return true;
403}
404
406{
407 if (!pShell)
408 return OUString();
409
410 OUString aShellID;
411
412 SfxMedium* pMedium = pShell->GetMedium();
413 if (pMedium)
414 aShellID = pMedium->GetBaseURL();
415
416 if (!aShellID.isEmpty())
417 return aShellID;
418
419 sal_Int64 nShellID = reinterpret_cast<sal_Int64>(pShell);
420 aShellID = "0x" + OUString::number(nShellID, 16);
421 return aShellID;
422}
423
424// returns a pointer the first SfxDocument of specified type
425
427(
428 const std::function<bool ( const SfxObjectShell* )>& isObjectShell,
429 bool bOnlyVisible
430)
431{
432 std::vector<SfxObjectShell*> &rDocs = SfxGetpApp()->GetObjectShells_Impl();
433
434 // search for a SfxDocument of the specified type
435 for (SfxObjectShell* pSh : rDocs)
436 {
437 if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
438 continue;
439
440 if ( (!isObjectShell || isObjectShell( pSh)) &&
441 ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh )))
442 return pSh;
443 }
444
445 return nullptr;
446}
447
448
449// returns a pointer to the next SfxDocument of specified type behind *pDoc
450
452(
453 const SfxObjectShell& rPrev,
454 const std::function<bool ( const SfxObjectShell* )>& isObjectShell,
455 bool bOnlyVisible
456)
457{
458 std::vector<SfxObjectShell*> &rDocs = SfxGetpApp()->GetObjectShells_Impl();
459
460 // refind the specified predecessor
461 size_t nPos;
462 for ( nPos = 0; nPos < rDocs.size(); ++nPos )
463 if ( rDocs[nPos] == &rPrev )
464 break;
465
466 // search for the next SfxDocument of the specified type
467 for ( ++nPos; nPos < rDocs.size(); ++nPos )
468 {
469 SfxObjectShell* pSh = rDocs[ nPos ];
470 if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
471 continue;
472
473 if ( (!isObjectShell || isObjectShell( pSh)) &&
474 ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh )))
475 return pSh;
476 }
477 return nullptr;
478}
479
480
482{
484 return pFrame ? pFrame->GetObjectShell() : nullptr;
485}
486
487
489{
490 return pImpl->bInPrepareClose;
491}
492
493namespace {
494
495struct BoolEnv_Impl
496{
497 SfxObjectShell_Impl& rImpl;
498 explicit BoolEnv_Impl( SfxObjectShell_Impl& rImplP) : rImpl( rImplP )
499 { rImplP.bInPrepareClose = true; }
500 ~BoolEnv_Impl() { rImpl.bInPrepareClose = false; }
501};
502
503}
504
506(
507 bool bUI // true: Dialog and so on is allowed
508 // false: silent-mode
509)
510{
511 if( pImpl->bInPrepareClose || pImpl->bPreparedForClose )
512 return true;
513 BoolEnv_Impl aBoolEnv( *pImpl );
514
515 // DocModalDialog?
516 if ( IsInModalMode() )
517 return false;
518
519 SfxViewFrame* pFirst = SfxViewFrame::GetFirst( this );
520 if( pFirst && !pFirst->GetFrame().PrepareClose_Impl( bUI ) )
521 return false;
522
523 // prepare views for closing
524 for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
525 pFrm; pFrm = SfxViewFrame::GetNext( *pFrm, this ) )
526 {
527 DBG_ASSERT(pFrm->GetViewShell(),"No Shell");
528 if ( pFrm->GetViewShell() )
529 {
530 bool bRet = pFrm->GetViewShell()->PrepareClose( bUI );
531 if ( !bRet )
532 return bRet;
533 }
534 }
535
536 SfxApplication *pSfxApp = SfxGetpApp();
537 pSfxApp->NotifyEvent( SfxEventHint(SfxEventHintId::PrepareCloseDoc, GlobalEventConfig::GetEventName(GlobalEventId::PREPARECLOSEDOC), this) );
538
540 {
541 pImpl->bPreparedForClose = true;
542 return true;
543 }
544
545 // Ask if possible if it should be saved
546 // only ask for the Document in the visible window
547 SfxViewFrame *pFrame = SfxObjectShell::Current() == this
549
550 if ( bUI && IsModified() && pFrame )
551 {
552 // restore minimized
553 SfxFrame& rTop = pFrame->GetFrame();
555 pFrame->GetFrame().Appear();
556
557 // Ask if to save
558 short nRet = RET_YES;
559 {
560 const Reference<XTitle> xTitle(*pImpl->pBaseModel, UNO_QUERY_THROW);
561 const OUString sTitle = xTitle->getTitle ();
562 nRet = ExecuteQuerySaveDocument(pFrame->GetFrameWeld(), sTitle);
563 }
564 /*HACK for plugin::destroy()*/
565
566 if ( RET_YES == nRet )
567 {
568 // Save by each Dispatcher
569 const SfxPoolItem *pPoolItem;
570 if (IsReadOnly())
571 {
572 SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
573 const SfxPoolItem* ppArgs[] = { &aWarnItem, nullptr };
574 pPoolItem = pFrame->GetBindings().ExecuteSynchron(SID_SAVEASDOC, ppArgs);
575 }
576 else if (IsSaveVersionOnClose())
577 {
578 SfxStringItem aItem( SID_DOCINFO_COMMENTS, SfxResId(STR_AUTOMATICVERSION) );
579 SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
580 const SfxPoolItem* ppArgs[] = { &aItem, &aWarnItem, nullptr };
581 pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
582 }
583 else
584 {
585 SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
586 const SfxPoolItem* ppArgs[] = { &aWarnItem, nullptr };
587 pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
588 }
589
590 if ( !pPoolItem || pPoolItem->IsVoidItem() )
591 return false;
592 if ( auto pBoolItem = dynamic_cast< const SfxBoolItem *>( pPoolItem ) )
593 if ( !pBoolItem->GetValue() )
594 return false;
595 }
596 else if ( RET_CANCEL == nRet )
597 // Cancelled
598 return false;
599 }
600
601 if ( pFrame )
603 pImpl->bPreparedForClose = true;
604 return true;
605}
606
607
608#if HAVE_FEATURE_SCRIPTING
609namespace
610{
611 BasicManager* lcl_getBasicManagerForDocument( const SfxObjectShell& _rDocument )
612 {
613 if ( !_rDocument.Get_Impl()->m_bNoBasicCapabilities )
614 {
615 if ( !_rDocument.Get_Impl()->bBasicInitialized )
616 const_cast< SfxObjectShell& >( _rDocument ).InitBasicManager_Impl();
617 return _rDocument.Get_Impl()->aBasicManager.get();
618 }
619
620 // assume we do not have Basic ourself, but we can refer to another
621 // document which does (by our model's XScriptInvocationContext::getScriptContainer).
622 // In this case, we return the BasicManager of this other document.
623
624 OSL_ENSURE( !Reference< XEmbeddedScripts >( _rDocument.GetModel(), UNO_QUERY ).is(),
625 "lcl_getBasicManagerForDocument: inconsistency: no Basic, but an XEmbeddedScripts?" );
626 Reference< XModel > xForeignDocument;
627 Reference< XScriptInvocationContext > xContext( _rDocument.GetModel(), UNO_QUERY );
628 if ( xContext.is() )
629 {
630 xForeignDocument.set( xContext->getScriptContainer(), UNO_QUERY );
631 OSL_ENSURE( xForeignDocument.is() && xForeignDocument != _rDocument.GetModel(),
632 "lcl_getBasicManagerForDocument: no Basic, but providing ourself as script container?" );
633 }
634
635 BasicManager* pBasMgr = nullptr;
636 if ( xForeignDocument.is() )
638
639 return pBasMgr;
640 }
641}
642#endif
643
645{
646 BasicManager* pBasMgr = nullptr;
647#if HAVE_FEATURE_SCRIPTING
648 try
649 {
650 pBasMgr = lcl_getBasicManagerForDocument( *this );
651 if ( !pBasMgr )
653 }
654 catch (const css::ucb::ContentCreationException&)
655 {
656 TOOLS_WARN_EXCEPTION("sfx.doc", "");
657 }
658#endif
659 return pBasMgr;
660}
661
663{
664#if !HAVE_FEATURE_SCRIPTING
665 return false;
666#else
667 if ( pImpl->m_bNoBasicCapabilities )
668 return false;
669
670 if ( !pImpl->bBasicInitialized )
671 const_cast< SfxObjectShell* >( this )->InitBasicManager_Impl();
672
673 return pImpl->aBasicManager.isValid();
674#endif
675}
676
677
678#if HAVE_FEATURE_SCRIPTING
679namespace
680{
681 const Reference< XLibraryContainer >&
682 lcl_getOrCreateLibraryContainer( bool _bScript, Reference< XLibraryContainer >& _rxContainer,
683 const Reference< XModel >& _rxDocument )
684 {
685 if ( !_rxContainer.is() )
686 {
687 try
688 {
689 Reference< XStorageBasedDocument > xStorageDoc( _rxDocument, UNO_QUERY );
690 const Reference< XComponentContext > xContext(
691 ::comphelper::getProcessComponentContext() );
692 _rxContainer.set ( _bScript
693 ? DocumentScriptLibraryContainer::create(
694 xContext, xStorageDoc )
695 : DocumentDialogLibraryContainer::create(
696 xContext, xStorageDoc )
697 , UNO_QUERY_THROW );
698 }
699 catch (const Exception&)
700 {
701 DBG_UNHANDLED_EXCEPTION("sfx.doc");
702 }
703 }
704 return _rxContainer;
705 }
706}
707#endif
708
709Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer()
710{
711#if HAVE_FEATURE_SCRIPTING
712 try
713 {
714 if ( !pImpl->m_bNoBasicCapabilities )
715 return lcl_getOrCreateLibraryContainer( false, pImpl->xDialogLibraries, GetModel() );
716
717 BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
718 if ( pBasMgr )
719 return pBasMgr->GetDialogLibraryContainer();
720 }
721 catch (const css::ucb::ContentCreationException&)
722 {
723 TOOLS_WARN_EXCEPTION("sfx.doc", "");
724 }
725
726 SAL_WARN("sfx.doc", "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?");
727#endif
728 return SfxGetpApp()->GetDialogContainer();
729}
730
731Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
732{
733#if HAVE_FEATURE_SCRIPTING
735 {
736 try
737 {
738 if ( !pImpl->m_bNoBasicCapabilities )
739 return lcl_getOrCreateLibraryContainer( true, pImpl->xBasicLibraries, GetModel() );
740
741 BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
742 if ( pBasMgr )
743 return pBasMgr->GetScriptLibraryContainer();
744 }
745 catch (const css::ucb::ContentCreationException&)
746 {
747 TOOLS_WARN_EXCEPTION("sfx.doc", "");
748 }
749 }
750 SAL_WARN("sfx.doc", "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?");
751#endif
752 return SfxGetpApp()->GetBasicContainer();
753}
754
756{
757#if !HAVE_FEATURE_SCRIPTING
758 return nullptr;
759#else
760 BasicManager * pMan = GetBasicManager();
761 return pMan ? pMan->GetLib(0) : nullptr;
762#endif
763}
764
766/* [Description]
767
768 Creates a document's BasicManager and loads it, if we are already based on
769 a storage.
770
771 [Note]
772
773 This method has to be called by implementations of <SvPersist::Load()>
774 (with its pStor parameter) and by implementations of <SvPersist::InitNew()>
775 (with pStor = 0).
776*/
777
778{
779 /* #163556# (DR) - Handling of recursive calls while creating the Basic
780 manager.
781
782 It is possible that (while creating the Basic manager) the code that
783 imports the Basic storage wants to access the Basic manager again.
784 Especially in VBA compatibility mode, there is code that wants to
785 access the "VBA Globals" object which is stored as global UNO constant
786 in the Basic manager.
787
788 To achieve correct handling of the recursive calls of this function
789 from lcl_getBasicManagerForDocument(), the implementation of the
790 function BasicManagerRepository::getDocumentBasicManager() has been
791 changed to return the Basic manager currently under construction, when
792 called repeatedly.
793
794 The variable pImpl->bBasicInitialized will be set to sal_True after
795 construction now, to ensure that the recursive call of the function
796 lcl_getBasicManagerForDocument() will be routed into this function too.
797
798 Calling BasicManagerHolder::reset() twice is not a big problem, as it
799 does not take ownership but stores only the raw pointer. Owner of all
800 Basic managers is the global BasicManagerRepository instance.
801 */
802#if HAVE_FEATURE_SCRIPTING
803 DBG_ASSERT( !pImpl->bBasicInitialized && !pImpl->aBasicManager.isValid(), "Local BasicManager already exists");
804 try
805 {
806 pImpl->aBasicManager.reset( BasicManagerRepository::getDocumentBasicManager( GetModel() ) );
807 }
808 catch (const css::ucb::ContentCreationException&)
809 {
810 TOOLS_WARN_EXCEPTION("sfx.doc", "");
811 }
812 DBG_ASSERT( pImpl->aBasicManager.isValid(), "SfxObjectShell::InitBasicManager_Impl: did not get a BasicManager!" );
813 pImpl->bBasicInitialized = true;
814#endif
815}
816
817
819{
820 return Close();
821}
822
823
825{
826 return this;
827}
828
829
830uno::Sequence< OUString > SfxObjectShell::GetEventNames()
831{
832 static uno::Sequence< OUString > s_EventNameContainer(rtl::Reference<GlobalEventConfig>(new GlobalEventConfig)->getElementNames());
833
834 return s_EventNameContainer;
835}
836
837
838css::uno::Reference< css::frame::XModel3 > SfxObjectShell::GetModel() const
839{
840 return GetBaseModel();
841}
842
844{
845 OSL_ENSURE( !pImpl->pBaseModel.is() || pModel == nullptr, "Model already set!" );
846 pImpl->pBaseModel.set( pModel );
847 if ( pImpl->pBaseModel.is() )
848 {
849 pImpl->pBaseModel->addCloseListener( new SfxModelListener_Impl(this) );
850 }
851}
852
853
854css::uno::Reference< css::frame::XModel3 > SfxObjectShell::GetBaseModel() const
855{
856 return pImpl->pBaseModel;
857}
858
860{
861 pImpl->nStyleFilter = nSet;
862}
863
865{
866 return pImpl->nStyleFilter;
867}
868
869
870void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComponent )
871{
872 WeakReference< XInterface >& rTheCurrentComponent = theCurrentComponent;
873
874 Reference< XInterface > xOldCurrentComp(rTheCurrentComponent);
875 if ( _rxComponent == xOldCurrentComp )
876 // nothing to do
877 return;
878 // note that "_rxComponent.get() == s_xCurrentComponent.get().get()" is /sufficient/, but not
879 // /required/ for "_rxComponent == s_xCurrentComponent.get()".
880 // In other words, it's still possible that we here do something which is not necessary,
881 // but we should have filtered quite some unnecessary calls already.
882
883#if HAVE_FEATURE_SCRIPTING
885 rTheCurrentComponent = _rxComponent;
886 if ( !pAppMgr )
887 return;
888
889 // set "ThisComponent" for Basic
890 pAppMgr->SetGlobalUNOConstant( "ThisComponent", Any( _rxComponent ) );
891
892 // set new current component for VBA compatibility
893 if ( _rxComponent.is() )
894 {
895 OUString aVBAConstName = lclGetVBAGlobalConstName( _rxComponent );
896 if ( !aVBAConstName.isEmpty() )
897 {
898 pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( _rxComponent ) );
899 s_aRegisteredVBAConstants[ _rxComponent.get() ] = aVBAConstName;
900 }
901 }
902 // no new component passed -> remove last registered VBA component
903 else if ( xOldCurrentComp.is() )
904 {
905 OUString aVBAConstName = lclGetVBAGlobalConstName( xOldCurrentComp );
906 if ( !aVBAConstName.isEmpty() )
907 {
908 pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( Reference< XInterface >() ) );
909 s_aRegisteredVBAConstants.erase( xOldCurrentComp.get() );
910 }
911 }
912#endif
913}
914
915Reference< XInterface > SfxObjectShell::GetCurrentComponent()
916{
917 return theCurrentComponent;
918}
919
920
921OUString SfxObjectShell::GetServiceNameFromFactory( const OUString& rFact )
922{
924 OUString aFact( rFact );
925 OUString aPrefix("private:factory/");
926 if ( aFact.startsWith( aPrefix ) )
927 aFact = aFact.copy( aPrefix.getLength() );
928 sal_Int32 nPos = aFact.indexOf( '?' );
929 if ( nPos != -1 )
930 {
931 aFact = aFact.copy( 0, nPos );
932 }
933 aFact = aFact.replaceAll("4", "");
934 aFact = aFact.toAsciiLowerCase();
935
936 // HACK: sometimes a real document service name is given here instead of
937 // a factory short name. Set return value directly to this service name as fallback
938 // in case next lines of code does nothing ...
939 // use rFact instead of normed aFact value !
940 OUString aServiceName = rFact;
941
942 if ( aFact == "swriter" )
943 {
944 aServiceName = "com.sun.star.text.TextDocument";
945 }
946 else if ( aFact == "sweb" || aFact == "swriter/web" )
947 {
948 aServiceName = "com.sun.star.text.WebDocument";
949 }
950 else if ( aFact == "sglobal" || aFact == "swriter/globaldocument" )
951 {
952 aServiceName = "com.sun.star.text.GlobalDocument";
953 }
954 else if ( aFact == "scalc" )
955 {
956 aServiceName = "com.sun.star.sheet.SpreadsheetDocument";
957 }
958 else if ( aFact == "sdraw" )
959 {
960 aServiceName = "com.sun.star.drawing.DrawingDocument";
961 }
962 else if ( aFact == "simpress" )
963 {
964 aServiceName = "com.sun.star.presentation.PresentationDocument";
965 }
966 else if ( aFact == "schart" )
967 {
968 aServiceName = "com.sun.star.chart.ChartDocument";
969 }
970 else if ( aFact == "smath" )
971 {
972 aServiceName = "com.sun.star.formula.FormulaProperties";
973 }
974#if HAVE_FEATURE_SCRIPTING
975 else if ( aFact == "sbasic" )
976 {
977 aServiceName = "com.sun.star.script.BasicIDE";
978 }
979#endif
980#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
981 else if ( aFact == "sdatabase" )
982 {
983 aServiceName = "com.sun.star.sdb.OfficeDatabaseDocument";
984 }
985#endif
986
987 return aServiceName;
988}
989
991{
992 return CreateObject( GetServiceNameFromFactory( rFact ), eMode );
993}
994
995
996SfxObjectShell* SfxObjectShell::CreateObject( const OUString& rServiceName, SfxObjectCreateMode eCreateMode )
997{
998 if ( !rServiceName.isEmpty() )
999 {
1000 uno::Reference < frame::XModel > xDoc( ::comphelper::getProcessServiceFactory()->createInstance( rServiceName ), UNO_QUERY );
1002 {
1003 pRet->SetCreateMode_Impl(eCreateMode);
1004 return pRet;
1005 }
1006 }
1007
1008 return nullptr;
1009}
1010
1011Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxItemSet& rSet )
1012{
1013 uno::Sequence < beans::PropertyValue > aProps;
1014 TransformItems( SID_OPENDOC, rSet, aProps );
1015 const SfxStringItem* pFileNameItem = rSet.GetItem<SfxStringItem>(SID_FILE_NAME, false);
1016 const SfxStringItem* pTargetItem = rSet.GetItem<SfxStringItem>(SID_TARGETNAME, false);
1017 OUString aURL;
1018 OUString aTarget("_blank");
1019 if ( pFileNameItem )
1020 aURL = pFileNameItem->GetValue();
1021 if ( pTargetItem )
1022 aTarget = pTargetItem->GetValue();
1023
1024 uno::Reference < frame::XComponentLoader > xLoader =
1025 frame::Desktop::create(comphelper::getProcessComponentContext());
1026
1027 Reference <lang::XComponent> xComp;
1028 try
1029 {
1030 xComp = xLoader->loadComponentFromURL(aURL, aTarget, 0, aProps);
1031 }
1032 catch (const uno::Exception&)
1033 {
1034 }
1035
1036 return xComp;
1037}
1038
1039SfxObjectShell* SfxObjectShell::GetShellFromComponent(const Reference<uno::XInterface>& xComp)
1040{
1041 try
1042 {
1043 Reference<lang::XUnoTunnel> xTunnel(xComp, UNO_QUERY);
1044 if (!xTunnel)
1045 return nullptr;
1046 static const Sequence <sal_Int8> aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() );
1047 return comphelper::getSomething_cast<SfxObjectShell>(xTunnel->getSomething(aSeq));
1048 }
1049 catch (const Exception&)
1050 {
1051 }
1052
1053 return nullptr;
1054}
1055
1056SfxObjectShell* SfxObjectShell::GetParentShell(const css::uno::Reference<css::uno::XInterface>& xChild)
1057{
1058 SfxObjectShell* pResult = nullptr;
1059
1060 try
1061 {
1062 if (css::uno::Reference<css::container::XChild> xChildModel{ xChild, css::uno::UNO_QUERY })
1063 pResult = GetShellFromComponent(xChildModel->getParent());
1064 }
1065 catch (const Exception&)
1066 {
1067 }
1068
1069 return pResult;
1070}
1071
1072void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
1073{
1074 pImpl->bInitialized = true;
1076 return;
1077 if ( i_fromInitNew )
1078 {
1081 }
1082 else
1083 {
1085 }
1086}
1087
1088
1090{
1091 // currently this function needs to be overwritten by Writer and Calc only
1092 SAL_WARN( "sfx.doc", "function not implemented" );
1093 return false;
1094}
1095
1096
1098{
1099 // currently this function needs to be overwritten by Writer and Calc only
1100 SAL_WARN( "sfx.doc", "function not implemented" );
1101 return false;
1102}
1103
1104
1105void SfxObjectShell::SetChangeRecording( bool /*bActivate*/, bool /*bLockAllViews*/ )
1106{
1107 // currently this function needs to be overwritten by Writer and Calc only
1108 SAL_WARN( "sfx.doc", "function not implemented" );
1109}
1110
1111
1112void SfxObjectShell::SetProtectionPassword( const OUString & /*rPassword*/ )
1113{
1114 // currently this function needs to be overwritten by Writer and Calc only
1115 SAL_WARN( "sfx.doc", "function not implemented" );
1116}
1117
1118
1119bool SfxObjectShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > & /*rPasswordHash*/ )
1120{
1121 // currently this function needs to be overwritten by Writer and Calc only
1122 SAL_WARN( "sfx.doc", "function not implemented" );
1123 return false;
1124}
1125
1126/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
short ExecuteQuerySaveDocument(weld::Widget *_pParent, std::u16string_view _rTitle)
Opens the general query save document dialog.
HRESULT createInstance(REFIID iid, Ifc **ppIfc)
SfxApplication * SfxGetpApp()
Definition: app.hxx:231
void TransformItems(sal_uInt16 nSlotId, const SfxItemSet &rSet, uno::Sequence< beans::PropertyValue > &rArgs, const SfxSlot *pSlot)
Definition: appuno.cxx:908
StarBASIC * GetLib(sal_uInt16 nLib) const
const css::uno::Reference< css::script::XPersistentLibraryContainer > & GetScriptLibraryContainer() const
void SetGlobalUNOConstant(const OUString &rName, const css::uno::Any &_rValue, css::uno::Any *pOldValue=nullptr)
const css::uno::Reference< css::script::XPersistentLibraryContainer > & GetDialogLibraryContainer() const
const OUString & GetValue() const
static OUString GetEventName(GlobalEventId nID)
OUString GetMainURL(DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
static SfxApplication * Get()
Definition: app.cxx:70
css::script::XLibraryContainer * GetBasicContainer()
Definition: appbas.cxx:87
void ReleaseIndex(sal_uInt16 i)
Definition: app.cxx:318
static BasicManager * GetBasicManager()
Definition: appbas.cxx:62
void RemoveDdeTopic(SfxObjectShell const *)
Definition: appdde.cxx:475
css::script::XLibraryContainer * GetDialogContainer()
Definition: appbas.cxx:73
SAL_DLLPRIVATE std::vector< SfxObjectShell * > & GetObjectShells_Impl() const
Definition: app.cxx:375
void NotifyEvent(const SfxEventHint &rEvent, bool bSynchron=true)
Definition: appcfg.cxx:338
const DdeService * GetDdeService() const
Definition: appdde.cxx:497
BasicManager * get() const
returns the BasicManager which this instance is currently bound to
Definition: appbaslib.hxx:59
const SfxPoolItem * ExecuteSynchron(sal_uInt16 nSlot, const SfxPoolItem **pArgs=nullptr)
Definition: bindings.cxx:858
void Appear()
Definition: frame.cxx:528
SAL_WARN_UNUSED_RESULT SfxViewFrame * GetCurrentViewFrame() const
Definition: frame.cxx:234
SAL_DLLPRIVATE bool PrepareClose_Impl(bool bUI)
Definition: frame.cxx:155
const SfxPoolItem * GetItem(sal_uInt16 nWhich, bool bSearchInParent=true) const
SAL_DLLPRIVATE void CloseAndReleaseStreams_Impl()
Definition: docfile.cxx:3277
OUString GetBaseURL(bool bForSaving=false)
Definition: docfile.cxx:634
const INetURLObject & GetURLObject() const
Definition: docfile.cxx:3597
SAL_DLLPRIVATE void CanDisposeStorage_Impl(bool bDisposeStorage)
Definition: docfile.cxx:1947
SAL_DLLPRIVATE bool HasStorage_Impl() const
Definition: docfile.cxx:4327
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
Definition: docfile.cxx:1703
virtual bool HasChangeRecordProtection() const
Definition: objxtor.cxx:1097
static SfxObjectShell * CreateObject(const OUString &rServiceName, SfxObjectCreateMode=SfxObjectCreateMode::STANDARD)
Definition: objxtor.cxx:996
bool DoClose()
Definition: objxtor.cxx:818
virtual bool PrepareClose(bool bUI=true)
Definition: objxtor.cxx:506
bool CloseInternal()
Definition: objxtor.cxx:363
css::uno::Reference< css::script::XLibraryContainer > GetBasicContainer()
Definition: objxtor.cxx:731
SfxObjectShell(SfxObjectCreateMode)
Constructor of the class SfxObjectShell.
Definition: objxtor.cxx:273
static OUString GetServiceNameFromFactory(const OUString &rFact)
Definition: objxtor.cxx:921
SAL_DLLPRIVATE void InitBasicManager_Impl()
Definition: objxtor.cxx:765
virtual bool GetProtectionHash(css::uno::Sequence< sal_Int8 > &rPasswordHash)
Definition: objxtor.cxx:1119
static OUString CreateShellID(const SfxObjectShell *pShell)
Definition: objxtor.cxx:405
virtual SfxObjectShell * GetObjectShell() override
Definition: objxtor.cxx:824
sal_uInt16 GetAutoStyleFilterIndex() const
Definition: objxtor.cxx:864
static css::uno::Reference< css::lang::XComponent > CreateAndLoadComponent(const SfxItemSet &rSet)
Definition: objxtor.cxx:1011
SAL_DLLPRIVATE void SetInitialized_Impl(const bool i_fromInitNew)
Definition: objxtor.cxx:1072
bool IsInModalMode() const
Definition: objmisc.cxx:422
bool IsInPrepareClose() const
Definition: objxtor.cxx:488
virtual css::uno::Sequence< OUString > GetEventNames()
Definition: objxtor.cxx:830
SfxProgress * GetProgress() const
Definition: objmisc.cxx:877
BasicManager * GetBasicManager() const
Definition: objxtor.cxx:644
static SfxObjectShell * GetShellFromComponent(const css::uno::Reference< css::uno::XInterface > &xComp)
Definition: objxtor.cxx:1039
bool IsEnableSetModified() const
Definition: objmisc.cxx:248
SfxObjectCreateMode eCreateMode
Definition: objsh.hxx:189
virtual ~SfxObjectShell() override
Definition: objxtor.cxx:284
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
Definition: objxtor.cxx:452
bool HasBasic() const
Definition: objxtor.cxx:662
bool IsReadOnly() const
Definition: objmisc.cxx:416
virtual bool IsChangeRecording() const
Definition: objxtor.cxx:1089
bool IsDocShared() const
Definition: objmisc.cxx:634
static void SetCurrentComponent(const css::uno::Reference< css::uno::XInterface > &_rxComponent)
Definition: objxtor.cxx:870
static SfxObjectShell * GetParentShell(const css::uno::Reference< css::uno::XInterface > &xChild)
Definition: objxtor.cxx:1056
SAL_DLLPRIVATE void FreeSharedFile(const OUString &aTempFileURL)
bool IsModified() const
Definition: objmisc.cxx:259
virtual bool Close() override
Definition: objxtor.cxx:356
SfxMedium * pMedium
Definition: objsh.hxx:187
void SetAutoStyleFilterIndex(sal_uInt16 nSet)
Definition: objxtor.cxx:859
css::uno::Reference< css::script::XLibraryContainer > GetDialogContainer()
Definition: objxtor.cxx:709
virtual void SetProtectionPassword(const OUString &rPassword)
Definition: objxtor.cxx:1112
static SfxObjectShell * CreateObjectByFactoryName(const OUString &rURL, SfxObjectCreateMode=SfxObjectCreateMode::STANDARD)
Definition: objxtor.cxx:990
SAL_DLLPRIVATE SfxObjectShell_Impl * Get_Impl()
Definition: objsh.hxx:718
SfxMedium * GetMedium() const
Definition: objsh.hxx:261
css::uno::Reference< css::frame::XModel3 > GetModel() const
Definition: objxtor.cxx:838
css::uno::Reference< css::frame::XModel3 > GetBaseModel() const
Definition: objxtor.cxx:854
std::unique_ptr< struct SfxObjectShell_Impl > pImpl
Definition: objsh.hxx:185
StarBASIC * GetBasic() const
Definition: objxtor.cxx:755
static css::uno::Reference< css::uno::XInterface > GetCurrentComponent()
Definition: objxtor.cxx:915
void EnableSetModified(bool bEnable=true)
Definition: objmisc.cxx:241
virtual void SetChangeRecording(bool bActivate, bool bLockAllViews=false)
Definition: objxtor.cxx:1105
bool IsSaveVersionOnClose() const
Definition: objcont.cxx:659
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
Definition: objxtor.cxx:427
SfxObjectCreateMode GetCreateMode() const
Definition: objsh.hxx:487
bool Stamp_GetPrintCancelState() const
Definition: objxtor.cxx:348
bool IsPreview() const
Definition: objmisc.cxx:1552
SAL_DLLPRIVATE void SetActivateEvent_Impl(SfxEventHintId)
Definition: objmisc.cxx:922
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
Definition: objxtor.cxx:481
void SetBaseModel(SfxBaseModel *pModel)
Definition: objxtor.cxx:843
void Stamp_SetPrintCancelState(bool bState)
Definition: objxtor.cxx:342
virtual bool IsVoidItem() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
Definition: viewfrm.cxx:1975
SfxBindings & GetBindings()
Definition: viewfrm.hxx:110
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetNext(const SfxViewFrame &rPrev, const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
Definition: viewfrm.cxx:2006
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
Definition: viewfrm.cxx:1983
SfxFrame & GetFrame() const
Definition: viewfrm.cxx:2782
virtual SfxObjectShell * GetObjectShell() override
Definition: viewfrm.cxx:2218
weld::Window * GetFrameWeld() const
Definition: viewfrm.cxx:2797
static void SetViewFrame(SfxViewFrame *)
Definition: viewfrm.cxx:3583
static BasicManager * getDocumentBasicManager(const css::uno::Reference< css::frame::XModel > &_rxDocumentModel)
static void CloseMethod(SfxBindings &rBindings)
static bool IsFuzzing()
#define DBG_ASSERT(sCon, aError)
#define TOOLS_WARN_EXCEPTION(area, stream)
#define DBG_UNHANDLED_EXCEPTION(...)
URL aURL
#define ERRCODE_NONE
SfxEventHintId
Definition: event.hxx:116
UNKNOWN
Mode eMode
sal_uInt16 nPos
Definition: linksrc.cxx:118
Sequence< sal_Int8 > aSeq
Definition: lnkbase2.cxx:83
#define SAL_WARN(area, stream)
MapUnit
NONE
@ Exception
Reference< XComponentContext > getProcessComponentContext()
SfxObjectCreateMode
Definition: objsh.hxx:157
SfxLoadedFlags
Definition: objsh.hxx:123
#define SFX_GLOBAL_CLASSID
Definition: objsh.hxx:808
SfxModelFlags
@ DISABLE_DOCUMENT_RECOVERY
@ DISABLE_EMBEDDED_SCRIPTS
OUString SfxResId(TranslateId aId)
Definition: sfxresid.cxx:22
static SfxItemSet & rSet
Definition: shell.cxx:534
SignatureState
virtual ~SfxObjectShell_Impl()
Definition: objxtor.cxx:238
SfxObjectShell_Impl(SfxObjectShell &_rDocShell)
Definition: objxtor.cxx:180
SfxBasicManagerHolder aBasicManager
Definition: objshimp.hxx:55
bool m_bNoBasicCapabilities
Definition: objshimp.hxx:84
unsigned char sal_Bool
RET_CANCEL
RET_YES