diff options
Diffstat (limited to 'reportdesign/source/core')
-rw-r--r-- | reportdesign/source/core/api/ReportDefinition.cxx | 2 | ||||
-rw-r--r-- | reportdesign/source/core/api/ReportEngineJFree.cxx | 6 | ||||
-rw-r--r-- | reportdesign/source/core/misc/reportformula.cxx | 31 |
3 files changed, 13 insertions, 26 deletions
diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 571095a3ac66..6deca0ae05f4 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1455,7 +1455,7 @@ void SAL_CALL OReportDefinition::storeToStorage( const uno::Reference< embed::XS uno::Reference< beans::XPropertySet> xProp(_xStorageToSaveTo,uno::UNO_QUERY); if ( xProp.is() ) { - static const OUString sPropName("MediaType"); + static const char sPropName[] = "MediaType"; OUString sOldMediaType; xProp->getPropertyValue(sPropName) >>= sOldMediaType; if ( !xProp->getPropertyValue(sPropName).hasValue() || sOldMediaType.isEmpty() || MIMETYPE_OASIS_OPENDOCUMENT_REPORT != sOldMediaType ) diff --git a/reportdesign/source/core/api/ReportEngineJFree.cxx b/reportdesign/source/core/api/ReportEngineJFree.cxx index 924f146ac95c..304dee782c75 100644 --- a/reportdesign/source/core/api/ReportEngineJFree.cxx +++ b/reportdesign/source/core/api/ReportEngineJFree.cxx @@ -163,7 +163,7 @@ OUString OReportEngineJFree::getNewOutputName() if ( !m_xReport.is() || !m_xActiveConnection.is() ) throw lang::IllegalArgumentException(); - static const OUString s_sMediaType("MediaType"); + static const char s_sMediaType[] = "MediaType"; try { MimeConfigurationHelper aConfighelper(m_xContext); @@ -229,11 +229,11 @@ OUString OReportEngineJFree::getNewOutputName() OUStringBuffer sAuthor(aUserOpts.GetFirstName()); sAuthor.appendAscii(" "); sAuthor.append(aUserOpts.GetLastName()); - static const OUString s_sAuthor("Author"); + static const char s_sAuthor[] = "Author"; aConvertedProperties[nPos].Name = s_sAuthor; aConvertedProperties[nPos++].Value <<= sAuthor.makeStringAndClear(); - static const OUString s_sTitle("Title"); + static const char s_sTitle[] = "Title"; aConvertedProperties[nPos].Name = s_sTitle; aConvertedProperties[nPos++].Value <<= m_xReport->getCaption(); diff --git a/reportdesign/source/core/misc/reportformula.cxx b/reportdesign/source/core/misc/reportformula.cxx index 0b53d279f1a1..77d24b853751 100644 --- a/reportdesign/source/core/misc/reportformula.cxx +++ b/reportdesign/source/core/misc/reportformula.cxx @@ -31,22 +31,8 @@ namespace rptui namespace { - const OUString& lcl_getExpressionPrefix( sal_Int32* _pTakeLengthOrNull = NULL ) - { - static OUString s_sPrefix( "rpt:" ); - if ( _pTakeLengthOrNull ) - *_pTakeLengthOrNull = s_sPrefix.getLength(); - return s_sPrefix; - } - - - const OUString& lcl_getFieldPrefix( sal_Int32* _pTakeLengthOrNull = NULL ) - { - static OUString s_sPrefix( "field:" ); - if ( _pTakeLengthOrNull ) - *_pTakeLengthOrNull = s_sPrefix.getLength(); - return s_sPrefix; - } + static const char sExpressionPrefix[] = "rpt:"; + static const char sFieldPrefix[] = "field:"; } @@ -67,17 +53,17 @@ namespace rptui { case Expression: { - if ( _rFieldOrExpression.startsWith( lcl_getExpressionPrefix() ) ) + if ( _rFieldOrExpression.startsWith( sExpressionPrefix ) ) m_sCompleteFormula = _rFieldOrExpression; else - m_sCompleteFormula = lcl_getExpressionPrefix() + _rFieldOrExpression; + m_sCompleteFormula = sExpressionPrefix + _rFieldOrExpression; } break; case Field: { OUStringBuffer aBuffer; - aBuffer.append( lcl_getFieldPrefix() ); + aBuffer.append( sFieldPrefix ); aBuffer.appendAscii( "[" ); aBuffer.append( _rFieldOrExpression ); aBuffer.appendAscii( "]" ); @@ -100,18 +86,19 @@ namespace rptui { m_sCompleteFormula = _rFormula; - sal_Int32 nPrefixLen( -1 ); // is it an ordinary expression? - if ( m_sCompleteFormula.startsWith( lcl_getExpressionPrefix( &nPrefixLen ) ) ) + if ( m_sCompleteFormula.startsWith( sExpressionPrefix ) ) { + sal_Int32 nPrefixLen = strlen(sExpressionPrefix); m_eType = Expression; m_sUndecoratedContent = m_sCompleteFormula.copy( nPrefixLen ); return; } /// does it refer to a field? - if ( m_sCompleteFormula.startsWith( lcl_getFieldPrefix( &nPrefixLen ) ) ) + if ( m_sCompleteFormula.startsWith( sFieldPrefix ) ) { + sal_Int32 nPrefixLen = strlen(sFieldPrefix); if ( ( m_sCompleteFormula.getLength() >= nPrefixLen + 2 ) && ( m_sCompleteFormula[ nPrefixLen ] == '[' ) && ( m_sCompleteFormula[ m_sCompleteFormula.getLength() - 1 ] == ']' ) |