summaryrefslogtreecommitdiff
path: root/sax/qa
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-07-08 23:12:00 +0200
committerStephan Bergmann <sbergman@redhat.com>2016-07-08 23:12:00 +0200
commit22663a12c35753977253699fbc61441acdce27ec (patch)
tree28f49606301f0931feb16bfda2e777b6cec089e8 /sax/qa
parent6d4f2dcc7cbba771e9d9b00de50368db4a88ef1b (diff)
loplugin:staticmethods
Change-Id: Ia9a3b93df2c885a56705b35b88fe0a8f50a10b74
Diffstat (limited to 'sax/qa')
-rw-r--r--sax/qa/cppunit/xmlimport.cxx49
1 files changed, 22 insertions, 27 deletions
diff --git a/sax/qa/cppunit/xmlimport.cxx b/sax/qa/cppunit/xmlimport.cxx
index e5f858fc3054..6057a6429be6 100644
--- a/sax/qa/cppunit/xmlimport.cxx
+++ b/sax/qa/cppunit/xmlimport.cxx
@@ -349,10 +349,6 @@ void SAL_CALL TestLegacyDocumentHandler::endElement( const OUString& aName )
class NSDocumentHandler : public cppu::WeakImplHelper< XDocumentHandler >
{
-private:
- OUString resolveNamespace( const OUString& rName );
- OUString getNamespaceValue( const OUString& rNamespacePrefix );
-
public:
NSDocumentHandler() {}
@@ -367,22 +363,19 @@ public:
virtual void SAL_CALL setDocumentLocator( const Reference< XLocator >& /* xLocator */ ) throw (SAXException, RuntimeException, exception) override {}
};
-void SAL_CALL NSDocumentHandler::startElement( const OUString& aName, const Reference< XAttributeList >&/* xAttribs */ )
- throw( SAXException, RuntimeException, exception )
+OUString getNamespaceValue( const OUString& rNamespacePrefix )
{
- if (! (aName == "office:document" || aName == "office:body" || aName == "office:text" ||
- aName == "text:p" || aName == "note:p") )
- CPPUNIT_ASSERT(false);
-
- OUString sResolvedName = resolveNamespace(aName);
- if (! ( sResolvedName == "urn:oasis:names:tc:opendocument:xmlns:office:1.0:document" ||
- sResolvedName == "urn:oasis:names:tc:opendocument:xmlns:office:1.0:body" ||
- sResolvedName == "urn:oasis:names:tc:opendocument:xmlns:office:1.0:text" ||
- sResolvedName == "urn:oasis:names:tc:opendocument:xmlns:text:1.0:p") )
- CPPUNIT_ASSERT(false);
+ OUString aNamespaceURI;
+ if (rNamespacePrefix == "office")
+ aNamespaceURI = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
+ else if (rNamespacePrefix == "text")
+ aNamespaceURI = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
+ else if (rNamespacePrefix == "note")
+ aNamespaceURI = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
+ return aNamespaceURI;
}
-OUString NSDocumentHandler::resolveNamespace( const OUString& aName )
+OUString resolveNamespace( const OUString& aName )
{
int index;
if (( index = aName.indexOf( ':' )) > 0 )
@@ -398,18 +391,20 @@ OUString NSDocumentHandler::resolveNamespace( const OUString& aName )
return aName;
}
-OUString NSDocumentHandler::getNamespaceValue( const OUString& rNamespacePrefix )
+void SAL_CALL NSDocumentHandler::startElement( const OUString& aName, const Reference< XAttributeList >&/* xAttribs */ )
+ throw( SAXException, RuntimeException, exception )
{
- OUString aNamespaceURI;
- if (rNamespacePrefix == "office")
- aNamespaceURI = "urn:oasis:names:tc:opendocument:xmlns:office:1.0";
- else if (rNamespacePrefix == "text")
- aNamespaceURI = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
- else if (rNamespacePrefix == "note")
- aNamespaceURI = "urn:oasis:names:tc:opendocument:xmlns:text:1.0";
- return aNamespaceURI;
-}
+ if (! (aName == "office:document" || aName == "office:body" || aName == "office:text" ||
+ aName == "text:p" || aName == "note:p") )
+ CPPUNIT_ASSERT(false);
+ OUString sResolvedName = resolveNamespace(aName);
+ if (! ( sResolvedName == "urn:oasis:names:tc:opendocument:xmlns:office:1.0:document" ||
+ sResolvedName == "urn:oasis:names:tc:opendocument:xmlns:office:1.0:body" ||
+ sResolvedName == "urn:oasis:names:tc:opendocument:xmlns:office:1.0:text" ||
+ sResolvedName == "urn:oasis:names:tc:opendocument:xmlns:text:1.0:p") )
+ CPPUNIT_ASSERT(false);
+}
class XMLImportTest : public test::BootstrapFixture
{