[Libreoffice-commits] core.git: extensions/source forms/source l10ntools/source oox/source rsc/source sfx2/source ucb/source
Thomas Arnhold
thomas at arnhold.org
Sat Jun 29 00:54:12 PDT 2013
extensions/source/plugin/base/xplugin.cxx | 2 +-
forms/source/component/DatabaseForm.cxx | 2 +-
l10ntools/source/helpex.cxx | 2 +-
l10ntools/source/lngmerge.cxx | 4 ++--
l10ntools/source/merge.cxx | 4 ++--
l10ntools/source/po.cxx | 2 +-
l10ntools/source/propmerge.cxx | 2 +-
l10ntools/source/treemerge.cxx | 8 ++++----
oox/source/export/chartexport.cxx | 2 +-
rsc/source/tools/rsctools.cxx | 2 +-
sfx2/source/appl/appserv.cxx | 2 +-
ucb/source/ucp/webdav/SerfSession.cxx | 2 +-
12 files changed, 17 insertions(+), 17 deletions(-)
New commits:
commit e67c21ee0696cde7538016a813a5cbf39fb803b0
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Sat Jun 29 09:45:49 2013 +0200
Search for char instead of 1 char long string, when possible.
follow-up of a7674482254ee996b1c4fee60f3064778be369aa
Change-Id: I25f40c601454c092078307d931333af1bc1447ac
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index 701974d..404e438 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -964,7 +964,7 @@ PluginInputStream::PluginInputStream( XPlugin_Impl* pPlugin,
// set correct extension, some plugins need that
OUString aName( m_aNPStream.url, strlen( m_aNPStream.url ), m_pPlugin->getTextEncoding() );
OUString aExtension;
- sal_Int32 nSepInd = aName.lastIndexOf(".");
+ sal_Int32 nSepInd = aName.lastIndexOf('.');
if( nSepInd != -1 )
{
aExtension = aName.copy( nSepInd + 1, aName.getLength() - nSepInd - 1 );
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 7f15aba..4976da0 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -1063,7 +1063,7 @@ sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const OUString
delete pStream;
pStream = 0;
}
- sal_Int32 nSepInd = aFileName.lastIndexOf(".");
+ sal_Int32 nSepInd = aFileName.lastIndexOf('.');
OUString aExtension = aFileName.copy( nSepInd + 1, aFileName.getLength() - nSepInd - 1 );
INetContentType eContentType = INetContentTypes::GetContentType4Extension( aExtension );
if (eContentType != CONTENT_TYPE_UNKNOWN)
diff --git a/l10ntools/source/helpex.cxx b/l10ntools/source/helpex.cxx
index 5c6156f..5d0c387 100644
--- a/l10ntools/source/helpex.cxx
+++ b/l10ntools/source/helpex.cxx
@@ -92,7 +92,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) {
HelpParser aParser( sXhpFile );
const OString sOutput(
aArgs.m_sOutputFile +
- sXhpFile.copy( sXhpFile.lastIndexOf("/") ));
+ sXhpFile.copy( sXhpFile.lastIndexOf('/') ));
if( !aParser.Merge( aArgs.m_sMergeSrc, sOutput,
aArgs.m_sLanguage, pMergeDataFile ))
{
diff --git a/l10ntools/source/lngmerge.cxx b/l10ntools/source/lngmerge.cxx
index 27c7d5d..bed6c93 100644
--- a/l10ntools/source/lngmerge.cxx
+++ b/l10ntools/source/lngmerge.cxx
@@ -248,7 +248,7 @@ sal_Bool LngParser::Merge(
OString sNewText;
pEntrys->GetText( sNewText, STRING_TYP_TEXT, sLang, sal_True );
if( sLang == "qtz" )
- sNewText = sNewText.copy(sNewText.indexOf("|") + 2);
+ sNewText = sNewText.copy(sNewText.indexOf('|') + 2);
if ( !sNewText.isEmpty()) {
OString *pLine = (*pLines)[ nPos ];
@@ -286,7 +286,7 @@ sal_Bool LngParser::Merge(
OString sNewText;
pEntrys->GetText( sNewText, STRING_TYP_TEXT, sCur, sal_True );
if( sCur == "qtz" )
- sNewText = sNewText.copy(sNewText.indexOf("|") + 2);
+ sNewText = sNewText.copy(sNewText.indexOf('|') + 2);
if ( !sNewText.isEmpty() && sCur != "x-comment")
{
OString sLine;
diff --git a/l10ntools/source/merge.cxx b/l10ntools/source/merge.cxx
index fab9e6e..63b212c 100644
--- a/l10ntools/source/merge.cxx
+++ b/l10ntools/source/merge.cxx
@@ -181,7 +181,7 @@ sal_Bool MergeEntrys::GetText( OString &rReturn,
OString MergeEntrys::GetQTZText(const ResData& rResData, const OString& rOrigText)
{
- const OString sFilename = rResData.sFilename.copy(rResData.sFilename.lastIndexOf("/")+1);
+ const OString sFilename = rResData.sFilename.copy(rResData.sFilename.lastIndexOf('/')+1);
const OString sKey =
PoEntry::genKeyId(sFilename + rResData.sGId + rResData.sId + rResData.sResTyp + rOrigText);
return sKey + "||" + rOrigText;
@@ -310,7 +310,7 @@ MergeDataFile::MergeDataFile(
const sal_Int32 nStart =
sPoFileName.indexOf(sTransSource)+sTransSource.getLength();
const sal_Int32 nCount =
- sPoFileName.indexOf("/",nStart) - nStart;
+ sPoFileName.indexOf('/',nStart) - nStart;
sLang = sPoFileName.copy(nStart,nCount);
}
aLanguageSet.insert( sLang );
diff --git a/l10ntools/source/po.cxx b/l10ntools/source/po.cxx
index 7b4a94c..c7f92d8 100644
--- a/l10ntools/source/po.cxx
+++ b/l10ntools/source/po.cxx
@@ -245,7 +245,7 @@ PoEntry::PoEntry(
throw WRONGHELPTEXT;
m_pGenPo = new GenPoEntry();
- m_pGenPo->setReference(rSourceFile.copy(rSourceFile.lastIndexOf("/")+1));
+ m_pGenPo->setReference(rSourceFile.copy(rSourceFile.lastIndexOf('/')+1));
OString sMsgCtxt =
rGroupId + "\n" +
diff --git a/l10ntools/source/propmerge.cxx b/l10ntools/source/propmerge.cxx
index ee715f7..72070fb 100644
--- a/l10ntools/source/propmerge.cxx
+++ b/l10ntools/source/propmerge.cxx
@@ -191,7 +191,7 @@ void PropParser::Merge( const OString &rMergeSrc, const OString &rDestinationFil
if( !sLine.startsWith(" *") && !sLine.startsWith("/*") &&
nEqualSign != -1 )
{
- const OString sID( sLine.copy( 0, sLine.indexOf("=") ).trim() );
+ const OString sID( sLine.copy( 0, sLine.indexOf('=') ).trim() );
ResData aResData( sID, m_sSource );
aResData.sResTyp = "property";
OString sNewText;
diff --git a/l10ntools/source/treemerge.cxx b/l10ntools/source/treemerge.cxx
index 6f4bf6a..06e93d7 100644
--- a/l10ntools/source/treemerge.cxx
+++ b/l10ntools/source/treemerge.cxx
@@ -68,13 +68,13 @@ namespace
helper::xmlStrToOString( pID );
xmlFree( pID );
- const sal_Int32 nFirstSlash = sID.indexOf("/");
+ const sal_Int32 nFirstSlash = sID.indexOf('/');
// Update id attribute of topic
{
OString sNewID =
sID.copy( 0, nFirstSlash + 1 ) +
- rXhpRoot.copy( rXhpRoot.lastIndexOf("/") + 1 ) +
- sID.copy( sID.indexOf( "/", nFirstSlash + 1 ) );
+ rXhpRoot.copy( rXhpRoot.lastIndexOf('/') + 1 ) +
+ sID.copy( sID.indexOf( '/', nFirstSlash + 1 ) );
xmlSetProp(
pReturn, (const xmlChar*)("id"),
reinterpret_cast<const xmlChar*>(sNewID.getStr()));
@@ -82,7 +82,7 @@ namespace
const OString sXhpPath =
rXhpRoot +
- sID.copy(sID.indexOf("/", nFirstSlash + 1));
+ sID.copy(sID.indexOf('/', nFirstSlash + 1));
xmlDocPtr pXhpFile = xmlParseFile( sXhpPath.getStr() );
// if xhpfile is missing than put this topic into comment
if ( !pXhpFile )
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index b654001..49e2344 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -491,7 +491,7 @@ OUString ChartExport::parseFormula( const OUString& rRange )
OSL_TRACE("ChartExport::parseFormula, parser is invalid");
//FIXME: currently just using simple converter, e.g $Sheet1.$A$1:$C$1 -> Sheet1!$A$1:$C$1
OUString aRange( rRange );
- if( aRange.indexOf("$") == 0 )
+ if( aRange.indexOf('$') == 0 )
aRange = aRange.copy(1);
aRange = aRange.replaceAll(".$", "!$" );
aResult = aRange;
diff --git a/rsc/source/tools/rsctools.cxx b/rsc/source/tools/rsctools.cxx
index 1310a91..b766ead 100644
--- a/rsc/source/tools/rsctools.cxx
+++ b/rsc/source/tools/rsctools.cxx
@@ -127,7 +127,7 @@ sal_Bool Append(const OString &rOutputSrs, const OString &rTmpFile)
/* replaces extension of a file name */
OString OutputFile(const OString &rInput, const char * pExt)
{
- sal_Int32 nSepInd = rInput.lastIndexOf(".");
+ sal_Int32 nSepInd = rInput.lastIndexOf('.');
if( nSepInd != -1 )
{
diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 8914037..1fdd6c1 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -439,7 +439,7 @@ void SfxApplication::MiscExec_Impl( SfxRequest& rReq )
{
OUString module = SfxHelp::GetCurrentModuleIdentifier();
OUString sURL("http://hub.libreoffice.org/send-feedback/?LOversion=" + utl::ConfigManager::getAboutBoxProductVersion() +
- "&LOlocale=" + utl::ConfigManager::getLocale() + "&LOmodule=" + module.copy(module.lastIndexOf(".") + 1 ) );
+ "&LOlocale=" + utl::ConfigManager::getLocale() + "&LOmodule=" + module.copy(module.lastIndexOf('.') + 1 ) );
try
{
uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShellExecute(
diff --git a/ucb/source/ucp/webdav/SerfSession.cxx b/ucb/source/ucp/webdav/SerfSession.cxx
index ffef27d..92cd797 100644
--- a/ucb/source/ucp/webdav/SerfSession.cxx
+++ b/ucb/source/ucp/webdav/SerfSession.cxx
@@ -1547,7 +1547,7 @@ SerfSession::isDomainMatch( OUString certHostName )
if (hostName.equalsIgnoreAsciiCase( certHostName ) )
return sal_True;
- if ( 0 == certHostName.indexOf( OUString::createFromAscii( "*" ) ) &&
+ if ( 0 == certHostName.indexOf( '*' ) &&
hostName.getLength() >= certHostName.getLength() )
{
OUString cmpStr = certHostName.copy( 1 );
More information about the Libreoffice-commits
mailing list