summaryrefslogtreecommitdiff
path: root/sax
diff options
context:
space:
mode:
Diffstat (limited to 'sax')
-rw-r--r--sax/inc/sax/dllapi.h3
-rw-r--r--sax/inc/sax/fastattribs.hxx3
-rw-r--r--sax/inc/sax/fshelper.hxx8
-rw-r--r--sax/inc/sax/parser/saxparser.hxx5
-rw-r--r--sax/inc/sax/tools/attributemap.hxx3
-rw-r--r--sax/inc/sax/tools/converter.hxx3
-rw-r--r--sax/inc/sax/tools/documenthandleradapter.hxx254
-rw-r--r--sax/inc/sax/tools/saxobject.hxx3
-rw-r--r--sax/inc/sax/tools/tokenmap.hxx3
-rw-r--r--sax/inc/xml2utf.hxx3
-rw-r--r--sax/prj/d.lst1
-rw-r--r--sax/qa/cppunit/test_converter.cxx4
-rw-r--r--sax/source/expatwrap/attrlistimpl.cxx15
-rw-r--r--sax/source/expatwrap/attrlistimpl.hxx3
-rw-r--r--sax/source/expatwrap/factory.hxx2
-rw-r--r--sax/source/expatwrap/sax_expat.cxx64
-rw-r--r--sax/source/expatwrap/saxwriter.cxx31
-rw-r--r--sax/source/expatwrap/xml2utf.cxx6
-rw-r--r--sax/source/fastparser/facreg.cxx3
-rw-r--r--sax/source/fastparser/fastparser.cxx11
-rw-r--r--sax/source/fastparser/fastparser.hxx7
-rw-r--r--sax/source/tools/converter.cxx215
-rw-r--r--sax/source/tools/fastattribs.cxx7
-rw-r--r--sax/source/tools/fastserializer.cxx152
-rw-r--r--sax/source/tools/fastserializer.hxx60
-rw-r--r--sax/source/tools/fshelper.cxx12
-rw-r--r--sax/test/sax/factory.hxx2
-rw-r--r--sax/test/sax/testsax.cxx6
-rw-r--r--sax/test/sax/testwriter.cxx17
-rw-r--r--sax/test/saxdemo.cxx21
-rw-r--r--sax/test/testcomponent.cxx12
-rw-r--r--sax/util/makefile.mk1
32 files changed, 621 insertions, 319 deletions
diff --git a/sax/inc/sax/dllapi.h b/sax/inc/sax/dllapi.h
index e9aca11fb0bd..1e4904718776 100644
--- a/sax/inc/sax/dllapi.h
+++ b/sax/inc/sax/dllapi.h
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -37,3 +38,5 @@
#endif
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/sax/fastattribs.hxx b/sax/inc/sax/fastattribs.hxx
index 9a968982d39e..6759b58c1c74 100644
--- a/sax/inc/sax/fastattribs.hxx
+++ b/sax/inc/sax/fastattribs.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -89,3 +90,5 @@ private:
}
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/sax/fshelper.hxx b/sax/inc/sax/fshelper.hxx
index f816e3edc1c3..f6651fa8b647 100644
--- a/sax/inc/sax/fshelper.hxx
+++ b/sax/inc/sax/fshelper.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -51,7 +52,7 @@ class SAX_DLLPUBLIC FastSerializerHelper
{
public:
- FastSerializerHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream );
+ FastSerializerHelper( const ::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream >& xOutputStream, bool bWriteHeader = true );
~FastSerializerHelper();
@@ -101,7 +102,8 @@ public:
FastAttributeList *createAttrList();
- void mark();
+ void mark( ::com::sun::star::uno::Sequence< sal_Int32 > aOrder =
+ ::com::sun::star::uno::Sequence< sal_Int32 >() );
void mergeTopMarks( MergeMarksEnum eMergeType = MERGE_MARKS_APPEND );
private:
@@ -116,3 +118,5 @@ typedef boost::shared_ptr< FastSerializerHelper > FSHelperPtr;
}
#endif // _SAX_FS_HELPER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/sax/parser/saxparser.hxx b/sax/inc/sax/parser/saxparser.hxx
index dde71accd680..16bd1a3446e3 100644
--- a/sax/inc/sax/parser/saxparser.hxx
+++ b/sax/inc/sax/parser/saxparser.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -33,9 +34,7 @@
#include <com/sun/star/xml/sax/SAXException.hpp>
#include <rtl/ref.hxx>
-#ifndef BOOST_SHARED_PTR_HPP_INCLUDED
#include <boost/shared_ptr.hpp>
-#endif
#include <map>
#include <memory>
@@ -148,3 +147,5 @@ private:
}
#endif // _SAX_SAXPARSER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/sax/tools/attributemap.hxx b/sax/inc/sax/tools/attributemap.hxx
index ea8f55a9b626..7a867c932a9d 100644
--- a/sax/inc/sax/tools/attributemap.hxx
+++ b/sax/inc/sax/tools/attributemap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -68,3 +69,5 @@ namespace sax
}
#endif // _SAX_ATTRIBUTEMAP_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/sax/tools/converter.hxx b/sax/inc/sax/tools/converter.hxx
index 4b65c1dc83b2..13fb189d8429 100644
--- a/sax/inc/sax/tools/converter.hxx
+++ b/sax/inc/sax/tools/converter.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -206,3 +207,5 @@ public:
}
#endif // _SAX_CONVERTER_HXX
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/sax/tools/documenthandleradapter.hxx b/sax/inc/sax/tools/documenthandleradapter.hxx
new file mode 100644
index 000000000000..3e8705c6f951
--- /dev/null
+++ b/sax/inc/sax/tools/documenthandleradapter.hxx
@@ -0,0 +1,254 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+
+/*
+ * Version: MPL 1.1 / GPLv3+ / LGPLv3+
+ *
+ * The contents of this file are subject to the Mozilla Public License Version
+ * 1.1 (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * http://www.mozilla.org/MPL/
+ *
+ * Software distributed under the License is distributed on an "AS IS" basis,
+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
+ * for the specific language governing rights and limitations under the
+ * License.
+ *
+ * The Initial Developer of the Original Code is
+ * [ Peter Jentsch <pjotr@guineapics.de> ]
+ *
+ * Portions created by the Initial Developer are Copyright (C) 2010 the
+ * Initial Developer. All Rights Reserved.
+ *
+ * Contributor(s): Peter Jentsch <pjotr@guineapics.de>
+ *
+ * Alternatively, the contents of this file may be used under the terms of
+ * either the GNU General Public License Version 3 or later (the "GPLv3+"), or
+ * the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"),
+ * in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable
+ * instead of those above.
+ */
+
+#ifndef _DOCUMENTHANDLERADAPTER_H_
+#define _DOCUMENTHANDLERADAPTER_H_
+
+#include <com/sun/star/xml/sax/SAXException.hpp>
+#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+#include <com/sun/star/xml/sax/XExtendedDocumentHandler.hpp>
+
+namespace sax
+{
+ /**
+ * DocumentHandlerAdapter provides a base class for simple decorators to XDocumentHandlers.
+ * It forwards all method calls to a delegate. An inheriting class only needs to override the
+ * methods it actually wants to modify.
+ *
+ * See filters/source/odfflatxml/FlatXml.cxx for an example.
+ */
+ class DocumentHandlerAdapter : public ::com::sun::star::xml::sax::XDocumentHandler
+ {
+ public:
+ // XDocumentHandler
+ virtual void SAL_CALL
+ startDocument(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startDocument();
+ }
+
+ virtual void SAL_CALL
+ endDocument(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endDocument();
+ }
+
+ virtual void SAL_CALL
+ startElement(const ::rtl::OUString& aName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startElement(aName, xAttribs);
+ }
+
+ virtual void SAL_CALL
+ endElement(const ::rtl::OUString& aName) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endElement(aName);
+ }
+
+ virtual void SAL_CALL
+ characters(const ::rtl::OUString& aChars) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->characters(aChars);
+ }
+
+ virtual void SAL_CALL
+ ignorableWhitespace(const ::rtl::OUString& aWhitespaces) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->ignorableWhitespace(aWhitespaces);
+ }
+ virtual void SAL_CALL
+ processingInstruction(const ::rtl::OUString& aTarget, const ::rtl::OUString& aData)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->processingInstruction(aTarget, aData);
+ }
+ virtual void SAL_CALL
+ setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->setDocumentLocator(xLocator);
+ }
+ DocumentHandlerAdapter(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& delegate);
+ DocumentHandlerAdapter() :
+ m_handler(::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > (0, ::com::sun::star::uno::UNO_QUERY))
+ {
+ }
+ ;
+
+ protected:
+ virtual void SAL_CALL
+ setDelegate(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler >& delegate)
+ {
+ m_handler = delegate;
+ }
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > SAL_CALL
+ getDelegate()
+ {
+ return m_handler;
+ }
+ virtual
+ ~DocumentHandlerAdapter()
+ {
+
+ }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XDocumentHandler > m_handler;
+
+ };
+
+ /**
+ * ExtendedDocumentHandlerAdapter provides a base class for simple decorators to XExtendedDocumentHandlers.
+ * It forwards all method calls to a delegate. An inheriting class only needs to override the
+ * methods it actually wants to modify.
+ */
+ class ExtendedDocumentHandlerAdapter : public ::com::sun::star::xml::sax::XExtendedDocumentHandler
+
+ {
+
+ public:
+ // XDocumentHandler
+ virtual void SAL_CALL
+ startDocument(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startDocument();
+ }
+
+ virtual void SAL_CALL
+ endDocument(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endDocument();
+ }
+
+ virtual void SAL_CALL
+ startElement(const ::rtl::OUString& aName,
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList > & xAttribs)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startElement(aName, xAttribs);
+ }
+
+ virtual void SAL_CALL
+ endElement(const ::rtl::OUString& aName) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endElement(aName);
+ }
+
+ virtual void SAL_CALL
+ characters(const ::rtl::OUString& aChars) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->characters(aChars);
+ }
+
+ virtual void SAL_CALL
+ ignorableWhitespace(const ::rtl::OUString& aWhitespaces) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->ignorableWhitespace(aWhitespaces);
+ }
+ virtual void SAL_CALL
+ processingInstruction(const ::rtl::OUString& aTarget, const ::rtl::OUString& aData)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->processingInstruction(aTarget, aData);
+ }
+ virtual void SAL_CALL
+ setDocumentLocator(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator > & xLocator)
+ throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->setDocumentLocator(xLocator);
+ }
+ // XExtendedDocumentHandler
+ virtual void SAL_CALL
+ startCDATA(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->startCDATA();
+ }
+ virtual void SAL_CALL
+ endCDATA(void) throw (::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->endCDATA();
+ }
+ virtual void SAL_CALL
+ comment(const ::rtl::OUString& sComment) throw (::com::sun::star::xml::sax::SAXException,
+ ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->comment(sComment);
+ }
+ virtual void SAL_CALL
+ unknown(const ::rtl::OUString& sString) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->unknown(sString);
+ }
+ virtual void SAL_CALL
+ allowLineBreak(void) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
+ {
+ m_handler->allowLineBreak();
+ }
+ protected:
+ ExtendedDocumentHandlerAdapter() :
+ m_handler(::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > (0, ::com::sun::star::uno::UNO_QUERY))
+ {
+ }
+ ExtendedDocumentHandlerAdapter(
+ const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > delegate) :
+ m_handler(delegate)
+ {
+ }
+
+ virtual void SAL_CALL
+ setDelegate(const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler >& delegate)
+ {
+ m_handler = delegate;
+ }
+ virtual ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > SAL_CALL
+ getDelegate()
+ {
+ return m_handler;
+ }
+ virtual
+ ~ExtendedDocumentHandlerAdapter()
+ {
+
+ }
+
+ private:
+ ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XExtendedDocumentHandler > m_handler;
+ };
+}
+#endif /* _DOCUMENTHANDLERADAPTER_H_ */
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/sax/tools/saxobject.hxx b/sax/inc/sax/tools/saxobject.hxx
index 56b901d9579f..ee72ceeac983 100644
--- a/sax/inc/sax/tools/saxobject.hxx
+++ b/sax/inc/sax/tools/saxobject.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -48,3 +49,5 @@ namespace sax
}
#endif // _SAX_OBJECT_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/sax/tools/tokenmap.hxx b/sax/inc/sax/tools/tokenmap.hxx
index 42add0690e9a..8749a6587b1c 100644
--- a/sax/inc/sax/tools/tokenmap.hxx
+++ b/sax/inc/sax/tools/tokenmap.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -63,3 +64,5 @@ namespace sax
}
#endif // _SAX_TOKENMAP_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/inc/xml2utf.hxx b/sax/inc/xml2utf.hxx
index 1a0640f5a687..175894a9874b 100644
--- a/sax/inc/xml2utf.hxx
+++ b/sax/inc/xml2utf.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -145,3 +146,5 @@ private:
Unicode2TextConverter *m_pUnicode2Text;
};
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/prj/d.lst b/sax/prj/d.lst
index 76177f554909..86617b9f3ed2 100644
--- a/sax/prj/d.lst
+++ b/sax/prj/d.lst
@@ -12,5 +12,6 @@ mkdir: %_DEST%\inc%_EXT%\sax\tools
..\inc\sax\fshelper.hxx %_DEST%\inc%_EXT%\sax\fshelper.hxx
..\inc\sax\fastattribs.hxx %_DEST%\inc%_EXT%\sax\fastattribs.hxx
..\inc\sax\tools\converter.hxx %_DEST%\inc%_EXT%\sax\tools\converter.hxx
+..\inc\sax\tools\documenthandleradapter.hxx %_DEST%\inc%_EXT%\sax\tools\documenthandleradapter.hxx
dos: sh -c "if test %OS% = MACOSX; then macosx-create-bundle %_DEST%\lib%_EXT%\*.dylib; fi"
diff --git a/sax/qa/cppunit/test_converter.cxx b/sax/qa/cppunit/test_converter.cxx
index b1881f248c0c..dcd5bb7e5cc8 100644
--- a/sax/qa/cppunit/test_converter.cxx
+++ b/sax/qa/cppunit/test_converter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,12 +26,10 @@
*
************************************************************************/
-#include "preextstl.h"
#include <cppunit/TestAssert.h>
#include <cppunit/TestFixture.h>
#include <cppunit/extensions/HelperMacros.h>
#include <cppunit/plugin/TestPlugIn.h>
-#include "postextstl.h"
#include <rtl/ustrbuf.hxx>
@@ -244,3 +243,4 @@ CPPUNIT_TEST_SUITE_REGISTRATION(ConverterTest);
CPPUNIT_PLUGIN_IMPLEMENT();
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/attrlistimpl.cxx b/sax/source/expatwrap/attrlistimpl.cxx
index 114eb653f648..f7ec5d16f664 100644
--- a/sax/source/expatwrap/attrlistimpl.cxx
+++ b/sax/source/expatwrap/attrlistimpl.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -111,8 +112,10 @@ OUString AttributeList::getTypeByName( const OUString& sName ) throw (RuntimeExc
{
vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
- if( (*ii).sName == sName ) {
+ for (; ii != m_pImpl->vecAttribute.end(); ++ii )
+ {
+ if( (*ii).sName == sName )
+ {
return (*ii).sType;
}
}
@@ -123,8 +126,10 @@ OUString AttributeList::getValueByName(const OUString& sName) throw (RuntimeExce
{
vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
- if( (*ii).sName == sName ) {
+ for (; ii != m_pImpl->vecAttribute.end(); ++ii)
+ {
+ if( (*ii).sName == sName )
+ {
return (*ii).sValue;
}
}
@@ -166,3 +171,5 @@ void AttributeList::clear()
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/attrlistimpl.hxx b/sax/source/expatwrap/attrlistimpl.hxx
index aaf6cf84b359..870f4dd258ac 100644
--- a/sax/source/expatwrap/attrlistimpl.hxx
+++ b/sax/source/expatwrap/attrlistimpl.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,7 +30,6 @@
#define _SAX_ATTRLISTIMPL_HXX
#include "sal/config.h"
-//#include "sax/saxdllapi.h"
#include <cppuhelper/implbase2.hxx>
@@ -83,3 +83,4 @@ private:
#endif
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/factory.hxx b/sax/source/expatwrap/factory.hxx
index c6a566781044..169788a02bfe 100644
--- a/sax/source/expatwrap/factory.hxx
+++ b/sax/source/expatwrap/factory.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -32,3 +33,4 @@ OUString SaxWriter_getImplementationName() throw();
Sequence< OUString > SaxWriter_getSupportedServiceNames(void) throw();
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/sax_expat.cxx b/sax/source/expatwrap/sax_expat.cxx
index aaaac6bd564e..114d29bea648 100644
--- a/sax/source/expatwrap/sax_expat.cxx
+++ b/sax/source/expatwrap/sax_expat.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -466,7 +467,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
if( ! entity.structSource.aInputStream.is() )
{
- throw SAXException( OUString::createFromAscii( "No input source" ) ,
+ throw SAXException( OUString(RTL_CONSTASCII_USTRINGPARAM("No input source")) ,
Reference< XInterface > () , Any() );
}
@@ -481,7 +482,7 @@ void SaxExpatParser::parseStream( const InputSource& structSource)
entity.pParser = XML_ParserCreate( 0 );
if( ! entity.pParser )
{
- throw SAXException( OUString::createFromAscii( "Couldn't create parser" ) ,
+ throw SAXException( OUString(RTL_CONSTASCII_USTRINGPARAM("Couldn't create parser")) ,
Reference< XInterface > (), Any() );
}
@@ -595,7 +596,7 @@ void SaxExpatParser::setLocale( const Locale & locale ) throw (RuntimeException)
// XServiceInfo
OUString SaxExpatParser::getImplementationName() throw ()
{
- return OUString::createFromAscii( IMPLEMENTATION_NAME );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( IMPLEMENTATION_NAME ));
}
// XServiceInfo
@@ -616,7 +617,7 @@ Sequence< OUString > SaxExpatParser::getSupportedServiceNames(void) throw ()
{
Sequence<OUString> seq(1);
- seq.getArray()[0] = OUString::createFromAscii( SERVICE_NAME );
+ seq.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( SERVICE_NAME ));
return seq;
}
@@ -631,82 +632,82 @@ OUString getErrorMessage( XML_Error xmlE, OUString sSystemId , sal_Int32 nLine )
{
OUString Message;
if( XML_ERROR_NONE == xmlE ) {
- Message = OUString::createFromAscii( "No" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("No"));
}
else if( XML_ERROR_NO_MEMORY == xmlE ) {
- Message = OUString::createFromAscii( "no memory" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("no memory"));
}
else if( XML_ERROR_SYNTAX == xmlE ) {
- Message = OUString::createFromAscii( "syntax" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("syntax"));
}
else if( XML_ERROR_NO_ELEMENTS == xmlE ) {
- Message = OUString::createFromAscii( "no elements" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("no elements"));
}
else if( XML_ERROR_INVALID_TOKEN == xmlE ) {
- Message = OUString::createFromAscii( "invalid token" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("invalid token"));
}
else if( XML_ERROR_UNCLOSED_TOKEN == xmlE ) {
- Message = OUString::createFromAscii( "unclosed token" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unclosed token"));
}
else if( XML_ERROR_PARTIAL_CHAR == xmlE ) {
- Message = OUString::createFromAscii( "partial char" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("partial char"));
}
else if( XML_ERROR_TAG_MISMATCH == xmlE ) {
- Message = OUString::createFromAscii( "tag mismatch" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("tag mismatch"));
}
else if( XML_ERROR_DUPLICATE_ATTRIBUTE == xmlE ) {
- Message = OUString::createFromAscii( "duplicate attribute" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("duplicate attribute"));
}
else if( XML_ERROR_JUNK_AFTER_DOC_ELEMENT == xmlE ) {
- Message = OUString::createFromAscii( "junk after doc element" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("junk after doc element"));
}
else if( XML_ERROR_PARAM_ENTITY_REF == xmlE ) {
- Message = OUString::createFromAscii( "parameter entity reference" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("parameter entity reference"));
}
else if( XML_ERROR_UNDEFINED_ENTITY == xmlE ) {
- Message = OUString::createFromAscii( "undefined entity" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("undefined entity"));
}
else if( XML_ERROR_RECURSIVE_ENTITY_REF == xmlE ) {
- Message = OUString::createFromAscii( "recursive entity reference" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("recursive entity reference"));
}
else if( XML_ERROR_ASYNC_ENTITY == xmlE ) {
- Message = OUString::createFromAscii( "async entity" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("async entity"));
}
else if( XML_ERROR_BAD_CHAR_REF == xmlE ) {
- Message = OUString::createFromAscii( "bad char reference" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("bad char reference"));
}
else if( XML_ERROR_BINARY_ENTITY_REF == xmlE ) {
- Message = OUString::createFromAscii( "binary entity reference" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("binary entity reference"));
}
else if( XML_ERROR_ATTRIBUTE_EXTERNAL_ENTITY_REF == xmlE ) {
- Message = OUString::createFromAscii( "attribute external entity reference" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("attribute external entity reference"));
}
else if( XML_ERROR_MISPLACED_XML_PI == xmlE ) {
- Message = OUString::createFromAscii( "misplaced xml processing instruction" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("misplaced xml processing instruction"));
}
else if( XML_ERROR_UNKNOWN_ENCODING == xmlE ) {
- Message = OUString::createFromAscii( "unknown encoding" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unknown encoding"));
}
else if( XML_ERROR_INCORRECT_ENCODING == xmlE ) {
- Message = OUString::createFromAscii( "incorrect encoding" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("incorrect encoding"));
}
else if( XML_ERROR_UNCLOSED_CDATA_SECTION == xmlE ) {
- Message = OUString::createFromAscii( "unclosed cdata section" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("unclosed cdata section"));
}
else if( XML_ERROR_EXTERNAL_ENTITY_HANDLING == xmlE ) {
- Message = OUString::createFromAscii( "external entity reference" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("external entity reference"));
}
else if( XML_ERROR_NOT_STANDALONE == xmlE ) {
- Message = OUString::createFromAscii( "not standalone" );
+ Message = OUString(RTL_CONSTASCII_USTRINGPARAM("not standalone"));
}
- OUString str = OUString::createFromAscii( "[" );
+ OUString str(RTL_CONSTASCII_USTRINGPARAM("["));
str += sSystemId;
- str += OUString::createFromAscii( " line " );
+ str += OUString(RTL_CONSTASCII_USTRINGPARAM(" line "));
str += OUString::valueOf( nLine );
- str += OUString::createFromAscii( "]: " );
+ str += OUString(RTL_CONSTASCII_USTRINGPARAM("]: "));
str += Message;
- str += OUString::createFromAscii( "error" );
+ str += OUString(RTL_CONSTASCII_USTRINGPARAM("error"));
return str;
}
@@ -1074,3 +1075,4 @@ void * SAL_CALL component_getFactory(
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/saxwriter.cxx b/sax/source/expatwrap/saxwriter.cxx
index 92d53700aa86..1417fb644679 100644
--- a/sax/source/expatwrap/saxwriter.cxx
+++ b/sax/source/expatwrap/saxwriter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -178,7 +179,8 @@ public:
sal_Bool bDoNormalization,
sal_Bool bNormalizeWhitespace) throw( SAXException );
- sal_uInt32 GetLastColumnCount() { return (sal_uInt32)(nCurrentPos - nLastLineFeedPos); }
+ sal_uInt32 GetLastColumnCount() const
+ { return (sal_uInt32)(nCurrentPos - nLastLineFeedPos); }
inline void startDocument() throw( SAXException );
@@ -244,7 +246,7 @@ inline sal_uInt32 SaxWriterHelper::writeSequence() throw( SAXException )
Any a;
a <<= e;
throw SAXException(
- OUString::createFromAscii( "io exception during writing" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("io exception during writing")),
Reference< XInterface > (),
a );
}
@@ -455,7 +457,7 @@ inline sal_Bool SaxWriterHelper::convertToXML( const sal_Unicode * pStr,
}
else
{
- OSL_ENSURE( false, "illegal Unicode character" );
+ OSL_FAIL( "illegal Unicode character" );
bRet = sal_False;
}
@@ -1001,7 +1003,7 @@ public: // XServiceInfo
private:
void writeSequence( const Sequence<sal_Int8> & seq );
- sal_Int32 getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurence ) throw();
+ sal_Int32 getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurrence ) throw();
Reference< XOutputStream > m_out;
Sequence < sal_Int8 > m_seqStartElement;
@@ -1029,12 +1031,12 @@ Reference < XInterface > SAL_CALL SaxWriter_CreateInstance(
OUString SaxWriter_getServiceName() throw()
{
- return OUString::createFromAscii( "com.sun.star.xml.sax.Writer" );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer"));
}
OUString SaxWriter_getImplementationName() throw()
{
- return OUString::createFromAscii( "com.sun.star.extensions.xml.sax.Writer" );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.extensions.xml.sax.Writer"));
}
Sequence< OUString > SaxWriter_getSupportedServiceNames(void) throw()
@@ -1045,14 +1047,14 @@ Sequence< OUString > SaxWriter_getSupportedServiceNames(void) throw()
}
-sal_Int32 SAXWriter::getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurence ) throw()
+sal_Int32 SAXWriter::getIndentPrefixLength( sal_Int32 nFirstLineBreakOccurrence ) throw()
{
sal_Int32 nLength =-1;
if (mp_SaxWriterHelper)
{
if ( m_bForceLineBreak ||
(m_bAllowLineBreak &&
- ((nFirstLineBreakOccurence + mp_SaxWriterHelper->GetLastColumnCount()) > MAXCOLUMNCOUNT)) )
+ ((nFirstLineBreakOccurrence + mp_SaxWriterHelper->GetLastColumnCount()) > MAXCOLUMNCOUNT)) )
nLength = m_nLevel;
}
m_bForceLineBreak = sal_False;
@@ -1110,12 +1112,12 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE
if( ! m_bDocStarted )
{
throw SAXException(
- OUString::createFromAscii( "endDocument called before startDocument" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("endDocument called before startDocument")),
Reference< XInterface >() , Any() );
}
if( m_nLevel ) {
throw SAXException(
- OUString::createFromAscii( "unexpected end of document" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("unexpected end of document")),
Reference< XInterface >() , Any() );
}
mp_SaxWriterHelper->endDocument();
@@ -1128,7 +1130,7 @@ void SAXWriter::endDocument(void) throw(SAXException, RuntimeE
Any a;
a <<= e;
throw SAXException(
- OUString::createFromAscii( "IO exception during closing the IO Stream" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("IO exception during closing the IO Stream")),
Reference< XInterface > (),
a );
}
@@ -1256,19 +1258,19 @@ void SAXWriter::characters(const OUString& aChars) throw(SAXException, RuntimeE
bThrowException = !mp_SaxWriterHelper->writeString( aChars, sal_False, sal_False );
else
{
- // Note : nFirstLineBreakOccurence is not exact, because we don't know, how
+ // Note : nFirstLineBreakOccurrence is not exact, because we don't know, how
// many 2 and 3 byte chars are inbetween. However this whole stuff
// is eitherway for pretty printing only, so it does not need to be exact.
sal_Int32 nLength(0);
sal_Int32 nIndentPrefix(-1);
if (m_bAllowLineBreak)
{
- sal_Int32 nFirstLineBreakOccurence = getFirstLineBreak( aChars );
+ sal_Int32 nFirstLineBreakOccurrence = getFirstLineBreak( aChars );
nLength = calcXMLByteLength( aChars.getStr(), aChars.getLength(),
! m_bIsCDATA , sal_False );
nIndentPrefix = getIndentPrefixLength(
- nFirstLineBreakOccurence >= 0 ? nFirstLineBreakOccurence : nLength );
+ nFirstLineBreakOccurrence >= 0 ? nFirstLineBreakOccurrence : nLength );
}
else
nIndentPrefix = getIndentPrefixLength(nLength);
@@ -1452,3 +1454,4 @@ void SAXWriter::unknown(const OUString& sString) throw (SAXException, RuntimeExc
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/expatwrap/xml2utf.cxx b/sax/source/expatwrap/xml2utf.cxx
index bbd72b2a0d8b..b7aa1cad0424 100644
--- a/sax/source/expatwrap/xml2utf.cxx
+++ b/sax/source/expatwrap/xml2utf.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -34,10 +35,11 @@
#include <com/sun/star/io/XInputStream.hpp>
-using namespace rtl;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::io;
+using ::rtl::OString;
+
#include "xml2utf.hxx"
namespace sax_expatwrap {
@@ -568,3 +570,5 @@ void Unicode2TextConverter::init( rtl_TextEncoding encoding )
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/fastparser/facreg.cxx b/sax/source/fastparser/facreg.cxx
index 98a55823271e..af05616854c1 100644
--- a/sax/source/fastparser/facreg.cxx
+++ b/sax/source/fastparser/facreg.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <cppuhelper/factory.hxx>
#include <cppuhelper/weak.hxx>
#include <cppuhelper/implbase2.hxx>
@@ -76,3 +77,5 @@ void * SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServic
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/fastparser/fastparser.cxx b/sax/source/fastparser/fastparser.cxx
index 1a4cc9278e1e..bff58a6a5817 100644
--- a/sax/source/fastparser/fastparser.cxx
+++ b/sax/source/fastparser/fastparser.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -25,9 +26,6 @@
*
************************************************************************/
-//#include <stdlib.h>
-//#include <sal/alloca.h>
-
#include <boost/scoped_ptr.hpp>
#include <osl/diagnose.h>
@@ -51,7 +49,6 @@ using namespace ::cppu;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::xml::sax;
-//using namespace ::com::sun::star::util;
using namespace ::com::sun::star::io;
namespace sax_fastparser {
@@ -553,7 +550,7 @@ Sequence< OUString > FastSaxParser::getSupportedServiceNames_Static(void)
// XServiceInfo
OUString FastSaxParser::getImplementationName() throw (RuntimeException)
{
- return OUString::createFromAscii( PARSER_IMPLEMENTATION_NAME );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( PARSER_IMPLEMENTATION_NAME ));
}
// XServiceInfo
@@ -574,7 +571,7 @@ Sequence< OUString > FastSaxParser::getSupportedServiceNames(void) throw (Runtim
{
Sequence<OUString> seq(1);
- seq.getArray()[0] = OUString::createFromAscii( PARSER_SERVICE_NAME );
+ seq.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( PARSER_SERVICE_NAME ));
return seq;
}
@@ -951,3 +948,5 @@ int FastSaxParser::callbackExternalEntityRef( XML_Parser parser,
}
} // namespace sax_fastparser
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/fastparser/fastparser.hxx b/sax/source/fastparser/fastparser.hxx
index a0331fe4035a..77f04c798433 100644
--- a/sax/source/fastparser/fastparser.hxx
+++ b/sax/source/fastparser/fastparser.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -30,7 +31,7 @@
#include <vector>
#include <stack>
-#include <hash_map>
+#include <boost/unordered_map.hpp>
#include <boost/shared_ptr.hpp>
#include <rtl/ref.hxx>
#include <com/sun/star/xml/sax/XFastParser.hpp>
@@ -56,7 +57,7 @@ struct SaxContextImpl;
typedef ::boost::shared_ptr< SaxContextImpl > SaxContextImplPtr;
typedef ::boost::shared_ptr< NamespaceDefine > NamespaceDefineRef;
-typedef ::std::hash_map< ::rtl::OUString, sal_Int32,
+typedef ::boost::unordered_map< ::rtl::OUString, sal_Int32,
::rtl::OUStringHash, ::std::equal_to< ::rtl::OUString > > NamespaceMap;
// --------------------------------------------------------------------
@@ -162,3 +163,5 @@ private:
}
#endif // _SAX_FASTPARSER_HXX_
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/tools/converter.cxx b/sax/source/tools/converter.cxx
index 26b3c48998f3..efa9f1687d7f 100644
--- a/sax/source/tools/converter.cxx
+++ b/sax/source/tools/converter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -36,14 +37,14 @@
#include <rtl/math.hxx>
#include "sax/tools/converter.hxx"
-using namespace rtl;
using namespace com::sun::star;
using namespace com::sun::star::uno;
using namespace com::sun::star::util;
-//using namespace com::sun::star::text;
-//using namespace com::sun::star::style;
using namespace ::com::sun::star::i18n;
+using ::rtl::OUString;
+using ::rtl::OUStringBuffer;
+
namespace sax {
static const sal_Char* gpsMM = "mm";
@@ -269,198 +270,11 @@ void Converter::convertMeasure( OUStringBuffer& rBuffer,
sal_Int16 nSourceUnit /* = MeasureUnit::MM_100TH */,
sal_Int16 nTargetUnit /* = MeasureUnit::INCH */ )
{
- OSL_ENSURE( false, "Converter::convertMeasure - not implemented, tools/BigInt needs replacement" );
+ OSL_FAIL( "Converter::convertMeasure - not implemented, tools/BigInt needs replacement" );
(void)rBuffer;
(void)nMeasure;
(void)nSourceUnit;
(void)nTargetUnit;
-#if 0
- if( nSourceUnit == MeasureUnit::PERCENT )
- {
- OSL_ENSURE( nTargetUnit == MeasureUnit::PERCENT,
- "MeasureUnit::PERCENT only maps to MeasureUnit::PERCENT!" );
-
- rBuffer.append( nMeasure );
- rBuffer.append( sal_Unicode('%' ) );
- }
- else
- {
- // the sign is processed seperatly
- if( nMeasure < 0 )
- {
- nMeasure = -nMeasure;
- rBuffer.append( sal_Unicode('-') );
- }
-
- // The new length is (nVal * nMul)/(nDiv*nFac*10)
- long nMul = 1000;
- long nDiv = 1;
- long nFac = 100;
- const sal_Char* psUnit = 0;
- switch( nSourceUnit )
- {
- case MeasureUnit::TWIP:
- switch( nTargetUnit )
- {
- case MeasureUnit::MM_100TH:
- case MeasureUnit::MM_10TH:
- OSL_ENSURE( MeasureUnit::INCH == nTargetUnit,"output unit not supported for twip values" );
- case MeasureUnit::MM:
- // 0.01mm = 0.57twip (exactly)
- nMul = 25400; // 25.4 * 1000
- nDiv = 1440; // 72 * 20;
- nFac = 100;
- psUnit = gpsMM;
- break;
-
- case MeasureUnit::CM:
- // 0.001cm = 0.57twip (exactly)
- nMul = 25400; // 2.54 * 10000
- nDiv = 1440; // 72 * 20;
- nFac = 1000;
- psUnit = gpsCM;
- break;
-
- case MeasureUnit::POINT:
- // 0.01pt = 0.2twip (exactly)
- nMul = 1000;
- nDiv = 20;
- nFac = 100;
- psUnit = gpsPT;
- break;
-
- case MeasureUnit::INCH:
- default:
- OSL_ENSURE( MeasureUnit::INCH == nTargetUnit,
- "output unit not supported for twip values" );
- // 0.0001in = 0.144twip (exactly)
- nMul = 100000;
- nDiv = 1440; // 72 * 20;
- nFac = 10000;
- psUnit = gpsINCH;
- break;
- }
- break;
-
- case MeasureUnit::POINT:
- // 1pt = 1pt (exactly)
- OSL_ENSURE( MeasureUnit::POINT == nTargetUnit,
- "output unit not supported for pt values" );
- nMul = 10;
- nDiv = 1;
- nFac = 1;
- psUnit = gpsPT;
- break;
- case MeasureUnit::MM_10TH:
- case MeasureUnit::MM_100TH:
- {
- long nFac2 = (MeasureUnit::MM_100TH == nSourceUnit) ? 100 : 10;
- switch( nTargetUnit )
- {
- case MeasureUnit::MM_100TH:
- case MeasureUnit::MM_10TH:
- OSL_ENSURE( MeasureUnit::INCH == nTargetUnit,
- "output unit not supported for 1/100mm values" );
- case MeasureUnit::MM:
- // 0.01mm = 1 mm/100 (exactly)
- nMul = 10;
- nDiv = 1;
- nFac = nFac2;
- psUnit = gpsMM;
- break;
-
- case MeasureUnit::CM:
- // 0.001mm = 1 mm/100 (exactly)
- nMul = 10;
- nDiv = 1; // 72 * 20;
- nFac = 10*nFac2;
- psUnit = gpsCM;
- break;
-
- case MeasureUnit::POINT:
- // 0.01pt = 0.35 mm/100 (exactly)
- nMul = 72000;
- nDiv = 2540;
- nFac = nFac2;
- psUnit = gpsPT;
- break;
-
- case MeasureUnit::INCH:
- default:
- OSL_ENSURE( MeasureUnit::INCH == nTargetUnit,
- "output unit not supported for 1/100mm values" );
- // 0.0001in = 0.254 mm/100 (exactly)
- nMul = 100000;
- nDiv = 2540;
- nFac = 100*nFac2;
- psUnit = gpsINCH;
- break;
- }
- break;
- }
- }
-
- long nLongVal = 0;
- bool bOutLongVal = true;
- if( nMeasure > SAL_INT32_MAX / nMul )
- {
- // A big int is required for calculation
- BigInt nBigVal( nMeasure );
- BigInt nBigFac( nFac );
- nBigVal *= nMul;
- nBigVal /= nDiv;
- nBigVal += 5;
- nBigVal /= 10;
-
- if( nBigVal.IsLong() )
- {
- // To convert the value into a string a long is sufficient
- nLongVal = (long)nBigVal;
- }
- else
- {
- BigInt nBigFac2( nFac );
- BigInt nBig10( 10 );
- rBuffer.append( (sal_Int32)(nBigVal / nBigFac2) );
- if( !(nBigVal % nBigFac2).IsZero() )
- {
- rBuffer.append( sal_Unicode('.') );
- while( nFac > 1 && !(nBigVal % nBigFac2).IsZero() )
- {
- nFac /= 10;
- nBigFac2 = nFac;
- rBuffer.append( (sal_Int32)((nBigVal / nBigFac2) % nBig10 ) );
- }
- }
- bOutLongVal = false;
- }
- }
- else
- {
- nLongVal = nMeasure * nMul;
- nLongVal /= nDiv;
- nLongVal += 5;
- nLongVal /= 10;
- }
-
- if( bOutLongVal )
- {
- rBuffer.append( (sal_Int32)(nLongVal / nFac) );
- if( nFac > 1 && (nLongVal % nFac) != 0 )
- {
- rBuffer.append( sal_Unicode('.') );
- while( nFac > 1 && (nLongVal % nFac) != 0 )
- {
- nFac /= 10;
- rBuffer.append( (sal_Int32)((nLongVal / nFac) % 10) );
- }
- }
- }
-
- if( psUnit )
- rBuffer.appendAscii( psUnit );
- }
-#endif
}
static const OUString& getTrueString()
@@ -847,7 +661,7 @@ bool Converter::convertDuration(double& rfTime,
{
//! how many days is a year or month?
- OSL_ENSURE( false, "years or months in duration: not implemented");
+ OSL_FAIL( "years or months in duration: not implemented");
bSuccess = false;
}
else
@@ -1365,11 +1179,10 @@ bool Converter::convertDateOrDateTime(
const ::rtl::OUString string = rString.trim().toAsciiUpperCase();
sal_Int32 nPos(0);
- bool bNegative(false);
if ((string.getLength() > nPos) && (sal_Unicode('-') == string[nPos]))
{
+ //Negative Number
++nPos;
- bNegative = true;
}
sal_Int32 nYear(0);
@@ -1495,13 +1308,6 @@ bool Converter::convertDateOrDateTime(
{
bSuccess = false; // only 24:00:00 is valid
}
-#if 0
- else
- {
- nHours = 0; // normalize 24:00:00 to 00:00:00 of next day
- lcl_addDay(bNegative, nYear, nMonth, nDay, 1);
- }
-#endif
}
}
@@ -1569,11 +1375,6 @@ bool Converter::convertDateOrDateTime(
if (bSuccess && bHaveTimezone)
{
// util::DateTime does not support timezones!
-#if 0
- // do not add timezone, just strip it (as suggested by er)
- lcl_addTimezone(bNegative, nYear, nMonth, nDay, nHours, nMinutes,
- !bHaveTimezoneMinus, nTimezoneHours, nTimezoneMinutes);
-#endif
}
if (bSuccess)
@@ -2096,3 +1897,5 @@ sal_Int16 Converter::GetUnitFromString(const ::rtl::OUString& rString, sal_Int16
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/tools/fastattribs.cxx b/sax/source/tools/fastattribs.cxx
index 4bf9d55c75b8..53fc40350022 100644
--- a/sax/source/tools/fastattribs.cxx
+++ b/sax/source/tools/fastattribs.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -147,7 +148,7 @@ Sequence< Attribute > FastAttributeList::getUnknownAttributes( ) throw (Runtime
{
Sequence< Attribute > aSeq( maUnknownAttributes.size() );
Attribute* pAttr = aSeq.getArray();
- for( UnknownAttributeList::iterator attrIter = maUnknownAttributes.begin(); attrIter != maUnknownAttributes.end(); attrIter++ )
+ for( UnknownAttributeList::iterator attrIter = maUnknownAttributes.begin(); attrIter != maUnknownAttributes.end(); ++attrIter )
(*attrIter).FillAttribute( pAttr++ );
return aSeq;
}
@@ -156,7 +157,7 @@ Sequence< FastAttribute > FastAttributeList::getFastAttributes( ) throw (Runtim
Sequence< FastAttribute > aSeq( maAttributes.size() );
FastAttribute* pAttr = aSeq.getArray();
FastAttributeMap::iterator fastAttrIter = maAttributes.begin();
- for(; fastAttrIter != maAttributes.end(); fastAttrIter++ )
+ for(; fastAttrIter != maAttributes.end(); ++fastAttrIter )
{
pAttr->Token = fastAttrIter->first;
pAttr->Value = OStringToOUString( fastAttrIter->second, RTL_TEXTENCODING_UTF8 );
@@ -166,3 +167,5 @@ Sequence< FastAttribute > FastAttributeList::getFastAttributes( ) throw (Runtim
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/tools/fastserializer.cxx b/sax/source/tools/fastserializer.cxx
index af89761a2c86..e894c2ca0d13 100644
--- a/sax/source/tools/fastserializer.cxx
+++ b/sax/source/tools/fastserializer.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -29,12 +30,19 @@
#include <rtl/ustrbuf.hxx>
#include <rtl/byteseq.hxx>
+#include <comphelper/sequenceasvector.hxx>
+
#include <com/sun/star/xml/Attribute.hpp>
#include <com/sun/star/xml/FastAttribute.hpp>
#include <com/sun/star/xml/sax/XFastAttributeList.hpp>
#include <string.h>
+#if DEBUG
+#include <cstdio>
+#endif
+
+using ::comphelper::SequenceAsVector;
using ::rtl::OString;
using ::rtl::OUString;
using ::rtl::OUStringBuffer;
@@ -82,7 +90,7 @@ namespace sax_fastparser {
OUString FastSaxSerializer::escapeXml( const OUString& s )
{
::rtl::OUStringBuffer sBuf( s.getLength() );
- const sal_Unicode* pStr = s;
+ const sal_Unicode* pStr = s.getStr();
sal_Int32 nLen = s.getLength();
for( sal_Int32 i = 0; i < nLen; ++i)
{
@@ -130,6 +138,9 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
+ if ( !maMarkStack.empty() )
+ maMarkStack.top()->setCurrentElement( Element );
+
writeBytes(toUnoSequence(aOpeningBracket));
writeId(Element);
@@ -197,6 +208,9 @@ namespace sax_fastparser {
if (!mxOutputStream.is())
return;
+ if ( !maMarkStack.empty() )
+ maMarkStack.top()->setCurrentElement( Element );
+
writeBytes(toUnoSequence(aOpeningBracket));
writeId(Element);
@@ -282,7 +296,7 @@ namespace sax_fastparser {
// XServiceInfo
OUString FastSaxSerializer::getImplementationName() throw (RuntimeException)
{
- return OUString::createFromAscii( SERIALIZER_IMPLEMENTATION_NAME );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( SERIALIZER_IMPLEMENTATION_NAME ));
}
// XServiceInfo
@@ -302,13 +316,13 @@ namespace sax_fastparser {
Sequence< OUString > FastSaxSerializer::getSupportedServiceNames(void) throw (RuntimeException)
{
Sequence<OUString> seq(1);
- seq.getArray()[0] = OUString::createFromAscii( SERIALIZER_SERVICE_NAME );
+ seq.getArray()[0] = OUString(RTL_CONSTASCII_USTRINGPARAM( SERIALIZER_SERVICE_NAME ));
return seq;
}
OUString FastSaxSerializer::getImplementationName_Static()
{
- return OUString::createFromAscii( SERIALIZER_IMPLEMENTATION_NAME );
+ return OUString(RTL_CONSTASCII_USTRINGPARAM( SERIALIZER_IMPLEMENTATION_NAME ));
}
Sequence< OUString > FastSaxSerializer::getSupportedServiceNames_Static(void)
@@ -318,10 +332,39 @@ namespace sax_fastparser {
return aRet;
}
- void FastSaxSerializer::mark()
+ void FastSaxSerializer::mark( Int32Sequence aOrder )
+ {
+ if ( aOrder.hasElements() )
+ {
+ boost::shared_ptr< ForMerge > pSort( new ForSort( aOrder ) );
+ maMarkStack.push( pSort );
+ }
+ else
+ {
+ boost::shared_ptr< ForMerge > pMerge( new ForMerge( ) );
+ maMarkStack.push( pMerge );
+ }
+ }
+
+#if DEBUG
+ void FastSaxSerializer::printMarkStack( )
{
- maMarkStack.push( ForMerge() );
+ ::std::stack< boost::shared_ptr< ForMerge > > aCopy( maMarkStack );
+ int nSize = aCopy.size();
+ int i = 0;
+ while ( !aCopy.empty() )
+ {
+ fprintf( stderr, "%d\n", nSize - i );
+
+ aCopy.top( )->print( );
+
+ fprintf( stderr, "\n" );
+
+ aCopy.pop( );
+ i++;
+ }
}
+#endif
void FastSaxSerializer::mergeTopMarks( sax_fastparser::MergeMarksEnum eMergeType )
{
@@ -330,19 +373,19 @@ namespace sax_fastparser {
if ( maMarkStack.size() == 1 )
{
- mxOutputStream->writeBytes( maMarkStack.top().getData() );
+ mxOutputStream->writeBytes( maMarkStack.top()->getData() );
maMarkStack.pop();
return;
}
- const Int8Sequence aMerge( maMarkStack.top().getData() );
+ const Int8Sequence aMerge( maMarkStack.top()->getData() );
maMarkStack.pop();
switch ( eMergeType )
{
- case MERGE_MARKS_APPEND: maMarkStack.top().append( aMerge ); break;
- case MERGE_MARKS_PREPEND: maMarkStack.top().prepend( aMerge ); break;
- case MERGE_MARKS_POSTPONE: maMarkStack.top().postpone( aMerge ); break;
+ case MERGE_MARKS_APPEND: maMarkStack.top()->append( aMerge ); break;
+ case MERGE_MARKS_PREPEND: maMarkStack.top()->prepend( aMerge ); break;
+ case MERGE_MARKS_POSTPONE: maMarkStack.top()->postpone( aMerge ); break;
}
}
@@ -351,7 +394,7 @@ namespace sax_fastparser {
if ( maMarkStack.empty() )
mxOutputStream->writeBytes( aData );
else
- maMarkStack.top().append( aData );
+ maMarkStack.top()->append( aData );
}
FastSaxSerializer::Int8Sequence& FastSaxSerializer::ForMerge::getData()
@@ -362,6 +405,25 @@ namespace sax_fastparser {
return maData;
}
+#if DEBUG
+ void FastSaxSerializer::ForMerge::print( )
+ {
+ fprintf( stderr, "Data: " );
+ for ( sal_Int32 i=0, len=maData.getLength(); i < len; i++ )
+ {
+ fprintf( stderr, "%c", maData[i] );
+ }
+
+ fprintf( stderr, "\nPostponed: " );
+ for ( sal_Int32 i=0, len=maPostponed.getLength(); i < len; i++ )
+ {
+ fprintf( stderr, "%c", maPostponed[i] );
+ }
+
+ fprintf( stderr, "\n" );
+ }
+#endif
+
void FastSaxSerializer::ForMerge::prepend( const Int8Sequence &rWhat )
{
merge( maData, rWhat, false );
@@ -399,5 +461,71 @@ namespace sax_fastparser {
}
}
+ void FastSaxSerializer::ForMerge::resetData( )
+ {
+ maData = Int8Sequence();
+ }
+
+ void FastSaxSerializer::ForSort::setCurrentElement( sal_Int32 nElement )
+ {
+ SequenceAsVector< sal_Int32 > aOrder( maOrder );
+ if( std::find( aOrder.begin(), aOrder.end(), nElement ) != aOrder.end() )
+ {
+ mnCurrentElement = nElement;
+ if ( maData.find( nElement ) == maData.end() )
+ maData[ nElement ] = Int8Sequence();
+ }
+ }
+
+ void FastSaxSerializer::ForSort::prepend( const Int8Sequence &rWhat )
+ {
+ append( rWhat );
+ }
+
+ void FastSaxSerializer::ForSort::append( const Int8Sequence &rWhat )
+ {
+ merge( maData[mnCurrentElement], rWhat, true );
+ }
+
+ void FastSaxSerializer::ForSort::sort()
+ {
+ // Clear the ForMerge data to avoid duplicate items
+ resetData();
+
+ // Sort it all
+ std::map< sal_Int32, Int8Sequence >::iterator iter;
+ for ( sal_Int32 i=0, len=maOrder.getLength(); i < len; i++ )
+ {
+ iter = maData.find( maOrder[i] );
+ if ( iter != maData.end() )
+ ForMerge::append( iter->second );
+ }
+ }
+
+ FastSaxSerializer::Int8Sequence& FastSaxSerializer::ForSort::getData()
+ {
+ sort( );
+ return ForMerge::getData();
+ }
+
+#if DEBUG
+ void FastSaxSerializer::ForSort::print( )
+ {
+ std::map< sal_Int32, Int8Sequence >::iterator iter = maData.begin();
+ while ( iter != maData.end( ) )
+ {
+ fprintf( stderr, "pair: %d, ", iter->first );
+ for ( sal_Int32 i=0, len=iter->second.getLength(); i < len; ++i )
+ fprintf( stderr, "%c", iter->second[i] );
+ fprintf( stderr, "\n" );
+ ++iter;
+ }
+
+ sort( );
+ ForMerge::print();
+ }
+#endif
+
} // namespace sax_fastparser
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/tools/fastserializer.hxx b/sax/source/tools/fastserializer.hxx
index a98a0ff7a67d..961875194a20 100644
--- a/sax/source/tools/fastserializer.hxx
+++ b/sax/source/tools/fastserializer.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -35,6 +36,9 @@
#include <cppuhelper/implbase2.hxx>
#include <stack>
+#include <map>
+
+#include <boost/shared_ptr.hpp>
#include "sax/dllapi.h"
#include "sax/fshelper.hxx"
@@ -46,6 +50,9 @@ namespace sax_fastparser {
class SAX_DLLPUBLIC FastSaxSerializer : public ::cppu::WeakImplHelper2< ::com::sun::star::xml::sax::XFastSerializer, ::com::sun::star::lang::XServiceInfo >
{
+ typedef ::com::sun::star::uno::Sequence< ::sal_Int8 > Int8Sequence;
+ typedef ::com::sun::star::uno::Sequence< ::sal_Int32 > Int32Sequence;
+
public:
explicit FastSaxSerializer( );
virtual ~FastSaxSerializer();
@@ -101,7 +108,7 @@ public:
mergeTopMarks( true ), mergeTopMarks(), /r, /p
and you are done.
*/
- void mark();
+ void mark( Int32Sequence aOrder = Int32Sequence() );
/** Merge 2 topmost marks.
@@ -124,7 +131,6 @@ private:
::com::sun::star::uno::Reference< ::com::sun::star::io::XOutputStream > mxOutputStream;
::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastTokenHandler > mxFastTokenHandler;
- typedef ::com::sun::star::uno::Sequence< ::sal_Int8 > Int8Sequence;
class ForMerge
{
Int8Sequence maData;
@@ -132,18 +138,56 @@ private:
public:
ForMerge() : maData(), maPostponed() {}
+ virtual ~ForMerge() {}
- Int8Sequence& getData();
+ virtual void setCurrentElement( ::sal_Int32 /*nToken*/ ) {}
+ virtual Int8Sequence& getData();
+#if DEBUG
+ virtual void print();
+#endif
- void prepend( const Int8Sequence &rWhat );
- void append( const Int8Sequence &rWhat );
+ virtual void prepend( const Int8Sequence &rWhat );
+ virtual void append( const Int8Sequence &rWhat );
void postpone( const Int8Sequence &rWhat );
- private:
+ protected:
+ void resetData( );
static void merge( Int8Sequence &rTop, const Int8Sequence &rMerge, bool bAppend );
};
- ::std::stack< ForMerge > maMarkStack;
+ class ForSort : public ForMerge
+ {
+ std::map< ::sal_Int32, Int8Sequence > maData;
+ sal_Int32 mnCurrentElement;
+
+ Int32Sequence maOrder;
+
+ public:
+ ForSort( Int32Sequence aOrder ) :
+ ForMerge(),
+ maData(),
+ mnCurrentElement( 0 ),
+ maOrder( aOrder ) {}
+
+ void setCurrentElement( ::sal_Int32 nToken );
+
+ virtual Int8Sequence& getData();
+
+#if DEBUG
+ virtual void print();
+#endif
+
+ virtual void prepend( const Int8Sequence &rWhat );
+ virtual void append( const Int8Sequence &rWhat );
+ private:
+ void sort();
+ };
+
+#if DEBUG
+ void printMarkStack( );
+#endif
+
+ ::std::stack< boost::shared_ptr< ForMerge > > maMarkStack;
void writeFastAttributeList( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XFastAttributeList >& Attribs );
void write( const ::rtl::OUString& s );
@@ -159,3 +203,5 @@ protected:
} // namespace sax_fastparser
#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/source/tools/fshelper.cxx b/sax/source/tools/fshelper.cxx
index 6956e5b32bf3..239096ae8a05 100644
--- a/sax/source/tools/fshelper.cxx
+++ b/sax/source/tools/fshelper.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
#include <sax/fshelper.hxx>
#include "fastserializer.hxx"
#include <com/sun/star/xml/sax/XFastTokenHandler.hpp>
@@ -9,7 +10,7 @@ using namespace ::com::sun::star::uno;
namespace sax_fastparser {
-FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& xOutputStream ) :
+FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >& xOutputStream, bool bWriteHeader ) :
mpSerializer(new FastSaxSerializer())
{
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext(), UNO_SET_THROW );
@@ -18,7 +19,8 @@ FastSerializerHelper::FastSerializerHelper(const Reference< io::XOutputStream >&
mpSerializer->setFastTokenHandler( mxTokenHandler );
mpSerializer->setOutputStream( xOutputStream );
- mpSerializer->startDocument();
+ if( bWriteHeader )
+ mpSerializer->startDocument();
}
FastSerializerHelper::~FastSerializerHelper()
@@ -179,9 +181,9 @@ FastSerializerHelper* FastSerializerHelper::writeId(sal_Int32 tokenId)
return mpSerializer->getOutputStream();
}
-void FastSerializerHelper::mark()
+void FastSerializerHelper::mark( Sequence< sal_Int32 > aOrder )
{
- mpSerializer->mark();
+ mpSerializer->mark( aOrder );
}
void FastSerializerHelper::mergeTopMarks( MergeMarksEnum eMergeType )
@@ -196,3 +198,5 @@ FastAttributeList * FastSerializerHelper::createAttrList()
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/test/sax/factory.hxx b/sax/test/sax/factory.hxx
index 4ab5553a8b78..e40f1c491431 100644
--- a/sax/test/sax/factory.hxx
+++ b/sax/test/sax/factory.hxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -87,3 +88,4 @@ Sequence<OUString> OSaxWriterTest_getSupportedServiceNames( ) throw();
} \
((void)0)
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/test/sax/testsax.cxx b/sax/test/sax/testsax.cxx
index b51f4cb59181..6fe4fb5b1d0a 100644
--- a/sax/test/sax/testsax.cxx
+++ b/sax/test/sax/testsax.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -236,7 +237,7 @@ Reference < XInputStream > createStreamFromSequence(
const Reference < XMultiServiceFactory > &xSMgr )
{
Reference < XInterface > xOutStreamService =
- xSMgr->createInstance( OUString::createFromAscii("com.sun.star.io.Pipe") );
+ xSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.io.Pipe")) );
OSL_ASSERT( xOutStreamService.is() );
Reference< XOutputStream > rOutStream( xOutStreamService , UNO_QUERY );
OSL_ASSERT( rOutStream.is() );
@@ -822,7 +823,7 @@ sal_Bool SAL_CALL component_writeInfo(
}
catch (InvalidRegistryException &)
{
- OSL_ENSURE( sal_False, "### InvalidRegistryException!" );
+ OSL_FAIL( "### InvalidRegistryException!" );
}
}
@@ -868,3 +869,4 @@ void * SAL_CALL component_getFactory(
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/test/sax/testwriter.cxx b/sax/test/sax/testwriter.cxx
index 27c8559d51d4..f894236d190c 100644
--- a/sax/test/sax/testwriter.cxx
+++ b/sax/test/sax/testwriter.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -252,8 +253,10 @@ OUString AttributeListImpl::getTypeByName( const OUString& sName ) throw (Runti
{
vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
- if( (*ii).sName == sName ) {
+ for (; ii != m_pImpl->vecAttribute.end(); ++ii)
+ {
+ if( (*ii).sName == sName )
+ {
return (*ii).sType;
}
}
@@ -264,8 +267,10 @@ OUString AttributeListImpl::getValueByName(const OUString& sName) throw (Runtim
{
vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
- if( (*ii).sName == sName ) {
+ for(; ii != m_pImpl->vecAttribute.end(); ++ii)
+ {
+ if( (*ii).sName == sName )
+ {
return (*ii).sValue;
}
}
@@ -347,7 +352,7 @@ void OSaxWriterTest::testInvariant( const OUString& TestName,
const Reference < XInterface >& TestObject )
throw ( IllegalArgumentException, RuntimeException)
{
- if( OUString::createFromAscii("com.sun.star.xml.sax.Writer") == TestName ) {
+ if( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")) == TestName ) {
Reference< XDocumentHandler > doc( TestObject , UNO_QUERY );
Reference< XExtendedDocumentHandler > ext( TestObject , UNO_QUERY );
Reference< XActiveDataSource > source( TestObject , UNO_QUERY );
@@ -696,3 +701,5 @@ void OSaxWriterTest::testPerformance(const Reference< XExtendedDocumentHandler
printf( "Performance writing : %g s\n" , fEnd - fStart );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/test/saxdemo.cxx b/sax/test/saxdemo.cxx
index 6023f09ac948..6aedffcb42b6 100644
--- a/sax/test/saxdemo.cxx
+++ b/sax/test/saxdemo.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -50,8 +51,7 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase3.hxx>
-#include <vos/dynload.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
using namespace ::rtl;
using namespace ::std;
@@ -357,7 +357,7 @@ OUString AttributeListImpl::getTypeByName( const OUString& sName ) throw (Runti
{
vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
+ for( ; ii != m_pImpl->vecAttribute.end() ; ++ii ) {
if( (*ii).sName == sName ) {
return (*ii).sType;
}
@@ -369,7 +369,7 @@ OUString AttributeListImpl::getValueByName(const OUString& sName) throw (Runtim
{
vector<struct TagAttribute>::iterator ii = m_pImpl->vecAttribute.begin();
- for( ; ii != m_pImpl->vecAttribute.end() ; ii ++ ) {
+ for( ; ii != m_pImpl->vecAttribute.end() ; ++ii ) {
if( (*ii).sName == sName ) {
return (*ii).sValue;
}
@@ -509,7 +509,7 @@ int main (int argc, char **argv)
{
// Create registration service
Reference < XInterface > x = xSMgr->createInstance(
- OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) );
xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY );
}
catch( Exception & ) {
@@ -521,10 +521,9 @@ int main (int argc, char **argv)
try
{
// Load dll for the tested component
- OUString aDllName =
- OUString::createFromAscii( "sax.uno" SAL_DLLEXTENSION );
+ OUString aDllName(RTL_CONSTASCII_USTRINGPARAM( "sax.uno" SAL_DLLEXTENSION ));
xReg->registerImplementation(
- OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")),
aDllName,
Reference< XSimpleRegistry > () );
}
@@ -541,7 +540,7 @@ int main (int argc, char **argv)
// read xml from a file and count elements
//--------------------------------
Reference< XInterface > x = xSMgr->createInstance(
- OUString::createFromAscii( "com.sun.star.xml.sax.Parser" ) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")) );
if( x.is() )
{
Reference< XParser > rParser( x , UNO_QUERY );
@@ -581,7 +580,7 @@ int main (int argc, char **argv)
//----------------------
// The SAX-Writer demo
//----------------------
- x= xSMgr->createInstance( OUString::createFromAscii( "com.sun.star.xml.sax.Writer" ) );
+ x= xSMgr->createInstance( OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Writer")) );
if( x.is() )
{
printf( "start writing to %s\n" , argv[2] );
@@ -649,3 +648,5 @@ int main (int argc, char **argv)
printf( "couln't create sax-writer component\n" );
}
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/test/testcomponent.cxx b/sax/test/testcomponent.cxx
index f22366092b67..e395add9f662 100644
--- a/sax/test/testcomponent.cxx
+++ b/sax/test/testcomponent.cxx
@@ -1,3 +1,4 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*************************************************************************
*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
@@ -41,8 +42,7 @@
#include <cppuhelper/servicefactory.hxx>
-#include <vos/dynload.hxx>
-#include <vos/diagnose.hxx>
+#include <osl/diagnose.h>
using namespace ::rtl;
using namespace ::cppu;
@@ -79,7 +79,7 @@ int main (int argc, char **argv)
{
// Create registration service
Reference < XInterface > x = xSMgr->createInstance(
- OUString::createFromAscii( "com.sun.star.registry.ImplementationRegistration" ) );
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.registry.ImplementationRegistration")) );
xReg = Reference< XImplementationRegistration > ( x , UNO_QUERY );
}
catch( Exception & ) {
@@ -102,7 +102,7 @@ int main (int argc, char **argv)
aDllName += OUString( RTL_CONSTASCII_USTRINGPARAM(".so"));
#endif
xReg->registerImplementation(
- OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ),
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")),
aDllName,
xSimpleReg );
}
@@ -130,7 +130,7 @@ int main (int argc, char **argv)
#endif
xReg->registerImplementation(
- OUString::createFromAscii( "com.sun.star.loader.SharedLibrary" ) ,
+ OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.loader.SharedLibrary")) ,
aDllName,
xSimpleReg );
}
@@ -228,3 +228,5 @@ int main (int argc, char **argv)
rComp->dispose();
return 0;
}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sax/util/makefile.mk b/sax/util/makefile.mk
index 5e2f378603e9..8875e381e1b9 100644
--- a/sax/util/makefile.mk
+++ b/sax/util/makefile.mk
@@ -50,7 +50,6 @@ SHL1USE_EXPORTS=name
SHL1LIBS= $(LIB1TARGET)
SHL1STDLIBS= \
- $(VOSLIB) \
$(CPPULIB) \
$(CPPUHELPERLIB)\
$(COMPHELPERLIB)\