summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2011-07-09 20:49:13 +0200
committerThomas Arnhold <thomas@arnhold.org>2011-07-10 09:38:55 +0200
commitc60e9ceaf2564ec3a8005aad84bbef0cf211e5ec (patch)
tree6146ff16f8a4ab65377ad8d8cee01095aec1648c /sax
parent40c9e4f82e4340fc0fdd962187cad0d9dcee04c7 (diff)
Enable test/sax
To compile some adjustments had to be made.
Diffstat (limited to 'sax')
-rw-r--r--sax/prj/build.lst1
-rw-r--r--sax/test/saxdemo.cxx46
2 files changed, 25 insertions, 22 deletions
diff --git a/sax/prj/build.lst b/sax/prj/build.lst
index 849700087ae7..658ec97e8e79 100644
--- a/sax/prj/build.lst
+++ b/sax/prj/build.lst
@@ -4,3 +4,4 @@ ax sax\source\expatwrap nmake - all ax_expatwrap NULL
ax sax\source\tools nmake - all ax_tools NULL
ax sax\source\fastparser nmake - all ax_fastparser ax_expatwrap ax_tools NULL
ax sax\qa\cppunit nmake - all ax_qa_cppunit ax_tools NULL
+ax sax\test nmake - all ax_test NULL
diff --git a/sax/test/saxdemo.cxx b/sax/test/saxdemo.cxx
index 6aedffcb42b6..b00eb0703672 100644
--- a/sax/test/saxdemo.cxx
+++ b/sax/test/saxdemo.cxx
@@ -36,6 +36,7 @@
#include <stdio.h>
#include <vector>
+#include <cstring>
#include <com/sun/star/registry/XImplementationRegistration.hpp>
#include <com/sun/star/lang/XComponent.hpp>
@@ -92,7 +93,7 @@ public:
{
return readBytes( aData, nMaxBytesToRead );
}
- virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip )
+ virtual void SAL_CALL skipBytes( sal_Int32 /* nBytesToSkip */ )
throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException)
{
// not implemented
@@ -107,8 +108,8 @@ public:
{
// not needed
}
- sal_Int32 nPos;
Sequence< sal_Int8> m_seq;
+ sal_Int32 nPos;
};
//-------------------------------
@@ -155,11 +156,11 @@ public: // Error handler
Reference < XInterface >() ,
aSAXParseException );
}
- virtual void SAL_CALL fatalError(const Any& aSAXParseException) throw (SAXException, RuntimeException)
+ virtual void SAL_CALL fatalError(const Any& /* aSAXParseException */) throw (SAXException, RuntimeException)
{
printf( "Fatal Error !\n" );
}
- virtual void SAL_CALL warning(const Any& aSAXParseException) throw (SAXException, RuntimeException)
+ virtual void SAL_CALL warning(const Any& /* aSAXParseException */) throw (SAXException, RuntimeException)
{
printf( "Warning !\n" );
}
@@ -182,7 +183,7 @@ public: // ExtendedDocumentHandler
m_iElementCount, m_iAttributeCount, m_iWhitespaceCount , m_iCharCount );
}
- virtual void SAL_CALL startElement(const OUString& aName,
+ virtual void SAL_CALL startElement(const OUString& /* aName */,
const Reference< XAttributeList > & xAttribs)
throw (SAXException,RuntimeException)
{
@@ -190,7 +191,7 @@ public: // ExtendedDocumentHandler
m_iAttributeCount += xAttribs->getLength();
}
- virtual void SAL_CALL endElement(const OUString& aName) throw (SAXException,RuntimeException)
+ virtual void SAL_CALL endElement(const OUString& /* aName */) throw (SAXException,RuntimeException)
{
// ignored
}
@@ -204,12 +205,12 @@ public: // ExtendedDocumentHandler
m_iWhitespaceCount += aWhitespaces.getLength();
}
- virtual void SAL_CALL processingInstruction(const OUString& aTarget, const OUString& aData) throw (SAXException,RuntimeException)
+ virtual void SAL_CALL processingInstruction(const OUString& /* aTarget */, const OUString& /* aData */) throw (SAXException,RuntimeException)
{
// ignored
}
- virtual void SAL_CALL setDocumentLocator(const Reference< XLocator> & xLocator)
+ virtual void SAL_CALL setDocumentLocator(const Reference< XLocator> & /* xLocator */)
throw (SAXException,RuntimeException)
{
// ignored
@@ -218,7 +219,7 @@ public: // ExtendedDocumentHandler
virtual InputSource SAL_CALL resolveEntity(
const OUString& sPublicId,
const OUString& sSystemId)
- throw (SAXException,RuntimeException)
+ throw (RuntimeException)
{
InputSource source;
source.sSystemId = sSystemId;
@@ -233,13 +234,13 @@ public: // ExtendedDocumentHandler
virtual void SAL_CALL startCDATA(void) throw (SAXException,RuntimeException)
{
}
- virtual void SAL_CALL endCDATA(void) throw (SAXException,RuntimeException)
+ virtual void SAL_CALL endCDATA(void) throw (RuntimeException)
{
}
- virtual void SAL_CALL comment(const OUString& sComment) throw (SAXException,RuntimeException)
+ virtual void SAL_CALL comment(const OUString& /* sComment */) throw (SAXException,RuntimeException)
{
}
- virtual void SAL_CALL unknown(const OUString& sString) throw (SAXException,RuntimeException)
+ virtual void SAL_CALL unknown(const OUString& /* sString */) throw (SAXException,RuntimeException)
{
}
@@ -289,13 +290,13 @@ private:
struct TagAttribute
{
TagAttribute(){}
- TagAttribute( const OUString &sName,
- const OUString &sType ,
- const OUString &sValue )
+ TagAttribute( const OUString &s_Name,
+ const OUString &s_Type ,
+ const OUString &s_Value )
{
- this->sName = sName;
- this->sType = sType;
- this->sValue = sValue;
+ this->sName = s_Name;
+ this->sType = s_Type;
+ this->sValue = s_Value;
}
OUString sName;
@@ -329,7 +330,7 @@ AttributeListImpl::AttributeListImpl( const AttributeListImpl &r )
OUString AttributeListImpl::getNameByIndex(sal_Int16 i) throw (RuntimeException)
{
- if( i < m_pImpl->vecAttribute.size() ) {
+ if( i < sal::static_int_cast<sal_Int16>(m_pImpl->vecAttribute.size()) ) {
return m_pImpl->vecAttribute[i].sName;
}
return OUString();
@@ -338,7 +339,7 @@ OUString AttributeListImpl::getNameByIndex(sal_Int16 i) throw (RuntimeException
OUString AttributeListImpl::getTypeByIndex(sal_Int16 i) throw (RuntimeException)
{
- if( i < m_pImpl->vecAttribute.size() ) {
+ if( i < sal::static_int_cast<sal_Int16>(m_pImpl->vecAttribute.size()) ) {
return m_pImpl->vecAttribute[i].sType;
}
return OUString();
@@ -346,7 +347,7 @@ OUString AttributeListImpl::getTypeByIndex(sal_Int16 i) throw (RuntimeException
OUString AttributeListImpl::getValueByIndex(sal_Int16 i) throw (RuntimeException)
{
- if( i < m_pImpl->vecAttribute.size() ) {
+ if( i < sal::static_int_cast<sal_Int16>(m_pImpl->vecAttribute.size()) ) {
return m_pImpl->vecAttribute[i].sValue;
}
return OUString();
@@ -418,11 +419,12 @@ void writeParagraphHelper(
{
int nMax = s.getLength();
int nStart = 0;
+ int n = 1;
Sequence<sal_uInt16> seq( s.getLength() );
memcpy( seq.getArray() , s.getStr() , s.getLength() * sizeof( sal_uInt16 ) );
- for( int n = 1 ; n < nMax ; n++ ){
+ for( n = 1 ; n < nMax ; n++ ){
if( 32 == seq.getArray()[n] ) {
r->allowLineBreak();
r->characters( s.copy( nStart , n - nStart ) );