1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
21 #include <vcl/svapp.hxx>
22 #include <tools/debug.hxx>
23 #include <vcl/weld.hxx>
25 #include <basic/sbstar.hxx>
26 #include <basic/basrdll.hxx>
27 #include <strings.hrc>
28 #include <sbxbase.hxx>
29 #include <config_features.h>
36 std::unique_ptr
<SbxAppData
> xSbxAppData
;
41 , xSbxAppData(new SbxAppData
)
61 void BasicDLL::EnableBreak( bool bEnable
)
63 BasicDLL
* pThis
= BASIC_DLL
;
64 DBG_ASSERT( pThis
, "BasicDLL::EnableBreak: No instance yet!" );
67 pThis
->m_xImpl
->bBreakEnabled
= bEnable
;
71 void BasicDLL::SetDebugMode( bool bDebugMode
)
73 BasicDLL
* pThis
= BASIC_DLL
;
74 DBG_ASSERT( pThis
, "BasicDLL::EnableBreak: No instance yet!" );
77 pThis
->m_xImpl
->bDebugMode
= bDebugMode
;
82 void BasicDLL::BasicBreak()
84 BasicDLL
* pThis
= BASIC_DLL
;
85 DBG_ASSERT( pThis
, "BasicDLL::EnableBreak: No instance yet!" );
86 #if HAVE_FEATURE_SCRIPTING
89 // bJustStopping: if there's someone pressing STOP like crazy umpteen times,
90 // but the Basic doesn't stop early enough, the box might appear more often...
91 static bool bJustStopping
= false;
92 if (StarBASIC::IsRunning() && !bJustStopping
93 && (pThis
->m_xImpl
->bBreakEnabled
|| pThis
->m_xImpl
->bDebugMode
))
97 std::unique_ptr
<weld::MessageDialog
> xInfoBox(Application::CreateMessageDialog(nullptr,
98 VclMessageType::Info
, VclButtonsType::Ok
,
99 BasResId(IDS_SBERR_TERMINATED
)));
101 bJustStopping
= false;
107 SbxAppData
& GetSbxData_Impl()
109 return *BASIC_DLL
->m_xImpl
->xSbxAppData
;
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */