diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-01-10 08:10:31 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-01-10 08:10:31 +0100 |
commit | 92b58a275341a1696257804cac85a2c33a71c1d5 (patch) | |
tree | 9a02489a28c76e5c57daffef3d673bdca0e38d6a /sfx2/source | |
parent | 172257062881dab61b71367c8be31460e9b26cc9 (diff) |
New loplugin:conststringvar: sfx2
Change-Id: I287d338711a15fb53f4653b6475191099b8379e1
Diffstat (limited to 'sfx2/source')
-rw-r--r-- | sfx2/source/appl/sfxhelp.cxx | 8 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 37 | ||||
-rw-r--r-- | sfx2/source/sidebar/Deck.cxx | 2 |
3 files changed, 18 insertions, 29 deletions
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx index e992cc9a4d5a..6586e79a8f31 100644 --- a/sfx2/source/appl/sfxhelp.cxx +++ b/sfx2/source/appl/sfxhelp.cxx @@ -113,10 +113,9 @@ static OUString const & HelpLocaleString() { OUString aBaseInstallPath; utl::Bootstrap::locateBaseInstallation(aBaseInstallPath); - static const char *szHelpPath = "/help/"; + static const char szHelpPath[] = "/help/"; - OUString sHelpPath = aBaseInstallPath + - OUString::createFromAscii(szHelpPath) + aLocaleStr; + OUString sHelpPath = aBaseInstallPath + szHelpPath + aLocaleStr; osl::DirectoryItem aDirItem; if (osl::DirectoryItem::get(sHelpPath, aDirItem) != osl::FileBase::E_None) @@ -128,8 +127,7 @@ static OUString const & HelpLocaleString() { bOk = true; sLang = sLang.copy( 0, nSepPos ); - sHelpPath = aBaseInstallPath + - OUString::createFromAscii(szHelpPath) + sLang; + sHelpPath = aBaseInstallPath + szHelpPath + sLang; if (osl::DirectoryItem::get(sHelpPath, aDirItem) != osl::FileBase::E_None) bOk = false; } diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 3bd5fd578a2f..db67f94d49ed 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -458,10 +458,10 @@ const char* s_stdMetaList[] = { nullptr }; -const char* s_nsXLink = "http://www.w3.org/1999/xlink"; -const char* s_nsDC = "http://purl.org/dc/elements/1.1/"; -const char* s_nsODF = "urn:oasis:names:tc:opendocument:xmlns:office:1.0"; -const char* s_nsODFMeta = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0"; +const char s_nsXLink[] = "http://www.w3.org/1999/xlink"; +const char s_nsDC[] = "http://purl.org/dc/elements/1.1/"; +const char s_nsODF[] = "urn:oasis:names:tc:opendocument:xmlns:office:1.0"; +const char s_nsODFMeta[] = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0"; // const char* s_nsOOo = "http://openoffice.org/2004/office"; // not used (yet?) static const char s_meta [] = "meta.xml"; @@ -1123,10 +1123,10 @@ void SAL_CALL SfxDocumentMetaData::init( m_xDoc = i_xDoc; // select nodes for standard meta data stuff - xPath->registerNS("xlink", OUString::createFromAscii(s_nsXLink)); - xPath->registerNS("dc", OUString::createFromAscii(s_nsDC)); - xPath->registerNS("office", OUString::createFromAscii(s_nsODF)); - xPath->registerNS("meta", OUString::createFromAscii(s_nsODFMeta)); + xPath->registerNS("xlink", s_nsXLink); + xPath->registerNS("dc", s_nsDC); + xPath->registerNS("office", s_nsODF); + xPath->registerNS("meta", s_nsODFMeta); // NB: we do not handle the single-XML-file ODF variant, which would // have the root element office:document. // The root of such documents must be converted in the importer! @@ -1149,7 +1149,7 @@ void SAL_CALL SfxDocumentMetaData::init( while (xNode.is()) { if (css::xml::dom::NodeType_ELEMENT_NODE ==xNode->getNodeType()) { - if ( xNode->getNamespaceURI().equalsAscii(s_nsODF) && xNode->getLocalName() == "document-meta" ) + if ( xNode->getNamespaceURI() == s_nsODF && xNode->getLocalName() == "document-meta" ) { xRElem.set(xNode, css::uno::UNO_QUERY_THROW); break; @@ -1168,20 +1168,15 @@ void SAL_CALL SfxDocumentMetaData::init( } if (!xRElem.is()) { xRElem = i_xDoc->createElementNS( - OUString::createFromAscii(s_nsODF), - "office:document-meta"); + s_nsODF, "office:document-meta"); css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem, css::uno::UNO_QUERY_THROW); i_xDoc->appendChild(xRNode); } - xRElem->setAttributeNS(OUString::createFromAscii(s_nsODF), - "office:version", - "1.0"); + xRElem->setAttributeNS(s_nsODF, "office:version", "1.0"); // does not exist, otherwise m_xParent would not be null css::uno::Reference<css::xml::dom::XNode> xParent ( - i_xDoc->createElementNS( - OUString::createFromAscii(s_nsODF), - "office:meta"), + i_xDoc->createElementNS(s_nsODF, "office:meta"), css::uno::UNO_QUERY_THROW); xRElem->appendChild(xParent); m_xParent = xParent; @@ -1248,12 +1243,8 @@ void SAL_CALL SfxDocumentMetaData::init( css::uno::Reference<css::xml::dom::XElement> xElem(*it, css::uno::UNO_QUERY_THROW); css::uno::Any any; - OUString name = xElem->getAttributeNS( - OUString::createFromAscii(s_nsODFMeta), - "name"); - OUString type = xElem->getAttributeNS( - OUString::createFromAscii(s_nsODFMeta), - "value-type"); + OUString name = xElem->getAttributeNS(s_nsODFMeta, "name"); + OUString type = xElem->getAttributeNS(s_nsODFMeta, "value-type"); OUString text = getNodeText(*it); if ( type == "float" ) { double d; diff --git a/sfx2/source/sidebar/Deck.cxx b/sfx2/source/sidebar/Deck.cxx index acac122d32d6..cc39d0283250 100644 --- a/sfx2/source/sidebar/Deck.cxx +++ b/sfx2/source/sidebar/Deck.cxx @@ -280,7 +280,7 @@ const OUString GetWindowClassification(const vcl::Window* pWindow) void Deck::PrintWindowSubTree(vcl::Window* pRoot, int nIndentation) { - static const char* sIndentation = " "; + static const char* const sIndentation = " "; const Point aLocation (pRoot->GetPosPixel()); const Size aSize (pRoot->GetSizePixel()); SAL_INFO( |