diff options
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/items/flagitem.cxx | 5 | ||||
-rw-r--r-- | svl/source/items/itemprop.cxx | 2 | ||||
-rw-r--r-- | svl/source/items/visitem.cxx | 6 | ||||
-rw-r--r-- | svl/source/numbers/zformat.cxx | 8 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.cxx | 4 | ||||
-rw-r--r-- | svl/source/numbers/zforscan.hxx | 4 |
6 files changed, 17 insertions, 12 deletions
diff --git a/svl/source/items/flagitem.cxx b/svl/source/items/flagitem.cxx index 8a023a7399be..270be1e57530 100644 --- a/svl/source/items/flagitem.cxx +++ b/svl/source/items/flagitem.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> #include <svl/flagitem.hxx> #include <svl/poolitem.hxx> @@ -40,7 +43,7 @@ bool SfxFlagItem::GetPresentation { rText.clear(); for ( sal_uInt8 nFlag = 0; nFlag < GetFlagCount(); ++nFlag ) - rText += GetFlag(nFlag) ? OUStringLiteral(u"true") : OUStringLiteral(u"false"); + rText += GetFlag(nFlag) ? std::u16string_view(u"true") : std::u16string_view(u"false"); return true; } diff --git a/svl/source/items/itemprop.cxx b/svl/source/items/itemprop.cxx index bd710089b874..f3b7719e36ff 100644 --- a/svl/source/items/itemprop.cxx +++ b/svl/source/items/itemprop.cxx @@ -56,7 +56,7 @@ SfxItemPropertyMap_Impl::SfxItemPropertyMap_Impl( const SfxItemPropertyMap_Impl* SfxItemPropertyMap::SfxItemPropertyMap( const SfxItemPropertyMapEntry* pEntries ) : m_pImpl( new SfxItemPropertyMap_Impl ) { - while( pEntries->aName.getLength() ) + while( !pEntries->aName.empty() ) { (*m_pImpl) [ pEntries->aName ] = pEntries; ++pEntries; diff --git a/svl/source/items/visitem.cxx b/svl/source/items/visitem.cxx index 81523f2be65a..c1788c32d1ed 100644 --- a/svl/source/items/visitem.cxx +++ b/svl/source/items/visitem.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <string_view> + #include <svl/visitem.hxx> #include <com/sun/star/uno/Any.hxx> #include <osl/diagnose.h> @@ -36,7 +40,7 @@ bool SfxVisibilityItem::GetPresentation(SfxItemPresentation, OUString & rText, const IntlWrapper&) const { - rText = m_nValue.bVisible ? OUStringLiteral(u"TRUE") : OUStringLiteral(u"FALSE"); + rText = m_nValue.bVisible ? std::u16string_view(u"TRUE") : std::u16string_view(u"FALSE"); return true; } diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 03fe0f68c041..b7df3a6a9ca4 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -2855,7 +2855,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, if (fNum > D_MAX_U_INT32 || rInfo.nCntExp > 9) // Too large { - sBuff = ImpSvNumberformatScan::GetErrorString(); + sBuff = ImpSvNumberformatScan::sErrStr; return false; } if (rInfo.nCntExp == 0) @@ -2873,7 +2873,7 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber, if (fNum1 > D_MAX_U_INT32) { - sBuff = ImpSvNumberformatScan::GetErrorString(); + sBuff = ImpSvNumberformatScan::sErrStr; return false; } nFrac = static_cast<sal_uInt64>(floor(fNum1)); @@ -3080,7 +3080,7 @@ bool SvNumberformat::ImpGetTimeOutput(double fNumber, } if (fTime > D_MAX_U_INT32) { - sBuff = ImpSvNumberformatScan::GetErrorString(); + sBuff = ImpSvNumberformatScan::sErrStr; return false; } sal_uInt32 nSeconds = static_cast<sal_uInt32>(fTime); @@ -4261,7 +4261,7 @@ bool SvNumberformat::ImpGetNumberOutput(double fNumber, } else { - sStr = ImpSvNumberformatScan::GetErrorString(); + sStr = ImpSvNumberformatScan::sErrStr; return false; } } diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx index 288623ef2a6c..64875df1bfda 100644 --- a/svl/source/numbers/zforscan.cxx +++ b/svl/source/numbers/zforscan.cxx @@ -122,8 +122,6 @@ static const std::u16string_view& GermanColorName(size_t i) return sGermanColorNames[i]; } -const OUStringLiteral ImpSvNumberformatScan::sErrStr = u"#FMT"; - ImpSvNumberformatScan::ImpSvNumberformatScan( SvNumberFormatter* pFormatterP ) : maNullDate( 30, 12, 1899) , eNewLnge(LANGUAGE_DONTKNOW) @@ -1867,7 +1865,7 @@ sal_Int32 ImpSvNumberformatScan::FinalScan( OUString& rString ) sDiv += sStrArray[j++]; } assert(j > 0 && "if i is 0, first iteration through loop is guaranteed by surrounding if condition"); - if (OUString::number(sDiv.toInt32()) == sDiv) + if (std::u16string_view(OUString::number(sDiv.toInt32())) == sDiv) { // Found a Divisor while (i < j) diff --git a/svl/source/numbers/zforscan.hxx b/svl/source/numbers/zforscan.hxx index 2120a58323fd..dc7c35aea307 100644 --- a/svl/source/numbers/zforscan.hxx +++ b/svl/source/numbers/zforscan.hxx @@ -91,7 +91,6 @@ public: const OUString& GetFalseString() const { return GetSpecialKeyword( NF_KEY_FALSE ); } const OUString& GetRedString() const { return GetKeywords()[NF_KEY_RED]; } const OUString& GetBooleanString() const { return GetKeywords()[NF_KEY_BOOLEAN]; } - static const OUStringLiteral& GetErrorString() { return sErrStr; } static const ::std::vector<Color> & GetStandardColors() { return StandardColor; @@ -173,6 +172,8 @@ public: /// Get type scanned (so far). SvNumFormatType GetScannedType() const { return eScannedType; } + static constexpr OUStringLiteral sErrStr = u"#FMT"; // String for error output + private: // Private section NfKeywordTable sKeyword; // Syntax keywords static const NfKeywordTable sEnglishKeyword; // English Syntax keywords @@ -209,7 +210,6 @@ private: // Private section OUString sCurAbbrev; // Currency abbreviation OUString sBooleanEquivalent1; // "TRUE";"TRUE";"FALSE" OUString sBooleanEquivalent2; // [>0]"TRUE";[<0]"TRUE";"FALSE" - static const OUStringLiteral sErrStr; // String for error output bool bConvertMode; // Set in the convert mode bool mbConvertDateOrder; // Set in the convert mode whether to convert date particles order |