summaryrefslogtreecommitdiff
path: root/basic/source
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source')
-rw-r--r--basic/source/app/app.cxx6
-rw-r--r--basic/source/app/appwin.cxx8
-rw-r--r--basic/source/app/brkpnts.cxx1
-rw-r--r--basic/source/app/dialogs.cxx2
-rw-r--r--basic/source/app/dialogs.hxx1
-rw-r--r--basic/source/app/msgedit.cxx13
-rw-r--r--basic/source/app/process.cxx5
-rw-r--r--basic/source/app/processw.hxx4
-rw-r--r--basic/source/app/textedit.cxx4
-rw-r--r--basic/source/basmgr/basicmanagerrepository.cxx2
-rw-r--r--basic/source/basmgr/basmgr.cxx2
-rw-r--r--basic/source/classes/disas.cxx26
-rw-r--r--basic/source/classes/image.cxx2
-rw-r--r--basic/source/classes/sb.cxx15
-rw-r--r--basic/source/classes/sb.src58
-rw-r--r--basic/source/classes/sbunoobj.cxx10
-rw-r--r--basic/source/classes/sbxmod.cxx22
-rw-r--r--basic/source/comp/codegen.cxx10
-rw-r--r--basic/source/comp/loops.cxx3
-rw-r--r--basic/source/comp/sbcomp.cxx376
-rw-r--r--basic/source/comp/symtbl.cxx2
-rw-r--r--basic/source/inc/namecont.hxx4
-rw-r--r--basic/source/inc/object.hxx4
-rw-r--r--basic/source/inc/opcodes.hxx4
-rw-r--r--basic/source/inc/sbtrace.hxx45
-rw-r--r--basic/source/inc/sbunoobj.hxx5
-rw-r--r--basic/source/inc/scriptcont.hxx2
-rw-r--r--basic/source/runtime/dllmgr-x64.cxx2
-rw-r--r--basic/source/runtime/dllmgr-x86.cxx2
-rw-r--r--basic/source/runtime/iosys.cxx2
-rw-r--r--basic/source/runtime/makefile.mk1
-rw-r--r--basic/source/runtime/methods.cxx7
-rw-r--r--basic/source/runtime/runtime.cxx20
-rw-r--r--basic/source/runtime/stdobj.cxx4
-rw-r--r--basic/source/sbx/sbxbase.cxx7
-rw-r--r--basic/source/sbx/sbxcurr.cxx2
-rw-r--r--basic/source/sbx/sbxdate.cxx8
-rw-r--r--basic/source/sbx/sbxdec.hxx4
-rw-r--r--basic/source/sbx/sbxform.cxx4
-rw-r--r--basic/source/sbx/sbxscan.cxx7
-rw-r--r--basic/source/sbx/sbxvalue.cxx4
-rw-r--r--basic/source/uno/dlgcont.cxx3
-rw-r--r--basic/source/uno/modsizeexceeded.cxx3
-rw-r--r--basic/source/uno/namecont.cxx12
-rw-r--r--basic/source/uno/scriptcont.cxx8
45 files changed, 84 insertions, 652 deletions
diff --git a/basic/source/app/app.cxx b/basic/source/app/app.cxx
index 7cb4f2ab5751..e82261084a70 100644
--- a/basic/source/app/app.cxx
+++ b/basic/source/app/app.cxx
@@ -74,13 +74,15 @@
using namespace comphelper;
using namespace cppu;
-using namespace rtl;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star::ucb;
using namespace com::sun::star::beans;
+using ::rtl::OUString;
+using ::rtl::OUStringToOString;
+
#endif /* _USE_UNO */
IMPL_GEN_RES_STR;
@@ -237,7 +239,7 @@ int BasicApp::Main( )
DBG_INSTOUTERROR( DBG_OUT_TESTTOOL );
if ( osl_setDebugMessageFunc( osl_TestToolDebugMessageFilter ) )
- DBG_ERROR("osl_setDebugMessageFunc returns non NULL pointer");
+ OSL_FAIL("osl_setDebugMessageFunc returns non NULL pointer");
#endif
ResMgr::SetReadStringHook( ReplaceStringHookProc );
diff --git a/basic/source/app/appwin.cxx b/basic/source/app/appwin.cxx
index 120feafb7fb0..e39d6c8e95b3 100644
--- a/basic/source/app/appwin.cxx
+++ b/basic/source/app/appwin.cxx
@@ -390,7 +390,7 @@ BOOL AppWin::DiskFileChanged( USHORT nWhat )
// uncomment to avoid compiler warning
// break;
default:
- DBG_ERROR("Not Implemented in AppWin::DiskFileChanged");
+ OSL_FAIL("Not Implemented in AppWin::DiskFileChanged");
}
return TRUE;
}
@@ -415,7 +415,7 @@ void AppWin::UpdateFileInfo( USHORT nWhat )
}
break;
default:
- DBG_ERROR("Not Implemented in AppWin::UpdateFileInfo");
+ OSL_FAIL("Not Implemented in AppWin::UpdateFileInfo");
}
}
@@ -590,7 +590,7 @@ USHORT AppWin::QuerySave( QueryBits nBits )
nReturn = SAVE_RES_CANCEL;
break;
default:
- DBG_ERROR("switch default where no default should be: Internal error");
+ OSL_FAIL("switch default where no default should be: Internal error");
nReturn = SAVE_RES_CANCEL;
}
SkipReload( FALSE );
@@ -619,7 +619,7 @@ BOOL AppWin::Close()
// uncomment to avoid compiler warning
// break;
default:
- DBG_ERROR("Not Implemented in AppWin::Close");
+ OSL_FAIL("Not Implemented in AppWin::Close");
return FALSE;
}
}
diff --git a/basic/source/app/brkpnts.cxx b/basic/source/app/brkpnts.cxx
index 86176a764345..a09480c80dc3 100644
--- a/basic/source/app/brkpnts.cxx
+++ b/basic/source/app/brkpnts.cxx
@@ -28,7 +28,6 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_basic.hxx"
-#include <tools/list.hxx>
#include <basic/sbx.hxx>
#include <basic/sbmod.hxx>
#include <basic/sbstar.hxx>
diff --git a/basic/source/app/dialogs.cxx b/basic/source/app/dialogs.cxx
index ba2a523944aa..178455cb9e77 100644
--- a/basic/source/app/dialogs.cxx
+++ b/basic/source/app/dialogs.cxx
@@ -301,7 +301,7 @@ IMPL_LINK( OptionsDialog, ActivatePageHdl, TabControl *, pTabCtrl )
case RID_TP_FON:
pNewTabPage = new FontOptions( pTabCtrl, aConfig );
break;
- default: DBG_ERROR( "PageHdl: Unbekannte ID!" );
+ default: OSL_FAIL( "PageHdl: Unbekannte ID!" );
}
DBG_ASSERT( pNewTabPage, "Keine Page!" );
pTabCtrl->SetTabPage( nId, pNewTabPage );
diff --git a/basic/source/app/dialogs.hxx b/basic/source/app/dialogs.hxx
index 743949b64898..677bef1962be 100644
--- a/basic/source/app/dialogs.hxx
+++ b/basic/source/app/dialogs.hxx
@@ -38,7 +38,6 @@
#include <vcl/tabctrl.hxx>
#include <vcl/tabpage.hxx>
#include <tools/config.hxx>
-#include <tools/list.hxx>
#include <vcl/lstbox.hxx>
#include <vcl/floatwin.hxx>
#include <vcl/toolbox.hxx>
diff --git a/basic/source/app/msgedit.cxx b/basic/source/app/msgedit.cxx
index 16e8639c7430..34b59d50ed9b 100644
--- a/basic/source/app/msgedit.cxx
+++ b/basic/source/app/msgedit.cxx
@@ -167,7 +167,7 @@ void MsgEdit::AddAnyMsg( TTLogMsg *LogMsg )
case LOG_ASSERTION: AddAssertion( aUILogMsg, LogMsg->aDebugData ); break;
case LOG_ASSERTION_STACK: AddAssertionStack( aUILogMsg, LogMsg->aDebugData ); break;
case LOG_QA_ERROR: AddQAError( aUILogMsg, LogMsg->aDebugData ); break;
- default:DBG_ERROR("Unbekannter Typ in ResultFile. Speichern des ResultFile resultiert in Informationsverlust");
+ default:OSL_FAIL("Unbekannter Typ in ResultFile. Speichern des ResultFile resultiert in Informationsverlust");
}
if ( !bFileLoading )
@@ -486,7 +486,7 @@ String MsgEdit::Impl_MakeText( SvLBoxEntry *pEntry ) const
case LOG_ASSERTION: break;
case LOG_ASSERTION_STACK:aRet.AppendAscii("--> "); break;
case LOG_QA_ERROR: break;
- default:DBG_ERROR("Unknown type in ResultWindow!");
+ default:OSL_FAIL("Unknown type in ResultWindow!");
}
aRet += aEditTree.GetEntryText( pEntry );
return aRet;
@@ -543,10 +543,9 @@ String MsgEdit::GetSelected()
TextSelection MsgEdit::GetSelection() const
{
- ULONG nStart=0,nEnd=0;
-
if ( aEditTree.FirstSelected() )
{
+ ULONG nStart=0,nEnd=0;
nStart = aEditTree.GetModel()->GetAbsPos(aEditTree.FirstSelected() );
if ( aEditTree.LastSelected() )
nEnd = aEditTree.GetModel()->GetAbsPos(aEditTree.LastSelected() );
@@ -585,7 +584,7 @@ void MsgEdit::ReplaceSelected( const String& rStr )
{
(void) rStr; /* avoid warning about unused parameter */
Sound::Beep();
- DBG_ERROR("Not Implemented");
+ OSL_FAIL("Not Implemented");
}
BOOL MsgEdit::IsModified(){ return bModified; }
@@ -609,7 +608,7 @@ void MsgEdit::SetText( const String& rStr )
{
(void) rStr; /* avoid warning about unused parameter */
Sound::Beep();
- DBG_ERROR("Not Implemented");
+ OSL_FAIL("Not Implemented");
}
BOOL MsgEdit::HasText() const
@@ -917,7 +916,7 @@ TTFeatures TTTreeListBox::GetFeatures( SvLBoxEntry* pEntry )
case LOG_QA_ERROR:
return HasQAError;
default:
- DBG_ERROR("Unknown type in ResultWindow");
+ OSL_FAIL("Unknown type in ResultWindow");
}
return HasNothing;
}
diff --git a/basic/source/app/process.cxx b/basic/source/app/process.cxx
index 397eaadbdfee..91e28de22a6a 100644
--- a/basic/source/app/process.cxx
+++ b/basic/source/app/process.cxx
@@ -31,9 +31,8 @@
#ifdef WNT
-#include <tools/prewin.h>
-#include "winbase.h"
-#include <tools/postwin.h>
+#include <prewin.h>
+#include <postwin.h>
#endif
#include <tools/errcode.hxx>
#include <basic/sbxcore.hxx>
diff --git a/basic/source/app/processw.hxx b/basic/source/app/processw.hxx
index 0972ed3f5269..32e486b0ffd8 100644
--- a/basic/source/app/processw.hxx
+++ b/basic/source/app/processw.hxx
@@ -39,12 +39,12 @@ class ProcessWrapper : public SbxObject
using SbxVariable::GetInfo;
// Definition of a table entry. This is done here because
// through this methods and property can declared as private.
-#if defined ( ICC ) || defined ( HPUX ) || defined ( C50 ) || defined ( C52 )
+#if defined ( ICC ) || defined ( C50 ) || defined ( C52 )
public:
#endif
typedef void( ProcessWrapper::*pMeth )
( SbxVariable* pThis, SbxArray* pArgs, BOOL bWrite );
-#if defined ( ICC ) || defined ( HPUX )
+#if defined ( ICC )
private:
#endif
diff --git a/basic/source/app/textedit.cxx b/basic/source/app/textedit.cxx
index 30d1f7a24038..2891cf5e7a16 100644
--- a/basic/source/app/textedit.cxx
+++ b/basic/source/app/textedit.cxx
@@ -201,7 +201,7 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff )
if ( rLast.nStart > rLast.nEnd ) // Only up to the bug of MD repaired
{
#if OSL_DEBUG_LEVEL > 1
- DBG_ERROR( "MD-Bug is not repaired!" );
+ OSL_FAIL( "MD-Bug is not repaired!" );
#endif
nCount--;
aPortionList.Remove( nCount);
@@ -324,7 +324,7 @@ void TextEditImp::ImpDoHighlight( const String& rSource, ULONG nLineOff )
default:
{
aColor = Color( RGB_COLORDATA( 0xff, 0x80, 0x80 ) );
- DBG_ERROR( "Unknown syntax color" );
+ OSL_FAIL( "Unknown syntax color" );
}
}
pTextEngine->SetAttrib( TextAttribFontColor( aColor ), nLine, r.nStart, r.nEnd+1 );
diff --git a/basic/source/basmgr/basicmanagerrepository.cxx b/basic/source/basmgr/basicmanagerrepository.cxx
index c49ebeeeaa37..2057a065e96c 100644
--- a/basic/source/basmgr/basicmanagerrepository.cxx
+++ b/basic/source/basmgr/basicmanagerrepository.cxx
@@ -348,7 +348,7 @@ namespace basic
if ( pos != m_aCreationListeners.end() )
m_aCreationListeners.erase( pos );
else {
- DBG_ERROR( "ImplRepository::revokeCreationListener: listener is not registered!" );
+ OSL_FAIL( "ImplRepository::revokeCreationListener: listener is not registered!" );
}
}
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index 3b798597e168..dde988b50d38 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -1460,7 +1460,7 @@ void BasicManager::CheckModules( StarBASIC* pLib, BOOL bReference ) const
// cause modified
if( !bModified && bReference )
{
- DBG_ERROR( "Per Reference eingebundene Basic-Library ist nicht compiliert!" );
+ OSL_FAIL( "Per Reference eingebundene Basic-Library ist nicht compiliert!" );
pLib->SetModified( FALSE );
}
}
diff --git a/basic/source/classes/disas.cxx b/basic/source/classes/disas.cxx
index fdef98bce335..24cc000edfe7 100644
--- a/basic/source/classes/disas.cxx
+++ b/basic/source/classes/disas.cxx
@@ -36,7 +36,6 @@
#include "sb.hxx"
#include "iosys.hxx"
#include "disas.hxx"
-#include "sbtrace.hxx"
static const char* pOp1[] = {
@@ -364,10 +363,6 @@ BOOL SbiDisas::DisasLine( String& rText )
if( !Fetch() )
return FALSE;
-#ifdef DBG_TRACE_BASIC
- String aTraceStr_STMNT;
-#endif
-
// New line?
if( eOp == _STMNT && nOp1 != nLine )
{
@@ -400,10 +395,6 @@ BOOL SbiDisas::DisasLine( String& rText )
rText.AppendAscii( "; " );
rText += s;
rText.AppendAscii( _crlf() );
-
-#ifdef DBG_TRACE_BASIC
- aTraceStr_STMNT = s;
-#endif
}
}
@@ -463,10 +454,6 @@ BOOL SbiDisas::DisasLine( String& rText )
rText += aPCodeStr;
-#ifdef DBG_TRACE_BASIC
- dbg_RegisterTraceTextForPC( pMod, nPC, aTraceStr_STMNT, aPCodeStr );
-#endif
-
return TRUE;
}
@@ -611,13 +598,6 @@ void SbiDisas::OffOp( String& rText )
}
// Data type
-#ifdef HP9000 // TODO: remove this!
-static char* SbiDisas_TypeOp_pTypes[13] = {
- "Empty","Null","Integer","Long","Single","Double",
- "Currency","Date","String","Object","Error","Boolean",
- "Variant" };
-#define pTypes SbiDisas_TypeOp_pTypes
-#endif
void SbiDisas::TypeOp( String& rText )
{
// From 1996-01-19: type can contain flag for BYVAL (StepARGTYP)
@@ -628,12 +608,11 @@ void SbiDisas::TypeOp( String& rText )
}
if( nOp1 < 13 )
{
-#ifndef HP9000
static char pTypes[][13] = {
"Empty","Null","Integer","Long","Single","Double",
"Currency","Date","String","Object","Error","Boolean",
"Variant" };
-#endif
+
rText.AppendAscii( pTypes[ nOp1 ] );
}
else
@@ -642,9 +621,6 @@ void SbiDisas::TypeOp( String& rText )
rText += (USHORT)nOp1;
}
}
-#ifdef HP9000
-#undef pTypes
-#endif
// TRUE-Label, condition Opcode
void SbiDisas::CaseOp( String& rText )
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index 654ad79df750..716cbe0497d7 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -149,7 +149,6 @@ BOOL SbiImage::Load( SvStream& r, UINT32& nVersion )
ULONG nNext;
while( ( nNext = r.Tell() ) < nLast )
{
- short i;
r >> nSign >> nLen >> nCount;
nNext += nLen + 8;
@@ -217,6 +216,7 @@ BOOL SbiImage::Load( SvStream& r, UINT32& nVersion )
case B_STRINGPOOL:
if( bBadVer ) break;
MakeStrings( nCount );
+ short i;
for( i = 0; i < nStrings && SbiGood( r ); i++ )
{
r >> nOff;
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 07c429769df0..5e53bfb49e1b 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -37,7 +37,6 @@
#include <tools/stream.hxx>
#include <tools/errinf.hxx>
#include <basic/sbx.hxx>
-#include <tools/list.hxx>
#include <tools/shl.hxx>
#include <tools/rc.hxx>
#include <vcl/svapp.hxx>
@@ -56,7 +55,7 @@
#include <osl/mutex.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include "errobject.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <com/sun/star/script/ModuleType.hpp>
#include <com/sun/star/script/ModuleInfo.hpp>
@@ -375,12 +374,12 @@ SbxObject* cloneTypeObjectImpl( const SbxObject& rTypeObj )
SbxBase* pParObj = pVar->GetObject();
SbxDimArray* pSource = PTR_CAST(SbxDimArray,pParObj);
SbxDimArray* pDest = new SbxDimArray( pVar->GetType() );
- INT32 lb = 0;
- INT32 ub = 0;
pDest->setHasFixedSize( pSource->hasFixedSize() );
if ( pSource->GetDims() && pSource->hasFixedSize() )
{
+ INT32 lb = 0;
+ INT32 ub = 0;
for ( INT32 j = 1 ; j <= pSource->GetDims(); ++j )
{
pSource->GetDim32( (INT32)j, lb, ub );
@@ -502,7 +501,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbMethod* pImplMethod = pIfaceMethod->getImplMethod();
if( !pImplMethod )
{
- DBG_ERROR( "No ImplMethod" );
+ OSL_FAIL( "No ImplMethod" );
continue;
}
@@ -512,7 +511,7 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
SbMethod* pImplMethodCopy = p ? PTR_CAST(SbMethod,p) : NULL;
if( !pImplMethodCopy )
{
- DBG_ERROR( "Found no ImplMethod copy" );
+ OSL_FAIL( "Found no ImplMethod copy" );
continue;
}
SbIfaceMapperMethod* pNewIfaceMethod =
@@ -946,7 +945,7 @@ struct ClassModuleRunInitItem
{}
};
-typedef std::hash_map< ::rtl::OUString, ClassModuleRunInitItem,
+typedef boost::unordered_map< ::rtl::OUString, ClassModuleRunInitItem,
::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInitDependencyMap;
static ModuleInitDependencyMap* GpMIDMap = NULL;
@@ -976,7 +975,7 @@ void SbModule::implProcessModuleRunInit( ClassModuleRunInitItem& rItem )
if( rParentItem.m_bProcessing )
{
// TODO: raise error?
- DBG_ERROR( "Cyclic module dependency detected" );
+ OSL_FAIL( "Cyclic module dependency detected" );
continue;
}
diff --git a/basic/source/classes/sb.src b/basic/source/classes/sb.src
index 73cc1c3a0b2c..df916c64b031 100644
--- a/basic/source/classes/sb.src
+++ b/basic/source/classes/sb.src
@@ -47,17 +47,14 @@ Resource RID_BASIC_START
};
String SbERR_BAD_ARGUMENT & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ung³ltiger Prozeduraufruf : Ungltiger Prozeduraufruf */
Text [ en-US ] = "Invalid procedure call." ;
};
String SbERR_MATH_OVERFLOW & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? šberlauf : Überlauf */
Text [ en-US ] = "Overflow." ;
};
String SbERR_NO_MEMORY & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Nicht gen³gend Speicher : Nicht gengend Speicher */
Text [ en-US ] = "Not enough memory." ;
};
String SbERR_ALREADY_DIM & ERRCODE_RES_MASK
@@ -66,7 +63,6 @@ Resource RID_BASIC_START
};
String SbERR_OUT_OF_RANGE & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Index au˜erhalb des definierten Bereichs : Index auÿerhalb des definierten Bereichs */
Text [ en-US ] = "Index out of defined range." ;
};
String SbERR_DUPLICATE_DEF & ERRCODE_RES_MASK
@@ -83,12 +79,10 @@ Resource RID_BASIC_START
};
String SbERR_CONVERSION & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Datentypen unvertrõglich : Datentypen unvertr§glich */
Text [ en-US ] = "Data type mismatch." ;
};
String SbERR_BAD_PARAMETER & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ung³ltiger Parameter : Ungltiger Parameter */
Text [ en-US ] = "Invalid parameter." ;
};
String SbERR_USER_ABORT & ERRCODE_RES_MASK
@@ -101,7 +95,6 @@ Resource RID_BASIC_START
};
String SbERR_STACK_OVERFLOW & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Nicht gen³gend Stapelspeicher : Nicht gengend Stapelspeicher */
Text [ en-US ] = "Not enough stack memory." ;
};
String SbERR_PROC_UNDEFINED & ERRCODE_RES_MASK
@@ -134,12 +127,10 @@ Resource RID_BASIC_START
};
String SbERR_FILE_ALREADY_OPEN & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Datei bereits ge÷ffnet : Datei bereits ge”ffnet */
Text [ en-US ] = "File already open." ;
};
String SbERR_IO_ERROR & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Gerõte-E/A-Fehler : Ger§te-E/A-Fehler */
Text [ en-US ] = "Device I/O error." ;
};
String SbERR_FILE_EXISTS & ERRCODE_RES_MASK
@@ -148,7 +139,6 @@ Resource RID_BASIC_START
};
String SbERR_BAD_RECORD_LENGTH & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Falsche Datensatzlõnge : Falsche Datensatzl§nge */
Text [ en-US ] = "Incorrect record length." ;
};
String SbERR_DISK_FULL & ERRCODE_RES_MASK
@@ -157,7 +147,6 @@ Resource RID_BASIC_START
};
String SbERR_READ_PAST_EOF & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Lesen ³ber das Ende der Datei hinaus : Lesen ber das Ende der Datei hinaus */
Text [ en-US ] = "Reading exceeds EOF." ;
};
String SbERR_BAD_RECORD_NUMBER & ERRCODE_RES_MASK
@@ -170,7 +159,6 @@ Resource RID_BASIC_START
};
String SbERR_NO_DEVICE & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Gerõt nicht verf³gbar : Ger§t nicht verfgbar */
Text [ en-US ] = "Device not available." ;
};
String SbERR_ACCESS_DENIED & ERRCODE_RES_MASK
@@ -187,7 +175,6 @@ Resource RID_BASIC_START
};
String SbERR_DIFFERENT_DRIVE & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Umbenennen auf verschiedenen Laufwerken nicht m÷glich : Umbenennen auf verschiedenen Laufwerken nicht m”glich */
Text [ en-US ] = "Renaming on different drives impossible." ;
};
String SbERR_ACCESS_ERROR & ERRCODE_RES_MASK
@@ -204,12 +191,10 @@ Resource RID_BASIC_START
};
String SbERR_BAD_PATTERN & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Zeichenfolgenmuster unzulõssig : Zeichenfolgenmuster unzul§ssig */
Text [ en-US ] = "Invalid string pattern." ;
};
String SBERR_IS_NULL & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Verwendung von Null unzulõssig : Verwendung von Null unzul§ssig */
Text [ en-US ] = "Use of zero not permitted." ;
};
String SbERR_DDE_ERROR & ERRCODE_RES_MASK
@@ -222,7 +207,6 @@ Resource RID_BASIC_START
};
String SbERR_DDE_OUTOFCHANNELS & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Keine freien DDE-Kanõle : Keine freien DDE-Kan§le */
Text [ en-US ] = "No DDE channels available." ;
};
String SbERR_DDE_NO_RESPONSE & ERRCODE_RES_MASK
@@ -239,17 +223,14 @@ Resource RID_BASIC_START
};
String SbERR_DDE_NOTPROCESSED & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Fremdapplikation kann DDE-Operation nicht ausf³hren : Fremdapplikation kann DDE-Operation nicht ausfhren */
Text [ en-US ] = "External application cannot execute DDE operation." ;
};
String SbERR_DDE_TIMEOUT & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Zeit³berschreitung wõhrend des Wartens auf DDE-Antwort : Zeitberschreitung w§hrend des Wartens auf DDE-Antwort */
Text [ en-US ] = "Timeout while waiting for DDE response." ;
};
String SbERR_DDE_USER_INTERRUPT & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Benutzer dr³ckte ESCAPE wõhrend der DDE-Operation : Benutzer drckte ESCAPE w§hrend der DDE-Operation */
Text [ en-US ] = "User pressed ESCAPE during DDE operation." ;
};
String SbERR_DDE_BUSY & ERRCODE_RES_MASK
@@ -270,7 +251,6 @@ Resource RID_BASIC_START
};
String SbERR_DDE_CONV_CLOSED & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? DDE-Verbindung ist unterbrochen oder geõndert worden : DDE-Verbindung ist unterbrochen oder ge§ndert worden */
Text [ en-US ] = "DDE connection interrupted or modified." ;
};
String SbERR_DDE_NO_CHANNEL & ERRCODE_RES_MASK
@@ -279,7 +259,6 @@ Resource RID_BASIC_START
};
String SbERR_DDE_INVALID_LINK & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ung³ltiges DDE-Linkformat : Ungltiges DDE-Linkformat */
Text [ en-US ] = "Invalid DDE link format." ;
};
String SbERR_DDE_QUEUE_OVERFLOW & ERRCODE_RES_MASK
@@ -288,52 +267,42 @@ Resource RID_BASIC_START
};
String SbERR_DDE_LINK_ALREADY_EST & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Paste Link bereits durchgef³hrt : Paste Link bereits durchgefhrt */
Text [ en-US ] = "Paste link already performed." ;
};
String SbERR_DDE_LINK_INV_TOPIC & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? LinkMode kann wegen ung³ltigen Link-Topics nicht gesetzt werden : LinkMode kann wegen ungltigen Link-Topics nicht gesetzt werden */
Text [ en-US ] = "Link mode cannot be set due to invalid link topic." ;
};
String SbERR_DDE_DLL_NOT_FOUND & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? F³r DDE wird DDEML.DLL ben÷tigt : Fr DDE wird DDEML.DLL ben”tigt */
Text [ en-US ] = "DDE requires the DDEML.DLL file." ;
};
String SbERR_CANNOT_LOAD & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Das Modul kann nicht geladen werden, ung³ltiges Format : Das Modul kann nicht geladen werden, ungltiges Format */
Text [ en-US ] = "Module cannot be loaded; invalid format." ;
};
String SbERR_BAD_INDEX & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ung³ltiger Objektindex : Ungltiger Objektindex */
Text [ en-US ] = "Invalid object index." ;
};
String SbERR_NO_ACTIVE_OBJECT & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Objekt ist nicht verf³gbar : Objekt ist nicht verfgbar */
Text [ en-US ] = "Object is not available." ;
};
String SbERR_BAD_PROP_VALUE & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Falscher Wert f³r Eigenschaft : Falscher Wert fr Eigenschaft */
Text [ en-US ] = "Incorrect property value." ;
};
String SbERR_PROP_READONLY & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Eigenschaft ist schreibgesch³tzt : Eigenschaft ist schreibgeschtzt */
Text [ en-US ] = "This property is read-only." ;
};
String SbERR_PROP_WRITEONLY & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Eigenschaft ist lesegesch³tzt : Eigenschaft ist lesegeschtzt */
Text [ en-US ] = "This property is write only." ;
};
String SbERR_INVALID_OBJECT & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ung³ltige Objektreferenz : Ungltige Objektreferenz */
Text [ en-US ] = "Invalid object reference." ;
};
String SbERR_NO_METHOD & ERRCODE_RES_MASK
@@ -350,12 +319,10 @@ Resource RID_BASIC_START
};
String SbERR_NO_OLE & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? OLE-Automatisierung wird von diesem Objekt nicht unterst³tzt : OLE-Automatisierung wird von diesem Objekt nicht untersttzt */
Text [ en-US ] = "OLE Automation is not supported by this object." ;
};
String SbERR_BAD_METHOD & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Objekt unterst³tzt diese Eigenschaft oder Methode nicht : Objekt untersttzt diese Eigenschaft oder Methode nicht */
Text [ en-US ] = "This property or method is not supported by the object." ;
};
String SbERR_OLE_ERROR & ERRCODE_RES_MASK
@@ -364,17 +331,14 @@ Resource RID_BASIC_START
};
String SbERR_BAD_ACTION & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Diese Aktion wird vom angegebenen Objekt nicht unterst³tzt : Diese Aktion wird vom angegebenen Objekt nicht untersttzt */
Text [ en-US ] = "This action is not supported by given object." ;
};
String SbERR_NO_NAMED_ARGS & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Benannte Argumente werden vom angegebenen Objekt nicht unterst³tzt : Benannte Argumente werden vom angegebenen Objekt nicht untersttzt */
Text [ en-US ] = "Named arguments are not supported by given object." ;
};
String SbERR_BAD_LOCALE & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Das aktuelle Gebietsschema wird vom angegebenen Objekt nicht unterst³tzt : Das aktuelle Gebietsschema wird vom angegebenen Objekt nicht untersttzt */
Text [ en-US ] = "The current locale setting is not supported by the given object." ;
};
String SbERR_NAMED_NOT_FOUND & ERRCODE_RES_MASK
@@ -395,7 +359,6 @@ Resource RID_BASIC_START
};
String SbERR_BAD_ORDINAL & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ordnungszahl ung³ltig : Ordnungszahl ungltig */
Text [ en-US ] = "Invalid ordinal number." ;
};
String SbERR_DLLPROC_NOT_FOUND & ERRCODE_RES_MASK
@@ -404,7 +367,6 @@ Resource RID_BASIC_START
};
String SbERR_BAD_CLIPBD_FORMAT & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ung³ltiges Clipboard-Format : Ungltiges Clipboard-Format */
Text [ en-US ] = "Invalid clipboard format." ;
};
String SbERR_PROPERTY_NOT_FOUND & ERRCODE_RES_MASK
@@ -421,12 +383,10 @@ Resource RID_BASIC_START
};
String SbERR_BAD_NUMBER_OF_ARGS & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ung³ltige Anzahl von Argumenten : Ungltige Anzahl von Argumenten */
Text [ en-US ] = "Invalid number of arguments." ;
};
String SbERR_METHOD_FAILED & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Fehler in Ausf³hrung einer Methode : Fehler in Ausfhrung einer Methode */
Text [ en-US ] = "Error executing a method." ;
};
String SbERR_SETPROP_FAILED & ERRCODE_RES_MASK
@@ -516,12 +476,10 @@ Resource RID_BASIC_START
};
String SbERR_BAD_CHAR_IN_NUMBER & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Ung³ltiges Zeichen in Zahl : Ungltiges Zeichen in Zahl */
Text [ en-US ] = "Invalid character in number." ;
};
String SbERR_MUST_HAVE_DIMS & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Array mu˜ dimensioniert werden : Array muÿ dimensioniert werden */
Text [ en-US ] = "Array must be dimensioned." ;
};
String SbERR_NO_IF & ERRCODE_RES_MASK
@@ -530,12 +488,10 @@ Resource RID_BASIC_START
};
String SbERR_NOT_IN_SUBR & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? $(ARG1) innerhalb einer Prozedur unzulõssig : $(ARG1) innerhalb einer Prozedur unzul§ssig */
Text [ en-US ] = "$(ARG1) not allowed within a procedure." ;
};
String SbERR_NOT_IN_MAIN & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? $(ARG1) au˜erhalb einer Prozedur unzulõssig : $(ARG1) auÿerhalb einer Prozedur unzul§ssig */
Text [ en-US ] = "$(ARG1) not allowed outside a procedure." ;
};
String SbERR_WRONG_DIMS & ERRCODE_RES_MASK
@@ -552,12 +508,10 @@ Resource RID_BASIC_START
};
String SbERR_PROG_TOO_LARGE & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Programm ist zu gro˜ : Programm ist zu groÿ */
Text [ en-US ] = "Program too large." ;
};
String SbERR_NO_STRINGS_ARRAYS & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Strings oder Arrays unzulõssig : Strings oder Arrays unzul§ssig */
Text [ en-US ] = "Strings or arrays not permitted." ;
};
String ERRCODE_BASIC_EXCEPTION & ERRCODE_RES_MASK
@@ -604,26 +558,14 @@ String IDS_SBERR_STOREREF
};
String ERRCODE_BASMGR_LIBLOAD & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Laden der Bibliothek '$(ARG1)' : Fehler beim Laden der Bibliothek ''$(ARG1)'' */
- /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Laden der Bibliothek '$(ARG1)' : Fehler beim Laden der Bibliothek ''$(ARG1) */
- /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Laden der Bibliothek '$(ARG1)' : Fehler beim Laden der Bibliothek ''$(ARG1) */
- /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Laden der Bibliothek '$(ARG1)' : Fehler beim Laden der Bibliothek ''$(ARG1)'' */
Text [ en-US ] = "Error loading library '$(ARG1)'." ;
};
String ERRCODE_BASMGR_LIBSAVE & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Speichern der Bibliothek: '$(ARG1)' : Fehler beim Speichern der Bibliothek: ''$(ARG1)'' */
- /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Speichern der Bibliothek: '$(ARG1)' : Fehler beim Speichern der Bibliothek: ''$(ARG1) */
- /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Speichern der Bibliothek: '$(ARG1)' : Fehler beim Speichern der Bibliothek: ''$(ARG1) */
- /* ### ACHTUNG: Neuer Text in Resource? Fehler beim Speichern der Bibliothek: '$(ARG1)' : Fehler beim Speichern der Bibliothek: ''$(ARG1)'' */
Text [ en-US ] = "Error saving library: '$(ARG1)'." ;
};
String ERRCODE_BASMGR_MGROPEN & ERRCODE_RES_MASK
{
- /* ### ACHTUNG: Neuer Text in Resource? Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden : Das BASIC aus der Datei ''$(ARG1)'' konnte nicht initialisiert werden */
- /* ### ACHTUNG: Neuer Text in Resource? Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden : Das BASIC aus der Datei ''$(ARG1)'' konnte nicht initialisiert werden */
- /* ### ACHTUNG: Neuer Text in Resource? Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden : Das BASIC aus der Datei ''$(ARG1)'' konnte nicht initialisiert werden */
- /* ### ACHTUNG: Neuer Text in Resource? Das BASIC aus der Datei '$(ARG1)' konnte nicht initialisiert werden : Das BASIC aus der Datei ''$(ARG1)'' konnte nicht initialisiert werden */
Text [ en-US ] = "The BASIC from the file '$(ARG1)' could not be initialized." ;
};
String ERRCODE_BASMGR_MGRSAVE & ERRCODE_RES_MASK
diff --git a/basic/source/classes/sbunoobj.cxx b/basic/source/classes/sbunoobj.cxx
index c80bc992349f..9dffcf21361e 100644
--- a/basic/source/classes/sbunoobj.cxx
+++ b/basic/source/classes/sbunoobj.cxx
@@ -94,7 +94,7 @@ using namespace cppu;
#include<runtime.hxx>
#include<math.h>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <com/sun/star/reflection/XTypeDescriptionEnumerationAccess.hpp>
#include <com/sun/star/reflection/XConstantsTypeDescription.hpp>
@@ -1743,7 +1743,7 @@ bool checkUnoObjectType( SbUnoObject* pUnoObj,
Reference<XIdlClass> xClass = TypeToIdlClass( rType );
if( !xClass.is() )
{
- DBG_ERROR("failed to get XIdlClass for type");
+ OSL_FAIL("failed to get XIdlClass for type");
break;
}
::rtl::OUString sClassName = xClass->getName();
@@ -1839,7 +1839,7 @@ String Impl_GetSupportedInterfaces( SbUnoObject* pUnoObj )
else if( xClassProvider.is() )
{
- DBG_ERROR( "XClassProvider not supported in UNO3" );
+ OSL_FAIL( "XClassProvider not supported in UNO3" );
}
}
return aRet;
@@ -3218,7 +3218,7 @@ void RTL_Impl_EqualUnoObjects( StarBASIC* pBasic, SbxArray& rPar, BOOL bWrite )
refVar->PutBool( TRUE );
}
-typedef std::hash_map< ::rtl::OUString, std::vector< ::rtl::OUString >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleHash;
+typedef boost::unordered_map< ::rtl::OUString, std::vector< ::rtl::OUString >, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleHash;
// helper wrapper function to interact with TypeProvider and
@@ -3245,7 +3245,7 @@ getTypeDescriptorEnumeration( const ::rtl::OUString& sSearchRoot,
return xEnum;
}
-typedef std::hash_map< ::rtl::OUString, Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
+typedef boost::unordered_map< ::rtl::OUString, Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
VBAConstantHelper&
VBAConstantHelper::instance()
diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx
index 750d48a67ca1..28b783c3d7d8 100644
--- a/basic/source/classes/sbxmod.cxx
+++ b/basic/source/classes/sbxmod.cxx
@@ -45,7 +45,6 @@
#include "runtime.hxx"
#include "token.hxx"
#include "sbunoobj.hxx"
-#include "sbtrace.hxx"
#include <svtools/syntaxhighlight.hxx>
@@ -1121,9 +1120,6 @@ USHORT SbModule::Run( SbMethod* pMeth )
StarBASICRef xBasic;
if( bDelInst )
{
-#ifdef DBG_TRACE_BASIC
- dbg_InitTrace();
-#endif
// #32779: Hold Basic during the execution
xBasic = (StarBASIC*) GetParent();
@@ -1180,10 +1176,6 @@ USHORT SbModule::Run( SbMethod* pMeth )
pMOD = this;
SbiRuntime* pRt = new SbiRuntime( this, pMeth, pMeth->nStart );
-#ifdef DBG_TRACE_BASIC
- dbg_traceNotifyCall( this, pMeth, pINST->nCallLvl );
-#endif
-
pRt->pNext = pINST->pRun;
if( pRt->pNext )
pRt->pNext->block();
@@ -1196,11 +1188,6 @@ USHORT SbModule::Run( SbMethod* pMeth )
if( pRt->pNext )
pRt->pNext->unblock();
-#ifdef DBG_TRACE_BASIC
- bool bLeave = true;
- dbg_traceNotifyCall( this, pMeth, pINST->nCallLvl, bLeave );
-#endif
-
// #63710 It can happen by an another thread handling at events,
// that the show call returns to an dialog (by closing the
// dialog per UI), before a by an event triggered further call returned,
@@ -1304,19 +1291,10 @@ void SbModule::RunInit()
// The init code starts always here
SbiRuntime* pRt = new SbiRuntime( this, NULL, 0 );
-#ifdef DBG_TRACE_BASIC
- dbg_traceNotifyCall( this, NULL, 0 );
-#endif
-
pRt->pNext = pINST->pRun;
pINST->pRun = pRt;
while( pRt->Step() ) {}
-#ifdef DBG_TRACE_BASIC
- bool bLeave = true;
- dbg_traceNotifyCall( this, NULL, 0, bLeave );
-#endif
-
pINST->pRun = pRt->pNext;
delete pRt;
pMOD = pOldMod;
diff --git a/basic/source/comp/codegen.cxx b/basic/source/comp/codegen.cxx
index 8f67efd3ff7c..19c822553fac 100644
--- a/basic/source/comp/codegen.cxx
+++ b/basic/source/comp/codegen.cxx
@@ -33,6 +33,7 @@
#include "sbcomp.hxx"
#include "image.hxx"
#include <limits>
+#include <algorithm>
#include <com/sun/star/script/ModuleType.hpp>
// nInc is the increment size of the buffers
@@ -236,14 +237,14 @@ void SbiCodeGen::Save()
ePropType = SbxOBJECT;
break;
case PROPERTY_MODE_NONE:
- DBG_ERROR( "Illegal PropertyMode PROPERTY_MODE_NONE" );
+ OSL_FAIL( "Illegal PropertyMode PROPERTY_MODE_NONE" );
break;
}
String aPropName = pProc->GetPropName();
if( nPass == 1 )
aPropName = aPropName.Copy( aIfaceName.Len() + 1 );
SbProcedureProperty* pProcedureProperty = NULL;
- OSL_TRACE("*** getProcedureProperty for thing %s",
+ OSL_TRACE("*** getProcedureProperty for thing %s",
rtl::OUStringToOString( aPropName,RTL_TEXTENCODING_UTF8 ).getStr() );
pProcedureProperty = rMod.GetProcedureProperty( aPropName, ePropType );
}
@@ -437,10 +438,7 @@ public:
T result = 0 ;
static const S max = std::numeric_limits< S >::max();
result = m_nNumOp0 + ( ( sizeof(S) + 1 ) * m_nNumSingleParams ) + ( (( sizeof(S) * 2 )+ 1 ) * m_nNumDoubleParams );
- if ( result > max )
- return max;
-
- return static_cast<S>(result);
+ return std::min(static_cast<T>(max), result);
}
virtual bool processParams(){ return false; }
};
diff --git a/basic/source/comp/loops.cxx b/basic/source/comp/loops.cxx
index 260ac341a46a..b5131c58dfaf 100644
--- a/basic/source/comp/loops.cxx
+++ b/basic/source/comp/loops.cxx
@@ -317,8 +317,7 @@ void SbiParser::OnGoto()
UINT32 nLbl = 0;
do
{
- SbiToken eTok2 = NIL;
- eTok2 = Next(); // Label holen
+ Next(); // Label holen
if( MayBeLabel() )
{
UINT32 nOff = pProc->GetLabels().Reference( aSym );
diff --git a/basic/source/comp/sbcomp.cxx b/basic/source/comp/sbcomp.cxx
index e7bf0393d296..03c9a50c18da 100644
--- a/basic/source/comp/sbcomp.cxx
+++ b/basic/source/comp/sbcomp.cxx
@@ -32,374 +32,6 @@
#include <basic/sbx.hxx>
#include "sbcomp.hxx"
#include "image.hxx"
-#include "sbtrace.hxx"
-
-
-//==========================================================================
-// Tracing, for debugging only
-
-// To activate tracing enable in sbtrace.hxx
-#ifdef DBG_TRACE_BASIC
-
-#include <hash_map>
-
-// Trace Settings
-static const char* GpTraceFileName = "d:\\zBasic.Asm\\BasicTrace.txt";
-static const bool GbIncludePCodes = false;
-static const int GnIndentPerCallLevel = 4;
-static const int GnIndentForPCode = 2;
-
-struct TraceTextData
-{
- rtl::OString m_aTraceStr_STMNT;
- rtl::OString m_aTraceStr_PCode;
-};
-typedef std::hash_map< sal_Int32, TraceTextData > PCToTextDataMap;
-typedef std::hash_map< ::rtl::OUString, PCToTextDataMap*, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleTraceMap;
-
-ModuleTraceMap GaModuleTraceMap;
-ModuleTraceMap& rModuleTraceMap = GaModuleTraceMap;
-
-static void lcl_PrepareTraceForModule( SbModule* pModule )
-{
- String aModuleName = pModule->GetName();
- ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName );
- if( it != rModuleTraceMap.end() )
- {
- PCToTextDataMap* pInnerMap = it->second;
- delete pInnerMap;
- rModuleTraceMap.erase( it );
- }
-
- String aDisassemblyStr;
- pModule->Disassemble( aDisassemblyStr );
-}
-
-static void lcl_lineOut( const char* pFileName, const char* pStr, const char* pPreStr = NULL )
-{
- const char* pPrintFirst = (pPreStr != NULL) ? pPreStr : "";
- FILE* pFile = fopen( pFileName, "a+" );
- if( pFile != NULL )
- {
- fprintf( pFile, "%s%s\n", pPrintFirst, pStr );
- fclose( pFile );
- }
-}
-
-const char* lcl_getSpaces( int nSpaceCount )
-{
- static sal_Char Spaces[] = " "
- " "
- " ";
- static int nAvailableSpaceCount = strlen( Spaces );
- static sal_Char* pSpacesEnd = Spaces + nAvailableSpaceCount;
-
- if( nSpaceCount > nAvailableSpaceCount )
- nSpaceCount = nAvailableSpaceCount;
-
- return pSpacesEnd - nSpaceCount;
-}
-
-static rtl::OString lcl_toOStringSkipLeadingWhites( const String& aStr )
-{
- static sal_Char Buffer[1000];
-
- rtl::OString aOStr = OUStringToOString( rtl::OUString( aStr ), RTL_TEXTENCODING_ASCII_US );
- const sal_Char* pStr = aOStr.getStr();
-
- // Skip whitespace
- sal_Char c = *pStr;
- while( c == ' ' || c == '\t' )
- {
- pStr++;
- c = *pStr;
- }
-
- int nLen = strlen( pStr );
- strncpy( Buffer, pStr, nLen );
- Buffer[nLen] = 0;
-
- rtl::OString aORetStr( Buffer );
- return aORetStr;
-}
-
-String dumpMethodParameters( SbMethod* pMethod )
-{
- String aStr;
- if( pMethod == NULL )
- return aStr;
-
- SbxError eOld = SbxBase::GetError();
-
- SbxArray* pParams = pMethod->GetParameters();
- SbxInfo* pInfo = pMethod->GetInfo();
- if ( pParams )
- {
- aStr += '(';
- // 0 is sub itself
- for ( USHORT nParam = 1; nParam < pParams->Count(); nParam++ )
- {
- SbxVariable* pVar = pParams->Get( nParam );
- DBG_ASSERT( pVar, "Parameter?!" );
- if ( pVar->GetName().Len() )
- aStr += pVar->GetName();
- else if ( pInfo )
- {
- const SbxParamInfo* pParam = pInfo->GetParam( nParam );
- if ( pParam )
- aStr += pParam->aName;
- }
- aStr += '=';
- if( pVar->GetType() & SbxARRAY )
- aStr += String( RTL_CONSTASCII_USTRINGPARAM( "..." ) );
- else
- aStr += pVar->GetString();
- if ( nParam < ( pParams->Count() - 1 ) )
- aStr += String( RTL_CONSTASCII_USTRINGPARAM( ", " ) );
- }
- aStr += ')';
- }
-
- SbxBase::ResetError();
- if( eOld != SbxERR_OK )
- SbxBase::SetError( eOld );
-
- return aStr;
-}
-
-// Public functions
-void dbg_InitTrace( void )
-{
- FILE* pFile = fopen( GpTraceFileName, "w" );
- if( pFile != NULL )
- fclose( pFile );
-}
-
-void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl )
-{
- SbModule* pTraceMod = pModule;
- if( pTraceMod->ISA(SbClassModuleObject) )
- {
- SbClassModuleObject* pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod;
- pTraceMod = pClassModuleObj->getClassModule();
- }
-
- String aModuleName = pTraceMod->GetName();
- ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName );
- if( it == rModuleTraceMap.end() )
- {
- const char* pModuleNameStr = OUStringToOString( rtl::OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ).getStr();
- char Buffer[200];
- sprintf( Buffer, "TRACE ERROR: Unknown module \"%s\"", pModuleNameStr );
- lcl_lineOut( GpTraceFileName, Buffer );
- return;
- }
-
- PCToTextDataMap* pInnerMap = it->second;
- if( pInnerMap == NULL )
- {
- lcl_lineOut( GpTraceFileName, "TRACE INTERNAL ERROR: No inner map" );
- return;
- }
-
- PCToTextDataMap::iterator itInner = pInnerMap->find( nPC );
- if( itInner == pInnerMap->end() )
- {
- const char* pModuleNameStr = OUStringToOString( rtl::OUString( aModuleName ), RTL_TEXTENCODING_ASCII_US ).getStr();
- char Buffer[200];
- sprintf( Buffer, "TRACE ERROR: No info for PC = %d in module \"%s\"", nPC, pModuleNameStr );
- lcl_lineOut( GpTraceFileName, Buffer );
- return;
- }
-
- //nCallLvl--;
- //if( nCallLvl < 0 )
- // nCallLvl = 0;
- int nIndent = nCallLvl * GnIndentPerCallLevel;
-
- const TraceTextData& rTraceTextData = itInner->second;
- const rtl::OString& rStr_STMNT = rTraceTextData.m_aTraceStr_STMNT;
- if( rStr_STMNT.getLength() )
- lcl_lineOut( GpTraceFileName, rStr_STMNT.getStr(), lcl_getSpaces( nIndent ) );
-
- if( !GbIncludePCodes )
- return;
-
- nIndent += GnIndentForPCode;
- const rtl::OString& rStr_PCode = rTraceTextData.m_aTraceStr_PCode;
- if( rStr_PCode.getLength() )
- lcl_lineOut( GpTraceFileName, rStr_PCode.getStr(), lcl_getSpaces( nIndent ) );
-}
-
-void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave )
-{
- static const char* pSeparator = "' ================================================================================";
-
- SbModule* pTraceMod = pModule;
- SbClassModuleObject* pClassModuleObj = NULL;
- if( pTraceMod->ISA(SbClassModuleObject) )
- {
- pClassModuleObj = (SbClassModuleObject*)(SbxBase*)pTraceMod;
- pTraceMod = pClassModuleObj->getClassModule();
- }
-
- if( nCallLvl > 0 )
- nCallLvl--;
- int nIndent = nCallLvl * GnIndentPerCallLevel;
- if( !bLeave )
- {
- lcl_lineOut( GpTraceFileName, "" );
- lcl_lineOut( GpTraceFileName, pSeparator, lcl_getSpaces( nIndent ) );
- }
-
- String aStr;
- if( bLeave )
- {
- lcl_lineOut( GpTraceFileName, "}", lcl_getSpaces( nIndent ) );
- aStr.AppendAscii( "' Leaving " );
- }
- else
- {
- aStr.AppendAscii( "Entering " );
- }
- String aModuleName = pTraceMod->GetName();
- aStr += aModuleName;
- if( pMethod != NULL )
- {
- aStr.AppendAscii( "::" );
- String aMethodName = pMethod->GetName();
- aStr += aMethodName;
- }
- else
- {
- aStr.AppendAscii( "/RunInit" );
- }
-
- if( pClassModuleObj != NULL )
- {
- aStr.AppendAscii( "[this=" );
- aStr += pClassModuleObj->GetName();
- aStr.AppendAscii( "]" );
- }
- if( !bLeave )
- aStr += dumpMethodParameters( pMethod );
-
- lcl_lineOut( GpTraceFileName, OUStringToOString( rtl::OUString( aStr ), RTL_TEXTENCODING_ASCII_US ).getStr(), lcl_getSpaces( nIndent ) );
- if( !bLeave )
- lcl_lineOut( GpTraceFileName, "{", lcl_getSpaces( nIndent ) );
-
- if( bLeave )
- lcl_lineOut( GpTraceFileName, "" );
-}
-
-void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, INT32 nCallLvl )
-{
- rtl::OString aOTraceErrMsg = OUStringToOString( rtl::OUString( aTraceErrMsg ), RTL_TEXTENCODING_ASCII_US );
-
- char Buffer[200];
- const char* pHandledStr = bTraceErrHandled ? " / HANDLED" : "";
- sprintf( Buffer, "*** ERROR%s, Id = %d, Msg = \"%s\" ***", pHandledStr, (int)nTraceErr, aOTraceErrMsg.getStr() );
- int nIndent = nCallLvl * GnIndentPerCallLevel;
- lcl_lineOut( GpTraceFileName, Buffer, lcl_getSpaces( nIndent ) );
-}
-
-void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC,
- const String& aTraceStr_STMNT, const String& aTraceStr_PCode )
-{
- String aModuleName = pModule->GetName();
- ModuleTraceMap::iterator it = rModuleTraceMap.find( aModuleName );
- PCToTextDataMap* pInnerMap;
- if( it == rModuleTraceMap.end() )
- {
- pInnerMap = new PCToTextDataMap();
- rModuleTraceMap[ aModuleName ] = pInnerMap;
- }
- else
- {
- pInnerMap = it->second;
- }
-
- TraceTextData aData;
-
- rtl::OString aOTraceStr_STMNT = lcl_toOStringSkipLeadingWhites( aTraceStr_STMNT );
- aData.m_aTraceStr_STMNT = aOTraceStr_STMNT;
-
- rtl::OString aOTraceStr_PCode = lcl_toOStringSkipLeadingWhites( aTraceStr_PCode );
- aData.m_aTraceStr_PCode = aOTraceStr_PCode;
-
- (*pInnerMap)[nPC] = aData;
-}
-
-#endif
-
-
-//==========================================================================
-// For debugging only
-//#define DBG_SAVE_DISASSEMBLY
-
-#ifdef DBG_SAVE_DISASSEMBLY
-static bool dbg_bDisassemble = true;
-#include <comphelper/processfactory.hxx>
-
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/ucb/XSimpleFileAccess3.hpp>
-#include <com/sun/star/io/XTextOutputStream.hpp>
-#include <com/sun/star/io/XActiveDataSource.hpp>
-
-using namespace comphelper;
-using namespace rtl;
-using namespace com::sun::star::uno;
-using namespace com::sun::star::lang;
-using namespace com::sun::star::ucb;
-using namespace com::sun::star::io;
-
-void dbg_SaveDisassembly( SbModule* pModule )
-{
- bool bDisassemble = dbg_bDisassemble;
- if( bDisassemble )
- {
- Reference< XSimpleFileAccess3 > xSFI;
- Reference< XTextOutputStream > xTextOut;
- Reference< XOutputStream > xOut;
- Reference< XMultiServiceFactory > xSMgr = getProcessServiceFactory();
- if( xSMgr.is() )
- {
- Reference< XSimpleFileAccess3 > xSFI = Reference< XSimpleFileAccess3 >( xSMgr->createInstance
- ( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.ucb.SimpleFileAccess" )) ), UNO_QUERY );
- if( xSFI.is() )
- {
- String aFile( RTL_CONSTASCII_USTRINGPARAM("file:///d:/zBasic.Asm/Asm_") );
- StarBASIC* pBasic = (StarBASIC*)pModule->GetParent();
- if( pBasic )
- {
- aFile += pBasic->GetName();
- aFile.AppendAscii( "_" );
- }
- aFile += pModule->GetName();
- aFile.AppendAscii( ".txt" );
-
- // String aFile( RTL_CONSTASCII_USTRINGPARAM("file:///d:/BasicAsm.txt") );
- if( xSFI->exists( aFile ) )
- xSFI->kill( aFile );
- xOut = xSFI->openFileWrite( aFile );
- Reference< XInterface > x = xSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.io.TextOutputStream" )) );
- Reference< XActiveDataSource > xADS( x, UNO_QUERY );
- xADS->setOutputStream( xOut );
- xTextOut = Reference< XTextOutputStream >( x, UNO_QUERY );
- }
- }
-
- if( xTextOut.is() )
- {
- String aDisassemblyStr;
- pModule->Disassemble( aDisassemblyStr );
- xTextOut->writeString( aDisassemblyStr );
- }
- xOut->closeOutput();
- }
-}
-#endif
-
// Diese Routine ist hier definiert, damit der Compiler als eigenes Segment
// geladen werden kann.
@@ -453,14 +85,6 @@ BOOL SbModule::Compile()
}
}
-#ifdef DBG_SAVE_DISASSEMBLY
- dbg_SaveDisassembly( this );
-#endif
-
-#ifdef DBG_TRACE_BASIC
- lcl_PrepareTraceForModule( this );
-#endif
-
return bRet;
}
diff --git a/basic/source/comp/symtbl.cxx b/basic/source/comp/symtbl.cxx
index 5778655406f8..6ab16e1abf19 100644
--- a/basic/source/comp/symtbl.cxx
+++ b/basic/source/comp/symtbl.cxx
@@ -500,7 +500,7 @@ void SbiProcDef::setPropertyMode( PropertyMode ePropMode )
case PROPERTY_MODE_LET: aCompleteProcName.AppendAscii( "Let " ); break;
case PROPERTY_MODE_SET: aCompleteProcName.AppendAscii( "Set " ); break;
case PROPERTY_MODE_NONE:
- DBG_ERROR( "Illegal PropertyMode PROPERTY_MODE_NONE" );
+ OSL_FAIL( "Illegal PropertyMode PROPERTY_MODE_NONE" );
break;
}
aCompleteProcName += aName;
diff --git a/basic/source/inc/namecont.hxx b/basic/source/inc/namecont.hxx
index 3b253952fb67..419230c1c2b6 100644
--- a/basic/source/inc/namecont.hxx
+++ b/basic/source/inc/namecont.hxx
@@ -29,7 +29,7 @@
#ifndef BASIC_NAMECONTAINER_HXX
#define BASIC_NAMECONTAINER_HXX
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <com/sun/star/lang/XSingleServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/lang/XInitialization.hpp>
@@ -101,7 +101,7 @@ struct eqName_Impl
}
};
-typedef std::hash_map
+typedef boost::unordered_map
<
::rtl::OUString,
sal_Int32,
diff --git a/basic/source/inc/object.hxx b/basic/source/inc/object.hxx
index a6ebfdc5df20..c1fdad21d1ce 100644
--- a/basic/source/inc/object.hxx
+++ b/basic/source/inc/object.hxx
@@ -55,12 +55,12 @@ using SbxVariable::GetInfo;
// Definition eines Tabelleneintrags. Dies wird hier gemacht,
// da dadurch die Methoden und Properties als private deklariert
// werden koennen.
-#if defined ( ICC ) || defined ( HPUX ) || defined ( C50 ) || defined ( C52 )
+#if defined ( ICC ) || defined ( C50 ) || defined ( C52 )
public:
#endif
typedef void( SampleObject::*pMeth )
( SbxVariable* pThis, SbxArray* pArgs, BOOL bWrite );
-#if defined ( ICC ) || defined ( HPUX )
+#if defined ( ICC )
private:
#endif
diff --git a/basic/source/inc/opcodes.hxx b/basic/source/inc/opcodes.hxx
index 309ff38c5564..cbc98ac22fd4 100644
--- a/basic/source/inc/opcodes.hxx
+++ b/basic/source/inc/opcodes.hxx
@@ -31,10 +31,6 @@
#include "sbintern.hxx"
-#ifdef MTW
-#undef _NUMBER
-#endif
-
// Ein Opcode ist entweder 1, 3 oder 5 Bytes lang, je nach numerischen
// Wert des Opcodes (s.u.).
diff --git a/basic/source/inc/sbtrace.hxx b/basic/source/inc/sbtrace.hxx
deleted file mode 100644
index daa10d7f9b57..000000000000
--- a/basic/source/inc/sbtrace.hxx
+++ /dev/null
@@ -1,45 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef _SBTRACE_HXX
-#define _SBTRACE_HXX
-
-// #define DBG_TRACE_BASIC
-
-#ifdef DBG_TRACE_BASIC
-void dbg_InitTrace( void );
-void dbg_traceStep( SbModule* pModule, UINT32 nPC, INT32 nCallLvl );
-void dbg_traceNotifyCall( SbModule* pModule, SbMethod* pMethod, INT32 nCallLvl, bool bLeave = false );
-void dbg_traceNotifyError( SbError nTraceErr, const String& aTraceErrMsg, bool bTraceErrHandled, INT32 nCallLvl );
-void dbg_RegisterTraceTextForPC( SbModule* pModule, UINT32 nPC,
- const String& aTraceStr_STMNT, const String& aTraceStr_PCode );
-#endif
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/inc/sbunoobj.hxx b/basic/source/inc/sbunoobj.hxx
index 011ffb9a7e02..faf913229ad3 100644
--- a/basic/source/inc/sbunoobj.hxx
+++ b/basic/source/inc/sbunoobj.hxx
@@ -42,7 +42,8 @@
#include <com/sun/star/reflection/XServiceTypeDescription2.hpp>
#include <com/sun/star/reflection/XSingletonTypeDescription.hpp>
#include <rtl/ustring.hxx>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
+#include <vector>
class SbUnoObject: public SbxObject
{
@@ -321,7 +322,7 @@ public:
virtual void Clear();
};
-typedef std::hash_map< ::rtl::OUString, ::com::sun::star::uno::Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
+typedef boost::unordered_map< ::rtl::OUString, ::com::sun::star::uno::Any, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > VBAConstantsHash;
typedef std::vector< rtl::OUString > VBAConstantsVector;
diff --git a/basic/source/inc/scriptcont.hxx b/basic/source/inc/scriptcont.hxx
index 1b68e089c451..f7f948bd0b31 100644
--- a/basic/source/inc/scriptcont.hxx
+++ b/basic/source/inc/scriptcont.hxx
@@ -142,7 +142,7 @@ public:
};
//============================================================================
-typedef std::hash_map< ::rtl::OUString, ::com::sun::star::script::ModuleInfo, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInfoMap;
+typedef boost::unordered_map< ::rtl::OUString, ::com::sun::star::script::ModuleInfo, ::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > ModuleInfoMap;
typedef ::cppu::ImplHelper1 < ::com::sun::star::script::vba::XVBAModuleInfo
> SfxScriptLibrary_BASE;
diff --git a/basic/source/runtime/dllmgr-x64.cxx b/basic/source/runtime/dllmgr-x64.cxx
index aa3ce5ea3e02..87be0587bb81 100644
--- a/basic/source/runtime/dllmgr-x64.cxx
+++ b/basic/source/runtime/dllmgr-x64.cxx
@@ -196,7 +196,7 @@ SbError marshalString(
return e;
}
std::vector< char > * blob = data.newBlob();
- blob->insert(blob->begin(), str.getStr(), str.getStr() + str.getLength());
+ blob->insert(blob->begin(), str.getStr(), str.getStr() + str.getLength() + 1);
*buffer = address(*blob);
data.unmarshalStrings.push_back(StringData(variable, *buffer, special));
return ERRCODE_NONE;
diff --git a/basic/source/runtime/dllmgr-x86.cxx b/basic/source/runtime/dllmgr-x86.cxx
index 09aee07fc934..64419c9e3b6e 100644
--- a/basic/source/runtime/dllmgr-x86.cxx
+++ b/basic/source/runtime/dllmgr-x86.cxx
@@ -203,7 +203,7 @@ SbError marshalString(
return e;
}
std::vector< char > * blob = data.newBlob();
- blob->insert(blob->begin(), str.getStr(), str.getStr() + str.getLength());
+ blob->insert(blob->begin(), str.getStr(), str.getStr() + str.getLength() + 1 );
*buffer = address(*blob);
data.unmarshalStrings.push_back(StringData(variable, *buffer, special));
return ERRCODE_NONE;
diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx
index 3984a03626aa..10990fc9fb39 100644
--- a/basic/source/runtime/iosys.cxx
+++ b/basic/source/runtime/iosys.cxx
@@ -625,7 +625,7 @@ void UCBStream::SetSize( ULONG nSize )
{
(void)nSize;
- DBG_ERROR( "not allowed to call from basic" );
+ OSL_FAIL( "not allowed to call from basic" );
SetError( ERRCODE_IO_GENERAL );
}
diff --git a/basic/source/runtime/makefile.mk b/basic/source/runtime/makefile.mk
index f8c81032a20e..64d9a6ff446d 100644
--- a/basic/source/runtime/makefile.mk
+++ b/basic/source/runtime/makefile.mk
@@ -65,6 +65,7 @@ SLOFILES+= \
$(SLO)$/dllmgr-none.obj
.ENDIF
.IF "$(GUI)$(COM)$(CPU)" == "WNTMSCI"
+SLOFILES+= \
$(SLO)$/wnt-x86.obj
.ELIF "$(GUI)$(COM)$(CPU)" == "WNTGCCI"
SLOFILES+= \
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index ed9b9fed8436..380064bb0da8 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -52,9 +52,8 @@
#include "runtime.hxx"
#include "sbunoobj.hxx"
#ifdef WNT
-#include <tools/prewin.h>
-#include "winbase.h"
-#include <tools/postwin.h>
+#include <prewin.h>
+#include <postwin.h>
#include <tools/fsys.hxx>
#else
#include <osl/file.hxx>
@@ -3447,7 +3446,7 @@ RTLFUNC(Rnd)
else
{
double nRand = (double)rand();
- nRand = ( nRand / (double)RAND_MAX );
+ nRand = ( nRand / ((double)RAND_MAX + 1.0));
rPar.Get(0)->PutDouble( nRand );
}
}
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 3de2f480b92e..d0babeee3d96 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -45,7 +45,6 @@
#include <com/sun/star/container/XEnumerationAccess.hpp>
#include "sbunoobj.hxx"
#include "errobject.hxx"
-#include "sbtrace.hxx"
SbxVariable* getDefaultProp( SbxVariable* pRef );
@@ -325,7 +324,7 @@ SbiInstance::~SbiInstance()
}
catch( const Exception& )
{
- DBG_ERROR( "SbiInstance::~SbiInstance: caught an exception while disposing the components!" );
+ OSL_FAIL( "SbiInstance::~SbiInstance: caught an exception while disposing the components!" );
}
ComponentVector.clear();
@@ -732,11 +731,6 @@ BOOL SbiRuntime::Step()
Application::Reschedule();
}
-#ifdef DBG_TRACE_BASIC
- UINT32 nPC = ( pCode - (const BYTE* )pImg->GetCode() );
- dbg_traceStep( pMod, nPC, pINST->nCallLvl );
-#endif
-
SbiOpcode eOp = (SbiOpcode ) ( *pCode++ );
UINT32 nOp1, nOp2;
if( eOp <= SbOP0_END )
@@ -773,11 +767,6 @@ BOOL SbiRuntime::Step()
// (insbesondere nicht nach Compiler-Fehlern zur Laufzeit)
if( nError && bRun )
{
-#ifdef DBG_TRACE_BASIC
- SbError nTraceErr = nError;
- String aTraceErrMsg = GetSbData()->aErrMsg;
- bool bTraceErrHandled = true;
-#endif
SbError err = nError;
ClearExprStack();
nError = 0;
@@ -858,19 +847,12 @@ BOOL SbiRuntime::Step()
// Kein Error-Hdl gefunden -> altes Vorgehen
else
{
-#ifdef DBG_TRACE_BASIC
- bTraceErrHandled = false;
-#endif
pInst->Abort();
}
// ALT: Nur
// pInst->Abort();
}
-
-#ifdef DBG_TRACE_BASIC
- dbg_traceNotifyError( nTraceErr, aTraceErrMsg, bTraceErrHandled, pINST->nCallLvl );
-#endif
}
}
return bRun;
diff --git a/basic/source/runtime/stdobj.cxx b/basic/source/runtime/stdobj.cxx
index f5f54dad8515..f2f51c4406c7 100644
--- a/basic/source/runtime/stdobj.cxx
+++ b/basic/source/runtime/stdobj.cxx
@@ -35,7 +35,7 @@
#include <sal/macros.h>
#include "rtlproto.hxx"
#include "sbintern.hxx"
-#include <hash_map>
+#include <boost/unordered_map.hpp>
// Das nArgs-Feld eines Tabelleneintrags ist wie folgt verschluesselt:
// Zur Zeit wird davon ausgegangen, dass Properties keine Parameter
// benoetigen!
@@ -82,7 +82,7 @@ struct StringHashCode
class VBABlacklist
{
friend class VBABlackListQuery;
- std::hash_map< String, bool, StringHashCode > mBlackList;
+ boost::unordered_map< String, bool, StringHashCode > mBlackList;
VBABlacklist()
{
const char* list[] = { "Red" };
diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx
index 62c822af1ea7..6683fbdc56ee 100644
--- a/basic/source/sbx/sbxbase.cxx
+++ b/basic/source/sbx/sbxbase.cxx
@@ -49,18 +49,11 @@ TYPEINIT0(SbxBase)
SbxAppData* GetSbxData_Impl()
{
-#ifndef DOS
SbxAppData** ppData = (SbxAppData**) ::GetAppData( SHL_SBX );
SbxAppData* p = *ppData;
if( !p )
p = *ppData = new SbxAppData;
return p;
-#else
- SbxAppData** ppData;
- SbxAppData* p;
- p = *ppData = new SbxAppData;
- return p;
-#endif
}
SbxAppData::~SbxAppData()
diff --git a/basic/source/sbx/sbxcurr.cxx b/basic/source/sbx/sbxcurr.cxx
index 1c039ef66d59..de80ea281b16 100644
--- a/basic/source/sbx/sbxcurr.cxx
+++ b/basic/source/sbx/sbxcurr.cxx
@@ -488,7 +488,7 @@ start:
{
SbxBase::SetError( SbxERR_OVERFLOW ); val = SbxMININT;
}
- *p->pInteger = (INT16) r; break;
+ *p->pInteger = (INT16) val; break;
}
case SbxBYREF | SbxERROR:
case SbxBYREF | SbxUSHORT:
diff --git a/basic/source/sbx/sbxdate.cxx b/basic/source/sbx/sbxdate.cxx
index ee4c18996846..282409f081d2 100644
--- a/basic/source/sbx/sbxdate.cxx
+++ b/basic/source/sbx/sbxdate.cxx
@@ -87,7 +87,6 @@ double ImpGetDate( const SbxValues* p )
nRes = 0;
else
{
-#ifndef DOS
LanguageType eLangType = GetpApp()->GetSettings().GetLanguage();
SvNumberFormatter* pFormatter;
@@ -138,9 +137,6 @@ double ImpGetDate( const SbxValues* p )
}
delete pFormatter;
-#else
- SbxBase::SetError( SbxERR_CONVERSION ); nRes = 0;
-#endif
}
break;
case SbxOBJECT:
@@ -235,7 +231,6 @@ start:
case SbxBYREF | SbxSTRING:
case SbxSTRING:
case SbxLPSTR:
-#ifndef DOS
{
if( !p->pOUString )
p->pOUString = new ::rtl::OUString;
@@ -292,11 +287,8 @@ start:
pFormatter->GetOutputString( n, nIndex, aTmpString, &pColor );
*p->pOUString = aTmpString;
delete pFormatter;
-#endif
break;
-#ifndef DOS
}
-#endif
case SbxOBJECT:
{
SbxValue* pVal = PTR_CAST(SbxValue,p->pObj);
diff --git a/basic/source/sbx/sbxdec.hxx b/basic/source/sbx/sbxdec.hxx
index fcd7edbe1bc7..5438c151e60f 100644
--- a/basic/source/sbx/sbxdec.hxx
+++ b/basic/source/sbx/sbxdec.hxx
@@ -34,7 +34,7 @@
#undef WB_LEFT
#undef WB_RIGHT
-#include <tools/prewin.h>
+#include <prewin.h>
} // close extern "C" {
#ifndef __MINGW32__
@@ -43,7 +43,7 @@
#include <oleauto.h>
extern "C" { // reopen extern "C" {
-#include <tools/postwin.h>
+#include <postwin.h>
#endif
#endif
diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx
index 182b4e7db37c..3e6aee717283 100644
--- a/basic/source/sbx/sbxform.cxx
+++ b/basic/source/sbx/sbxform.cxx
@@ -385,13 +385,11 @@ short SbxBasicFormater::GetDigitAtPos( double dNumber, short nPos,
double& dNextNumber, BOOL& bFoundFirstDigit )
// ACHTUNG: nPos kann auch negativ werden, f"ur Stellen nach dem Dezimal-Punkt
{
- double dTemp = dNumber;
- double dDigit,dPos;
+ double dDigit;
short nMaxDigit;
// erst mal aus der Zahl eine positive Zahl machen:
dNumber = fabs( dNumber );
- dPos = (double)nPos;
// "uberpr"ufe ob Zahl zu klein f"ur angegebene Stelle ist
nMaxDigit = (short)get_number_of_digits( dNumber );
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 5fe1704bcc38..c7cfe6e6850e 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -289,7 +289,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
short nExp = 0; // Exponent
short nDig = nPrec + 1; // Anzahl Digits in Zahl
short nDec; // Anzahl Vorkommastellen
- register int i, digit;
+ register int i;
// Komma besorgen
sal_Unicode cDecimalSep, cThousandSep;
@@ -339,6 +339,7 @@ static void myftoa( double nNum, char * pBuf, short nPrec, short nExpWidth,
// Zahl ausgeben:
if( nDig > 0 )
{
+ register int digit;
for( i = 0 ; ; ++i )
{
if( i < 16 )
@@ -747,8 +748,6 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
SvNumberFormatter aFormatter( xFactory, eLangType );
sal_uInt32 nIndex;
- xub_StrLen nCheckPos = 0;
- short nType;
double nNumber;
Color* pCol;
@@ -757,6 +756,8 @@ void SbxValue::Format( XubString& rRes, const XubString* pFmt ) const
// number format, use SvNumberFormatter to handle it.
if( bSuccess )
{
+ xub_StrLen nCheckPos = 0;
+ short nType;
String aFmtStr = *pFmt;
VbaFormatInfo* pInfo = getFormatInfo( aFmtStr );
if( pInfo && pInfo->meType != VBA_FORMAT_TYPE_NULL )
diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx
index df4fe7b4a753..6838e68eeeaa 100644
--- a/basic/source/sbx/sbxvalue.cxx
+++ b/basic/source/sbx/sbxvalue.cxx
@@ -624,7 +624,7 @@ BOOL SbxValue::Put( const SbxValues& rVal )
{
if ( p != this )
{
- DBG_ERROR( "TheRealValue" );
+ OSL_FAIL( "TheRealValue" );
}
HACK(nicht bei Parent-Prop - sonst CyclicRef)
SbxVariable *pThisVar = PTR_CAST(SbxVariable, this);
@@ -1199,7 +1199,6 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
}
else if( GetType() == SbxCURRENCY || rOp.GetType() == SbxCURRENCY )
{
- double dTest;
aL.eType = SbxCURRENCY;
aR.eType = SbxCURRENCY;
@@ -1210,6 +1209,7 @@ BOOL SbxValue::Compute( SbxOperator eOp, const SbxValue& rOp )
if( Get( aL ) ) switch( eOp )
{
+ double dTest;
case SbxMUL:
// first overflow check: see if product will fit - test real value of product (hence 2 curr factors)
dTest = (double)aL.nInt64 * (double)aR.nInt64 / (double)CURRENCY_FACTOR_SQUARE;
diff --git a/basic/source/uno/dlgcont.cxx b/basic/source/uno/dlgcont.cxx
index 0f6e577794c6..6af1675b9175 100644
--- a/basic/source/uno/dlgcont.cxx
+++ b/basic/source/uno/dlgcont.cxx
@@ -70,9 +70,10 @@ using namespace com::sun::star::script;
using namespace com::sun::star::xml::sax;
using namespace com::sun::star;
using namespace cppu;
-using namespace rtl;
using namespace osl;
+using ::rtl::OUString;
+
using com::sun::star::uno::Reference;
#define GRAPHOBJ_URLPREFIX "vnd.sun.star.GraphicObject:"
diff --git a/basic/source/uno/modsizeexceeded.cxx b/basic/source/uno/modsizeexceeded.cxx
index c38fc75c4041..d36f424bb532 100644
--- a/basic/source/uno/modsizeexceeded.cxx
+++ b/basic/source/uno/modsizeexceeded.cxx
@@ -35,9 +35,10 @@
using namespace com::sun::star;
using namespace cppu;
-using namespace rtl;
using namespace osl;
+using ::rtl::OUString;
+
ModuleSizeExceeded::ModuleSizeExceeded( const uno::Sequence< ::rtl::OUString >& sModules )
{
script::ModuleSizeExceededRequest aReq;
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index e9672b3396da..9c65b6a5f2b8 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -90,11 +90,15 @@ using namespace com::sun::star::frame;
using namespace com::sun::star::deployment;
using namespace com::sun::star;
using namespace cppu;
-using namespace rtl;
using namespace osl;
using com::sun::star::uno::Reference;
+using ::rtl::OUString;
+using ::rtl::OStringBuffer;
+using ::rtl::OUStringToOString;
+using ::rtl::Uri;
+
// #i34411: Flag for error handling during migration
static bool GbMigrationSuppressErrors = false;
@@ -943,7 +947,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
catch( uno::Exception& )
{
// TODO: error handling?
- OSL_ASSERT( "Cannot access extensions!" );
+ OSL_FAIL( "Cannot access extensions!" );
}
}
@@ -1159,7 +1163,7 @@ sal_Bool SfxLibraryContainer::init_Impl(
// #i93163
if( bCleanUp )
{
- DBG_ERROR( "Upgrade of Basic installation failed somehow" );
+ OSL_FAIL( "Upgrade of Basic installation failed somehow" );
static char strErrorSavFolderName[] = "__basic_80_err";
INetURLObject aPrevUserBasicInetObj_Err( aUserBasicInetObj );
@@ -1399,7 +1403,6 @@ void SfxLibraryContainer::implStoreLibrary( SfxLibrary* pLib,
xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
// #87671 Allow encryption
-//REMOVE aPropName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("Encrypted") );
aPropName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) );
xProps->setPropertyValue( aPropName, uno::makeAny( sal_True ) );
@@ -1547,7 +1550,6 @@ void SfxLibraryContainer::implStoreLibraryIndexFile( SfxLibrary* pLib,
xProps->setPropertyValue( aPropName, uno::makeAny( aMime ) );
// #87671 Allow encryption
-//REMOVE aPropName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM("Encrypted") );
aPropName = String::CreateFromAscii( RTL_CONSTASCII_STRINGPARAM( "UseCommonStoragePasswordEncryption" ) );
xProps->setPropertyValue( aPropName, uno::makeAny( sal_True ) );
diff --git a/basic/source/uno/scriptcont.cxx b/basic/source/uno/scriptcont.cxx
index ece4fdccb9d4..d6bd191cd0da 100644
--- a/basic/source/uno/scriptcont.cxx
+++ b/basic/source/uno/scriptcont.cxx
@@ -80,11 +80,12 @@ using namespace com::sun::star::script;
using namespace com::sun::star::xml::sax;
using namespace com::sun::star;
using namespace cppu;
-using namespace rtl;
using namespace osl;
using com::sun::star::uno::Reference;
+using ::rtl::OUString;
+
//============================================================================
// Implementation class SfxScriptLibraryContainer
@@ -1151,11 +1152,6 @@ sal_Bool SfxScriptLibraryContainer::implLoadPasswordLibrary
}
}
-//REMOVE // If the password is verified the library must remain modified, because
-//REMOVE // otherwise for saving the storage would be copied and that doesn't work
-//REMOVE // with mtg's storages when the password is verified
-//REMOVE if( !pLib->mbPasswordVerified )
-//REMOVE pLib->mbModified = sal_False;
return bRet;
}