Kaydet (Commit) 92b58a27 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

New loplugin:conststringvar: sfx2

Change-Id: I287d338711a15fb53f4653b6475191099b8379e1
üst 17225706
...@@ -113,10 +113,9 @@ static OUString const & HelpLocaleString() ...@@ -113,10 +113,9 @@ static OUString const & HelpLocaleString()
{ {
OUString aBaseInstallPath; OUString aBaseInstallPath;
utl::Bootstrap::locateBaseInstallation(aBaseInstallPath); utl::Bootstrap::locateBaseInstallation(aBaseInstallPath);
static const char *szHelpPath = "/help/"; static const char szHelpPath[] = "/help/";
OUString sHelpPath = aBaseInstallPath + OUString sHelpPath = aBaseInstallPath + szHelpPath + aLocaleStr;
OUString::createFromAscii(szHelpPath) + aLocaleStr;
osl::DirectoryItem aDirItem; osl::DirectoryItem aDirItem;
if (osl::DirectoryItem::get(sHelpPath, aDirItem) != osl::FileBase::E_None) if (osl::DirectoryItem::get(sHelpPath, aDirItem) != osl::FileBase::E_None)
...@@ -128,8 +127,7 @@ static OUString const & HelpLocaleString() ...@@ -128,8 +127,7 @@ static OUString const & HelpLocaleString()
{ {
bOk = true; bOk = true;
sLang = sLang.copy( 0, nSepPos ); sLang = sLang.copy( 0, nSepPos );
sHelpPath = aBaseInstallPath + sHelpPath = aBaseInstallPath + szHelpPath + sLang;
OUString::createFromAscii(szHelpPath) + sLang;
if (osl::DirectoryItem::get(sHelpPath, aDirItem) != osl::FileBase::E_None) if (osl::DirectoryItem::get(sHelpPath, aDirItem) != osl::FileBase::E_None)
bOk = false; bOk = false;
} }
......
...@@ -458,10 +458,10 @@ const char* s_stdMetaList[] = { ...@@ -458,10 +458,10 @@ const char* s_stdMetaList[] = {
nullptr nullptr
}; };
const char* s_nsXLink = "http://www.w3.org/1999/xlink"; const char s_nsXLink[] = "http://www.w3.org/1999/xlink";
const char* s_nsDC = "http://purl.org/dc/elements/1.1/"; 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_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_nsODFMeta[] = "urn:oasis:names:tc:opendocument:xmlns:meta:1.0";
// const char* s_nsOOo = "http://openoffice.org/2004/office"; // not used (yet?) // const char* s_nsOOo = "http://openoffice.org/2004/office"; // not used (yet?)
static const char s_meta [] = "meta.xml"; static const char s_meta [] = "meta.xml";
...@@ -1123,10 +1123,10 @@ void SAL_CALL SfxDocumentMetaData::init( ...@@ -1123,10 +1123,10 @@ void SAL_CALL SfxDocumentMetaData::init(
m_xDoc = i_xDoc; m_xDoc = i_xDoc;
// select nodes for standard meta data stuff // select nodes for standard meta data stuff
xPath->registerNS("xlink", OUString::createFromAscii(s_nsXLink)); xPath->registerNS("xlink", s_nsXLink);
xPath->registerNS("dc", OUString::createFromAscii(s_nsDC)); xPath->registerNS("dc", s_nsDC);
xPath->registerNS("office", OUString::createFromAscii(s_nsODF)); xPath->registerNS("office", s_nsODF);
xPath->registerNS("meta", OUString::createFromAscii(s_nsODFMeta)); xPath->registerNS("meta", s_nsODFMeta);
// NB: we do not handle the single-XML-file ODF variant, which would // NB: we do not handle the single-XML-file ODF variant, which would
// have the root element office:document. // have the root element office:document.
// The root of such documents must be converted in the importer! // The root of such documents must be converted in the importer!
...@@ -1149,7 +1149,7 @@ void SAL_CALL SfxDocumentMetaData::init( ...@@ -1149,7 +1149,7 @@ void SAL_CALL SfxDocumentMetaData::init(
while (xNode.is()) { while (xNode.is()) {
if (css::xml::dom::NodeType_ELEMENT_NODE ==xNode->getNodeType()) 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); xRElem.set(xNode, css::uno::UNO_QUERY_THROW);
break; break;
...@@ -1168,20 +1168,15 @@ void SAL_CALL SfxDocumentMetaData::init( ...@@ -1168,20 +1168,15 @@ void SAL_CALL SfxDocumentMetaData::init(
} }
if (!xRElem.is()) { if (!xRElem.is()) {
xRElem = i_xDoc->createElementNS( xRElem = i_xDoc->createElementNS(
OUString::createFromAscii(s_nsODF), s_nsODF, "office:document-meta");
"office:document-meta");
css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem, css::uno::Reference<css::xml::dom::XNode> xRNode(xRElem,
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
i_xDoc->appendChild(xRNode); i_xDoc->appendChild(xRNode);
} }
xRElem->setAttributeNS(OUString::createFromAscii(s_nsODF), xRElem->setAttributeNS(s_nsODF, "office:version", "1.0");
"office:version",
"1.0");
// does not exist, otherwise m_xParent would not be null // does not exist, otherwise m_xParent would not be null
css::uno::Reference<css::xml::dom::XNode> xParent ( css::uno::Reference<css::xml::dom::XNode> xParent (
i_xDoc->createElementNS( i_xDoc->createElementNS(s_nsODF, "office:meta"),
OUString::createFromAscii(s_nsODF),
"office:meta"),
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
xRElem->appendChild(xParent); xRElem->appendChild(xParent);
m_xParent = xParent; m_xParent = xParent;
...@@ -1248,12 +1243,8 @@ void SAL_CALL SfxDocumentMetaData::init( ...@@ -1248,12 +1243,8 @@ void SAL_CALL SfxDocumentMetaData::init(
css::uno::Reference<css::xml::dom::XElement> xElem(*it, css::uno::Reference<css::xml::dom::XElement> xElem(*it,
css::uno::UNO_QUERY_THROW); css::uno::UNO_QUERY_THROW);
css::uno::Any any; css::uno::Any any;
OUString name = xElem->getAttributeNS( OUString name = xElem->getAttributeNS(s_nsODFMeta, "name");
OUString::createFromAscii(s_nsODFMeta), OUString type = xElem->getAttributeNS(s_nsODFMeta, "value-type");
"name");
OUString type = xElem->getAttributeNS(
OUString::createFromAscii(s_nsODFMeta),
"value-type");
OUString text = getNodeText(*it); OUString text = getNodeText(*it);
if ( type == "float" ) { if ( type == "float" ) {
double d; double d;
......
...@@ -280,7 +280,7 @@ const OUString GetWindowClassification(const vcl::Window* pWindow) ...@@ -280,7 +280,7 @@ const OUString GetWindowClassification(const vcl::Window* pWindow)
void Deck::PrintWindowSubTree(vcl::Window* pRoot, int nIndentation) void Deck::PrintWindowSubTree(vcl::Window* pRoot, int nIndentation)
{ {
static const char* sIndentation = " "; static const char* const sIndentation = " ";
const Point aLocation (pRoot->GetPosPixel()); const Point aLocation (pRoot->GetPosPixel());
const Size aSize (pRoot->GetSizePixel()); const Size aSize (pRoot->GetSizePixel());
SAL_INFO( SAL_INFO(
......
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