[Libreoffice-commits] core.git: 3 commits - configmgr/source desktop/source editeng/source i18npool/source oox/source sal/qa sc/source sd/source sfx2/source starmath/source stoc/source svl/source toolkit/source tools/source ucb/source vcl/unx
Noel Grandin
noel at peralex.com
Thu Dec 12 03:16:09 PST 2013
configmgr/source/access.cxx | 2
desktop/source/deployment/misc/dp_misc.cxx | 2
desktop/source/deployment/registry/sfwk/dp_sfwk.cxx | 2
editeng/source/editeng/eehtml.cxx | 5
i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx | 16 -
i18npool/source/localedata/LocaleNode.cxx | 2
oox/source/core/filterbase.cxx | 2
oox/source/dump/dumperbase.cxx | 6
oox/source/vml/vmlinputstream.cxx | 2
sal/qa/osl/security/osl_Security.cxx | 2
sc/source/core/data/dputil.cxx | 4
sc/source/core/tool/compiler.cxx | 6
sc/source/core/tool/token.cxx | 4
sc/source/filter/oox/worksheetbuffer.cxx | 2
sc/source/filter/oox/worksheethelper.cxx | 2
sc/source/ui/formdlg/formula.cxx | 2
sc/source/ui/unoobj/cellsuno.cxx | 2
sc/source/ui/view/viewdata.cxx | 2
sd/source/core/anminfo.cxx | 2
sd/source/ui/docshell/docshel4.cxx | 4
sd/source/ui/unoidl/unomodel.cxx | 2
sfx2/source/appl/appopen.cxx | 2
sfx2/source/bastyp/fltfnc.cxx | 2
sfx2/source/dialog/splitwin.cxx | 2
sfx2/source/doc/sfxbasemodel.cxx | 2
starmath/source/parse.cxx | 2
stoc/source/uriproc/UriReferenceFactory.cxx | 4
stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx | 2
svl/source/misc/urihelper.cxx | 2
toolkit/source/awt/vclxwindows.cxx | 2
tools/source/fsys/urlobj.cxx | 127 ++++------
ucb/source/regexp/regexp.cxx | 2
ucb/source/ucp/ext/ucpext_datasupplier.cxx | 2
vcl/unx/generic/printer/ppdparser.cxx | 2
34 files changed, 111 insertions(+), 115 deletions(-)
New commits:
commit 80612512fe3d681f13b794e84e30072ba149b698
Author: Noel Grandin <noel at peralex.com>
Date: Tue Dec 10 09:26:03 2013 +0200
remove unnecessary casts
It is no longer necessary to cast to sal_Unicode when calling
OUStringBuffer::append
Change-Id: Iab3d1e12eef472cfe11f1d0d1969ca404091dd7d
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index c9ba6b2..43e5b85 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -301,7 +301,7 @@ OUString toRoman( sal_Int32 n )
OUStringBuffer sTmp;
while(nOver1000--)
- sTmp.append(sal_Unicode(*coRomanArr));
+ sTmp.append(*coRomanArr);
while( nMask )
{
@@ -312,17 +312,17 @@ OUString toRoman( sal_Int32 n )
if( 5 < nZahl )
{
if( nZahl < 9 )
- sTmp.append(sal_Unicode(*(cRomanStr-1)));
+ sTmp.append(*(cRomanStr-1));
++nDiff;
nZahl -= 5;
}
switch( nZahl )
{
- case 3: sTmp.append(sal_Unicode(*cRomanStr)); //no break!
- case 2: sTmp.append(sal_Unicode(*cRomanStr)); //no break!
- case 1: sTmp.append(sal_Unicode(*cRomanStr)); break;
- case 4: sTmp.append(sal_Unicode(*cRomanStr)).append(sal_Unicode(*(cRomanStr-nDiff))); break;
- case 5: sTmp.append(sal_Unicode(*(cRomanStr-nDiff))); break;
+ case 3: sTmp.append(*cRomanStr); //no break!
+ case 2: sTmp.append(*cRomanStr); //no break!
+ case 1: sTmp.append(*cRomanStr); break;
+ case 4: sTmp.append(*cRomanStr).append(*(cRomanStr-nDiff)); break;
+ case 5: sTmp.append(*(cRomanStr-nDiff)); break;
}
nMask /= 10; // to the next decade
diff --git a/sc/source/core/data/dputil.cxx b/sc/source/core/data/dputil.cxx
index e21b2a8..14b8639 100644
--- a/sc/source/core/data/dputil.cxx
+++ b/sc/source/core/data/dputil.cxx
@@ -47,7 +47,7 @@ void appendDateStr(OUStringBuffer& rBuffer, double fValue, SvNumberFormatter* pF
OUString getSpecialDateName(double fValue, bool bFirst, SvNumberFormatter* pFormatter)
{
OUStringBuffer aBuffer;
- aBuffer.append(sal_Unicode(bFirst ? '<' : '>'));
+ aBuffer.append( bFirst ? '<' : '>' );
appendDateStr(aBuffer, fValue, pFormatter);
return aBuffer.makeStringAndClear();
}
@@ -206,7 +206,7 @@ OUString lcl_GetSpecialNumGroupName( double fValue, bool bFirst, sal_Unicode cDe
OSL_ENSURE( cDecSeparator != 0, "cDecSeparator not initialized" );
OUStringBuffer aBuffer;
- aBuffer.append((sal_Unicode)( bFirst ? '<' : '>' ));
+ aBuffer.append( bFirst ? '<' : '>' );
if ( bDateValues )
lcl_AppendDateStr( aBuffer, fValue, pFormatter );
else
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 496c151..ffce53b 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -934,7 +934,7 @@ struct ConventionOOO_A1_ODF : public ConventionOOO_A1
const ScComplexRefData& rRef,
bool bSingleRef ) const
{
- rBuffer.append(sal_Unicode('['));
+ rBuffer.append('[');
ScComplexRefData aRef( rRef );
// In case absolute/relative positions weren't separately available:
// transform relative to absolute!
@@ -954,11 +954,11 @@ struct ConventionOOO_A1_ODF : public ConventionOOO_A1
MakeOneRefStrImpl(rBuffer, rErrRef, rTabNames, aRef.Ref1, aAbs1, false, true);
if (!bSingleRef)
{
- rBuffer.append(sal_Unicode(':'));
+ rBuffer.append(':');
MakeOneRefStrImpl(rBuffer, rErrRef, rTabNames, aRef.Ref2, aAbs2, aAbs1.Tab() != aAbs2.Tab(), true);
}
}
- rBuffer.append(sal_Unicode(']'));
+ rBuffer.append(']');
}
virtual OUString makeExternalNameStr( const OUString& rFile, const OUString& rName ) const
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f74c5ee..772989b 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3212,9 +3212,9 @@ void appendDouble( sc::TokenStringContext& rCxt, OUStringBuffer& rBuf, double fV
void appendString( OUStringBuffer& rBuf, const OUString& rStr )
{
- rBuf.append(sal_Unicode('"'));
+ rBuf.append('"');
rBuf.append(rStr.replaceAll("\"", "\"\""));
- rBuf.append(sal_Unicode('"'));
+ rBuf.append('"');
}
void appendTokenByType( sc::TokenStringContext& rCxt, OUStringBuffer& rBuf, const FormulaToken& rToken, const ScAddress& rPos )
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index da17cbc..53c15bf 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -345,7 +345,7 @@ void UrlReference::setParameter(OUString const & key, OUString const & value)
OUStringBuffer newPath;
newPath.append(m_base.m_path.copy(0, i));
if (!bExistent) {
- newPath.append(sal_Unicode(m_base.m_path.indexOf('?') < 0 ? '?' : '&'));
+ newPath.append( m_base.m_path.indexOf('?') < 0 ? '?' : '&' );
newPath.append(encodeNameOrParamFragment(key));
newPath.append('=');
}
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index e9a05c5..99f0eeb 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -423,9 +423,9 @@ inline void INetURLObject::appendEscape(OUStringBuffer & rTheText,
sal_Char cEscapePrefix,
sal_uInt32 nOctet)
{
- rTheText.append(sal_Unicode(cEscapePrefix));
- rTheText.append(sal_Unicode(INetMIME::getHexDigit(int(nOctet >> 4))));
- rTheText.append(sal_Unicode(INetMIME::getHexDigit(int(nOctet & 15))));
+ rTheText.append( cEscapePrefix );
+ rTheText.append( (sal_Unicode)INetMIME::getHexDigit(int(nOctet >> 4)) );
+ rTheText.append( (sal_Unicode)INetMIME::getHexDigit(int(nOctet & 15)) );
}
namespace unnamed_tools_urlobj {
@@ -1637,7 +1637,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
}
aSynAbsURIRef.append(pSchemeBegin, pSchemeEnd - pSchemeBegin);
}
- aSynAbsURIRef.append(sal_Unicode(':'));
+ aSynAbsURIRef.append(':');
sal_Char cEscapePrefix = getEscapePrefix();
@@ -1705,7 +1705,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
if (eState == STATE_ABS_PATH)
{
- aSynAbsURIRef.append(sal_Unicode('/'));
+ aSynAbsURIRef.append('/');
eState = STATE_DONE;
while (p != pEnd)
{
@@ -1812,7 +1812,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
}
if (p != pEnd && *p == nSegmentDelimiter)
{
- aSynAbsURIRef.append(sal_Unicode('/'));
+ aSynAbsURIRef.append('/');
++p;
}
}
@@ -1847,7 +1847,7 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
if (eState == STATE_FRAGMENT && !bIgnoreFragment)
{
- aSynAbsURIRef.append(sal_Unicode('#'));
+ aSynAbsURIRef.append('#');
while (p != pEnd)
{
EscapeType eEscapeType;
@@ -2029,13 +2029,13 @@ bool INetURLObject::convertAbsToRel(OUString const & rTheAbsURIRef,
// to the new relative URL:
if (aSubject.m_aQuery.isPresent())
{
- aSynRelURIRef.append(sal_Unicode('?'));
+ aSynRelURIRef.append('?');
aSynRelURIRef.append(aSubject.decode(aSubject.m_aQuery, cEscapePrefix,
eDecodeMechanism, eCharset));
}
if (aSubject.m_aFragment.isPresent())
{
- aSynRelURIRef.append(sal_Unicode('#'));
+ aSynRelURIRef.append('#');
aSynRelURIRef.append(aSubject.decode(aSubject.m_aFragment,
cEscapePrefix, eDecodeMechanism, eCharset));
}
@@ -2405,7 +2405,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
case STATE_INITIAL:
if (*p == '[')
{
- aTheCanonic.append(sal_Unicode('['));
+ aTheCanonic.append('[');
eState = STATE_IP6;
}
else if (rtl::isAsciiAlpha(*p) || *p == '_')
@@ -2475,9 +2475,8 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
if (*p == '.')
if (nOctets < 4)
{
- aTheCanonic.append(
- OUString::number(nNumber));
- aTheCanonic.append(sal_Unicode('.'));
+ aTheCanonic.append( OUString::number(nNumber) );
+ aTheCanonic.append( '.' );
++nOctets;
eState = STATE_IP4_DOT;
}
@@ -2540,7 +2539,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
eState = STATE_IP6_DONE;
else if (*p == ':')
{
- aTheCanonic.append(sal_Unicode(':'));
+ aTheCanonic.append(':');
eState = STATE_IP6_3COLON;
}
else if (rtl::isAsciiDigit(*p))
@@ -2582,7 +2581,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
{
aTheCanonic.append(
OUString::number(nNumber, 16));
- aTheCanonic.append(sal_Unicode(':'));
+ aTheCanonic.append(':');
eState = STATE_IP6_HEXSEQ1_COLON;
}
else if (rtl::isAsciiHexDigit(*p) && nDigits < 4)
@@ -2597,7 +2596,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
case STATE_IP6_HEXSEQ1_COLON:
if (*p == ':')
{
- aTheCanonic.append(sal_Unicode(':'));
+ aTheCanonic.append(':');
eState = STATE_IP6_2COLON;
}
else if (rtl::isAsciiDigit(*p))
@@ -2627,7 +2626,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
{
aTheCanonic.append(
OUString::number(nNumber, 16));
- aTheCanonic.append(sal_Unicode(':'));
+ aTheCanonic.append(':');
eState = STATE_IP6_HEXSEQ1_COLON;
}
else if (*p == '.')
@@ -2636,7 +2635,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
+ (nNumber & 15);
aTheCanonic.append(
OUString::number(nNumber));
- aTheCanonic.append(sal_Unicode('.'));
+ aTheCanonic.append('.');
nOctets = 2;
eState = STATE_IP6_IP4_DOT;
}
@@ -2666,7 +2665,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
{
aTheCanonic.append(
OUString::number(nNumber, 16));
- aTheCanonic.append(sal_Unicode(':'));
+ aTheCanonic.append(':');
eState = STATE_IP6_HEXSEQ2_COLON;
}
else if (rtl::isAsciiHexDigit(*p) && nDigits < 4)
@@ -2706,7 +2705,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
{
aTheCanonic.append(
OUString::number(nNumber, 16));
- aTheCanonic.append(sal_Unicode(':'));
+ aTheCanonic.append(':');
eState = STATE_IP6_HEXSEQ2_COLON;
}
else if (*p == '.')
@@ -2715,7 +2714,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
+ (nNumber & 15);
aTheCanonic.append(
OUString::number(nNumber));
- aTheCanonic.append(sal_Unicode('.'));
+ aTheCanonic.append('.');
nOctets = 2;
eState = STATE_IP6_IP4_DOT;
}
@@ -2749,7 +2748,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
{
aTheCanonic.append(
OUString::number(nNumber));
- aTheCanonic.append(sal_Unicode('.'));
+ aTheCanonic.append('.');
++nOctets;
eState = STATE_IP6_IP4_DOT;
}
@@ -2802,7 +2801,7 @@ bool INetURLObject::parseHost(sal_Unicode const *& rBegin, sal_Unicode const * p
return false;
case STATE_IP6_DONE:
- aTheCanonic.append(sal_Unicode(']'));
+ aTheCanonic.append(']');
rBegin = p;
rCanonic = aTheCanonic.makeStringAndClear();
return true;
@@ -2954,7 +2953,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
PART_HTTP_PATH, '%', eCharset, true);
}
if (aTheSynPath.isEmpty())
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
break;
case INET_PROT_HTTP:
@@ -2975,13 +2974,13 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
PART_HTTP_PATH, '%', eCharset, true);
}
if (aTheSynPath.isEmpty())
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
break;
case INET_PROT_FILE:
{
if (bSkippedInitialSlash)
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
else if (pPos < pEnd
&& *pPos != nSegmentDelimiter
&& *pPos != nAltSegmentDelimiter)
@@ -2997,7 +2996,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
if (nUTF32 == nSegmentDelimiter
|| nUTF32 == nAltSegmentDelimiter)
{
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
continue;
}
else if (nUTF32 == '|'
@@ -3010,7 +3009,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
{
// A first segment of <ALPHA "|"> is translated to
// <ALPHA ":">:
- aTheSynPath.append(sal_Unicode(':'));
+ aTheSynPath.append(':');
continue;
}
}
@@ -3018,7 +3017,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
PART_PCHAR, '%', eCharset, true);
}
if (aTheSynPath.isEmpty())
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
break;
}
@@ -3046,7 +3045,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
|| pPos[1] == nFragmentDelimiter))
{
++pPos;
- aTheSynPath.append(sal_Unicode('*'));
+ aTheSynPath.append('*');
break;
}
@@ -3088,7 +3087,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
if (aTheSynPath.isEmpty())
return false;
++pPos;
- aTheSynPath.append(sal_Unicode('@'));
+ aTheSynPath.append('@');
{
sal_Unicode const * p = pPos;
while (p < pEnd && *pPos != nQueryDelimiter
@@ -3140,7 +3139,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
if (pPos == pEnd
|| *pPos == nQueryDelimiter
|| *pPos == nFragmentDelimiter)
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
else
{
if (*pPos != '/')
@@ -3201,13 +3200,13 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
'%', eMechanism,
eCharset, eEscapeType);
if (eEscapeType == ESCAPE_NO && nUTF32 == '/')
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
else
appendUCS4(aTheSynPath, nUTF32, eEscapeType, bOctets,
PART_PCHAR, '%', eCharset, false);
}
if (aTheSynPath.isEmpty())
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
break;
case INET_PROT_VIM:
@@ -3215,7 +3214,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
sal_Unicode const * pPathEnd = pPos;
while (pPathEnd < pEnd && *pPathEnd != nFragmentDelimiter)
++pPathEnd;
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
if (pPos == pPathEnd)
break;
else if (*pPos++ != '/')
@@ -3242,7 +3241,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
bInbox = false;
else
return false;
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
if (pPos == pPathEnd)
break;
else if (*pPos++ != '/')
@@ -3262,7 +3261,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
}
if (bEmpty)
return false;
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
if (pPos == pPathEnd)
break;
else if (*pPos++ != '/')
@@ -3285,14 +3284,14 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
break;
else if (*pPos++ != ':')
return false;
- aTheSynPath.append(sal_Unicode(':'));
+ aTheSynPath.append(':');
for (int i = 0; i < 3; ++i)
{
if (i != 0)
{
if (pPos == pPathEnd || *pPos++ != '.')
return false;
- aTheSynPath.append(sal_Unicode('.'));
+ aTheSynPath.append('.');
}
bEmpty = true;
while (pPos < pPathEnd && *pPos != '.')
@@ -3340,7 +3339,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
return false;
++pPos;
}
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
break;
case INET_PROT_VND_SUN_STAR_TDOC:
@@ -3353,7 +3352,7 @@ bool INetURLObject::parsePath(INetProtocol eScheme,
'%', eMechanism,
eCharset, eEscapeType);
if (eEscapeType == ESCAPE_NO && nUTF32 == '/')
- aTheSynPath.append(sal_Unicode('/'));
+ aTheSynPath.append('/');
else
appendUCS4(aTheSynPath, nUTF32, eEscapeType, bOctets,
PART_PCHAR, '%', eCharset, false);
@@ -3540,11 +3539,11 @@ bool INetURLObject::insertName(OUString const & rTheName, bool bOctets,
OUStringBuffer aNewPath;
aNewPath.append(pPathBegin, pPrefixEnd - pPathBegin);
- aNewPath.append(sal_Unicode('/'));
+ aNewPath.append('/');
aNewPath.append(encodeText(rTheName, bOctets, PART_PCHAR, getEscapePrefix(),
eMechanism, eCharset, true));
if (bInsertSlash) {
- aNewPath.append(sal_Unicode('/'));
+ aNewPath.append('/');
}
aNewPath.append(pSuffixBegin, pPathEnd - pSuffixBegin);
@@ -3612,7 +3611,7 @@ bool INetURLObject::setFragment(OUString const & rTheFragment,
m_aFragment.set(m_aAbsURIRef, aNewFragment);
else
{
- m_aAbsURIRef.append(sal_Unicode('#'));
+ m_aAbsURIRef.append('#');
m_aFragment.set(m_aAbsURIRef, aNewFragment, m_aAbsURIRef.getLength());
}
return true;
@@ -3754,7 +3753,7 @@ INetURLObject::getAbbreviated(
aBuffer.append(pSchemeBegin, pSchemeEnd - pSchemeBegin);
}
}
- aBuffer.append(static_cast< sal_Unicode >(':'));
+ aBuffer.append(':');
bool bAuthority = getSchemeInfo().m_bAuthority;
sal_Unicode const * pCoreBegin
= m_aAbsURIRef.getStr() + (bAuthority ? getAuthorityBegin() :
@@ -3874,12 +3873,12 @@ INetURLObject::getAbbreviated(
eCharset));
if (m_aQuery.isPresent())
{
- aBuffer.append(static_cast< sal_Unicode >('?'));
+ aBuffer.append('?');
aBuffer.append(decode(m_aQuery, cEscapePrefix, eMechanism, eCharset));
}
if (m_aFragment.isPresent())
{
- aBuffer.append(static_cast< sal_Unicode >('#'));
+ aBuffer.append('#');
aBuffer.
append(decode(m_aFragment, cEscapePrefix, eMechanism, eCharset));
}
@@ -4025,7 +4024,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
return false;
m_aAbsURIRef.setLength(0);
m_aAbsURIRef.appendAscii(getSchemeInfo().m_pScheme);
- m_aAbsURIRef.append(sal_Unicode(':'));
+ m_aAbsURIRef.append(':');
if (getSchemeInfo().m_bAuthority)
{
m_aAbsURIRef.append("//");
@@ -4061,7 +4060,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
{
if (getSchemeInfo().m_bPassword)
{
- m_aAbsURIRef.append(sal_Unicode(':'));
+ m_aAbsURIRef.append(':');
m_aAuth.set(m_aAbsURIRef,
encodeText(rThePassword, false,
m_eScheme == INET_PROT_VIM ?
@@ -4078,7 +4077,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
}
}
if (bUserInfo && getSchemeInfo().m_bHost)
- m_aAbsURIRef.append(sal_Unicode('@'));
+ m_aAbsURIRef.append('@');
if (getSchemeInfo().m_bHost)
{
OUStringBuffer aSynHost(rTheHost);
@@ -4125,7 +4124,7 @@ bool INetURLObject::ConcatData(INetProtocol eTheScheme,
{
if (getSchemeInfo().m_bPort)
{
- m_aAbsURIRef.append(sal_Unicode(':'));
+ m_aAbsURIRef.append(':');
m_aPort.set(m_aAbsURIRef,
OUString::number(nThePort),
m_aAbsURIRef.getLength());
@@ -4226,7 +4225,7 @@ OUString INetURLObject::GetHostPort(DecodeMechanism eMechanism,
eMechanism, eCharset));
if (m_aPort.isPresent())
{
- aHostPort.append(sal_Unicode(':'));
+ aHostPort.append(':');
aHostPort.append(decode(m_aPort, getEscapePrefix(),
eMechanism, eCharset));
}
@@ -4294,14 +4293,14 @@ bool INetURLObject::removeSegment(sal_Int32 nIndex, bool bIgnoreFinalSlash)
aNewPath.append(m_aAbsURIRef.getStr() + m_aPath.getBegin(),
aSegment.getBegin() - m_aPath.getBegin());
if (bIgnoreFinalSlash && aSegment.getEnd() == m_aPath.getEnd())
- aNewPath.append(sal_Unicode('/'));
+ aNewPath.append('/');
else
aNewPath.append(m_aAbsURIRef.getStr() + aSegment.getEnd(),
m_aPath.getEnd() - aSegment.getEnd());
if (aNewPath.isEmpty() && !aSegment.isEmpty() &&
m_aAbsURIRef[aSegment.getBegin()] == '/')
{
- aNewPath.append(sal_Unicode('/'));
+ aNewPath.append('/');
}
return setPath(aNewPath.makeStringAndClear(), false, NOT_CANONIC,
@@ -4497,7 +4496,7 @@ bool INetURLObject::setExtension(OUString const & rTheExtension,
OUStringBuffer aNewPath;
aNewPath.append(pPathBegin, pExtension - pPathBegin);
- aNewPath.append(sal_Unicode('.'));
+ aNewPath.append('.');
aNewPath.append(encodeText(rTheExtension, false, PART_PCHAR,
getEscapePrefix(), eMechanism, eCharset, true));
aNewPath.append(p, pPathEnd - p);
@@ -4561,7 +4560,7 @@ bool INetURLObject::setFinalSlash()
OUStringBuffer aNewPath;
aNewPath.append(pPathBegin, pPathEnd - pPathBegin);
- aNewPath.append(sal_Unicode('/'));
+ aNewPath.append('/');
return setPath(aNewPath.makeStringAndClear(), false, NOT_CANONIC,
RTL_TEXTENCODING_UTF8);
@@ -4718,7 +4717,7 @@ bool INetURLObject::setFSysPath(OUString const & rFSysPath,
p += 2;
else
{
- aSynAbsURIRef.append(sal_Unicode('/'));
+ aSynAbsURIRef.append('/');
if (pFSysEnd - p >= 2
&& rtl::isAsciiAlpha(p[0])
&& p[1] == ':'
@@ -4727,7 +4726,7 @@ bool INetURLObject::setFSysPath(OUString const & rFSysPath,
}
for (; p != pFSysEnd; ++p)
if (*p == '\\' || *p == nAltDelimiter)
- aSynAbsURIRef.append(sal_Unicode('/'));
+ aSynAbsURIRef.append('/');
else
switch (*p)
{
@@ -4745,13 +4744,13 @@ bool INetURLObject::setFSysPath(OUString const & rFSysPath,
}
case FSYS_MAC:
- aSynAbsURIRef.append(sal_Unicode('/'));
+ aSynAbsURIRef.append('/');
for (sal_Unicode const * p = pFSysBegin; p != pFSysEnd; ++p)
{
switch (*p)
{
case ':':
- aSynAbsURIRef.append(sal_Unicode('/'));
+ aSynAbsURIRef.append('/');
break;
case '/':
@@ -4822,7 +4821,7 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle,
aSynFSysPath.append(decode(m_aHost, '%', DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8));
else
- aSynFSysPath.append(sal_Unicode('.'));
+ aSynFSysPath.append('.');
aSynFSysPath.append(decode(m_aPath, '%', DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8));
return aSynFSysPath.makeStringAndClear();
@@ -4851,7 +4850,7 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle,
aSynFSysPath.append("\\\\");
aSynFSysPath.append(decode(m_aHost, '%', DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8));
- aSynFSysPath.append(sal_Unicode('\\'));
+ aSynFSysPath.append('\\');
}
sal_Unicode const * p
= m_aAbsURIRef.getStr() + m_aPath.getBegin();
@@ -4866,7 +4865,7 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle,
RTL_TEXTENCODING_UTF8,
eEscapeType);
if (eEscapeType == ESCAPE_NO && nUTF32 == '/')
- aSynFSysPath.append(sal_Unicode('\\'));
+ aSynFSysPath.append('\\');
else
aSynFSysPath.appendUtf32(nUTF32);
}
@@ -4895,7 +4894,7 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle,
RTL_TEXTENCODING_UTF8,
eEscapeType);
if (eEscapeType == ESCAPE_NO && nUTF32 == '/')
- aSynFSysPath.append(sal_Unicode(':'));
+ aSynFSysPath.append(':');
else
aSynFSysPath.appendUtf32(nUTF32);
}
diff --git a/ucb/source/regexp/regexp.cxx b/ucb/source/regexp/regexp.cxx
index 7e84f19..354e970 100644
--- a/ucb/source/regexp/regexp.cxx
+++ b/ucb/source/regexp/regexp.cxx
@@ -283,7 +283,7 @@ OUString Regexp::getRegexp(bool bReverse) const
case KIND_DOMAIN:
aBuffer.append("[^/?#]");
- aBuffer.append(sal_Unicode(m_bEmptyDomain ? '*' : '+'));
+ aBuffer.append( m_bEmptyDomain ? '*' : '+' );
if (!m_aInfix.isEmpty())
appendStringLiteral(&aBuffer, m_aInfix);
aBuffer.append("([/?#].*)?");
commit 7e72b9de5545ac3baaa44e2d7f11c2872b1677a7
Author: Noel Grandin <noel at peralex.com>
Date: Tue Dec 10 09:06:31 2013 +0200
use OUString::endsWith where possible
Change-Id: Ie2b68f79a7f9a54899f1d727f9a1fc7cfb14d90a
diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
index 9af1ef1..8051037 100644
--- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
+++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx
@@ -143,7 +143,7 @@ BackendImpl::PackageImpl::PackageImpl(
initPackageHandler();
sal_Int32 segmEnd = url.getLength();
- if (!url.isEmpty() && url[ url.getLength() - 1 ] == '/')
+ if ( url.endsWith("/") )
--segmEnd;
sal_Int32 segmStart = (url.lastIndexOf( '/', segmEnd ) + 1);
if (segmStart < 0)
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index 48d0a3c..edd4cd4 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -380,7 +380,7 @@ OString InputStream::readToElementBegin() throw (IOException, RuntimeException)
OString InputStream::readToElementEnd() throw (IOException, RuntimeException)
{
OString aText = OUStringToOString( mxTextStrm->readString( maClosingBracket, sal_False ), RTL_TEXTENCODING_ISO_8859_1 );
- OSL_ENSURE( !aText.isEmpty() && (aText[ aText.getLength() - 1 ] == '>'), "InputStream::readToElementEnd - missing closing bracket of XML element" );
+ OSL_ENSURE( aText.endsWith(">"), "InputStream::readToElementEnd - missing closing bracket of XML element" );
return aText;
}
diff --git a/ucb/source/ucp/ext/ucpext_datasupplier.cxx b/ucb/source/ucp/ext/ucpext_datasupplier.cxx
index a65e889..8c8057d 100644
--- a/ucb/source/ucp/ext/ucpext_datasupplier.cxx
+++ b/ucb/source/ucp/ext/ucpext_datasupplier.cxx
@@ -321,7 +321,7 @@ namespace ucb { namespace ucp { namespace ext
const OUString& rId( m_pImpl->m_aResults[ i_nIndex ].sId );
const OUString sRootURL( ContentProvider::getRootURL() );
OUString sTitle = Content::decodeIdentifier( rId.copy( sRootURL.getLength() ) );
- if ( !sTitle.isEmpty() && ( sTitle[ sTitle.getLength() - 1 ] == '/' ) )
+ if ( sTitle.endsWith("/") )
sTitle = sTitle.copy( 0, sTitle.getLength() - 1 );
xRow = Content::getArtificialNodePropertyValues( m_pImpl->m_xContext, getResultSet()->getProperties(), sTitle );
}
commit fb847101519ad74c02183672c04ebf1d700aae83
Author: Noel Grandin <noel at peralex.com>
Date: Tue Dec 10 08:31:13 2013 +0200
simplify - use OUString::startsWith where possible
Convert code like
if( !aStr.isEmpty() && aStr[0] == 'x' )
to
if( aStr.startsWith("x") )
Change-Id: Iabc3a44ed3be2d29eed876e0eeef212ccd271edf
diff --git a/configmgr/source/access.cxx b/configmgr/source/access.cxx
index a6a8035..616bd0e 100644
--- a/configmgr/source/access.cxx
+++ b/configmgr/source/access.cxx
@@ -2021,7 +2021,7 @@ rtl::Reference< ChildAccess > Access::getUnmodifiedChild(
rtl::Reference< ChildAccess > Access::getSubChild(OUString const & path) {
sal_Int32 i = 0;
// For backwards compatibility, allow absolute paths where meaningful:
- if (!path.isEmpty() && path[0] == '/') {
+ if( path.startsWith("/") ) {
++i;
if (!getRootAccess().is()) {
return rtl::Reference< ChildAccess >();
diff --git a/desktop/source/deployment/misc/dp_misc.cxx b/desktop/source/deployment/misc/dp_misc.cxx
index b7720e1..5d64ce2 100644
--- a/desktop/source/deployment/misc/dp_misc.cxx
+++ b/desktop/source/deployment/misc/dp_misc.cxx
@@ -266,7 +266,7 @@ OUString makeURL( OUString const & baseURL, OUString const & relPath_ )
else
buf.append( baseURL );
OUString relPath(relPath_);
- if (!relPath.isEmpty() && relPath[ 0 ] == '/')
+ if( relPath.startsWith("/") )
relPath = relPath.copy( 1 );
if (!relPath.isEmpty())
{
diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx
index b945521..f09f9fd 100644
--- a/editeng/source/editeng/eehtml.cxx
+++ b/editeng/source/editeng/eehtml.cxx
@@ -190,8 +190,7 @@ void EditHTMLParser::NextToken( int nToken )
StartPara( false );
OUString aText = aToken;
- if ( !aText.isEmpty() && ( aText[ 0 ] == ' ' )
- && ThrowAwayBlank() && !IsReadPRE() )
+ if ( aText.startsWith(" ") && ThrowAwayBlank() && !IsReadPRE() )
aText = aText.copy( 1 );
if ( pCurAnchor )
@@ -784,7 +783,7 @@ void EditHTMLParser::AnchorStart()
if ( !aRef.isEmpty() )
{
OUString aURL = aRef;
- if ( !aURL.isEmpty() && ( aURL[ 0 ] != '#' ) )
+ if ( aURL.startsWith("#") )
{
INetURLObject aTargetURL;
INetURLObject aRootURL( aBaseURL );
diff --git a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
index bd926d1..c9ba6b2 100644
--- a/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
+++ b/i18npool/source/defaultnumberingprovider/defaultnumberingprovider.cxx
@@ -525,7 +525,7 @@ static
int should_ignore( OUString s )
{
// return true if blank or null
- return s.equalsAscii(" ") || (!s.isEmpty() && s[0]==0);
+ return s == " " || (!s.isEmpty() && s[0]==0);
}
static
diff --git a/i18npool/source/localedata/LocaleNode.cxx b/i18npool/source/localedata/LocaleNode.cxx
index 73d7812..69360de 100644
--- a/i18npool/source/localedata/LocaleNode.cxx
+++ b/i18npool/source/localedata/LocaleNode.cxx
@@ -162,7 +162,7 @@ void print_OUString( const OUString& s )
bool is_empty_string( const OUString& s )
{
- return s.isEmpty() || (s.getLength()==1 && s[0]=='\n');
+ return s.isEmpty() || s == "\n";
}
void print_indent( int depth )
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 30a54d8..ce6d3fd 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -314,7 +314,7 @@ OUString FilterBase::getAbsoluteUrl( const OUString& rUrl ) const
/* (5) handle URLs relative to current drive, e.g. the URL '/path1/file1'
relative to the base URL 'file:///C:/path2/file2' does not result in
the expected 'file:///C:/path1/file1', but in 'file:///path1/file1'. */
- if( !aUrl.isEmpty() && (aUrl[ 0 ] == '/') &&
+ if( aUrl.startsWith("/") &&
mxImpl->maFileUrl.match( aFilePrefix ) &&
lclIsDosDrive( mxImpl->maFileUrl, nFilePrefixLen ) )
{
diff --git a/oox/source/dump/dumperbase.cxx b/oox/source/dump/dumperbase.cxx
index d0dd349..fc46d83 100644
--- a/oox/source/dump/dumperbase.cxx
+++ b/oox/source/dump/dumperbase.cxx
@@ -1085,7 +1085,7 @@ OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const
if( !getFlag( mnIgnore, nMask ) )
{
const OUString& rFlagName = aIt->second;
- bool bOnOff = !rFlagName.isEmpty() && rFlagName[ 0 ] == ':';
+ bool bOnOff = rFlagName.startsWith(":");
bool bFlag = getFlag( nKey, nMask );
if( bOnOff )
{
@@ -1094,7 +1094,7 @@ OUString FlagsList::implGetName( const Config& /*rCfg*/, sal_Int64 nKey ) const
}
else
{
- bool bNegated = !rFlagName.isEmpty() && rFlagName[ 0 ] == '!';
+ bool bNegated = rFlagName.startsWith("!");
sal_Int32 nBothSep = bNegated ? rFlagName.indexOf( '!', 1 ) : -1;
if( bFlag )
{
@@ -1412,7 +1412,7 @@ void SharedConfigData::createUnitConverter( const OUString& rData )
if( aDataVec.size() >= 2 )
{
OUString aFactor = aDataVec[ 1 ];
- bool bRecip = !aFactor.isEmpty() && aFactor[ 0 ] == '/';
+ bool bRecip = aFactor.startsWith("/");
if( bRecip )
aFactor = aFactor.copy( 1 );
double fFactor;
diff --git a/sal/qa/osl/security/osl_Security.cxx b/sal/qa/osl/security/osl_Security.cxx
index e9ad1a7..6fb065a 100644
--- a/sal/qa/osl/security/osl_Security.cxx
+++ b/sal/qa/osl/security/osl_Security.cxx
@@ -629,7 +629,7 @@ void MyTestPlugInImpl::initialize( CPPUNIT_NS::TestFactoryRegistry *,
{
rtl::OUString arg;
rtl_getAppCommandArg(i, &arg.pData);
- if( !arg.isEmpty() && arg[ 0 ] == '-' )
+ if( arg.startsWith("-") )
continue;
if( argsCount >= 3 )
{
diff --git a/sc/source/filter/oox/worksheetbuffer.cxx b/sc/source/filter/oox/worksheetbuffer.cxx
index c9e5e57..53f45b9 100644
--- a/sc/source/filter/oox/worksheetbuffer.cxx
+++ b/sc/source/filter/oox/worksheetbuffer.cxx
@@ -111,7 +111,7 @@ OUString WorksheetBuffer::getCalcSheetName( sal_Int32 nWorksheet ) const
void WorksheetBuffer::convertSheetNameRef( OUString& sSheetNameRef ) const
{
// convert '#SheetName!A1' to '#SheetName.A1'
- if( !sSheetNameRef.isEmpty() && (sSheetNameRef[ 0 ] == '#') )
+ if( sSheetNameRef.startsWith("#") )
{
sal_Int32 nSepPos = sSheetNameRef.lastIndexOf( '!' );
if( nSepPos > 0 )
diff --git a/sc/source/filter/oox/worksheethelper.cxx b/sc/source/filter/oox/worksheethelper.cxx
index 32fc416..5974560 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -1039,7 +1039,7 @@ OUString WorksheetGlobals::getHyperlinkUrl( const HyperlinkModel& rHyperlink ) c
OUString aUrl = aUrlBuffer.makeStringAndClear();
// convert '#SheetName!A1' to '#SheetName.A1'
- if( !aUrl.isEmpty() && (aUrl[ 0 ] == '#') )
+ if( aUrl.startsWith("#") )
{
sal_Int32 nSepPos = aUrl.lastIndexOf( '!' );
if( nSepPos > 0 )
diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 3dccb81..48d7c7c 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -169,7 +169,7 @@ ScFormulaDlg::ScFormulaDlg( SfxBindings* pB, SfxChildWindow* pCW,
if ( !bEdit )
{
OUString aNewFormula('=');
- if ( !aFormula.isEmpty() && aFormula[0] == '=' )
+ if ( aFormula.startsWith("=") )
aNewFormula = aFormula;
pScMod->InputReplaceSelection( aNewFormula );
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index a948a01..ddf3dbd 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -1391,7 +1391,7 @@ static OUString lcl_GetInputString( ScDocument* pDoc, const ScAddress& rPos, sal
sal_Bool bIsNumberFormat(pFormatter->IsNumberFormat(aTempString, nNumFmt, fDummy));
if ( bIsNumberFormat )
aTempString = "'" + aTempString;
- else if ( !aTempString.isEmpty() && aTempString[0] == '\'' )
+ else if ( aTempString.startsWith("'") )
{
// if the string starts with a "'", add another one because setFormula
// strips one (like text input, except for "text" number formats)
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 4e3e065..1b6daf0 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -1328,7 +1328,7 @@ void ScViewData::EditGrowY( sal_Bool bInitial )
// Subsequent calls with empty text might involve changed attributes (including
// font height), so they are treated like normal text.
OUString aText = pEngine->GetText( 0 );
- if ( ( aText.isEmpty() && bInitial ) || (!aText.isEmpty() && aText[0] == '=') )
+ if ( ( aText.isEmpty() && bInitial ) || aText.startsWith("=") )
nAllowedExtra = SC_GROWY_BIG_EXTRA;
}
diff --git a/sd/source/core/anminfo.cxx b/sd/source/core/anminfo.cxx
index f833422..1f897a0 100644
--- a/sd/source/core/anminfo.cxx
+++ b/sd/source/core/anminfo.cxx
@@ -132,7 +132,7 @@ OUString SdAnimationInfo::GetBookmark()
sBookmark = pURLField->GetURL();
}
- if( (meClickAction == ::com::sun::star::presentation::ClickAction_BOOKMARK) && !sBookmark.isEmpty() && (sBookmark[0] == '#') )
+ if( (meClickAction == ::com::sun::star::presentation::ClickAction_BOOKMARK) && sBookmark.startsWith("#") )
sBookmark = sBookmark.copy( 1 );
return sBookmark;
diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx
index eeae100..5304db5 100644
--- a/sd/source/ui/docshell/docshel4.cxx
+++ b/sd/source/ui/docshell/docshel4.cxx
@@ -873,7 +873,7 @@ sal_Bool DrawDocShell::GetObjectIsmarked(const OUString& rBookmark)
OUString aBookmark( rBookmark );
- if( !rBookmark.isEmpty() && rBookmark[0] == sal_Unicode('#') )
+ if( rBookmark.startsWith("#") )
aBookmark = rBookmark.copy( 1 );
// Ist das Bookmark eine Seite?
@@ -979,7 +979,7 @@ sal_Bool DrawDocShell::GotoTreeBookmark(const OUString& rBookmark)
OUString aBookmark( rBookmark );
- if( !rBookmark.isEmpty() && rBookmark[0] == sal_Unicode('#') )
+ if( rBookmark.startsWith("#") )
aBookmark = rBookmark.copy( 1 );
// Ist das Bookmark eine Seite?
diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx
index 2aa7af5..e15ef7f 100644
--- a/sd/source/ui/unoidl/unomodel.cxx
+++ b/sd/source/ui/unoidl/unomodel.cxx
@@ -1558,7 +1558,7 @@ sal_Int32 ImplPDFGetBookmarkPage( const OUString& rBookmark, SdDrawDocument& rDo
OUString aBookmark( rBookmark );
- if( !rBookmark.isEmpty() && rBookmark[ 0 ] == '#' )
+ if( rBookmark.startsWith("#") )
aBookmark = rBookmark.copy( 1 );
// is the bookmark a page ?
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index e8e23c5..c15ce42 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -1051,7 +1051,7 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
// make URL ready
SFX_REQUEST_ARG( rReq, pURLItem, SfxStringItem, SID_FILE_NAME, sal_False );
aFileName = pURLItem->GetValue();
- if( !aFileName.isEmpty() && aFileName[0] == '#' ) // Mark without URL
+ if( aFileName.startsWith("#") ) // Mark without URL
{
SfxViewFrame *pView = pTargetFrame ? pTargetFrame->GetCurrentViewFrame() : 0;
if ( !pView )
diff --git a/sfx2/source/bastyp/fltfnc.cxx b/sfx2/source/bastyp/fltfnc.cxx
index 65974d0..fd1c75d 100644
--- a/sfx2/source/bastyp/fltfnc.cxx
+++ b/sfx2/source/bastyp/fltfnc.cxx
@@ -747,7 +747,7 @@ const SfxFilter* SfxFilterMatcher::GetFilter4Extension( const OUString& rExt, Sf
// Use extension without dot!
OUString sExt( rExt );
- if ( !sExt.isEmpty() && ( sExt[0] == (sal_Unicode)'.' ))
+ if ( sExt.startsWith(".") )
sExt = sExt.copy(1);
com::sun::star::uno::Sequence < com::sun::star::beans::NamedValue > aSeq(1);
diff --git a/sfx2/source/dialog/splitwin.cxx b/sfx2/source/dialog/splitwin.cxx
index 15ffacf..f229df6 100644
--- a/sfx2/source/dialog/splitwin.cxx
+++ b/sfx2/source/dialog/splitwin.cxx
@@ -272,7 +272,7 @@ SfxSplitWindow::SfxSplitWindow( Window* pParent, SfxChildAlignment eAl,
OUString aTemp;
if ( aUserItem >>= aTemp )
aWinData = aTemp;
- if ( !aWinData.isEmpty() && aWinData[0] == 'V' )
+ if ( aWinData.startsWith("V") )
{
pEmptyWin->nState = (sal_uInt16) aWinData.getToken( 1, ',' ).toInt32();
if ( pEmptyWin->nState & 2 )
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index f7196d8..14ca59f 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -290,7 +290,7 @@ struct IMPL_SfxBaseModel_DataContainer : public ::sfx2::IModifiableDocument
OSL_ENSURE(!uri.isEmpty(), "GetDMA: empty uri?");
if (!uri.isEmpty() && !uri.endsWithAsciiL("/", 1))
{
- uri = uri + OUString("/");
+ uri = uri + "/";
}
m_xDocumentMetadata = new ::sfx2::DocumentMetadataAccess(
diff --git a/starmath/source/parse.cxx b/starmath/source/parse.cxx
index b5e3765..9b8fc8d 100644
--- a/starmath/source/parse.cxx
+++ b/starmath/source/parse.cxx
@@ -2295,7 +2295,7 @@ void SmParser::Special()
// conversion of symbol names for 6.0 (XML) file format
// (name change on import / export.
// UI uses localized names XML file format does not.)
- if (!rName.isEmpty() && rName[0] == '%')
+ if( rName.startsWith("%") )
{
if (IsImportSymbolNames())
{
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx
index 903e2c0..121c761 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -185,9 +185,7 @@ css::uno::Reference< css::uri::XUriReference > parseGeneric(
OUString const & scheme, OUString const & schemeSpecificPart)
{
bool isAbsolute = !scheme.isEmpty();
- bool isHierarchical
- = !isAbsolute
- || (!schemeSpecificPart.isEmpty() && schemeSpecificPart[0] == '/');
+ bool isHierarchical = !isAbsolute || schemeSpecificPart.startsWith("/");
bool hasAuthority = false;
OUString authority;
OUString path;
diff --git a/svl/source/misc/urihelper.cxx b/svl/source/misc/urihelper.cxx
index f147f1a..d2c1783 100644
--- a/svl/source/misc/urihelper.cxx
+++ b/svl/source/misc/urihelper.cxx
@@ -62,7 +62,7 @@ OUString URIHelper::SmartRel2Abs(INetURLObject const & rTheBaseURIRef,
INetURLObject::FSysStyle eStyle)
{
// Backwards compatibility:
- if (!rTheRelURIRef.isEmpty() && rTheRelURIRef[0] == '#')
+ if( rTheRelURIRef.startsWith("#") )
return rTheRelURIRef;
INetURLObject aAbsURIRef;
diff --git a/toolkit/source/awt/vclxwindows.cxx b/toolkit/source/awt/vclxwindows.cxx
index e7a2e84..5da5369 100644
--- a/toolkit/source/awt/vclxwindows.cxx
+++ b/toolkit/source/awt/vclxwindows.cxx
@@ -2157,7 +2157,7 @@ void SAL_CALL VCLXListBox::itemListChanged( const EventObject& i_rEvent ) throw
for ( sal_Int32 i=0; i<aItems.getLength(); ++i )
{
OUString aLocalizationKey( aItems[i].First );
- if ( xStringResourceResolver.is() && !aLocalizationKey.isEmpty() && aLocalizationKey[0] == '&' )
+ if ( xStringResourceResolver.is() && aLocalizationKey.startsWith("&") )
{
aLocalizationKey = xStringResourceResolver->resolveString(aLocalizationKey.copy( 1 ));
}
diff --git a/vcl/unx/generic/printer/ppdparser.cxx b/vcl/unx/generic/printer/ppdparser.cxx
index 57c9ff5..c09414c 100644
--- a/vcl/unx/generic/printer/ppdparser.cxx
+++ b/vcl/unx/generic/printer/ppdparser.cxx
@@ -680,7 +680,7 @@ PPDParser::PPDParser( const OUString& rFile ) :
while( ! aStream.IsEof() )
{
OString aCurLine = aStream.ReadLine();
- if (!aCurLine.isEmpty() && aCurLine[0] == '*')
+ if( aCurLine.startsWith("*") )
{
if (aCurLine.matchIgnoreAsciiCase(OString("*include:")))
{
More information about the Libreoffice-commits
mailing list