testbasi.cxx (9d1279ec) testbasi.cxx (f6675432)
1/**************************************************************
1/**************************************************************
2 *
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance
9 * with the License. You may obtain a copy of the License at
10 *
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied. See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
19 *
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_automation.hxx"
26#include <basic/sbx.hxx>
27

--- 48 unchanged lines hidden (view full) ---

76// Eigenes Objekt reinbraten
77 TestToolObj* pTTO = new TestToolObj( CUniString("App"), this );
78 pTTO->SetLogHdl( GenLogHdl() );
79 pTTO->SetWinInfoHdl( GenWinInfoHdl() );
80 pTTO->SetModuleWinExistsHdl( GenModuleWinExistsHdl() );
81 pTTO->SetWriteStringHdl( GenWriteStringHdl() );
82 pTTO->SetCErrorHdl( LINK( this, TTBasic, CErrorImpl ) );
83
20 *************************************************************/
21
22
23
24// MARKER(update_precomp.py): autogen include statement, do not remove
25#include "precompiled_automation.hxx"
26#include <basic/sbx.hxx>
27

--- 48 unchanged lines hidden (view full) ---

76// Eigenes Objekt reinbraten
77 TestToolObj* pTTO = new TestToolObj( CUniString("App"), this );
78 pTTO->SetLogHdl( GenLogHdl() );
79 pTTO->SetWinInfoHdl( GenWinInfoHdl() );
80 pTTO->SetModuleWinExistsHdl( GenModuleWinExistsHdl() );
81 pTTO->SetWriteStringHdl( GenWriteStringHdl() );
82 pTTO->SetCErrorHdl( LINK( this, TTBasic, CErrorImpl ) );
83
84 StartListeningTT( pTTO->GetTTBroadcaster() );
84 StartListeningTT( pTTO->GetTTBroadcaster() );
85
86 pTestObject = pTTO;
87 pTestObject->SetFlag( SBX_EXTSEARCH );
88 Insert( pTestObject );
89}
90
91MyBasic* TTBasic::CreateMyBasic()
92{

--- 27 unchanged lines hidden (view full) ---

120 SetCompileModule( p );
121 p->SetSource( ((TestToolObj*)pTestObject)->PreCompile(p->GetSource()) );
122 SetCompileModule( pOldModule );
123 if ( ((TestToolObj*)pTestObject)->WasPrecompilerError() )
124 return sal_False;
125 return MyBasic::Compile( p );
126}
127
85
86 pTestObject = pTTO;
87 pTestObject->SetFlag( SBX_EXTSEARCH );
88 Insert( pTestObject );
89}
90
91MyBasic* TTBasic::CreateMyBasic()
92{

--- 27 unchanged lines hidden (view full) ---

120 SetCompileModule( p );
121 p->SetSource( ((TestToolObj*)pTestObject)->PreCompile(p->GetSource()) );
122 SetCompileModule( pOldModule );
123 if ( ((TestToolObj*)pTestObject)->WasPrecompilerError() )
124 return sal_False;
125 return MyBasic::Compile( p );
126}
127
128const String TTBasic::GetSpechialErrorText()
128const String TTBasic::GetSpecialErrorText()
129{
130 String nErrorText;
131 if ( pTestObject && IS_ERROR() && GetErrorCode() == GET_ERROR()->nError )
132 {
133 nErrorText = GenRealString( GET_ERROR()->aText );
134 nErrorText.AppendAscii( ": " );
135 nErrorText += String::CreateFromInt64( GET_ERROR()->nError );
136 }
137 else
138 {
139 nErrorText = GetErrorText();
140 }
141 return nErrorText;
142}
143
144void TTBasic::ReportRuntimeError( AppBasEd *pEditWin )
145{
146 SbxVariableRef aDummy = new SbxVariable;
129{
130 String nErrorText;
131 if ( pTestObject && IS_ERROR() && GetErrorCode() == GET_ERROR()->nError )
132 {
133 nErrorText = GenRealString( GET_ERROR()->aText );
134 nErrorText.AppendAscii( ": " );
135 nErrorText += String::CreateFromInt64( GET_ERROR()->nError );
136 }
137 else
138 {
139 nErrorText = GetErrorText();
140 }
141 return nErrorText;
142}
143
144void TTBasic::ReportRuntimeError( AppBasEd *pEditWin )
145{
146 SbxVariableRef aDummy = new SbxVariable;
147 aDummy->SetUserData( 24 ); // ID_MaybeAddErr
147 aDummy->SetUserData( 24 ); // ID_MaybeAddErr
148 ((TestToolObj*)pTestObject)->Notify( pTestObject->GetBroadcaster(), SbxHint( SBX_HINT_DATAWANTED, aDummy ) );
148 ((TestToolObj*)pTestObject)->Notify( pTestObject->GetBroadcaster(), SbxHint( SBX_HINT_DATAWANTED, aDummy ) );
149 aDummy->SetUserData( 18 ); // ID_ExceptLog
149 aDummy->SetUserData( 18 ); // ID_ExceptLog
150 ((TestToolObj*)pTestObject)->Notify( pTestObject->GetBroadcaster(), SbxHint( SBX_HINT_DATAWANTED, aDummy ) );
151 MyBasic::ReportRuntimeError( pEditWin );
152}
153
154void TTBasic::DebugFindNoErrors( sal_Bool bDebugFindNoErrors )
155{
156 ((TestToolObj*)pTestObject)->DebugFindNoErrors( bDebugFindNoErrors );
157}
150 ((TestToolObj*)pTestObject)->Notify( pTestObject->GetBroadcaster(), SbxHint( SBX_HINT_DATAWANTED, aDummy ) );
151 MyBasic::ReportRuntimeError( pEditWin );
152}
153
154void TTBasic::DebugFindNoErrors( sal_Bool bDebugFindNoErrors )
155{
156 ((TestToolObj*)pTestObject)->DebugFindNoErrors( bDebugFindNoErrors );
157}
158
159/* vim: set noet sw=4 ts=4: */