33#include <com/sun/star/frame/Desktop.hpp>
34#include <com/sun/star/script/XLibraryContainerPassword.hpp>
37#include <osl/diagnose.h>
70struct theDllInstance :
public rtl::Static<DllInstance, theDllInstance> { };
77 theDllInstance::get();
82 if (Dll* pDll = theDllInstance::get().
get())
83 return pDll->GetShell();
89 Dll* pDll = theDllInstance::get().get();
90 if (pDll && !pDll->GetShell())
91 pDll->SetShell(pShell);
96 Dll* pDll = theDllInstance::get().get();
97 if (pDll && pDll->GetShell() == pShell)
98 pDll->SetShell(
nullptr);
103 if (Dll* pDll = theDllInstance::get().
get())
104 return pDll->GetExtraData();
121 auto pModule = std::make_unique<Module>(
"basctl", &rFactory);
129 DocShell::RegisterInterface( pMod );
130 Shell::RegisterFactory( SVX_INTERFACE_BASIDE_VIEWSH );
131 Shell::RegisterInterface( pMod );
147ExtraData::ExtraData () :
148 bChoosingMacro(false),
149 bShellInCriticalSection(false)
177 OSL_ENSURE(
aDocument.
isValid(),
"basctl::ExtraData::GlobalBasicBreakHdl: no document for the basic manager!" );
180 OUString aOULibName( pBasic->GetName() );
182 if ( xModLibContainer.is() && xModLibContainer->hasByName( aOULibName ) )
185 if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( aOULibName ) && !xPasswd->isLibraryPasswordVerified( aOULibName ) )
188 nRet = BasicDebugFlags::StepOut;
192 nRet = pShell->CallBasicBreakHdl( pBasic );
static void SetModule(SfxToolsModule nSharedLib, std::unique_ptr< SfxModule > pModule)
static SfxModule * GetModule(SfxToolsModule nSharedLib)
void SetDocumentServiceName(const OUString &rServiceName)
static void SetGlobalBreakHdl(const Link< StarBASIC *, BasicDebugFlags > &rNewHdl)
encapsulates a document which contains Basic scripts and dialogs
css::uno::Reference< css::script::XLibraryContainer > getLibraryContainer(LibraryContainerType _eType) const
returns the Basic or Dialog library container of the document
static ScriptDocument getDocumentForBasicManager(const BasicManager *_pManager)
returns a (newly created) ScriptDocument instance for the document to which a given BasicManager belo...
bool isValid() const
determines whether the document is actually able to contain Basic/Dialog libraries
std::unique_ptr< ExtraData > m_xExtraData
void SetShell(SwViewShell *pSh)
#define LINK(Instance, Class, Member)
OUString get(TranslateId sContextAndId, const std::locale &loc)
IMPL_STATIC_LINK(ExtraData, GlobalBasicBreakHdl, StarBASIC *, pBasic, BasicDebugFlags)
ExtraData * GetExtraData()
void ShellCreated(Shell *pShell)
BasicManager * FindBasicManager(StarBASIC const *pLib)
OUString IDEResId(TranslateId aId)
void ShellDestroyed(Shell const *pShell)
Reference< XComponentContext > getProcessComponentContext()
css::uno::Reference< css::deployment::XPackageRegistry > create(css::uno::Reference< css::deployment::XPackageRegistry > const &xRootRegistry, OUString const &context, OUString const &cachePath, css::uno::Reference< css::uno::XComponentContext > const &xComponentContext)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)