summaryrefslogtreecommitdiff
path: root/basic/source/classes/sb.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'basic/source/classes/sb.cxx')
-rw-r--r--basic/source/classes/sb.cxx26
1 files changed, 18 insertions, 8 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index d04e6c3f0b73..45b85dc6b83a 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -18,8 +18,6 @@
*/
#include "sb.hxx"
-#include <tools/rcid.h>
-#include <tools/resary.hxx>
#include <tools/stream.hxx>
#include <vcl/errinf.hxx>
#include <comphelper/solarmutex.hxx>
@@ -36,7 +34,7 @@
#include "sbobjmod.hxx"
#include "stdobj.hxx"
#include "filefmt.hxx"
-#include "sb.hrc"
+#include "basic.hrc"
#include <basrid.hxx>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -1576,18 +1574,30 @@ void StarBASIC::SetErrorData( ErrCode nCode, sal_uInt16 nLine,
aGlobals.nCol2 = nCol2;
}
+const ErrMsgCode* getRID_BASIC_START()
+{
+ return RID_BASIC_START;
+}
+
void StarBASIC::MakeErrorText( ErrCode nId, const OUString& aMsg )
{
SolarMutexGuard aSolarGuard;
sal_uInt16 nOldID = GetVBErrorCode( nId );
- // instantiate the help class
- ResStringArray aMyStringList(BasResId(RID_BASIC_START));
- sal_uInt32 nErrIdx = aMyStringList.FindIndex(nId.GetRest());
- if (nErrIdx != RESARRAY_INDEX_NOTFOUND)
+ const char* pErrorMsg = nullptr;
+ for (ErrMsgCode* pItem = RID_BASIC_START; pItem->second; ++pItem)
+ {
+ if (ErrCode(nId.GetRest()) == pItem->second)
+ {
+ pErrorMsg = pItem->first;
+ break;
+ }
+ }
+
+ if (pErrorMsg)
{
// merge message with additional text
- OUString sError = aMyStringList.GetString(nErrIdx);
+ OUString sError = BasResId(pErrorMsg);
OUStringBuffer aMsg1(sError);
// replace argument placeholder with %s
OUString aSrgStr( "$(ARG1)" );