summaryrefslogtreecommitdiffstats
path: root/basic
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-06-11 20:56:30 +0100
committerCaolán McNamara <caolanm@redhat.com>2017-07-21 08:20:50 +0100
commit00657aef09d854c74fb426a935a3e8b1fc390bb0 (patch)
treefd1a9bb264fe15dcc129498e62060ecd256b1ee7 /basic
parentosl: Unix pipe converted from OSL_ASSERT to assert/SAL_WARNs (diff)
downloadcore-00657aef09d854c74fb426a935a3e8b1fc390bb0.tar.gz
core-00657aef09d854c74fb426a935a3e8b1fc390bb0.zip
migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl * all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string") * ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching MODULE .mo files * UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui goes from l10n target to normal one, so the res/lang.zips of UI files go away * translation via Translation::get(hrc-define-key, imbued-std::locale) * python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there to keep finding the .hrc file uniform) so magic numbers can go away there * java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation mechanism * en-US res files go away, their strings are now the .hrc keys in the source code * remaining .res files are replaced by .mo files * in .res/.ui-lang-zip files, the old scheme missing translations of strings results in inserting the english original so something can be found, now the standard fallback of using the english original from the source key is used, so partial translations shrink dramatically in size * extract .hrc strings with hrcex which backs onto xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap * extract .ui strings with uiex which backs onto xgettext --add-comments --no-wrap * qtz for gettext translations is generated at runtime as ascii-ified crc32 of content + "|" + msgid * [API CHANGE] remove deprecated binary .res resouce loader related uno apis com::sun::star::resource::OfficeResourceLoader com::sun::star::resource::XResourceBundleLoader com::sun::star::resource::XResourceBundle when translating strings via uno apis com.sun.star.resource.StringResourceWithLocation can continue to be used Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
Diffstat (limited to 'basic')
-rw-r--r--basic/AllLangMoTarget_sb.mk13
-rw-r--r--basic/AllLangResTarget_sb.mk39
-rw-r--r--basic/Library_sb.mk3
-rw-r--r--basic/Module_basic.mk2
-rw-r--r--basic/inc/basic.hrc161
-rw-r--r--basic/inc/basrid.hxx8
-rw-r--r--basic/inc/pch/precompiled_sb.hxx1
-rw-r--r--basic/inc/strings.hrc (renamed from basic/inc/sb.hrc)19
-rw-r--r--basic/qa/cppunit/basictest.cxx1
-rw-r--r--basic/source/basmgr/basmgr.cxx2
-rw-r--r--basic/source/classes/sb.cxx26
-rw-r--r--basic/source/classes/sb.src191
-rw-r--r--basic/source/runtime/basrdll.cxx14
-rw-r--r--basic/source/runtime/methods.cxx2
-rw-r--r--basic/source/runtime/runtime.cxx2
-rw-r--r--basic/source/sbx/format.src51
-rw-r--r--basic/source/sbx/sbxscan.cxx20
17 files changed, 220 insertions, 335 deletions
diff --git a/basic/AllLangMoTarget_sb.mk b/basic/AllLangMoTarget_sb.mk
new file mode 100644
index 000000000000..90ece5be32da
--- /dev/null
+++ b/basic/AllLangMoTarget_sb.mk
@@ -0,0 +1,13 @@
+# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
+#
+# This file is part of the LibreOffice project.
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+$(eval $(call gb_AllLangMoTarget_AllLangMoTarget,sb))
+
+$(eval $(call gb_AllLangMoTarget_set_polocation,sb,basic))
+
+# vim: set noet sw=4 ts=4:
diff --git a/basic/AllLangResTarget_sb.mk b/basic/AllLangResTarget_sb.mk
deleted file mode 100644
index fa792286d626..000000000000
--- a/basic/AllLangResTarget_sb.mk
+++ /dev/null
@@ -1,39 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-# This file incorporates work covered by the following license notice:
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed
-# with this work for additional information regarding copyright
-# ownership. The ASF licenses this file to you under the Apache
-# License, Version 2.0 (the "License"); you may not use this file
-# except in compliance with the License. You may obtain a copy of
-# the License at http://www.apache.org/licenses/LICENSE-2.0 .
-#
-
-$(eval $(call gb_AllLangResTarget_AllLangResTarget,sb))
-
-
-$(eval $(call gb_AllLangResTarget_add_srs,sb,\
- sb/res \
-))
-
-$(eval $(call gb_SrsTarget_SrsTarget,sb/res))
-
-$(eval $(call gb_SrsTarget_set_include,sb/res,\
- $$(INCLUDE) \
- -I$(SRCDIR)/basic/inc \
-))
-
-$(eval $(call gb_SrsTarget_add_files,sb/res,\
- basic/source/classes/sb.src \
- basic/source/sbx/format.src \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/basic/Library_sb.mk b/basic/Library_sb.mk
index e2ed084131f0..f866a3bbd347 100644
--- a/basic/Library_sb.mk
+++ b/basic/Library_sb.mk
@@ -158,7 +158,4 @@ $(eval $(call gb_Library_add_exception_objects,sb,\
endif
endif
-# Runtime dependency for unit-tests
-$(eval $(call gb_Library_use_restarget,sb,sb))
-
# vim: set noet sw=4 ts=4:
diff --git a/basic/Module_basic.mk b/basic/Module_basic.mk
index 10fcbfd36990..a01c883268bc 100644
--- a/basic/Module_basic.mk
+++ b/basic/Module_basic.mk
@@ -12,7 +12,7 @@ $(eval $(call gb_Module_Module,basic))
ifneq ($(filter SCRIPTING,$(BUILD_TYPE)),)
$(eval $(call gb_Module_add_l10n_targets,basic,\
- AllLangResTarget_sb \
+ AllLangMoTarget_sb \
))
$(eval $(call gb_Module_add_check_targets,basic,\
diff --git a/basic/inc/basic.hrc b/basic/inc/basic.hrc
new file mode 100644
index 000000000000..c0824802a979
--- /dev/null
+++ b/basic/inc/basic.hrc
@@ -0,0 +1,161 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the N_("License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef INCLUDED_BASIC_INC_STRINGS_HRC
+#define INCLUDED_BASIC_INC_STRINGS_HRC
+
+#define NC_(Context, String) (Context "\004" u8##String)
+
+std::pair<const char*, ErrCode> RID_BASIC_START[] =
+{
+ { NC_("RID_BASIC_START", "Syntax error."), ErrCode(sal_uInt32(ERRCODE_BASIC_SYNTAX) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Return without Gosub."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_GOSUB) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Incorrect entry; please retry."), ErrCode(sal_uInt32(ERRCODE_BASIC_REDO_FROM_START) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid procedure call."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_ARGUMENT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Overflow."), ErrCode(sal_uInt32(ERRCODE_BASIC_MATH_OVERFLOW) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Not enough memory."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_MEMORY) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Array already dimensioned."), ErrCode(sal_uInt32(ERRCODE_BASIC_ALREADY_DIM) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Index out of defined range."), ErrCode(sal_uInt32(ERRCODE_BASIC_OUT_OF_RANGE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Duplicate definition."), ErrCode(sal_uInt32(ERRCODE_BASIC_DUPLICATE_DEF) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Division by zero."), ErrCode(sal_uInt32(ERRCODE_BASIC_ZERODIV) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Variable not defined."), ErrCode(sal_uInt32(ERRCODE_BASIC_VAR_UNDEFINED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Data type mismatch."), ErrCode(sal_uInt32(ERRCODE_BASIC_CONVERSION) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid parameter."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_PARAMETER) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Process interrupted by user."), ErrCode(sal_uInt32(ERRCODE_BASIC_USER_ABORT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Resume without error."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_RESUME) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Not enough stack memory."), ErrCode(sal_uInt32(ERRCODE_BASIC_STACK_OVERFLOW) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Sub-procedure or function procedure not defined."), ErrCode(sal_uInt32(ERRCODE_BASIC_PROC_UNDEFINED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Error loading DLL file."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_DLL_LOAD) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Wrong DLL call convention."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_DLL_CALL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Internal error $(ARG1)."), ErrCode(sal_uInt32(ERRCODE_BASIC_INTERNAL_ERROR) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid file name or file number."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_CHANNEL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "File not found."), ErrCode(sal_uInt32(ERRCODE_BASIC_FILE_NOT_FOUND) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Incorrect file mode."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_FILE_MODE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "File already open."), ErrCode(sal_uInt32(ERRCODE_BASIC_FILE_ALREADY_OPEN) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Device I/O error."), ErrCode(sal_uInt32(ERRCODE_BASIC_IO_ERROR) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "File already exists."), ErrCode(sal_uInt32(ERRCODE_BASIC_FILE_EXISTS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Incorrect record length."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_RECORD_LENGTH) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Disk or hard drive full."), ErrCode(sal_uInt32(ERRCODE_BASIC_DISK_FULL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Reading exceeds EOF."), ErrCode(sal_uInt32(ERRCODE_BASIC_READ_PAST_EOF) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Incorrect record number."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_RECORD_NUMBER) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Too many files."), ErrCode(sal_uInt32(ERRCODE_BASIC_TOO_MANY_FILES) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Device not available."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_DEVICE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Access denied."), ErrCode(sal_uInt32(ERRCODE_BASIC_ACCESS_DENIED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Disk not ready."), ErrCode(sal_uInt32(ERRCODE_BASIC_NOT_READY) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Not implemented."), ErrCode(sal_uInt32(ERRCODE_BASIC_NOT_IMPLEMENTED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Renaming on different drives impossible."), ErrCode(sal_uInt32(ERRCODE_BASIC_DIFFERENT_DRIVE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Path/File access error."), ErrCode(sal_uInt32(ERRCODE_BASIC_ACCESS_ERROR) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Path not found."), ErrCode(sal_uInt32(ERRCODE_BASIC_PATH_NOT_FOUND) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Object variable not set."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_OBJECT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid string pattern."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_PATTERN) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Use of zero not permitted."), ErrCode(sal_uInt32(ERRCODE_BASIC_IS_NULL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "DDE Error."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_ERROR) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Awaiting response to DDE connection."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_WAITINGACK) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "No DDE channels available."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_OUTOFCHANNELS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "No application responded to DDE connect initiation."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_NO_RESPONSE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Too many applications responded to DDE connect initiation."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_MULT_RESPONSES) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "DDE channel locked."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_CHANNEL_LOCKED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "External application cannot execute DDE operation."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_NOTPROCESSED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Timeout while waiting for DDE response."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_TIMEOUT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "User pressed ESCAPE during DDE operation."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_USER_INTERRUPT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "External application busy."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_BUSY) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "DDE operation without data."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_NO_DATA) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Data are in wrong format."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_WRONG_DATA_FORMAT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "External application has been terminated."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_PARTNER_QUIT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "DDE connection interrupted or modified."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_CONV_CLOSED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "DDE method invoked with no channel open."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_NO_CHANNEL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid DDE link format."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_INVALID_LINK) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "DDE message has been lost."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_QUEUE_OVERFLOW) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Paste link already performed."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_LINK_ALREADY_EST) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Link mode cannot be set due to invalid link topic."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_LINK_INV_TOPIC) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "DDE requires the DDEML.DLL file."), ErrCode(sal_uInt32(ERRCODE_BASIC_DDE_DLL_NOT_FOUND) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Module cannot be loaded; invalid format."), ErrCode(sal_uInt32(ERRCODE_BASIC_CANNOT_LOAD) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid object index."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_INDEX) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Object is not available."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_ACTIVE_OBJECT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Incorrect property value."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_PROP_VALUE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "This property is read-only."), ErrCode(sal_uInt32(ERRCODE_BASIC_PROP_READONLY) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "This property is write only."), ErrCode(sal_uInt32(ERRCODE_BASIC_PROP_WRITEONLY) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid object reference."), ErrCode(sal_uInt32(ERRCODE_BASIC_INVALID_OBJECT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Property or method not found: $(ARG1)."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_METHOD) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Object required."), ErrCode(sal_uInt32(ERRCODE_BASIC_NEEDS_OBJECT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid use of an object."), ErrCode(sal_uInt32(ERRCODE_BASIC_INVALID_USAGE_OBJECT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "OLE Automation is not supported by this object."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_OLE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "This property or method is not supported by the object."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_METHOD) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "OLE Automation Error."), ErrCode(sal_uInt32(ERRCODE_BASIC_OLE_ERROR) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "This action is not supported by given object."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_ACTION) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Named arguments are not supported by given object."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_NAMED_ARGS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "The current locale setting is not supported by the given object."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_LOCALE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Named argument not found."), ErrCode(sal_uInt32(ERRCODE_BASIC_NAMED_NOT_FOUND) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Argument is not optional."), ErrCode(sal_uInt32(ERRCODE_BASIC_NOT_OPTIONAL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid number of arguments."), ErrCode(sal_uInt32(ERRCODE_BASIC_WRONG_ARGS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Object is not a list."), ErrCode(sal_uInt32(ERRCODE_BASIC_NOT_A_COLL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid ordinal number."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_ORDINAL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Specified DLL function not found."), ErrCode(sal_uInt32(ERRCODE_BASIC_DLLPROC_NOT_FOUND) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid clipboard format."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_CLIPBD_FORMAT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Object does not have this property."), ErrCode(sal_uInt32(ERRCODE_BASIC_PROPERTY_NOT_FOUND) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Object does not have this method."), ErrCode(sal_uInt32(ERRCODE_BASIC_METHOD_NOT_FOUND) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Required argument lacking."), ErrCode(sal_uInt32(ERRCODE_BASIC_ARG_MISSING) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid number of arguments."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_NUMBER_OF_ARGS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Error executing a method."), ErrCode(sal_uInt32(ERRCODE_BASIC_METHOD_FAILED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Unable to set property."), ErrCode(sal_uInt32(ERRCODE_BASIC_SETPROP_FAILED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Unable to determine property."), ErrCode(sal_uInt32(ERRCODE_BASIC_GETPROP_FAILED) & ERRCODE_RES_MASK) },
+ // Compiler errors. These are not runtime errors.
+ { NC_("RID_BASIC_START", "Unexpected symbol: $(ARG1)."), ErrCode(sal_uInt32(ERRCODE_BASIC_UNEXPECTED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Expected: $(ARG1)."), ErrCode(sal_uInt32(ERRCODE_BASIC_EXPECTED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Symbol expected."), ErrCode(sal_uInt32(ERRCODE_BASIC_SYMBOL_EXPECTED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Variable expected."), ErrCode(sal_uInt32(ERRCODE_BASIC_VAR_EXPECTED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Label expected."), ErrCode(sal_uInt32(ERRCODE_BASIC_LABEL_EXPECTED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Value cannot be applied."), ErrCode(sal_uInt32(ERRCODE_BASIC_LVALUE_EXPECTED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Variable $(ARG1) already defined."), ErrCode(sal_uInt32(ERRCODE_BASIC_VAR_DEFINED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Sub procedure or function procedure $(ARG1) already defined."), ErrCode(sal_uInt32(ERRCODE_BASIC_PROC_DEFINED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Label $(ARG1) already defined."), ErrCode(sal_uInt32(ERRCODE_BASIC_LABEL_DEFINED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Variable $(ARG1) not found."), ErrCode(sal_uInt32(ERRCODE_BASIC_UNDEF_VAR) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Array or procedure $(ARG1) not found."), ErrCode(sal_uInt32(ERRCODE_BASIC_UNDEF_ARRAY) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Procedure $(ARG1) not found."), ErrCode(sal_uInt32(ERRCODE_BASIC_UNDEF_PROC) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Label $(ARG1) undefined."), ErrCode(sal_uInt32(ERRCODE_BASIC_UNDEF_LABEL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Unknown data type $(ARG1)."), ErrCode(sal_uInt32(ERRCODE_BASIC_UNDEF_TYPE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Exit $(ARG1) expected."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_EXIT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Statement block still open: $(ARG1) missing."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_BLOCK) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Parentheses do not match."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_BRACKETS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Symbol $(ARG1) already defined differently."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_DECLARATION) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Parameters do not correspond to procedure."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_PARAMETERS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Invalid character in number."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_CHAR_IN_NUMBER) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Array must be dimensioned."), ErrCode(sal_uInt32(ERRCODE_BASIC_MUST_HAVE_DIMS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Else/Endif without If."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_IF) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "$(ARG1) not allowed within a procedure."), ErrCode(sal_uInt32(ERRCODE_BASIC_NOT_IN_SUBR) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "$(ARG1) not allowed outside a procedure."), ErrCode(sal_uInt32(ERRCODE_BASIC_NOT_IN_MAIN) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Dimension specifications do not match."), ErrCode(sal_uInt32(ERRCODE_BASIC_WRONG_DIMS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Unknown option: $(ARG1)."), ErrCode(sal_uInt32(ERRCODE_BASIC_BAD_OPTION) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Constant $(ARG1) redefined."), ErrCode(sal_uInt32(ERRCODE_BASIC_CONSTANT_REDECLARED) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Program too large."), ErrCode(sal_uInt32(ERRCODE_BASIC_PROG_TOO_LARGE) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Strings or arrays not permitted."), ErrCode(sal_uInt32(ERRCODE_BASIC_NO_STRINGS_ARRAYS) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "An exception occurred $(ARG1)."), ErrCode(sal_uInt32(ERRCODE_BASIC_EXCEPTION) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "This array is fixed or temporarily locked."), ErrCode(sal_uInt32(ERRCODE_BASIC_ARRAY_FIX) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Out of string space."), ErrCode(sal_uInt32(ERRCODE_BASIC_STRING_OVERFLOW) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Expression Too Complex."), ErrCode(sal_uInt32(ERRCODE_BASIC_EXPR_TOO_COMPLEX) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Can't perform requested operation."), ErrCode(sal_uInt32(ERRCODE_BASIC_OPER_NOT_PERFORM) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "Too many DLL application clients."), ErrCode(sal_uInt32(ERRCODE_BASIC_TOO_MANY_DLL) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "For loop not initialized."), ErrCode(sal_uInt32(ERRCODE_BASIC_LOOP_NOT_INIT) & ERRCODE_RES_MASK) },
+ { NC_("RID_BASIC_START", "$(ARG1)"), ErrCode(sal_uInt32(ERRCODE_BASIC_COMPAT) & ERRCODE_RES_MASK) },
+ { nullptr, ERRCODE_NONE }
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/inc/basrid.hxx b/basic/inc/basrid.hxx
index 203c28162748..e6fd817afb23 100644
--- a/basic/inc/basrid.hxx
+++ b/basic/inc/basrid.hxx
@@ -20,13 +20,7 @@
#ifndef INCLUDED_BASIC_INC_BASRID_HXX
#define INCLUDED_BASIC_INC_BASRID_HXX
-#include <tools/resid.hxx>
-
-class BasResId : public ResId
-{
- public:
- BasResId( sal_uInt32 nId );
-};
+OUString BasResId(const char* pId);
#endif // INCLUDED_BASIC_INC_BASRID_HXX
diff --git a/basic/inc/pch/precompiled_sb.hxx b/basic/inc/pch/precompiled_sb.hxx
index 85d74021de78..a277651d7c50 100644
--- a/basic/inc/pch/precompiled_sb.hxx
+++ b/basic/inc/pch/precompiled_sb.hxx
@@ -59,7 +59,6 @@
#include <vcl/msgbox.hxx>
#include <vcl/settings.hxx>
#include <vcl/svapp.hxx>
-#include <basrid.hxx>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/i18n/KCharacterType.hpp>
#include <com/sun/star/i18n/KParseTokens.hpp>
diff --git a/basic/inc/sb.hrc b/basic/inc/strings.hrc
index 12469099cf88..deab90a91eb5 100644
--- a/basic/inc/sb.hrc
+++ b/basic/inc/strings.hrc
@@ -17,16 +17,21 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_BASIC_INC_SB_HRC
-#define INCLUDED_BASIC_INC_SB_HRC
+#ifndef INCLUDED_BASIC_INC_STRINGS_HRC
+#define INCLUDED_BASIC_INC_STRINGS_HRC
-#include <svl/solar.hrc>
+#define NC_(Context, String) (Context "\004" u8##String)
-#ifndef IDS_SBERR_START
- #define IDS_SBERR_START RID_BASIC_START
-#endif
+#define STR_BASICKEY_FORMAT_ON NC_("STR_BASICKEY_FORMAT_ON", "On")
+#define STR_BASICKEY_FORMAT_OFF NC_("STR_BASICKEY_FORMAT_OFF", "Off")
+#define STR_BASICKEY_FORMAT_TRUE NC_("STR_BASICKEY_FORMAT_TRUE", "True")
+#define STR_BASICKEY_FORMAT_FALSE NC_("STR_BASICKEY_FORMAT_FALSE", "False")
+#define STR_BASICKEY_FORMAT_YES NC_("STR_BASICKEY_FORMAT_YES", "Yes")
+#define STR_BASICKEY_FORMAT_NO NC_("STR_BASICKEY_FORMAT_NO", "No")
+//format currency
+#define STR_BASICKEY_FORMAT_CURRENCY NC_("STR_BASICKEY_FORMAT_CURRENCY", "@0.00 $;@(0.00 $)")
-#define IDS_SBERR_TERMINATED IDS_SBERR_START+2000
+#define IDS_SBERR_TERMINATED NC_("IDS_SBERR_TERMINATED", "The macro running has been interrupted")
#endif
diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx
index bedd89e5dacf..9622a2867242 100644
--- a/basic/qa/cppunit/basictest.cxx
+++ b/basic/qa/cppunit/basictest.cxx
@@ -20,7 +20,6 @@
void MacroSnippet::InitSnippet()
{
- CPPUNIT_ASSERT_MESSAGE( "No resource manager", maDll.GetBasResMgr() != nullptr );
mpBasic = new StarBASIC();
StarBASIC::SetGlobalErrorHdl( LINK( this, MacroSnippet, BasicErrorHdl ) );
}
diff --git a/basic/source/basmgr/basmgr.cxx b/basic/source/basmgr/basmgr.cxx
index cc1e3d340503..9189d7538df8 100644
--- a/basic/source/basmgr/basmgr.cxx
+++ b/basic/source/basmgr/basmgr.cxx
@@ -41,9 +41,7 @@
#include <basic/basmgr.hxx>
#include "global.hxx"
#include <sbunoobj.hxx>
-#include "basrid.hxx"
#include "sbintern.hxx"
-#include <sb.hrc>
#include <memory>
#include <vector>
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)" );
diff --git a/basic/source/classes/sb.src b/basic/source/classes/sb.src
deleted file mode 100644
index 634dcab034bd..000000000000
--- a/basic/source/classes/sb.src
+++ /dev/null
@@ -1,191 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <vcl/errcode.hxx>
-#include <basic/sberrors.hxx>
-
-#include "sb.hrc"
-
-StringArray RID_BASIC_START
-{
- ItemList [ en-US ] =
- {
- < "Syntax error." ; ERRCODE_BASIC_SYNTAX & ERRCODE_RES_MASK ; >;
- < "Return without Gosub." ; ERRCODE_BASIC_NO_GOSUB & ERRCODE_RES_MASK ; >;
- < "Incorrect entry; please retry." ; ERRCODE_BASIC_REDO_FROM_START & ERRCODE_RES_MASK ; >;
- < "Invalid procedure call." ; ERRCODE_BASIC_BAD_ARGUMENT & ERRCODE_RES_MASK ; >;
- < "Overflow." ; ERRCODE_BASIC_MATH_OVERFLOW & ERRCODE_RES_MASK ; >;
- < "Not enough memory." ; ERRCODE_BASIC_NO_MEMORY & ERRCODE_RES_MASK ; >;
- < "Array already dimensioned." ; ERRCODE_BASIC_ALREADY_DIM & ERRCODE_RES_MASK ; >;
- < "Index out of defined range." ; ERRCODE_BASIC_OUT_OF_RANGE & ERRCODE_RES_MASK ; >;
- < "Duplicate definition." ; ERRCODE_BASIC_DUPLICATE_DEF & ERRCODE_RES_MASK ; >;
- < "Division by zero." ; ERRCODE_BASIC_ZERODIV & ERRCODE_RES_MASK ; >;
- < "Variable not defined." ; ERRCODE_BASIC_VAR_UNDEFINED & ERRCODE_RES_MASK ; >;
- < "Data type mismatch." ; ERRCODE_BASIC_CONVERSION & ERRCODE_RES_MASK ; >;
- < "Invalid parameter." ; ERRCODE_BASIC_BAD_PARAMETER & ERRCODE_RES_MASK ; >;
- < "Process interrupted by user." ; ERRCODE_BASIC_USER_ABORT & ERRCODE_RES_MASK ; >;
- < "Resume without error." ; ERRCODE_BASIC_BAD_RESUME & ERRCODE_RES_MASK ; >;
- < "Not enough stack memory." ; ERRCODE_BASIC_STACK_OVERFLOW & ERRCODE_RES_MASK ; >;
- < "Sub-procedure or function procedure not defined." ; ERRCODE_BASIC_PROC_UNDEFINED & ERRCODE_RES_MASK ; >;
- < "Error loading DLL file." ; ERRCODE_BASIC_BAD_DLL_LOAD & ERRCODE_RES_MASK ; >;
- < "Wrong DLL call convention." ; ERRCODE_BASIC_BAD_DLL_CALL & ERRCODE_RES_MASK ; >;
- < "Internal error $(ARG1)." ; ERRCODE_BASIC_INTERNAL_ERROR & ERRCODE_RES_MASK ; >;
- < "Invalid file name or file number." ; ERRCODE_BASIC_BAD_CHANNEL & ERRCODE_RES_MASK ; >;
- < "File not found." ; ERRCODE_BASIC_FILE_NOT_FOUND & ERRCODE_RES_MASK ; >;
- < "Incorrect file mode." ; ERRCODE_BASIC_BAD_FILE_MODE & ERRCODE_RES_MASK ; >;
- < "File already open." ; ERRCODE_BASIC_FILE_ALREADY_OPEN & ERRCODE_RES_MASK ; >;
- < "Device I/O error." ; ERRCODE_BASIC_IO_ERROR & ERRCODE_RES_MASK ; >;
- < "File already exists." ; ERRCODE_BASIC_FILE_EXISTS & ERRCODE_RES_MASK ; >;
- < "Incorrect record length." ; ERRCODE_BASIC_BAD_RECORD_LENGTH & ERRCODE_RES_MASK ; >;
- < "Disk or hard drive full." ; ERRCODE_BASIC_DISK_FULL & ERRCODE_RES_MASK ; >;
- < "Reading exceeds EOF." ; ERRCODE_BASIC_READ_PAST_EOF & ERRCODE_RES_MASK ; >;
- < "Incorrect record number." ; ERRCODE_BASIC_BAD_RECORD_NUMBER & ERRCODE_RES_MASK ; >;
- < "Too many files." ; ERRCODE_BASIC_TOO_MANY_FILES & ERRCODE_RES_MASK ; >;
- < "Device not available." ; ERRCODE_BASIC_NO_DEVICE & ERRCODE_RES_MASK ; >;
- < "Access denied." ; ERRCODE_BASIC_ACCESS_DENIED & ERRCODE_RES_MASK ; >;
- < "Disk not ready." ; ERRCODE_BASIC_NOT_READY & ERRCODE_RES_MASK ; >;
- < "Not implemented." ; ERRCODE_BASIC_NOT_IMPLEMENTED & ERRCODE_RES_MASK ; >;
- < "Renaming on different drives impossible." ; ERRCODE_BASIC_DIFFERENT_DRIVE & ERRCODE_RES_MASK ; >;
- < "Path/File access error." ; ERRCODE_BASIC_ACCESS_ERROR & ERRCODE_RES_MASK ; >;
- < "Path not found." ; ERRCODE_BASIC_PATH_NOT_FOUND & ERRCODE_RES_MASK ; >;
- < "Object variable not set." ; ERRCODE_BASIC_NO_OBJECT & ERRCODE_RES_MASK ; >;
- < "Invalid string pattern." ; ERRCODE_BASIC_BAD_PATTERN & ERRCODE_RES_MASK ; >;
- < "Use of zero not permitted." ; ERRCODE_BASIC_IS_NULL & ERRCODE_RES_MASK ; >;
- < "DDE Error." ; ERRCODE_BASIC_DDE_ERROR & ERRCODE_RES_MASK ; >;
- < "Awaiting response to DDE connection." ; ERRCODE_BASIC_DDE_WAITINGACK & ERRCODE_RES_MASK ; >;
- < "No DDE channels available." ; ERRCODE_BASIC_DDE_OUTOFCHANNELS & ERRCODE_RES_MASK ; >;
- < "No application responded to DDE connect initiation." ; ERRCODE_BASIC_DDE_NO_RESPONSE & ERRCODE_RES_MASK ; >;
- < "Too many applications responded to DDE connect initiation." ; ERRCODE_BASIC_DDE_MULT_RESPONSES & ERRCODE_RES_MASK ; >;
- < "DDE channel locked." ; ERRCODE_BASIC_DDE_CHANNEL_LOCKED & ERRCODE_RES_MASK ; >;
- < "External application cannot execute DDE operation." ; ERRCODE_BASIC_DDE_NOTPROCESSED & ERRCODE_RES_MASK ; >;
- < "Timeout while waiting for DDE response." ; ERRCODE_BASIC_DDE_TIMEOUT & ERRCODE_RES_MASK ; >;
- < "User pressed ESCAPE during DDE operation." ; ERRCODE_BASIC_DDE_USER_INTERRUPT & ERRCODE_RES_MASK ; >;
- < "External application busy." ; ERRCODE_BASIC_DDE_BUSY & ERRCODE_RES_MASK ; >;
- < "DDE operation without data." ; ERRCODE_BASIC_DDE_NO_DATA & ERRCODE_RES_MASK ; >;
- < "Data are in wrong format." ; ERRCODE_BASIC_DDE_WRONG_DATA_FORMAT & ERRCODE_RES_MASK ; >;
- < "External application has been terminated." ; ERRCODE_BASIC_DDE_PARTNER_QUIT & ERRCODE_RES_MASK ; >;
- < "DDE connection interrupted or modified." ; ERRCODE_BASIC_DDE_CONV_CLOSED & ERRCODE_RES_MASK ; >;
- < "DDE method invoked with no channel open." ; ERRCODE_BASIC_DDE_NO_CHANNEL & ERRCODE_RES_MASK ; >;
- < "Invalid DDE link format." ; ERRCODE_BASIC_DDE_INVALID_LINK & ERRCODE_RES_MASK ; >;
- < "DDE message has been lost." ; ERRCODE_BASIC_DDE_QUEUE_OVERFLOW & ERRCODE_RES_MASK ; >;
- < "Paste link already performed." ; ERRCODE_BASIC_DDE_LINK_ALREADY_EST & ERRCODE_RES_MASK ; >;
- < "Link mode cannot be set due to invalid link topic." ; ERRCODE_BASIC_DDE_LINK_INV_TOPIC & ERRCODE_RES_MASK ; >;
- < "DDE requires the DDEML.DLL file." ; ERRCODE_BASIC_DDE_DLL_NOT_FOUND & ERRCODE_RES_MASK ; >;
- < "Module cannot be loaded; invalid format." ; ERRCODE_BASIC_CANNOT_LOAD & ERRCODE_RES_MASK ; >;
- < "Invalid object index." ; ERRCODE_BASIC_BAD_INDEX & ERRCODE_RES_MASK ; >;
- < "Object is not available." ; ERRCODE_BASIC_NO_ACTIVE_OBJECT & ERRCODE_RES_MASK ; >;
- < "Incorrect property value." ; ERRCODE_BASIC_BAD_PROP_VALUE & ERRCODE_RES_MASK ; >;
- < "This property is read-only." ; ERRCODE_BASIC_PROP_READONLY & ERRCODE_RES_MASK ; >;
- < "This property is write only." ; ERRCODE_BASIC_PROP_WRITEONLY & ERRCODE_RES_MASK ; >;
- < "Invalid object reference." ; ERRCODE_BASIC_INVALID_OBJECT & ERRCODE_RES_MASK ; >;
- < "Property or method not found: $(ARG1)." ; ERRCODE_BASIC_NO_METHOD & ERRCODE_RES_MASK ; >;
- < "Object required." ; ERRCODE_BASIC_NEEDS_OBJECT & ERRCODE_RES_MASK ; >;
- < "Invalid use of an object." ; ERRCODE_BASIC_INVALID_USAGE_OBJECT & ERRCODE_RES_MASK ; >;
- < "OLE Automation is not supported by this object." ; ERRCODE_BASIC_NO_OLE & ERRCODE_RES_MASK ; >;
- < "This property or method is not supported by the object." ; ERRCODE_BASIC_BAD_METHOD & ERRCODE_RES_MASK ; >;
- < "OLE Automation Error." ; ERRCODE_BASIC_OLE_ERROR & ERRCODE_RES_MASK ; >;
- < "This action is not supported by given object." ; ERRCODE_BASIC_BAD_ACTION & ERRCODE_RES_MASK ; >;
- < "Named arguments are not supported by given object." ; ERRCODE_BASIC_NO_NAMED_ARGS & ERRCODE_RES_MASK ; >;
- < "The current locale setting is not supported by the given object." ; ERRCODE_BASIC_BAD_LOCALE & ERRCODE_RES_MASK ; >;
- < "Named argument not found." ; ERRCODE_BASIC_NAMED_NOT_FOUND & ERRCODE_RES_MASK ; >;
- < "Argument is not optional." ; ERRCODE_BASIC_NOT_OPTIONAL & ERRCODE_RES_MASK ; >;
- < "Invalid number of arguments." ; ERRCODE_BASIC_WRONG_ARGS & ERRCODE_RES_MASK ; >;
- < "Object is not a list." ; ERRCODE_BASIC_NOT_A_COLL & ERRCODE_RES_MASK ; >;
- < "Invalid ordinal number." ; ERRCODE_BASIC_BAD_ORDINAL & ERRCODE_RES_MASK ; >;
- < "Specified DLL function not found." ; ERRCODE_BASIC_DLLPROC_NOT_FOUND & ERRCODE_RES_MASK ; >;
- < "Invalid clipboard format." ; ERRCODE_BASIC_BAD_CLIPBD_FORMAT & ERRCODE_RES_MASK ; >;
- < "Object does not have this property." ; ERRCODE_BASIC_PROPERTY_NOT_FOUND & ERRCODE_RES_MASK ; >;
- < "Object does not have this method." ; ERRCODE_BASIC_METHOD_NOT_FOUND & ERRCODE_RES_MASK ; >;
- < "Required argument lacking." ; ERRCODE_BASIC_ARG_MISSING & ERRCODE_RES_MASK ; >;
- < "Invalid number of arguments." ; ERRCODE_BASIC_BAD_NUMBER_OF_ARGS & ERRCODE_RES_MASK ; >;
- < "Error executing a method." ; ERRCODE_BASIC_METHOD_FAILED & ERRCODE_RES_MASK ; >;
- < "Unable to set property." ; ERRCODE_BASIC_SETPROP_FAILED & ERRCODE_RES_MASK ; >;
- < "Unable to determine property." ; ERRCODE_BASIC_GETPROP_FAILED & ERRCODE_RES_MASK ; >;
- // Compiler errors. These are not runtime errors.
- < "Unexpected symbol: $(ARG1)." ; ERRCODE_BASIC_UNEXPECTED & ERRCODE_RES_MASK ; >;
- < "Expected: $(ARG1)." ; ERRCODE_BASIC_EXPECTED & ERRCODE_RES_MASK ; >;
- < "Symbol expected." ; ERRCODE_BASIC_SYMBOL_EXPECTED & ERRCODE_RES_MASK ; >;
- < "Variable expected." ; ERRCODE_BASIC_VAR_EXPECTED & ERRCODE_RES_MASK ; >;
- < "Label expected." ; ERRCODE_BASIC_LABEL_EXPECTED & ERRCODE_RES_MASK ; >;
- < "Value cannot be applied." ; ERRCODE_BASIC_LVALUE_EXPECTED & ERRCODE_RES_MASK ; >;
- < "Variable $(ARG1) already defined." ; ERRCODE_BASIC_VAR_DEFINED & ERRCODE_RES_MASK ; >;
- < "Sub procedure or function procedure $(ARG1) already defined." ; ERRCODE_BASIC_PROC_DEFINED & ERRCODE_RES_MASK ; >;
- < "Label $(ARG1) already defined." ; ERRCODE_BASIC_LABEL_DEFINED & ERRCODE_RES_MASK ; >;
- < "Variable $(ARG1) not found." ; ERRCODE_BASIC_UNDEF_VAR & ERRCODE_RES_MASK ; >;
- < "Array or procedure $(ARG1) not found." ; ERRCODE_BASIC_UNDEF_ARRAY & ERRCODE_RES_MASK ; >;
- < "Procedure $(ARG1) not found." ; ERRCODE_BASIC_UNDEF_PROC & ERRCODE_RES_MASK ; >;
- < "Label $(ARG1) undefined." ; ERRCODE_BASIC_UNDEF_LABEL & ERRCODE_RES_MASK ; >;
- < "Unknown data type $(ARG1)." ; ERRCODE_BASIC_UNDEF_TYPE & ERRCODE_RES_MASK ; >;
- < "Exit $(ARG1) expected." ; ERRCODE_BASIC_BAD_EXIT & ERRCODE_RES_MASK ; >;
- < "Statement block still open: $(ARG1) missing." ; ERRCODE_BASIC_BAD_BLOCK & ERRCODE_RES_MASK ; >;
- < "Parentheses do not match." ; ERRCODE_BASIC_BAD_BRACKETS & ERRCODE_RES_MASK ; >;
- < "Symbol $(ARG1) already defined differently." ; ERRCODE_BASIC_BAD_DECLARATION & ERRCODE_RES_MASK ; >;
- < "Parameters do not correspond to procedure." ; ERRCODE_BASIC_BAD_PARAMETERS & ERRCODE_RES_MASK ; >;
- < "Invalid character in number." ; ERRCODE_BASIC_BAD_CHAR_IN_NUMBER & ERRCODE_RES_MASK ; >;
- < "Array must be dimensioned." ; ERRCODE_BASIC_MUST_HAVE_DIMS & ERRCODE_RES_MASK ; >;
- < "Else/Endif without If." ; ERRCODE_BASIC_NO_IF & ERRCODE_RES_MASK ; >;
- < "$(ARG1) not allowed within a procedure." ; ERRCODE_BASIC_NOT_IN_SUBR & ERRCODE_RES_MASK ; >;
- < "$(ARG1) not allowed outside a procedure." ; ERRCODE_BASIC_NOT_IN_MAIN & ERRCODE_RES_MASK ; >;
- < "Dimension specifications do not match." ; ERRCODE_BASIC_WRONG_DIMS & ERRCODE_RES_MASK ; >;
- < "Unknown option: $(ARG1)." ; ERRCODE_BASIC_BAD_OPTION & ERRCODE_RES_MASK ; >;
- < "Constant $(ARG1) redefined." ; ERRCODE_BASIC_CONSTANT_REDECLARED & ERRCODE_RES_MASK ; >;
- < "Program too large." ; ERRCODE_BASIC_PROG_TOO_LARGE & ERRCODE_RES_MASK ; >;
- < "Strings or arrays not permitted." ; ERRCODE_BASIC_NO_STRINGS_ARRAYS & ERRCODE_RES_MASK ; >;
- < "An exception occurred $(ARG1)." ; ERRCODE_BASIC_EXCEPTION & ERRCODE_RES_MASK ; >;
- < "This array is fixed or temporarily locked." ; ERRCODE_BASIC_ARRAY_FIX & ERRCODE_RES_MASK ; >;
- < "Out of string space." ; ERRCODE_BASIC_STRING_OVERFLOW & ERRCODE_RES_MASK ; >;
- < "Expression Too Complex." ; ERRCODE_BASIC_EXPR_TOO_COMPLEX & ERRCODE_RES_MASK ; >;
- < "Can't perform requested operation." ; ERRCODE_BASIC_OPER_NOT_PERFORM & ERRCODE_RES_MASK ; >;
- < "Too many DLL application clients." ; ERRCODE_BASIC_TOO_MANY_DLL & ERRCODE_RES_MASK ; >;
- < "For loop not initialized." ; ERRCODE_BASIC_LOOP_NOT_INIT & ERRCODE_RES_MASK ; >;
- < "$(ARG1)" ; ERRCODE_BASIC_COMPAT & ERRCODE_RES_MASK ; >;
- };
-};
-
- // Hinweis: IDS_SBERR_TERMINATED = IDS_SBERR_START+2000.
-String IDS_SBERR_TERMINATED
-{
- Text [ en-US ] = "The macro running has been interrupted" ;
-};
-String ERRCODE_BASMGR_LIBLOAD & ERRCODE_RES_MASK
-{
- Text [ en-US ] = "Error loading library '$(ARG1)'." ;
-};
-String ERRCODE_BASMGR_LIBSAVE & ERRCODE_RES_MASK
-{
- Text [ en-US ] = "Error saving library: '$(ARG1)'." ;
-};
-String ERRCODE_BASMGR_MGROPEN & ERRCODE_RES_MASK
-{
- Text [ en-US ] = "The BASIC from the file '$(ARG1)' could not be initialized." ;
-};
-String ERRCODE_BASMGR_MGRSAVE & ERRCODE_RES_MASK
-{
- Text [ en-US ] = "Error saving BASIC: '$(ARG1)'." ;
-};
-String ERRCODE_BASMGR_REMOVELIB & ERRCODE_RES_MASK
-{
- Text [ en-US ] = "Error removing library." ;
-};
-String ERRCODE_BASMGR_UNLOADLIB & ERRCODE_RES_MASK
-{
- Text [ en-US ] = "The library could not be removed from memory." ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx
index c9e4a153338d..e7f228060293 100644
--- a/basic/source/runtime/basrdll.cxx
+++ b/basic/source/runtime/basrdll.cxx
@@ -26,8 +26,8 @@
#include <basic/sbstar.hxx>
#include <basic/basrdll.hxx>
-#include <basrid.hxx>
-#include <sb.hrc>
+#include <tools/resmgr.hxx>
+#include "strings.hrc"
#include <sbxbase.hxx>
struct BasicDLL::Impl
@@ -35,13 +35,13 @@ struct BasicDLL::Impl
bool bDebugMode;
bool bBreakEnabled;
- std::unique_ptr<ResMgr> xBasResMgr;
+ std::locale aBasResLocale;
std::unique_ptr<SbxAppData> xSbxAppData;
Impl()
: bDebugMode(false)
, bBreakEnabled(true)
- , xBasResMgr(ResMgr::CreateResMgr("sb", Application::GetSettings().GetUILanguageTag()))
+ , aBasResLocale(Translate::Create("sb", Application::GetSettings().GetUILanguageTag()))
, xSbxAppData(new SbxAppData)
{ }
};
@@ -52,9 +52,9 @@ BasicDLL * BASIC_DLL;
}
-BasResId::BasResId( sal_uInt32 nId ) :
- ResId( nId, *(BASIC_DLL->GetBasResMgr()) )
+OUString BasResId(const char* pId)
{
+ return Translate::get(pId, BASIC_DLL->GetBasResLocale());
}
BasicDLL::BasicDLL()
@@ -67,7 +67,7 @@ BasicDLL::~BasicDLL()
{
}
-ResMgr* BasicDLL::GetBasResMgr() const { return m_xImpl->xBasResMgr.get(); }
+const std::locale& BasicDLL::GetBasResLocale() const { return m_xImpl->aBasResLocale; }
void BasicDLL::EnableBreak( bool bEnable )
{
diff --git a/basic/source/runtime/methods.cxx b/basic/source/runtime/methods.cxx
index f9f7d53597e3..56fa68c2aa52 100644
--- a/basic/source/runtime/methods.cxx
+++ b/basic/source/runtime/methods.cxx
@@ -72,9 +72,7 @@ using namespace com::sun::star::uno;
#include "stdobj.hxx"
#include "sbstdobj.hxx"
#include "rtlproto.hxx"
-#include "basrid.hxx"
#include "image.hxx"
-#include "sb.hrc"
#include "iosys.hxx"
#include "ddectrl.hxx"
#include <sbintern.hxx>
diff --git a/basic/source/runtime/runtime.cxx b/basic/source/runtime/runtime.cxx
index 8f7342b84aee..5d9764fa7581 100644
--- a/basic/source/runtime/runtime.cxx
+++ b/basic/source/runtime/runtime.cxx
@@ -53,7 +53,6 @@
#include <basic/sbuno.hxx>
-#include "basrid.hxx"
#include "codegen.hxx"
#include "comenumwrapper.hxx"
#include "ddectrl.hxx"
@@ -63,7 +62,6 @@
#include "iosys.hxx"
#include "opcodes.hxx"
#include "runtime.hxx"
-#include "sb.hrc"
#include "sb.hxx"
#include "sbintern.hxx"
#include "sbunoobj.hxx"
diff --git a/basic/source/sbx/format.src b/basic/source/sbx/format.src
deleted file mode 100644
index 432da3ffe2cd..000000000000
--- a/basic/source/sbx/format.src
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-#include <svtools/svtools.hrc>
-
-String STR_BASICKEY_FORMAT_ON
-{
- Text [ en-US ] = "On" ;
-};
-String STR_BASICKEY_FORMAT_OFF
-{
- Text [ en-US ] = "Off" ;
-};
-String STR_BASICKEY_FORMAT_TRUE
-{
- Text [ en-US ] = "True" ;
-};
-String STR_BASICKEY_FORMAT_FALSE
-{
- Text [ en-US ] = "False" ;
-};
-String STR_BASICKEY_FORMAT_YES
-{
- Text [ en-US ] = "Yes" ;
-};
-String STR_BASICKEY_FORMAT_NO
-{
- Text [ en-US ] = "No" ;
-};
-String STR_BASICKEY_FORMAT_CURRENCY
-{
- Text [ en-US ] = "@0.00 $;@(0.00 $)" ;
-};
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index eff6720951f5..8be89826439b 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -38,11 +38,10 @@
#include "sbxbase.hxx"
#include <basic/sbxfac.hxx>
#include <basic/sbxform.hxx>
-#include <svtools/svtools.hrc>
-#include "basrid.hxx"
#include "date.hxx"
#include "runtime.hxx"
+#include "strings.hrc"
#include <rtl/strbuf.hxx>
#include <rtl/character.hxx>
@@ -584,21 +583,16 @@ bool SbxValue::Scan( const OUString& rSrc, sal_uInt16* pLen )
namespace
{
-ResMgr& implGetResMgr()
+const std::locale& implGetResLocale()
{
- static ResMgr* const pResMgr( ResMgr::CreateResMgr(
- "sb", Application::GetSettings().GetUILanguageTag() ));
-
- return *pResMgr;
+ static std::locale loc(Translate::Create("sb", Application::GetSettings().GetUILanguageTag()));
+ return loc;
}
-class SbxValueFormatResId : public ResId
+OUString SbxValueFormatResId(const char *pId)
{
-public:
- explicit SbxValueFormatResId( sal_uInt32 nId )
- : ResId( nId, implGetResMgr() )
- {}
-};
+ return Translate::get(pId, implGetResLocale());
+}
enum class VbaFormatType
{