summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-06-26 13:53:15 +0200
committerStephan Bergmann <sbergman@redhat.com>2015-06-26 13:55:32 +0200
commit0b60670850d936173bc0f1253f55ceda56d7984d (patch)
tree25bbd2bab1ff81ea88b2e9980e9abab2669b86b0 /framework
parent17b2a351b713053258630084174ac59b3b5988be (diff)
loplugin:stringconstant: handle OUString+=OUString(literal)
Change-Id: Ie17c1d6c7664b3d3ad0255094b26ba433c2c1921
Diffstat (limited to 'framework')
-rw-r--r--framework/source/accelerators/storageholder.cxx26
-rw-r--r--framework/source/fwe/xml/statusbardocumenthandler.cxx3
-rw-r--r--framework/source/fwe/xml/toolboxdocumenthandler.cxx3
3 files changed, 10 insertions, 22 deletions
diff --git a/framework/source/accelerators/storageholder.cxx b/framework/source/accelerators/storageholder.cxx
index e315ef0d27aa..46fc19ab57f4 100644
--- a/framework/source/accelerators/storageholder.cxx
+++ b/framework/source/accelerators/storageholder.cxx
@@ -39,9 +39,8 @@
#include <algorithm>
-#define PATH_SEPARATOR_ASCII "/"
+#define PATH_SEPARATOR "/"
#define PATH_SEPARATOR_UNICODE ((sal_Unicode)'/')
-#define PATH_SEPARATOR OUString(PATH_SEPARATOR_ASCII)
namespace framework
{
@@ -104,9 +103,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri
++pIt )
{
const OUString& sChild = *pIt;
- OUString sCheckPath (sRelPath);
- sCheckPath += sChild;
- sCheckPath += PATH_SEPARATOR;
+ OUString sCheckPath (sRelPath + sChild + PATH_SEPARATOR);
// SAFE -> ------------------------------
aReadLock.reset();
@@ -157,8 +154,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri
}
xParent = xChild;
- sRelPath += sChild;
- sRelPath += PATH_SEPARATOR;
+ sRelPath += sChild + PATH_SEPARATOR;
}
// TODO think about return last storage as working storage ... but dont caching it inside this holder!
@@ -183,9 +179,7 @@ StorageHolder::TStorageList StorageHolder::getAllPathStorages(const OUString& sP
++pIt )
{
const OUString& sChild = *pIt;
- OUString sCheckPath (sRelPath);
- sCheckPath += sChild;
- sCheckPath += PATH_SEPARATOR;
+ OUString sCheckPath (sRelPath + sChild + PATH_SEPARATOR);
TPath2StorageInfo::iterator pCheck = m_lStorages.find(sCheckPath);
if (pCheck == m_lStorages.end())
@@ -199,8 +193,7 @@ StorageHolder::TStorageList StorageHolder::getAllPathStorages(const OUString& sP
TStorageInfo& rInfo = pCheck->second;
lStoragesOfPath.push_back(rInfo.Storage);
- sRelPath += sChild;
- sRelPath += PATH_SEPARATOR;
+ sRelPath += sChild + PATH_SEPARATOR;
}
return lStoragesOfPath;
@@ -248,9 +241,7 @@ void StorageHolder::closePath(const OUString& rPath)
pIt1 != lFolders.end();
++pIt1 )
{
- OUString sCurrentRelPath = sParentPath;
- sCurrentRelPath += *pIt1;
- sCurrentRelPath += PATH_SEPARATOR;
+ OUString sCurrentRelPath(sParentPath + *pIt1 + PATH_SEPARATOR);
*pIt1 = sCurrentRelPath;
sParentPath = sCurrentRelPath;
}
@@ -386,8 +377,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::getParentStorage(cons
sal_Int32 i = 0;
for (i=0; i<c-1; ++i)
{
- sParentPath += lFolders[i];
- sParentPath += PATH_SEPARATOR;
+ sParentPath += lFolders[i] + PATH_SEPARATOR;
}
TPath2StorageInfo::const_iterator pParent = m_lStorages.find(sParentPath);
@@ -494,7 +484,7 @@ OUString StorageHolder::impl_st_normPath(const OUString& sPath)
OUString sNormedPath = sPath;
// "/bla" => "bla" && "/" => "" (!)
- sNormedPath.startsWith(PATH_SEPARATOR_ASCII, &sNormedPath);
+ sNormedPath.startsWith(PATH_SEPARATOR, &sNormedPath);
// "/" => "" || "" => "" ?
if (sNormedPath.isEmpty())
diff --git a/framework/source/fwe/xml/statusbardocumenthandler.cxx b/framework/source/fwe/xml/statusbardocumenthandler.cxx
index aa36aa822392..cea1e3b41401 100644
--- a/framework/source/fwe/xml/statusbardocumenthandler.cxx
+++ b/framework/source/fwe/xml/statusbardocumenthandler.cxx
@@ -576,8 +576,7 @@ throw ( SAXException, RuntimeException )
if (m_aAttributeURL.isEmpty() )
{
- m_aAttributeURL = m_aXMLXlinkNS;
- m_aAttributeURL += OUString( ATTRIBUTE_URL );
+ m_aAttributeURL = m_aXMLXlinkNS + ATTRIBUTE_URL;
}
// save required attribute (URL)
diff --git a/framework/source/fwe/xml/toolboxdocumenthandler.cxx b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
index 2457da9d253f..013fad37f77f 100644
--- a/framework/source/fwe/xml/toolboxdocumenthandler.cxx
+++ b/framework/source/fwe/xml/toolboxdocumenthandler.cxx
@@ -768,8 +768,7 @@ throw ( SAXException, RuntimeException )
if ( m_aAttributeURL.isEmpty() )
{
- m_aAttributeURL = m_aXMLXlinkNS;
- m_aAttributeURL += OUString( ATTRIBUTE_URL );
+ m_aAttributeURL = m_aXMLXlinkNS + ATTRIBUTE_URL;
}
// save required attribute (URL)