reportdesign/inc/conditionalexpression.hxx | 2 - reportdesign/source/core/misc/conditionalexpression.cxx | 20 ++++++++-------- reportdesign/source/core/misc/reportformula.cxx | 6 ++-- reportdesign/source/ui/inc/ReportController.hxx | 3 +- reportdesign/source/ui/report/ReportController.cxx | 18 ++++++++------ 5 files changed, 26 insertions(+), 23 deletions(-)
New commits: commit 0adfac03387fec9669c33620d8a477ba61aadd65 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jul 15 15:57:06 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Jul 16 07:48:26 2025 +0200 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 <m.wegh...@posteo.de> 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<ConditionalExpression>( "AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) )" ); - _out_rCondExp[ eNotBetween ] = std::make_shared<ConditionalExpression>( "NOT( AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) ) )" ); - _out_rCondExp[ eEqualTo ] = std::make_shared<ConditionalExpression>( "( $$ ) = ( $1 )" ); - _out_rCondExp[ eNotEqualTo ] = std::make_shared<ConditionalExpression>( "( $$ ) <> ( $1 )" ); - _out_rCondExp[ eGreaterThan ] = std::make_shared<ConditionalExpression>( "( $$ ) > ( $1 )" ); - _out_rCondExp[ eLessThan ] = std::make_shared<ConditionalExpression>( "( $$ ) < ( $1 )" ); - _out_rCondExp[ eGreaterOrEqual ] = std::make_shared<ConditionalExpression>( "( $$ ) >= ( $1 )" ); - _out_rCondExp[ eLessOrEqual ] = std::make_shared<ConditionalExpression>( "( $$ ) <= ( $1 )" ); + _out_rCondExp[ eBetween ] = std::make_shared<ConditionalExpression>(u"AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) )"_ustr); + _out_rCondExp[ eNotBetween ] = std::make_shared<ConditionalExpression>(u"NOT( AND( ( $$ ) >= ( $1 ); ( $$ ) <= ( $2 ) ) )"_ustr); + _out_rCondExp[ eEqualTo ] = std::make_shared<ConditionalExpression>(u"( $$ ) = ( $1 )"_ustr); + _out_rCondExp[ eNotEqualTo ] = std::make_shared<ConditionalExpression>(u"( $$ ) <> ( $1 )"_ustr); + _out_rCondExp[ eGreaterThan ] = std::make_shared<ConditionalExpression>(u"( $$ ) > ( $1 )"_ustr); + _out_rCondExp[ eLessThan ] = std::make_shared<ConditionalExpression>(u"( $$ ) < ( $1 )"_ustr); + _out_rCondExp[ eGreaterOrEqual ] = std::make_shared<ConditionalExpression>(u"( $$ ) >= ( $1 )"_ustr); + _out_rCondExp[ eLessOrEqual ] = std::make_shared<ConditionalExpression>(u"( $$ ) <= ( $1 )"_ustr); return _out_rCondExp.size(); } commit 81a1eaa5f35fa5f8a4728309c1be6cfcf15e0ac1 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jul 15 15:41:34 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Jul 16 07:48:19 2025 +0200 reportdesign: const char[] -> std::u16string_view Change-Id: I76e64c69e2d5d5748217199d1267acfdf4b380c3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187918 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx index 5b90647374ad..6b2d528ee9ee 100644 --- a/reportdesign/source/core/misc/reportformula.cxx +++ b/reportdesign/source/core/misc/reportformula.cxx @@ -27,8 +27,8 @@ namespace rptui namespace { - const char sExpressionPrefix[] = "rpt:"; - const char sFieldPrefix[] = "field:"; + constexpr std::u16string_view sExpressionPrefix = u"rpt:"; + constexpr std::u16string_view sFieldPrefix = u"field:"; } @@ -50,7 +50,7 @@ namespace rptui /// does it refer to a field? if ( m_sCompleteFormula.startsWith( sFieldPrefix ) ) { - sal_Int32 nPrefixLen = strlen(sFieldPrefix); + sal_Int32 nPrefixLen = sFieldPrefix.length(); if ( ( m_sCompleteFormula.getLength() >= nPrefixLen + 2 ) && ( m_sCompleteFormula[ nPrefixLen ] == '[' ) && ( m_sCompleteFormula[ m_sCompleteFormula.getLength() - 1 ] == ']' ) commit c64e0922bbfc864d9766ceb4b953d960f625afaf Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Tue Jul 15 15:36:38 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Wed Jul 16 07:48:12 2025 +0200 reportdesign: Switch const char* param to std::u16string_view Change-Id: I939d4ab1664e68a42135ecaa45bb7fbf222df52e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/187917 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/reportdesign/source/ui/inc/ReportController.hxx b/reportdesign/source/ui/inc/ReportController.hxx index 6e8cc0f89d10..dbc8f66e0518 100644 --- a/reportdesign/source/ui/inc/ReportController.hxx +++ b/reportdesign/source/ui/inc/ReportController.hxx @@ -287,7 +287,8 @@ namespace rptui @param _rState the state to fill */ void impl_fillState_nothrow(const OUString& _sProperty,dbaui::FeatureState& _rState) const; - void impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const; + void impl_fillCustomShapeState_nothrow(std::u16string_view sCustomShapeType, + dbaui::FeatureState& _rState) const; /** set the property at all selected controls. @return <TRUE/> when the selection is not empty diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 42ed5b8f36ce..cf84a01b5c7f 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -645,7 +645,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_DRAWTBX_CS_BASIC20: case SID_DRAWTBX_CS_BASIC21: case SID_DRAWTBX_CS_BASIC22: - impl_fillCustomShapeState_nothrow("diamond",aReturn); + impl_fillCustomShapeState_nothrow(u"diamond", aReturn); break; case SID_DRAWTBX_CS_SYMBOL: case SID_DRAWTBX_CS_SYMBOL1: @@ -666,7 +666,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_DRAWTBX_CS_SYMBOL16: case SID_DRAWTBX_CS_SYMBOL17: case SID_DRAWTBX_CS_SYMBOL18: - impl_fillCustomShapeState_nothrow("smiley",aReturn); + impl_fillCustomShapeState_nothrow(u"smiley", aReturn); break; case SID_DRAWTBX_CS_ARROW: case SID_DRAWTBX_CS_ARROW1: @@ -695,7 +695,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_DRAWTBX_CS_ARROW24: case SID_DRAWTBX_CS_ARROW25: case SID_DRAWTBX_CS_ARROW26: - impl_fillCustomShapeState_nothrow("left-right-arrow",aReturn); + impl_fillCustomShapeState_nothrow(u"left-right-arrow", aReturn); break; case SID_DRAWTBX_CS_STAR: case SID_DRAWTBX_CS_STAR1: @@ -710,7 +710,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_DRAWTBX_CS_STAR10: case SID_DRAWTBX_CS_STAR11: case SID_DRAWTBX_CS_STAR12: - impl_fillCustomShapeState_nothrow("star5",aReturn); + impl_fillCustomShapeState_nothrow(u"star5", aReturn); break; case SID_DRAWTBX_CS_FLOWCHART: case SID_DRAWTBX_CS_FLOWCHART1: @@ -741,7 +741,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_DRAWTBX_CS_FLOWCHART26: case SID_DRAWTBX_CS_FLOWCHART27: case SID_DRAWTBX_CS_FLOWCHART28: - impl_fillCustomShapeState_nothrow("flowchart-internal-storage",aReturn); + impl_fillCustomShapeState_nothrow(u"flowchart-internal-storage", aReturn); break; case SID_DRAWTBX_CS_CALLOUT: case SID_DRAWTBX_CS_CALLOUT1: @@ -751,7 +751,7 @@ FeatureState OReportController::GetState(sal_uInt16 _nId) const case SID_DRAWTBX_CS_CALLOUT5: case SID_DRAWTBX_CS_CALLOUT6: case SID_DRAWTBX_CS_CALLOUT7: - impl_fillCustomShapeState_nothrow("round-rectangular-callout",aReturn); + impl_fillCustomShapeState_nothrow(u"round-rectangular-callout", aReturn); break; case SID_RPT_SHOWREPORTEXPLORER: aReturn.bEnabled = m_xReportDefinition.is(); @@ -4157,10 +4157,12 @@ bool OReportController::impl_setPropertyAtControls_throw(TranslateId pUndoResId, return !aSelection.empty(); } -void OReportController::impl_fillCustomShapeState_nothrow(const char* _pCustomShapeType,dbaui::FeatureState& _rState) const +void OReportController::impl_fillCustomShapeState_nothrow(std::u16string_view sCustomShapeType, + dbaui::FeatureState& _rState) const { _rState.bEnabled = isEditable(); - _rState.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::CustomShape && getDesignView()->GetInsertObjString().equalsAscii(_pCustomShapeType); + _rState.bChecked = getDesignView()->GetInsertObj() == SdrObjKind::CustomShape + && getDesignView()->GetInsertObjString() == sCustomShapeType; }