summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx')
-rw-r--r--odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx82
1 files changed, 41 insertions, 41 deletions
diff --git a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
index 6935eb351f55..34ae11cdbfe9 100644
--- a/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
+++ b/odk/examples/DevelopersGuide/OfficeDev/FilterDevelopment/FlatXmlFilter_cpp/FlatXml.cxx
@@ -3,7 +3,7 @@
*
* The Contents of this file are made available subject to the terms of
* the BSD license.
- *
+ *
* Copyright 2000, 2010 Oracle and/or its affiliates.
* All rights reserved.
*
@@ -30,7 +30,7 @@
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
* TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
* USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- *
+ *
*************************************************************************/
#include <cppuhelper/factory.hxx>
@@ -88,47 +88,47 @@ private:
public:
// ctor...
- XFlatXml( const Reference< XMultiServiceFactory > &r )
+ XFlatXml( const Reference< XMultiServiceFactory > &r )
: m_rServiceFactory(r)
, m_bPrettyPrint(sal_True)
{}
// XImportFilter
virtual sal_Bool SAL_CALL importer(
- const Sequence<PropertyValue>& aSourceData,
- const Reference<XDocumentHandler>& xHandler,
- const Sequence<OUString>& msUserData)
+ const Sequence<PropertyValue>& aSourceData,
+ const Reference<XDocumentHandler>& xHandler,
+ const Sequence<OUString>& msUserData)
throw(RuntimeException);
// XExportFilter
virtual sal_Bool SAL_CALL exporter(
- const Sequence<PropertyValue>& aSourceData,
- const Sequence<OUString>& msUserData)
+ const Sequence<PropertyValue>& aSourceData,
+ const Sequence<OUString>& msUserData)
throw(RuntimeException);
// XDocumentHandler
- virtual void SAL_CALL startDocument()
+ virtual void SAL_CALL startDocument()
throw (SAXException,RuntimeException);
- virtual void SAL_CALL endDocument()
+ virtual void SAL_CALL endDocument()
throw (SAXException, RuntimeException);
- virtual void SAL_CALL startElement(const OUString& str, const Reference<XAttributeList>& attriblist)
+ virtual void SAL_CALL startElement(const OUString& str, const Reference<XAttributeList>& attriblist)
throw (SAXException,RuntimeException);
- virtual void SAL_CALL endElement(const OUString& str)
+ virtual void SAL_CALL endElement(const OUString& str)
throw (SAXException, RuntimeException);
- virtual void SAL_CALL characters(const OUString& str)
+ virtual void SAL_CALL characters(const OUString& str)
throw (SAXException, RuntimeException);
- virtual void SAL_CALL ignorableWhitespace(const OUString& str)
+ virtual void SAL_CALL ignorableWhitespace(const OUString& str)
throw (SAXException, RuntimeException);
- virtual void SAL_CALL processingInstruction(const OUString& str, const OUString& str2)
+ virtual void SAL_CALL processingInstruction(const OUString& str, const OUString& str2)
throw (com::sun::star::xml::sax::SAXException,RuntimeException);
- virtual void SAL_CALL setDocumentLocator(const Reference<XLocator>& doclocator)
- throw (SAXException,RuntimeException);
+ virtual void SAL_CALL setDocumentLocator(const Reference<XLocator>& doclocator)
+ throw (SAXException,RuntimeException);
};
sal_Bool XFlatXml::importer(
- const Sequence<PropertyValue>& aSourceData,
- const Reference<XDocumentHandler>& xHandler,
- const Sequence<OUString>& msUserData)
+ const Sequence<PropertyValue>& aSourceData,
+ const Reference<XDocumentHandler>& xHandler,
+ const Sequence<OUString>& msUserData)
throw (RuntimeException)
{
// get information from media descriptor
@@ -137,12 +137,12 @@ sal_Bool XFlatXml::importer(
// the sax parser that drives the supplied document handler
sal_Int32 nLength = aSourceData.getLength();
OUString aName, aFileName, aURL;
- Reference< XInputStream > xInputStream;
+ Reference< XInputStream > xInputStream;
for ( sal_Int32 i = 0 ; i < nLength; i++)
{
aName = aSourceData[i].Name;
if (aName.equalsAscii("InputStream"))
- aSourceData[i].Value >>= xInputStream;
+ aSourceData[i].Value >>= xInputStream;
else if ( aName.equalsAscii("FileName"))
aSourceData[i].Value >>= aFileName;
else if ( aName.equalsAscii("URL"))
@@ -158,17 +158,17 @@ sal_Bool XFlatXml::importer(
if (xSeek.is())
xSeek->seek(0);
-
+
// create SAX parser that will read the document file
// and provide events to xHandler passed to this call
- Reference < XParser > xSaxParser( m_rServiceFactory->createInstance(
+ Reference < XParser > xSaxParser( m_rServiceFactory->createInstance(
OUString::createFromAscii("com.sun.star.xml.sax.Parser")), UNO_QUERY );
OSL_ASSERT(xSaxParser.is());
if(!xSaxParser.is())return sal_False;
// let the parser try to send the sax event to the document handler
try
- {
+ {
InputSource aInput;
aInput.sSystemId = aURL;
aInput.sPublicId = aURL;
@@ -188,8 +188,8 @@ sal_Bool XFlatXml::importer(
}
sal_Bool XFlatXml::exporter(
- const Sequence<PropertyValue>& aSourceData,
- const Sequence<OUString>& msUserData)
+ const Sequence<PropertyValue>& aSourceData,
+ const Sequence<OUString>& msUserData)
throw (RuntimeException)
{
@@ -199,9 +199,9 @@ sal_Bool XFlatXml::exporter(
// from it's data-source interface
OUString aName, sURL;
Reference<XOutputStream> rOutputStream;
- sal_Int32 nLength = aSourceData.getLength();
+ sal_Int32 nLength = aSourceData.getLength();
for ( sal_Int32 i = 0 ; i < nLength; i++)
- {
+ {
aName = aSourceData[i].Name;
if ( aName.equalsAscii("OutputStream"))
aSourceData[i].Value >>= rOutputStream;
@@ -243,44 +243,44 @@ void XFlatXml::endDocument() throw (SAXException,RuntimeException){
m_rDocumentHandler->endDocument();
}
-void XFlatXml::startElement(const OUString& str, const Reference<XAttributeList>& attriblist)
+void XFlatXml::startElement(const OUString& str, const Reference<XAttributeList>& attriblist)
throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->startElement(str, attriblist);
}
-void XFlatXml::endElement(const OUString& str)
- throw (SAXException, RuntimeException)
+void XFlatXml::endElement(const OUString& str)
+ throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->endElement(str);
}
-void XFlatXml::characters(const OUString& str)
- throw (SAXException, RuntimeException)
+void XFlatXml::characters(const OUString& str)
+ throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->characters(str);
}
-void XFlatXml::ignorableWhitespace(const OUString& str)
+void XFlatXml::ignorableWhitespace(const OUString& str)
throw (SAXException, RuntimeException)
-{
+{
OSL_ASSERT(m_rDocumentHandler.is());
if (!m_bPrettyPrint) return;
m_rDocumentHandler->ignorableWhitespace(str);
}
-
-void XFlatXml::processingInstruction(const OUString& str, const OUString& str2)
- throw (SAXException, RuntimeException)
+
+void XFlatXml::processingInstruction(const OUString& str, const OUString& str2)
+ throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->processingInstruction(str, str2);
}
-void XFlatXml::setDocumentLocator(const Reference<XLocator>& doclocator)
- throw (SAXException, RuntimeException)
+void XFlatXml::setDocumentLocator(const Reference<XLocator>& doclocator)
+ throw (SAXException, RuntimeException)
{
OSL_ASSERT(m_rDocumentHandler.is());
m_rDocumentHandler->setDocumentLocator(doclocator);