diff options
Diffstat (limited to 'xmloff/source/meta/xmlversion.cxx')
-rw-r--r-- | xmloff/source/meta/xmlversion.cxx | 38 |
1 files changed, 5 insertions, 33 deletions
diff --git a/xmloff/source/meta/xmlversion.cxx b/xmloff/source/meta/xmlversion.cxx index 819fa13500e1..8163dd5adbb1 100644 --- a/xmloff/source/meta/xmlversion.cxx +++ b/xmloff/source/meta/xmlversion.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. @@ -51,10 +52,9 @@ using ::rtl::OUString; // ------------------------------------------------------------------------ -sal_Char __FAR_DATA XMLN_VERSIONSLIST[] = "VersionList.xml"; +sal_Char XMLN_VERSIONSLIST[] = "VersionList.xml"; // ------------------------------------------------------------------------ - // #110897# XMLVersionListExport::XMLVersionListExport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, @@ -115,8 +115,6 @@ sal_uInt32 XMLVersionListExport::exportDoc( enum ::xmloff::token::XMLTokenEnum ) } // ------------------------------------------------------------------------ -// ------------------------------------------------------------------------ - // #110897# XMLVersionListImport::XMLVersionListImport( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > xServiceFactory, @@ -155,8 +153,6 @@ SvXMLImportContext *XMLVersionListImport::CreateContext( // ------------------------------------------------------------------------ -// ------------------------------------------------------------------------ - XMLVersionListContext::XMLVersionListContext( XMLVersionListImport& rImport, sal_uInt16 nPrefix, const OUString& rLocalName, @@ -191,8 +187,6 @@ SvXMLImportContext *XMLVersionListContext::CreateChildContext( sal_uInt16 nPrefi } // ------------------------------------------------------------------------ -// ------------------------------------------------------------------------ - XMLVersionContext::XMLVersionContext( XMLVersionListImport& rImport, sal_uInt16 nPref, const OUString& rLocalName, @@ -252,7 +246,6 @@ XMLVersionContext::~XMLVersionContext( void ) {} // ------------------------------------------------------------------------ -// static sal_Bool XMLVersionContext::ParseISODateTimeString( const rtl::OUString& rString, util::DateTime& rDateTime ) @@ -354,8 +347,6 @@ sal_Bool XMLVersionContext::ParseISODateTimeString( // ------------------------------------------------------------------------ -// ------------------------------------------------------------------------ - void SAL_CALL XMLVersionListPersistence::store( const uno::Reference< embed::XStorage >& xRoot, const uno::Sequence< util::RevisionTag >& rVersions ) throw (::com::sun::star::io::IOException, ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException) { @@ -375,14 +366,6 @@ void SAL_CALL XMLVersionListPersistence::store( const uno::Reference< embed::XSt // and delete it OUString sVerName( RTL_CONSTASCII_USTRINGPARAM( XMLN_VERSIONSLIST ) ); - // is this really needed, we set the size to zero before doing - // anything with this stream? -/* if ( xRoot->IsContained( sVerName ) ) - { - xRoot->Remove( sVerName ); - xRoot->Commit(); - } -*/ try { // open (create) the sub storage with the version info uno::Reference< io::XStream > xVerStream = xRoot->openStreamElement( @@ -391,11 +374,6 @@ void SAL_CALL XMLVersionListPersistence::store( const uno::Reference< embed::XSt if ( !xVerStream.is() ) throw uno::RuntimeException(); -//REMOVE // SetSize should not be neccessary because OpenStream( WRITE|TRUNC ) should already -//REMOVE // have set the size to zero -//REMOVE // xVerStream->SetSize ( 0L ); -//REMOVE xVerStream->SetBufferSize( 16*1024 ); - Reference< io::XOutputStream > xOut = xVerStream->getOutputStream(); if ( !xOut.is() ) throw uno::RuntimeException(); // the stream was successfuly opened for writing already @@ -405,14 +383,11 @@ void SAL_CALL XMLVersionListPersistence::store( const uno::Reference< embed::XSt Reference< XDocumentHandler > xHandler( xWriter, uno::UNO_QUERY ); - // XMLVersionListExport aExp( pList, sVerName, xHandler ); XMLVersionListExport aExp( xServiceFactory, rVersions, sVerName, xHandler ); aExp.exportDoc( ::xmloff::token::XML_VERSION ); -//REMOVE xVerStream->Commit(); xVerStream = uno::Reference< io::XStream >(); // use refcounting for now to dispose - // xRoot->Commit(); } catch( uno::Exception& ) { @@ -444,7 +419,7 @@ uno::Sequence< util::RevisionTag > SAL_CALL XMLVersionListPersistence::load( con if ( xProps.is() ) { try { - xProps->getPropertyValue( ::rtl::OUString::createFromAscii( "URL" ) ) >>= aParserInput.sSystemId; + xProps->getPropertyValue( ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("URL")) ) >>= aParserInput.sSystemId; } catch( uno::Exception& ) {} @@ -456,9 +431,6 @@ uno::Sequence< util::RevisionTag > SAL_CALL XMLVersionListPersistence::load( con if ( !xDocStream.is() ) throw uno::RuntimeException(); -//REMOVE xDocStream->Seek( 0L ); -//REMOVE xDocStream->SetBufferSize( 16*1024 ); - aParserInput.aInputStream = xDocStream->getInputStream(); OSL_ENSURE( aParserInput.aInputStream.is(), "The stream was successfuly opened for reading, the input part must be accessible!\n" ); @@ -467,12 +439,11 @@ uno::Sequence< util::RevisionTag > SAL_CALL XMLVersionListPersistence::load( con // get parser Reference< XInterface > xXMLParser = xServiceFactory->createInstance( - OUString::createFromAscii("com.sun.star.xml.sax.Parser") ); + OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.xml.sax.Parser")) ); DBG_ASSERT( xXMLParser.is(), "XMLReader::Read: com.sun.star.xml.sax.Parser service missing" ); // get filter - // Reference< XDocumentHandler > xFilter = new XMLVersionListImport( pList ); Reference< XDocumentHandler > xFilter = new XMLVersionListImport( xServiceFactory, aVersions ); // connect parser and filter @@ -539,3 +510,4 @@ uno::Reference< uno::XInterface > SAL_CALL XMLVersionImExportOOO_createInstance( return (cppu::OWeakObject*)new XMLVersionListPersistence; } +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |