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{
251 if (i_nCreationFlags & SfxModelFlags::EMBEDDED_OBJECT)
253 else if (i_nCreationFlags & SfxModelFlags::EXTERNAL_LINK)
255
256 const bool bScriptSupport = ( i_nCreationFlags & SfxModelFlags::DISABLE_EMBEDDED_SCRIPTS ) == SfxModelFlags::NONE;
257 if ( !bScriptSupport )
258 pImpl->m_bNoBasicCapabilities = true;
259
260 const bool bDocRecovery = ( i_nCreationFlags & SfxModelFlags::DISABLE_DOCUMENT_RECOVERY ) == SfxModelFlags::NONE;
261 if ( !bDocRecovery )
262 pImpl->m_bDocRecoverySupport = false;
263}
264
273 : pImpl(new SfxObjectShell_Impl(*this))
274 , pMedium(nullptr)
275 , eCreateMode(eMode)
276 , bHasName(false)
277 , bIsInGenerateThumbnail(false)
278 , mbAvoidRecentDocs(false)
279{
280}
281
283{
284
285 if ( IsEnableSetModified() )
286 EnableSetModified( false );
287
289 pImpl->pBaseModel.set( nullptr );
290
291 pImpl->pReloadTimer.reset();
292
293 SfxApplication *pSfxApp = SfxGetpApp();
294 if ( USHRT_MAX != pImpl->nVisualDocumentNumber && pSfxApp )
295 pSfxApp->ReleaseIndex(pImpl->nVisualDocumentNumber);
296
297 // Destroy Basic-Manager
298 pImpl->aBasicManager.reset(nullptr);
299
300 if ( pSfxApp && pSfxApp->GetDdeService() )
301 pSfxApp->RemoveDdeTopic( this );
302
303 pImpl->pBaseModel.set( nullptr );
304
305 // don't call GetStorage() here, in case of Load Failure it's possible that a storage was never assigned!
306 if ( pMedium && pMedium->HasStorage_Impl() && pMedium->GetStorage( false ) == pImpl->m_xDocStorage )
308
309 if ( pImpl->mxObjectContainer )
310 {
311 pImpl->mxObjectContainer->CloseEmbeddedObjects();
312 pImpl->mxObjectContainer.reset();
313 }
314
315 if ( pImpl->bOwnsStorage && pImpl->m_xDocStorage.is() )
316 pImpl->m_xDocStorage->dispose();
317
318 if ( pMedium )
319 {
321
322#if HAVE_FEATURE_MULTIUSER_ENVIRONMENT
323 if (IsDocShared())
325#endif
326 delete pMedium;
327 pMedium = nullptr;
328 }
329
330 // The removing of the temporary file must be done as the latest step in the document destruction
331 if ( !pImpl->aTempName.isEmpty() )
332 {
333 OUString aTmp;
334 osl::FileBase::getFileURLFromSystemPath( pImpl->aTempName, aTmp );
335 ::utl::UCBContentHelper::Kill( aTmp );
336 }
337}
338
339
341{
342 pImpl->bIsPrintJobCancelable = bState;
343}
344
345
347{
348 return pImpl->bIsPrintJobCancelable;
349}
350
351
352// closes the Object and all its views
353
355{
356 SfxObjectShellRef xKeepAlive(this);
357 return CloseInternal();
358}
359
360// variant that does not take a reference to itself, so we can call it during object destruction
362{
363 if ( !pImpl->bClosing )
364 {
365 // Do not close if a progress is still running
366 if ( GetProgress() )
367 return false;
368
369 pImpl->bClosing = true;
370 Reference< util::XCloseable > xCloseable( GetBaseModel(), UNO_QUERY );
371
372 if ( xCloseable.is() )
373 {
374 try
375 {
376 xCloseable->close( true );
377 }
378 catch (const Exception&)
379 {
380 pImpl->bClosing = false;
381 }
382 }
383
384 if ( pImpl->bClosing )
385 {
386 // remove from Document list
387 // If there is no App, there is no document to remove
388 // no need to call GetOrCreate here
390 if(pSfxApp)
391 {
392 std::vector<SfxObjectShell*> &rDocs = pSfxApp->GetObjectShells_Impl();
393 auto it = std::find( rDocs.begin(), rDocs.end(), this );
394 if ( it != rDocs.end() )
395 rDocs.erase( it );
396 }
397 }
398 }
399
400 return true;
401}
402
404{
405 if (!pShell)
406 return OUString();
407
408 OUString aShellID;
409
410 SfxMedium* pMedium = pShell->GetMedium();
411 if (pMedium)
412 aShellID = pMedium->GetBaseURL();
413
414 if (!aShellID.isEmpty())
415 return aShellID;
416
417 sal_Int64 nShellID = reinterpret_cast<sal_Int64>(pShell);
418 aShellID = "0x" + OUString::number(nShellID, 16);
419 return aShellID;
420}
421
422// returns a pointer the first SfxDocument of specified type
423
425(
426 const std::function<bool ( const SfxObjectShell* )>& isObjectShell,
427 bool bOnlyVisible
428)
429{
430 std::vector<SfxObjectShell*> &rDocs = SfxGetpApp()->GetObjectShells_Impl();
431
432 // search for a SfxDocument of the specified type
433 for (SfxObjectShell* pSh : rDocs)
434 {
435 if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
436 continue;
437
438 if ( (!isObjectShell || isObjectShell( pSh)) &&
439 ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh )))
440 return pSh;
441 }
442
443 return nullptr;
444}
445
446
447// returns a pointer to the next SfxDocument of specified type behind *pDoc
448
450(
451 const SfxObjectShell& rPrev,
452 const std::function<bool ( const SfxObjectShell* )>& isObjectShell,
453 bool bOnlyVisible
454)
455{
456 std::vector<SfxObjectShell*> &rDocs = SfxGetpApp()->GetObjectShells_Impl();
457
458 // refind the specified predecessor
459 size_t nPos;
460 for ( nPos = 0; nPos < rDocs.size(); ++nPos )
461 if ( rDocs[nPos] == &rPrev )
462 break;
463
464 // search for the next SfxDocument of the specified type
465 for ( ++nPos; nPos < rDocs.size(); ++nPos )
466 {
467 SfxObjectShell* pSh = rDocs[ nPos ];
468 if ( bOnlyVisible && pSh->IsPreview() && pSh->IsReadOnly() )
469 continue;
470
471 if ( (!isObjectShell || isObjectShell( pSh)) &&
472 ( !bOnlyVisible || SfxViewFrame::GetFirst( pSh )))
473 return pSh;
474 }
475 return nullptr;
476}
477
478
480{
482 return pFrame ? pFrame->GetObjectShell() : nullptr;
483}
484
485
487{
488 return pImpl->bInPrepareClose;
489}
490
491namespace {
492
493struct BoolEnv_Impl
494{
495 SfxObjectShell_Impl& rImpl;
496 explicit BoolEnv_Impl( SfxObjectShell_Impl& rImplP) : rImpl( rImplP )
497 { rImplP.bInPrepareClose = true; }
498 ~BoolEnv_Impl() { rImpl.bInPrepareClose = false; }
499};
500
501}
502
504(
505 bool bUI // true: Dialog and so on is allowed
506 // false: silent-mode
507)
508{
509 if( pImpl->bInPrepareClose || pImpl->bPreparedForClose )
510 return true;
511 BoolEnv_Impl aBoolEnv( *pImpl );
512
513 // DocModalDialog?
514 if ( IsInModalMode() )
515 return false;
516
517 SfxViewFrame* pFirst = SfxViewFrame::GetFirst( this );
518 if( pFirst && !pFirst->GetFrame().PrepareClose_Impl( bUI ) )
519 return false;
520
521 // prepare views for closing
522 for ( SfxViewFrame* pFrm = SfxViewFrame::GetFirst( this );
523 pFrm; pFrm = SfxViewFrame::GetNext( *pFrm, this ) )
524 {
525 DBG_ASSERT(pFrm->GetViewShell(),"No Shell");
526 if ( pFrm->GetViewShell() )
527 {
528 bool bRet = pFrm->GetViewShell()->PrepareClose( bUI );
529 if ( !bRet )
530 return bRet;
531 }
532 }
533
534 SfxApplication *pSfxApp = SfxGetpApp();
535 pSfxApp->NotifyEvent( SfxEventHint(SfxEventHintId::PrepareCloseDoc, GlobalEventConfig::GetEventName(GlobalEventId::PREPARECLOSEDOC), this) );
536
538 {
539 pImpl->bPreparedForClose = true;
540 return true;
541 }
542
543 // Ask if possible if it should be saved
544 // only ask for the Document in the visible window
545 SfxViewFrame *pFrame = SfxObjectShell::Current() == this
547
548 if ( bUI && IsModified() && pFrame )
549 {
550 // restore minimized
551 SfxFrame& rTop = pFrame->GetFrame();
553 pFrame->GetFrame().Appear();
554
555 // Ask if to save
556 short nRet = RET_YES;
557 {
558 const Reference<XTitle> xTitle(*pImpl->pBaseModel, UNO_QUERY_THROW);
559 const OUString sTitle = xTitle->getTitle ();
560 nRet = ExecuteQuerySaveDocument(pFrame->GetFrameWeld(), sTitle);
561 }
562 /*HACK for plugin::destroy()*/
563
564 if ( RET_YES == nRet )
565 {
566 // Save by each Dispatcher
567 const SfxPoolItem *pPoolItem;
568 if ( IsSaveVersionOnClose() )
569 {
570 SfxStringItem aItem( SID_DOCINFO_COMMENTS, SfxResId(STR_AUTOMATICVERSION) );
571 SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
572 const SfxPoolItem* ppArgs[] = { &aItem, &aWarnItem, nullptr };
573 pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
574 }
575 else
576 {
577 SfxBoolItem aWarnItem( SID_FAIL_ON_WARNING, bUI );
578 const SfxPoolItem* ppArgs[] = { &aWarnItem, nullptr };
579 pPoolItem = pFrame->GetBindings().ExecuteSynchron( SID_SAVEDOC, ppArgs );
580 }
581
582 if ( !pPoolItem || pPoolItem->IsVoidItem() )
583 return false;
584 if ( auto pBoolItem = dynamic_cast< const SfxBoolItem *>( pPoolItem ) )
585 if ( !pBoolItem->GetValue() )
586 return false;
587 }
588 else if ( RET_CANCEL == nRet )
589 // Cancelled
590 return false;
591 }
592
593 if ( pFrame )
595 pImpl->bPreparedForClose = true;
596 return true;
597}
598
599
600#if HAVE_FEATURE_SCRIPTING
601namespace
602{
603 BasicManager* lcl_getBasicManagerForDocument( const SfxObjectShell& _rDocument )
604 {
605 if ( !_rDocument.Get_Impl()->m_bNoBasicCapabilities )
606 {
607 if ( !_rDocument.Get_Impl()->bBasicInitialized )
608 const_cast< SfxObjectShell& >( _rDocument ).InitBasicManager_Impl();
609 return _rDocument.Get_Impl()->aBasicManager.get();
610 }
611
612 // assume we do not have Basic ourself, but we can refer to another
613 // document which does (by our model's XScriptInvocationContext::getScriptContainer).
614 // In this case, we return the BasicManager of this other document.
615
616 OSL_ENSURE( !Reference< XEmbeddedScripts >( _rDocument.GetModel(), UNO_QUERY ).is(),
617 "lcl_getBasicManagerForDocument: inconsistency: no Basic, but an XEmbeddedScripts?" );
618 Reference< XModel > xForeignDocument;
619 Reference< XScriptInvocationContext > xContext( _rDocument.GetModel(), UNO_QUERY );
620 if ( xContext.is() )
621 {
622 xForeignDocument.set( xContext->getScriptContainer(), UNO_QUERY );
623 OSL_ENSURE( xForeignDocument.is() && xForeignDocument != _rDocument.GetModel(),
624 "lcl_getBasicManagerForDocument: no Basic, but providing ourself as script container?" );
625 }
626
627 BasicManager* pBasMgr = nullptr;
628 if ( xForeignDocument.is() )
630
631 return pBasMgr;
632 }
633}
634#endif
635
637{
638 BasicManager* pBasMgr = nullptr;
639#if HAVE_FEATURE_SCRIPTING
640 try
641 {
642 pBasMgr = lcl_getBasicManagerForDocument( *this );
643 if ( !pBasMgr )
645 }
646 catch (const css::ucb::ContentCreationException&)
647 {
648 TOOLS_WARN_EXCEPTION("sfx.doc", "");
649 }
650#endif
651 return pBasMgr;
652}
653
655{
656#if !HAVE_FEATURE_SCRIPTING
657 return false;
658#else
659 if ( pImpl->m_bNoBasicCapabilities )
660 return false;
661
662 if ( !pImpl->bBasicInitialized )
663 const_cast< SfxObjectShell* >( this )->InitBasicManager_Impl();
664
665 return pImpl->aBasicManager.isValid();
666#endif
667}
668
669
670#if HAVE_FEATURE_SCRIPTING
671namespace
672{
673 const Reference< XLibraryContainer >&
674 lcl_getOrCreateLibraryContainer( bool _bScript, Reference< XLibraryContainer >& _rxContainer,
675 const Reference< XModel >& _rxDocument )
676 {
677 if ( !_rxContainer.is() )
678 {
679 try
680 {
681 Reference< XStorageBasedDocument > xStorageDoc( _rxDocument, UNO_QUERY );
682 const Reference< XComponentContext > xContext(
683 ::comphelper::getProcessComponentContext() );
684 _rxContainer.set ( _bScript
685 ? DocumentScriptLibraryContainer::create(
686 xContext, xStorageDoc )
687 : DocumentDialogLibraryContainer::create(
688 xContext, xStorageDoc )
689 , UNO_QUERY_THROW );
690 }
691 catch (const Exception&)
692 {
693 DBG_UNHANDLED_EXCEPTION("sfx.doc");
694 }
695 }
696 return _rxContainer;
697 }
698}
699#endif
700
701Reference< XLibraryContainer > SfxObjectShell::GetDialogContainer()
702{
703#if HAVE_FEATURE_SCRIPTING
704 try
705 {
706 if ( !pImpl->m_bNoBasicCapabilities )
707 return lcl_getOrCreateLibraryContainer( false, pImpl->xDialogLibraries, GetModel() );
708
709 BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
710 if ( pBasMgr )
711 return pBasMgr->GetDialogLibraryContainer();
712 }
713 catch (const css::ucb::ContentCreationException&)
714 {
715 TOOLS_WARN_EXCEPTION("sfx.doc", "");
716 }
717
718 SAL_WARN("sfx.doc", "SfxObjectShell::GetDialogContainer: falling back to the application - is this really expected here?");
719#endif
720 return SfxGetpApp()->GetDialogContainer();
721}
722
723Reference< XLibraryContainer > SfxObjectShell::GetBasicContainer()
724{
725#if HAVE_FEATURE_SCRIPTING
727 {
728 try
729 {
730 if ( !pImpl->m_bNoBasicCapabilities )
731 return lcl_getOrCreateLibraryContainer( true, pImpl->xBasicLibraries, GetModel() );
732
733 BasicManager* pBasMgr = lcl_getBasicManagerForDocument( *this );
734 if ( pBasMgr )
735 return pBasMgr->GetScriptLibraryContainer();
736 }
737 catch (const css::ucb::ContentCreationException&)
738 {
739 TOOLS_WARN_EXCEPTION("sfx.doc", "");
740 }
741 }
742 SAL_WARN("sfx.doc", "SfxObjectShell::GetBasicContainer: falling back to the application - is this really expected here?");
743#endif
744 return SfxGetpApp()->GetBasicContainer();
745}
746
748{
749#if !HAVE_FEATURE_SCRIPTING
750 return nullptr;
751#else
752 BasicManager * pMan = GetBasicManager();
753 return pMan ? pMan->GetLib(0) : nullptr;
754#endif
755}
756
758/* [Description]
759
760 Creates a document's BasicManager and loads it, if we are already based on
761 a storage.
762
763 [Note]
764
765 This method has to be called by implementations of <SvPersist::Load()>
766 (with its pStor parameter) and by implementations of <SvPersist::InitNew()>
767 (with pStor = 0).
768*/
769
770{
771 /* #163556# (DR) - Handling of recursive calls while creating the Basic
772 manager.
773
774 It is possible that (while creating the Basic manager) the code that
775 imports the Basic storage wants to access the Basic manager again.
776 Especially in VBA compatibility mode, there is code that wants to
777 access the "VBA Globals" object which is stored as global UNO constant
778 in the Basic manager.
779
780 To achieve correct handling of the recursive calls of this function
781 from lcl_getBasicManagerForDocument(), the implementation of the
782 function BasicManagerRepository::getDocumentBasicManager() has been
783 changed to return the Basic manager currently under construction, when
784 called repeatedly.
785
786 The variable pImpl->bBasicInitialized will be set to sal_True after
787 construction now, to ensure that the recursive call of the function
788 lcl_getBasicManagerForDocument() will be routed into this function too.
789
790 Calling BasicManagerHolder::reset() twice is not a big problem, as it
791 does not take ownership but stores only the raw pointer. Owner of all
792 Basic managers is the global BasicManagerRepository instance.
793 */
794#if HAVE_FEATURE_SCRIPTING
795 DBG_ASSERT( !pImpl->bBasicInitialized && !pImpl->aBasicManager.isValid(), "Local BasicManager already exists");
796 try
797 {
798 pImpl->aBasicManager.reset( BasicManagerRepository::getDocumentBasicManager( GetModel() ) );
799 }
800 catch (const css::ucb::ContentCreationException&)
801 {
802 TOOLS_WARN_EXCEPTION("sfx.doc", "");
803 }
804 DBG_ASSERT( pImpl->aBasicManager.isValid(), "SfxObjectShell::InitBasicManager_Impl: did not get a BasicManager!" );
805 pImpl->bBasicInitialized = true;
806#endif
807}
808
809
811{
812 return Close();
813}
814
815
817{
818 return this;
819}
820
821
822uno::Sequence< OUString > SfxObjectShell::GetEventNames()
823{
824 static uno::Sequence< OUString > s_EventNameContainer(rtl::Reference<GlobalEventConfig>(new GlobalEventConfig)->getElementNames());
825
826 return s_EventNameContainer;
827}
828
829
830css::uno::Reference< css::frame::XModel3 > SfxObjectShell::GetModel() const
831{
832 return GetBaseModel();
833}
834
836{
837 OSL_ENSURE( !pImpl->pBaseModel.is() || pModel == nullptr, "Model already set!" );
838 pImpl->pBaseModel.set( pModel );
839 if ( pImpl->pBaseModel.is() )
840 {
841 pImpl->pBaseModel->addCloseListener( new SfxModelListener_Impl(this) );
842 }
843}
844
845
846css::uno::Reference< css::frame::XModel3 > SfxObjectShell::GetBaseModel() const
847{
848 return pImpl->pBaseModel;
849}
850
852{
853 pImpl->nStyleFilter = nSet;
854}
855
857{
858 return pImpl->nStyleFilter;
859}
860
861
862void SfxObjectShell::SetCurrentComponent( const Reference< XInterface >& _rxComponent )
863{
864 WeakReference< XInterface >& rTheCurrentComponent = theCurrentComponent;
865
866 Reference< XInterface > xOldCurrentComp(rTheCurrentComponent);
867 if ( _rxComponent == xOldCurrentComp )
868 // nothing to do
869 return;
870 // note that "_rxComponent.get() == s_xCurrentComponent.get().get()" is /sufficient/, but not
871 // /required/ for "_rxComponent == s_xCurrentComponent.get()".
872 // In other words, it's still possible that we here do something which is not necessary,
873 // but we should have filtered quite some unnecessary calls already.
874
875#if HAVE_FEATURE_SCRIPTING
877 rTheCurrentComponent = _rxComponent;
878 if ( !pAppMgr )
879 return;
880
881 // set "ThisComponent" for Basic
882 pAppMgr->SetGlobalUNOConstant( "ThisComponent", Any( _rxComponent ) );
883
884 // set new current component for VBA compatibility
885 if ( _rxComponent.is() )
886 {
887 OUString aVBAConstName = lclGetVBAGlobalConstName( _rxComponent );
888 if ( !aVBAConstName.isEmpty() )
889 {
890 pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( _rxComponent ) );
891 s_aRegisteredVBAConstants[ _rxComponent.get() ] = aVBAConstName;
892 }
893 }
894 // no new component passed -> remove last registered VBA component
895 else if ( xOldCurrentComp.is() )
896 {
897 OUString aVBAConstName = lclGetVBAGlobalConstName( xOldCurrentComp );
898 if ( !aVBAConstName.isEmpty() )
899 {
900 pAppMgr->SetGlobalUNOConstant( aVBAConstName, Any( Reference< XInterface >() ) );
901 s_aRegisteredVBAConstants.erase( xOldCurrentComp.get() );
902 }
903 }
904#endif
905}
906
907Reference< XInterface > SfxObjectShell::GetCurrentComponent()
908{
909 return theCurrentComponent;
910}
911
912
913OUString SfxObjectShell::GetServiceNameFromFactory( const OUString& rFact )
914{
916 OUString aFact( rFact );
917 OUString aPrefix("private:factory/");
918 if ( aFact.startsWith( aPrefix ) )
919 aFact = aFact.copy( aPrefix.getLength() );
920 sal_Int32 nPos = aFact.indexOf( '?' );
921 if ( nPos != -1 )
922 {
923 aFact = aFact.copy( 0, nPos );
924 }
925 aFact = aFact.replaceAll("4", "");
926 aFact = aFact.toAsciiLowerCase();
927
928 // HACK: sometimes a real document service name is given here instead of
929 // a factory short name. Set return value directly to this service name as fallback
930 // in case next lines of code does nothing ...
931 // use rFact instead of normed aFact value !
932 OUString aServiceName = rFact;
933
934 if ( aFact == "swriter" )
935 {
936 aServiceName = "com.sun.star.text.TextDocument";
937 }
938 else if ( aFact == "sweb" || aFact == "swriter/web" )
939 {
940 aServiceName = "com.sun.star.text.WebDocument";
941 }
942 else if ( aFact == "sglobal" || aFact == "swriter/globaldocument" )
943 {
944 aServiceName = "com.sun.star.text.GlobalDocument";
945 }
946 else if ( aFact == "scalc" )
947 {
948 aServiceName = "com.sun.star.sheet.SpreadsheetDocument";
949 }
950 else if ( aFact == "sdraw" )
951 {
952 aServiceName = "com.sun.star.drawing.DrawingDocument";
953 }
954 else if ( aFact == "simpress" )
955 {
956 aServiceName = "com.sun.star.presentation.PresentationDocument";
957 }
958 else if ( aFact == "schart" )
959 {
960 aServiceName = "com.sun.star.chart.ChartDocument";
961 }
962 else if ( aFact == "smath" )
963 {
964 aServiceName = "com.sun.star.formula.FormulaProperties";
965 }
966#if HAVE_FEATURE_SCRIPTING
967 else if ( aFact == "sbasic" )
968 {
969 aServiceName = "com.sun.star.script.BasicIDE";
970 }
971#endif
972#if HAVE_FEATURE_DBCONNECTIVITY && !ENABLE_FUZZERS
973 else if ( aFact == "sdatabase" )
974 {
975 aServiceName = "com.sun.star.sdb.OfficeDatabaseDocument";
976 }
977#endif
978
979 return aServiceName;
980}
981
983{
984 return CreateObject( GetServiceNameFromFactory( rFact ), eMode );
985}
986
987
988SfxObjectShell* SfxObjectShell::CreateObject( const OUString& rServiceName, SfxObjectCreateMode eCreateMode )
989{
990 if ( !rServiceName.isEmpty() )
991 {
992 uno::Reference < frame::XModel > xDoc( ::comphelper::getProcessServiceFactory()->createInstance( rServiceName ), UNO_QUERY );
994 {
995 pRet->SetCreateMode_Impl(eCreateMode);
996 return pRet;
997 }
998 }
999
1000 return nullptr;
1001}
1002
1003Reference<lang::XComponent> SfxObjectShell::CreateAndLoadComponent( const SfxItemSet& rSet )
1004{
1005 uno::Sequence < beans::PropertyValue > aProps;
1006 TransformItems( SID_OPENDOC, rSet, aProps );
1007 const SfxStringItem* pFileNameItem = rSet.GetItem<SfxStringItem>(SID_FILE_NAME, false);
1008 const SfxStringItem* pTargetItem = rSet.GetItem<SfxStringItem>(SID_TARGETNAME, false);
1009 OUString aURL;
1010 OUString aTarget("_blank");
1011 if ( pFileNameItem )
1012 aURL = pFileNameItem->GetValue();
1013 if ( pTargetItem )
1014 aTarget = pTargetItem->GetValue();
1015
1016 uno::Reference < frame::XComponentLoader > xLoader =
1017 frame::Desktop::create(comphelper::getProcessComponentContext());
1018
1019 Reference <lang::XComponent> xComp;
1020 try
1021 {
1022 xComp = xLoader->loadComponentFromURL(aURL, aTarget, 0, aProps);
1023 }
1024 catch (const uno::Exception&)
1025 {
1026 }
1027
1028 return xComp;
1029}
1030
1031SfxObjectShell* SfxObjectShell::GetShellFromComponent(const Reference<uno::XInterface>& xComp)
1032{
1033 try
1034 {
1035 Reference<lang::XUnoTunnel> xTunnel(xComp, UNO_QUERY);
1036 if (!xTunnel)
1037 return nullptr;
1038 static const Sequence <sal_Int8> aSeq( SvGlobalName( SFX_GLOBAL_CLASSID ).GetByteSequence() );
1039 return comphelper::getSomething_cast<SfxObjectShell>(xTunnel->getSomething(aSeq));
1040 }
1041 catch (const Exception&)
1042 {
1043 }
1044
1045 return nullptr;
1046}
1047
1048SfxObjectShell* SfxObjectShell::GetParentShell(const css::uno::Reference<css::uno::XInterface>& xChild)
1049{
1050 SfxObjectShell* pResult = nullptr;
1051
1052 try
1053 {
1054 if (css::uno::Reference<css::container::XChild> xChildModel{ xChild, css::uno::UNO_QUERY })
1055 pResult = GetShellFromComponent(xChildModel->getParent());
1056 }
1057 catch (const Exception&)
1058 {
1059 }
1060
1061 return pResult;
1062}
1063
1064void SfxObjectShell::SetInitialized_Impl( const bool i_fromInitNew )
1065{
1066 pImpl->bInitialized = true;
1068 return;
1069 if ( i_fromInitNew )
1070 {
1073 }
1074 else
1075 {
1077 }
1078}
1079
1080
1082{
1083 // currently this function needs to be overwritten by Writer and Calc only
1084 SAL_WARN( "sfx.doc", "function not implemented" );
1085 return false;
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
1097void SfxObjectShell::SetChangeRecording( bool /*bActivate*/, bool /*bLockAllViews*/ )
1098{
1099 // currently this function needs to be overwritten by Writer and Calc only
1100 SAL_WARN( "sfx.doc", "function not implemented" );
1101}
1102
1103
1104void SfxObjectShell::SetProtectionPassword( const OUString & /*rPassword*/ )
1105{
1106 // currently this function needs to be overwritten by Writer and Calc only
1107 SAL_WARN( "sfx.doc", "function not implemented" );
1108}
1109
1110
1111bool SfxObjectShell::GetProtectionHash( /*out*/ css::uno::Sequence< sal_Int8 > & /*rPasswordHash*/ )
1112{
1113 // currently this function needs to be overwritten by Writer and Calc only
1114 SAL_WARN( "sfx.doc", "function not implemented" );
1115 return false;
1116}
1117
1118/* 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:232
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:722
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:3255
OUString GetBaseURL(bool bForSaving=false)
Definition: docfile.cxx:634
const INetURLObject & GetURLObject() const
Definition: docfile.cxx:3575
SAL_DLLPRIVATE void CanDisposeStorage_Impl(bool bDisposeStorage)
Definition: docfile.cxx:1947
SAL_DLLPRIVATE bool HasStorage_Impl() const
Definition: docfile.cxx:4306
css::uno::Reference< css::embed::XStorage > GetStorage(bool bCreateTempFile=true)
Definition: docfile.cxx:1703
virtual bool HasChangeRecordProtection() const
Definition: objxtor.cxx:1089
static SfxObjectShell * CreateObject(const OUString &rServiceName, SfxObjectCreateMode=SfxObjectCreateMode::STANDARD)
Definition: objxtor.cxx:988
bool DoClose()
Definition: objxtor.cxx:810
virtual bool PrepareClose(bool bUI=true)
Definition: objxtor.cxx:504
bool CloseInternal()
Definition: objxtor.cxx:361
css::uno::Reference< css::script::XLibraryContainer > GetBasicContainer()
Definition: objxtor.cxx:723
SfxObjectShell(SfxObjectCreateMode)
Constructor of the class SfxObjectShell.
Definition: objxtor.cxx:272
static OUString GetServiceNameFromFactory(const OUString &rFact)
Definition: objxtor.cxx:913
SAL_DLLPRIVATE void InitBasicManager_Impl()
Definition: objxtor.cxx:757
virtual bool GetProtectionHash(css::uno::Sequence< sal_Int8 > &rPasswordHash)
Definition: objxtor.cxx:1111
static OUString CreateShellID(const SfxObjectShell *pShell)
Definition: objxtor.cxx:403
virtual SfxObjectShell * GetObjectShell() override
Definition: objxtor.cxx:816
sal_uInt16 GetAutoStyleFilterIndex() const
Definition: objxtor.cxx:856
static css::uno::Reference< css::lang::XComponent > CreateAndLoadComponent(const SfxItemSet &rSet)
Definition: objxtor.cxx:1003
SAL_DLLPRIVATE void SetInitialized_Impl(const bool i_fromInitNew)
Definition: objxtor.cxx:1064
bool IsInModalMode() const
Definition: objmisc.cxx:418
bool IsInPrepareClose() const
Definition: objxtor.cxx:486
virtual css::uno::Sequence< OUString > GetEventNames()
Definition: objxtor.cxx:822
SfxProgress * GetProgress() const
Definition: objmisc.cxx:873
BasicManager * GetBasicManager() const
Definition: objxtor.cxx:636
static SfxObjectShell * GetShellFromComponent(const css::uno::Reference< css::uno::XInterface > &xComp)
Definition: objxtor.cxx:1031
bool IsEnableSetModified() const
Definition: objmisc.cxx:248
SfxObjectCreateMode eCreateMode
Definition: objsh.hxx:187
virtual ~SfxObjectShell() override
Definition: objxtor.cxx:282
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
Definition: objxtor.cxx:450
bool HasBasic() const
Definition: objxtor.cxx:654
bool IsReadOnly() const
Definition: objmisc.cxx:412
virtual bool IsChangeRecording() const
Definition: objxtor.cxx:1081
bool IsDocShared() const
Definition: objmisc.cxx:630
static void SetCurrentComponent(const css::uno::Reference< css::uno::XInterface > &_rxComponent)
Definition: objxtor.cxx:862
static SfxObjectShell * GetParentShell(const css::uno::Reference< css::uno::XInterface > &xChild)
Definition: objxtor.cxx:1048
SAL_DLLPRIVATE void FreeSharedFile(const OUString &aTempFileURL)
bool IsModified() const
Definition: objmisc.cxx:255
virtual bool Close() override
Definition: objxtor.cxx:354
SfxMedium * pMedium
Definition: objsh.hxx:185
void SetAutoStyleFilterIndex(sal_uInt16 nSet)
Definition: objxtor.cxx:851
css::uno::Reference< css::script::XLibraryContainer > GetDialogContainer()
Definition: objxtor.cxx:701
virtual void SetProtectionPassword(const OUString &rPassword)
Definition: objxtor.cxx:1104
static SfxObjectShell * CreateObjectByFactoryName(const OUString &rURL, SfxObjectCreateMode=SfxObjectCreateMode::STANDARD)
Definition: objxtor.cxx:982
SAL_DLLPRIVATE SfxObjectShell_Impl * Get_Impl()
Definition: objsh.hxx:707
SfxMedium * GetMedium() const
Definition: objsh.hxx:256
css::uno::Reference< css::frame::XModel3 > GetModel() const
Definition: objxtor.cxx:830
css::uno::Reference< css::frame::XModel3 > GetBaseModel() const
Definition: objxtor.cxx:846
std::unique_ptr< struct SfxObjectShell_Impl > pImpl
Definition: objsh.hxx:183
StarBASIC * GetBasic() const
Definition: objxtor.cxx:747
static css::uno::Reference< css::uno::XInterface > GetCurrentComponent()
Definition: objxtor.cxx:907
void EnableSetModified(bool bEnable=true)
Definition: objmisc.cxx:241
virtual void SetChangeRecording(bool bActivate, bool bLockAllViews=false)
Definition: objxtor.cxx:1097
bool IsSaveVersionOnClose() const
Definition: objcont.cxx:645
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
Definition: objxtor.cxx:425
SfxObjectCreateMode GetCreateMode() const
Definition: objsh.hxx:479
bool Stamp_GetPrintCancelState() const
Definition: objxtor.cxx:346
bool IsPreview() const
Definition: objmisc.cxx:1548
SAL_DLLPRIVATE void SetActivateEvent_Impl(SfxEventHintId)
Definition: objmisc.cxx:918
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
Definition: objxtor.cxx:479
void SetBaseModel(SfxBaseModel *pModel)
Definition: objxtor.cxx:835
void Stamp_SetPrintCancelState(bool bState)
Definition: objxtor.cxx:340
virtual bool IsVoidItem() const
static SAL_WARN_UNUSED_RESULT SfxViewFrame * Current()
Definition: viewfrm.cxx:1958
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:1989
static SAL_WARN_UNUSED_RESULT SfxViewFrame * GetFirst(const SfxObjectShell *pDoc=nullptr, bool bOnlyVisible=true)
Definition: viewfrm.cxx:1966
SfxFrame & GetFrame() const
Definition: viewfrm.cxx:2765
virtual SfxObjectShell * GetObjectShell() override
Definition: viewfrm.cxx:2201
weld::Window * GetFrameWeld() const
Definition: viewfrm.cxx:2780
static void SetViewFrame(SfxViewFrame *)
Definition: viewfrm.cxx:3566
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:155
SfxLoadedFlags
Definition: objsh.hxx:121
#define SFX_GLOBAL_CLASSID
Definition: objsh.hxx:797
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:54
bool m_bNoBasicCapabilities
Definition: objshimp.hxx:83
unsigned char sal_Bool
RET_CANCEL
RET_YES