Kaydet (Commit) 0b606708 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

loplugin:stringconstant: handle OUString+=OUString(literal)

Change-Id: Ie17c1d6c7664b3d3ad0255094b26ba433c2c1921
üst 17b2a351
...@@ -39,9 +39,8 @@ ...@@ -39,9 +39,8 @@
#include <algorithm> #include <algorithm>
#define PATH_SEPARATOR_ASCII "/" #define PATH_SEPARATOR "/"
#define PATH_SEPARATOR_UNICODE ((sal_Unicode)'/') #define PATH_SEPARATOR_UNICODE ((sal_Unicode)'/')
#define PATH_SEPARATOR OUString(PATH_SEPARATOR_ASCII)
namespace framework namespace framework
{ {
...@@ -104,9 +103,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri ...@@ -104,9 +103,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri
++pIt ) ++pIt )
{ {
const OUString& sChild = *pIt; const OUString& sChild = *pIt;
OUString sCheckPath (sRelPath); OUString sCheckPath (sRelPath + sChild + PATH_SEPARATOR);
sCheckPath += sChild;
sCheckPath += PATH_SEPARATOR;
// SAFE -> ------------------------------ // SAFE -> ------------------------------
aReadLock.reset(); aReadLock.reset();
...@@ -157,8 +154,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri ...@@ -157,8 +154,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::openPath(const OUStri
} }
xParent = xChild; xParent = xChild;
sRelPath += sChild; sRelPath += sChild + PATH_SEPARATOR;
sRelPath += PATH_SEPARATOR;
} }
// TODO think about return last storage as working storage ... but dont caching it inside this holder! // 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 ...@@ -183,9 +179,7 @@ StorageHolder::TStorageList StorageHolder::getAllPathStorages(const OUString& sP
++pIt ) ++pIt )
{ {
const OUString& sChild = *pIt; const OUString& sChild = *pIt;
OUString sCheckPath (sRelPath); OUString sCheckPath (sRelPath + sChild + PATH_SEPARATOR);
sCheckPath += sChild;
sCheckPath += PATH_SEPARATOR;
TPath2StorageInfo::iterator pCheck = m_lStorages.find(sCheckPath); TPath2StorageInfo::iterator pCheck = m_lStorages.find(sCheckPath);
if (pCheck == m_lStorages.end()) if (pCheck == m_lStorages.end())
...@@ -199,8 +193,7 @@ StorageHolder::TStorageList StorageHolder::getAllPathStorages(const OUString& sP ...@@ -199,8 +193,7 @@ StorageHolder::TStorageList StorageHolder::getAllPathStorages(const OUString& sP
TStorageInfo& rInfo = pCheck->second; TStorageInfo& rInfo = pCheck->second;
lStoragesOfPath.push_back(rInfo.Storage); lStoragesOfPath.push_back(rInfo.Storage);
sRelPath += sChild; sRelPath += sChild + PATH_SEPARATOR;
sRelPath += PATH_SEPARATOR;
} }
return lStoragesOfPath; return lStoragesOfPath;
...@@ -248,9 +241,7 @@ void StorageHolder::closePath(const OUString& rPath) ...@@ -248,9 +241,7 @@ void StorageHolder::closePath(const OUString& rPath)
pIt1 != lFolders.end(); pIt1 != lFolders.end();
++pIt1 ) ++pIt1 )
{ {
OUString sCurrentRelPath = sParentPath; OUString sCurrentRelPath(sParentPath + *pIt1 + PATH_SEPARATOR);
sCurrentRelPath += *pIt1;
sCurrentRelPath += PATH_SEPARATOR;
*pIt1 = sCurrentRelPath; *pIt1 = sCurrentRelPath;
sParentPath = sCurrentRelPath; sParentPath = sCurrentRelPath;
} }
...@@ -386,8 +377,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::getParentStorage(cons ...@@ -386,8 +377,7 @@ css::uno::Reference< css::embed::XStorage > StorageHolder::getParentStorage(cons
sal_Int32 i = 0; sal_Int32 i = 0;
for (i=0; i<c-1; ++i) for (i=0; i<c-1; ++i)
{ {
sParentPath += lFolders[i]; sParentPath += lFolders[i] + PATH_SEPARATOR;
sParentPath += PATH_SEPARATOR;
} }
TPath2StorageInfo::const_iterator pParent = m_lStorages.find(sParentPath); TPath2StorageInfo::const_iterator pParent = m_lStorages.find(sParentPath);
...@@ -494,7 +484,7 @@ OUString StorageHolder::impl_st_normPath(const OUString& sPath) ...@@ -494,7 +484,7 @@ OUString StorageHolder::impl_st_normPath(const OUString& sPath)
OUString sNormedPath = sPath; OUString sNormedPath = sPath;
// "/bla" => "bla" && "/" => "" (!) // "/bla" => "bla" && "/" => "" (!)
sNormedPath.startsWith(PATH_SEPARATOR_ASCII, &sNormedPath); sNormedPath.startsWith(PATH_SEPARATOR, &sNormedPath);
// "/" => "" || "" => "" ? // "/" => "" || "" => "" ?
if (sNormedPath.isEmpty()) if (sNormedPath.isEmpty())
......
...@@ -576,8 +576,7 @@ throw ( SAXException, RuntimeException ) ...@@ -576,8 +576,7 @@ throw ( SAXException, RuntimeException )
if (m_aAttributeURL.isEmpty() ) if (m_aAttributeURL.isEmpty() )
{ {
m_aAttributeURL = m_aXMLXlinkNS; m_aAttributeURL = m_aXMLXlinkNS + ATTRIBUTE_URL;
m_aAttributeURL += OUString( ATTRIBUTE_URL );
} }
// save required attribute (URL) // save required attribute (URL)
......
...@@ -768,8 +768,7 @@ throw ( SAXException, RuntimeException ) ...@@ -768,8 +768,7 @@ throw ( SAXException, RuntimeException )
if ( m_aAttributeURL.isEmpty() ) if ( m_aAttributeURL.isEmpty() )
{ {
m_aAttributeURL = m_aXMLXlinkNS; m_aAttributeURL = m_aXMLXlinkNS + ATTRIBUTE_URL;
m_aAttributeURL += OUString( ATTRIBUTE_URL );
} }
// save required attribute (URL) // save required attribute (URL)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment