diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-29 15:08:21 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-02 14:43:58 +0200 |
commit | 1597cc5b3e07dd24cb4cb10b35b1e93545e4b929 (patch) | |
tree | f6ed37244e41d23e8a84327b1580e37f3dc18829 /dbaccess | |
parent | 0e883d6dbee8d72257f77605ae0c8a1d5bfbf044 (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 'dbaccess')
-rw-r--r-- | dbaccess/source/core/api/SingleSelectQueryComposer.cxx | 26 | ||||
-rw-r--r-- | dbaccess/source/ui/uno/composerdialogs.cxx | 4 |
2 files changed, 15 insertions, 15 deletions
diff --git a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx index 1153fb56714e..38ff97293a99 100644 --- a/dbaccess/source/core/api/SingleSelectQueryComposer.cxx +++ b/dbaccess/source/core/api/SingleSelectQueryComposer.cxx @@ -77,18 +77,18 @@ namespace dbaccess { namespace BooleanComparisonMode = ::com::sun::star::sdb::BooleanComparisonMode; } -#define STR_SELECT "SELECT " -#define STR_FROM " FROM " -#define STR_WHERE " WHERE " -#define STR_GROUP_BY " GROUP BY " -#define STR_HAVING " HAVING " -#define STR_ORDER_BY " ORDER BY " -#define STR_AND " AND " -#define STR_OR " OR " +constexpr OUStringLiteral STR_SELECT = u"SELECT "; +constexpr OUStringLiteral STR_FROM = u" FROM "; +constexpr OUStringLiteral STR_WHERE = u" WHERE "; +constexpr OUStringLiteral STR_GROUP_BY = u" GROUP BY "; +constexpr OUStringLiteral STR_HAVING = u" HAVING "; +constexpr OUStringLiteral STR_ORDER_BY = u" ORDER BY "; +constexpr OUStringLiteral STR_AND = u" AND "; +constexpr OUStringLiteral STR_OR = u" OR "; constexpr OUStringLiteral STR_LIKE = u" LIKE "; -#define L_BRACKET "(" -#define R_BRACKET ")" -#define COMMA "," +constexpr OUStringLiteral L_BRACKET = u"("; +constexpr OUStringLiteral R_BRACKET = u")"; +constexpr OUStringLiteral COMMA = u","; namespace { @@ -752,7 +752,7 @@ Reference< XNameAccess > SAL_CALL OSingleSelectQueryComposer::getColumns( ) bCase = m_xMetaData->supportsMixedCaseQuotedIdentifiers(); aSelectColumns = m_aSqlIterator.getSelectColumns(); - OUStringBuffer aSQL( m_aPureSelectSQL + STR_WHERE " ( 0 = 1 )"); + OUStringBuffer aSQL( m_aPureSelectSQL + STR_WHERE + " ( 0 = 1 )"); // preserve the original WHERE clause // #i102234# @@ -1726,7 +1726,7 @@ void OSingleSelectQueryComposer::setConditionByColumn( const Reference< XPropert if ( !sFilter.isEmpty() && !aSQL.isEmpty() ) { sFilter = L_BRACKET + sFilter + R_BRACKET + - (andCriteria ? std::u16string_view(u"" STR_AND) : std::u16string_view(u"" STR_OR)); + (andCriteria ? std::u16string_view(STR_AND) : std::u16string_view(STR_OR)); } sFilter += aSQL; diff --git a/dbaccess/source/ui/uno/composerdialogs.cxx b/dbaccess/source/ui/uno/composerdialogs.cxx index 650f1fe26932..4daafb73a9fe 100644 --- a/dbaccess/source/ui/uno/composerdialogs.cxx +++ b/dbaccess/source/ui/uno/composerdialogs.cxx @@ -48,8 +48,8 @@ namespace dbaui #define PROPERTY_ID_QUERYCOMPOSER 100 #define PROPERTY_ID_ROWSET 101 -#define PROPERTY_QUERYCOMPOSER "QueryComposer" -#define PROPERTY_ROWSET "RowSet" +constexpr OUStringLiteral PROPERTY_QUERYCOMPOSER = u"QueryComposer"; +constexpr OUStringLiteral PROPERTY_ROWSET = u"RowSet"; using namespace ::com::sun::star::uno; using namespace ::com::sun::star::lang; |