From 0adfac03387fec9669c33620d8a477ba61aadd65 Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Tue, 15 Jul 2025 15:57:06 +0200 Subject: [PATCH] reportdesign: Use const OUString& instead of const char* param Change-Id: Ic76641beb8644e6b3348bd9d73a8a906b4cd5988 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187919 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- reportdesign/inc/conditionalexpression.hxx | 2 +- .../core/misc/conditionalexpression.cxx | 20 +++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/reportdesign/inc/conditionalexpression.hxx b/reportdesign/inc/conditionalexpression.hxx index ac814560d80d..270830d9abf1 100644 --- a/reportdesign/inc/conditionalexpression.hxx +++ b/reportdesign/inc/conditionalexpression.hxx @@ -39,7 +39,7 @@ namespace rptui const OUString m_sPattern; public: - ConditionalExpression( const char* _pAsciiPattern ); + ConditionalExpression(const OUString& sPattern); /** assembles an expression string from a field data source, and one or two operands */ diff --git a/reportdesign/source/core/misc/conditionalexpression.cxx b/reportdesign/source/core/misc/conditionalexpression.cxx index 40126acfc550..de31c47b9f53 100644 --- a/reportdesign/source/core/misc/conditionalexpression.cxx +++ b/reportdesign/source/core/misc/conditionalexpression.cxx @@ -29,8 +29,8 @@ namespace rptui // = ConditionalExpression - ConditionalExpression::ConditionalExpression( const char* _pAsciiPattern ) - :m_sPattern( OUString::createFromAscii( _pAsciiPattern ) ) + ConditionalExpression::ConditionalExpression(const OUString& sPattern) + : m_sPattern(sPattern) { } @@ -163,14 +163,14 @@ namespace rptui { ConditionalExpressions().swap(_out_rCondExp); - _out_rCondExp[ eBetween ] = std::make_shared( "AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) )" ); - _out_rCondExp[ eNotBetween ] = std::make_shared( "NOT( AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) ) )" ); - _out_rCondExp[ eEqualTo ] = std::make_shared( "( $$ ) = ( $1 )" ); - _out_rCondExp[ eNotEqualTo ] = std::make_shared( "( $$ ) <> ( $1 )" ); - _out_rCondExp[ eGreaterThan ] = std::make_shared( "( $$ ) > ( $1 )" ); - _out_rCondExp[ eLessThan ] = std::make_shared( "( $$ ) < ( $1 )" ); - _out_rCondExp[ eGreaterOrEqual ] = std::make_shared( "( $$ ) >= ( $1 )" ); - _out_rCondExp[ eLessOrEqual ] = std::make_shared( "( $$ ) <= ( $1 )" ); + _out_rCondExp[ eBetween ] = std::make_shared(u"AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) )"_ustr); + _out_rCondExp[ eNotBetween ] = std::make_shared(u"NOT( AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) ) )"_ustr); + _out_rCondExp[ eEqualTo ] = std::make_shared(u"( $$ ) = ( $1 )"_ustr); + _out_rCondExp[ eNotEqualTo ] = std::make_shared(u"( $$ ) <> ( $1 )"_ustr); + _out_rCondExp[ eGreaterThan ] = std::make_shared(u"( $$ ) > ( $1 )"_ustr); + _out_rCondExp[ eLessThan ] = std::make_shared(u"( $$ ) < ( $1 )"_ustr); + _out_rCondExp[ eGreaterOrEqual ] = std::make_shared(u"( $$ ) >= ( $1 )"_ustr); + _out_rCondExp[ eLessOrEqual ] = std::make_shared(u"( $$ ) <= ( $1 )"_ustr); return _out_rCondExp.size(); }