[Libreoffice-commits] core.git: starmath/source vcl/source vcl/unx
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Apr 21 12:12:37 UTC 2021
starmath/source/dialog.cxx | 3 +--
vcl/source/control/fmtfield.cxx | 6 ++----
vcl/source/treelist/imap2.cxx | 6 ++----
vcl/unx/generic/printer/ppdparser.cxx | 9 +++------
4 files changed, 8 insertions(+), 16 deletions(-)
New commits:
commit 69e385ec0240d0c44caa5a4ea0195e06007cd588
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Apr 21 12:28:54 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Apr 21 14:11:57 2021 +0200
simplify stripStart/End pairs into a single strip call
Change-Id: I32b1b7d944a4ec49d7daa5b8fa9371b059380062
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114393
Tested-by: Noel Grandin <noel.grandin at collabora.co.uk>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx
index fc722e252bce..523f2fa89d7f 100644
--- a/starmath/source/dialog.cxx
+++ b/starmath/source/dialog.cxx
@@ -1813,8 +1813,7 @@ bool SmSymDefineDialog::SelectSymbolSet(weld::ComboBox& rComboBox,
assert((&rComboBox == m_xOldSymbolSets.get() || &rComboBox == m_xSymbolSets.get()) && "Sm : wrong ComboBox");
// trim SymbolName (no leading and trailing blanks)
- OUString aNormName = comphelper::string::stripStart(rSymbolSetName, ' ');
- aNormName = comphelper::string::stripEnd(aNormName, ' ');
+ OUString aNormName = comphelper::string::strip(rSymbolSetName, ' ');
// and remove possible deviations within the input
rComboBox.set_entry_text(aNormName);
diff --git a/vcl/source/control/fmtfield.cxx b/vcl/source/control/fmtfield.cxx
index 2910c7e02604..cb55d2ce158a 100644
--- a/vcl/source/control/fmtfield.cxx
+++ b/vcl/source/control/fmtfield.cxx
@@ -1114,8 +1114,7 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
if (getPrependCurrSym())
{
OUString sSymbol = getCurrencySymbol();
- sSymbol = comphelper::string::stripStart(sSymbol, ' ');
- sSymbol = comphelper::string::stripEnd(sSymbol, ' ');
+ sSymbol = comphelper::string::strip(sSymbol, ' ');
OUStringBuffer sTemp("[$");
sTemp.append(sSymbol);
@@ -1136,8 +1135,7 @@ void DoubleCurrencyField::UpdateCurrencyFormat()
else
{
OUString sTemp = getCurrencySymbol();
- sTemp = comphelper::string::stripStart(sTemp, ' ');
- sTemp = comphelper::string::stripEnd(sTemp, ' ');
+ sTemp = comphelper::string::strip(sTemp, ' ');
sNewFormat.append(" [$");
sNewFormat.append(sTemp);
diff --git a/vcl/source/treelist/imap2.cxx b/vcl/source/treelist/imap2.cxx
index 4c55f67cde31..889b2c061d92 100644
--- a/vcl/source/treelist/imap2.cxx
+++ b/vcl/source/treelist/imap2.cxx
@@ -358,10 +358,8 @@ OUString ImageMap::ImpReadCERNURL( const char** ppStr )
{
OUString aStr(OUString::createFromAscii(*ppStr));
- aStr = comphelper::string::stripStart(aStr, ' ');
- aStr = comphelper::string::stripStart(aStr, '\t');
- aStr = comphelper::string::stripEnd(aStr, ' ');
- aStr = comphelper::string::stripEnd(aStr, '\t');
+ aStr = comphelper::string::strip(aStr, ' ');
+ aStr = comphelper::string::strip(aStr, '\t');
return INetURLObject::GetAbsURL( "", aStr );
}
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 7b29c876a8c3..75abab8bc728 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -720,14 +720,11 @@ PPDParser::PPDParser( const OUString& rFile ) :
if (aCurLine.matchIgnoreAsciiCase("*include:"))
{
aCurLine = aCurLine.copy(9);
- aCurLine = comphelper::string::stripStart(aCurLine, ' ');
- aCurLine = comphelper::string::stripEnd(aCurLine, ' ');
- aCurLine = comphelper::string::stripStart(aCurLine, '\t');
- aCurLine = comphelper::string::stripEnd(aCurLine, '\t');
+ aCurLine = comphelper::string::strip(aCurLine, ' ');
+ aCurLine = comphelper::string::strip(aCurLine, '\t');
aCurLine = comphelper::string::stripEnd(aCurLine, '\r');
aCurLine = comphelper::string::stripEnd(aCurLine, '\n');
- aCurLine = comphelper::string::stripStart(aCurLine, '"');
- aCurLine = comphelper::string::stripEnd(aCurLine, '"');
+ aCurLine = comphelper::string::strip(aCurLine, '"');
aStream.Close();
aStream.Open(getPPDFile(OStringToOUString(aCurLine, m_aFileEncoding)));
continue;
More information about the Libreoffice-commits
mailing list