summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-29 15:08:21 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-02 14:43:58 +0200
commit1597cc5b3e07dd24cb4cb10b35b1e93545e4b929 (patch)
treef6ed37244e41d23e8a84327b1580e37f3dc18829 /basic
parent0e883d6dbee8d72257f77605ae0c8a1d5bfbf044 (diff)
convert #defines to OUStringLiteral
mostly by doing $ git grep -l '#define.*\"' -- *.cxx | xargs perl -pi -e 's/^#define\s+(\w+)\s+(\".*\")/constexpr OUStringLiteral \1 = u\2;/g' Change-Id: Idface893449b0ef2a3c5254865a300585d752fbb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119669 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'basic')
-rw-r--r--basic/source/classes/sb.cxx2
-rw-r--r--basic/source/sbx/sbxform.cxx28
-rw-r--r--basic/source/sbx/sbxscan.cxx16
-rw-r--r--basic/source/uno/namecont.cxx4
4 files changed, 25 insertions, 25 deletions
diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx
index 74eacdb504c6..d394c9c8d9a1 100644
--- a/basic/source/classes/sb.cxx
+++ b/basic/source/classes/sb.cxx
@@ -52,7 +52,7 @@
using namespace ::com::sun::star::script;
-#define SB_RTLNAME "@SBRTL"
+constexpr OUStringLiteral SB_RTLNAME = u"@SBRTL";
// i#i68894#
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
diff --git a/basic/source/sbx/sbxform.cxx b/basic/source/sbx/sbxform.cxx
index 052a2dcc159e..0123dd076d02 100644
--- a/basic/source/sbx/sbxform.cxx
+++ b/basic/source/sbx/sbxform.cxx
@@ -58,24 +58,24 @@ COMMENT: Visual-Basic treats the following (invalid) format-strings
#define FORMAT_SEPARATOR ';'
// predefined formats for the Format$()-command:
-#define BASICFORMAT_GENERALNUMBER "General Number"
-#define BASICFORMAT_CURRENCY "Currency"
-#define BASICFORMAT_FIXED "Fixed"
-#define BASICFORMAT_STANDARD "Standard"
-#define BASICFORMAT_PERCENT "Percent"
-#define BASICFORMAT_SCIENTIFIC "Scientific"
-#define BASICFORMAT_YESNO "Yes/No"
-#define BASICFORMAT_TRUEFALSE "True/False"
-#define BASICFORMAT_ONOFF "On/Off"
+constexpr OUStringLiteral BASICFORMAT_GENERALNUMBER = u"General Number";
+constexpr OUStringLiteral BASICFORMAT_CURRENCY = u"Currency";
+constexpr OUStringLiteral BASICFORMAT_FIXED = u"Fixed";
+constexpr OUStringLiteral BASICFORMAT_STANDARD = u"Standard";
+constexpr OUStringLiteral BASICFORMAT_PERCENT = u"Percent";
+constexpr OUStringLiteral BASICFORMAT_SCIENTIFIC = u"Scientific";
+constexpr OUStringLiteral BASICFORMAT_YESNO = u"Yes/No";
+constexpr OUStringLiteral BASICFORMAT_TRUEFALSE = u"True/False";
+constexpr OUStringLiteral BASICFORMAT_ONOFF = u"On/Off";
// Comment: Visual-Basic has a maximum of 12 positions after the
// decimal point for floating-point-numbers.
// all format-strings are compatible to Visual-Basic:
-#define GENERALNUMBER_FORMAT "0.############"
-#define FIXED_FORMAT "0.00"
-#define STANDARD_FORMAT "@0.00"
-#define PERCENT_FORMAT "0.00%"
-#define SCIENTIFIC_FORMAT "#.00E+00"
+constexpr OUStringLiteral GENERALNUMBER_FORMAT = u"0.############";
+constexpr OUStringLiteral FIXED_FORMAT = u"0.00";
+constexpr OUStringLiteral STANDARD_FORMAT = u"@0.00";
+constexpr OUStringLiteral PERCENT_FORMAT = u"0.00%";
+constexpr OUStringLiteral SCIENTIFIC_FORMAT = u"#.00E+00";
// Comment: the character @ means that thousand-separators shall
// be generated. That's a StarBasic 'extension'.
diff --git a/basic/source/sbx/sbxscan.cxx b/basic/source/sbx/sbxscan.cxx
index 45375173209b..b59f948aa6d8 100644
--- a/basic/source/sbx/sbxscan.cxx
+++ b/basic/source/sbx/sbxscan.cxx
@@ -647,14 +647,14 @@ const VbaFormatInfo* getFormatInfo( const OUString& rFmt )
} // namespace
#if HAVE_FEATURE_SCRIPTING
-#define VBAFORMAT_GENERALDATE "General Date"
-#define VBAFORMAT_C "c"
-#define VBAFORMAT_N "n"
-#define VBAFORMAT_NN "nn"
-#define VBAFORMAT_W "w"
-#define VBAFORMAT_Y "y"
-#define VBAFORMAT_LOWERCASE "<"
-#define VBAFORMAT_UPPERCASE ">"
+constexpr OUStringLiteral VBAFORMAT_GENERALDATE = u"General Date";
+constexpr OUStringLiteral VBAFORMAT_C = u"c";
+constexpr OUStringLiteral VBAFORMAT_N = u"n";
+constexpr OUStringLiteral VBAFORMAT_NN = u"nn";
+constexpr OUStringLiteral VBAFORMAT_W = u"w";
+constexpr OUStringLiteral VBAFORMAT_Y = u"y";
+constexpr OUStringLiteral VBAFORMAT_LOWERCASE = u"<";
+constexpr OUStringLiteral VBAFORMAT_UPPERCASE = u">";
#endif
void SbxValue::Format( OUString& rRes, const OUString* pFmt ) const
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 631a7623806e..98b999ecf29e 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -3143,8 +3143,8 @@ void SAL_CALL SfxLibrary::removeChangesListener( const Reference< XChangesListen
// Implementation class ScriptExtensionIterator
-#define sBasicLibMediaType "application/vnd.sun.star.basic-library"
-#define sDialogLibMediaType "application/vnd.sun.star.dialog-library"
+constexpr OUStringLiteral sBasicLibMediaType = u"application/vnd.sun.star.basic-library";
+constexpr OUStringLiteral sDialogLibMediaType = u"application/vnd.sun.star.dialog-library";
ScriptExtensionIterator::ScriptExtensionIterator()
: m_xContext( comphelper::getProcessComponentContext() )