summaryrefslogtreecommitdiff
path: root/xmloff/source/meta
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/meta')
-rw-r--r--xmloff/source/meta/MetaExportComponent.cxx34
-rw-r--r--xmloff/source/meta/MetaImportComponent.cxx15
-rw-r--r--xmloff/source/meta/xmlmetae.cxx5
-rw-r--r--xmloff/source/meta/xmlmetai.cxx14
-rw-r--r--xmloff/source/meta/xmlversion.cxx38
5 files changed, 30 insertions, 76 deletions
diff --git a/xmloff/source/meta/MetaExportComponent.cxx b/xmloff/source/meta/MetaExportComponent.cxx
index 66717ae3aaf8..37af37bb498e 100644
--- a/xmloff/source/meta/MetaExportComponent.cxx
+++ b/xmloff/source/meta/MetaExportComponent.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.
@@ -33,16 +34,8 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/uno/Reference.hxx>
-
-#ifndef _COM_SUN_STAR_UNO_EXCEPTION_HPP
#include <com/sun/star/uno/Exception.hpp>
-#endif
#include <com/sun/star/beans/PropertyAttribute.hpp>
-
-// #110680#
-//#ifndef _COMPHELPER_PROCESSFACTORY_HXX_
-//#include <comphelper/processfactory.hxx>
-//#endif
#include <comphelper/genericpropertyset.hxx>
#include <rtl/ustrbuf.hxx>
#include "xmloff/xmlnmspe.hxx"
@@ -58,7 +51,6 @@
using namespace ::com::sun::star;
using namespace ::xmloff::token;
-// #110680#
XMLMetaExportComponent::XMLMetaExportComponent(
const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceFactory,
sal_uInt16 nFlags )
@@ -128,7 +120,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
// get filter component
xDocHandler = uno::Reference< xml::sax::XDocumentHandler >(
xFactory->createInstanceWithArguments(
- ::rtl::OUString::createFromAscii("com.sun.star.comp.Oasis2OOoTransformer"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.Oasis2OOoTransformer")),
aArgs),
uno::UNO_QUERY_THROW );
@@ -136,7 +128,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
}
catch( com::sun::star::uno::Exception& )
{
- OSL_ENSURE( sal_False, "Cannot instantiate com.sun.star.comp.Oasis2OOoTransformer!\n");
+ OSL_FAIL( "Cannot instantiate com.sun.star.comp.Oasis2OOoTransformer!\n");
}
}
}
@@ -144,17 +136,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
xDocHandler->startDocument();
{
-#if 0
- GetAttrList().AddAttribute(
- GetNamespaceMap().GetAttrNameByKey( XML_NAMESPACE_DC ),
- GetNamespaceMap().GetNameByKey( XML_NAMESPACE_DC ) );
- GetAttrList().AddAttribute(
- GetNamespaceMap().GetAttrNameByKey( XML_NAMESPACE_META ),
- GetNamespaceMap().GetNameByKey( XML_NAMESPACE_META ) );
- GetAttrList().AddAttribute(
- GetNamespaceMap().GetAttrNameByKey( XML_NAMESPACE_OFFICE ),
- GetNamespaceMap().GetNameByKey( XML_NAMESPACE_OFFICE ) );
-#else
+
const SvXMLNamespaceMap& rMap = GetNamespaceMap();
sal_uInt16 nPos = rMap.GetFirstKey();
while( USHRT_MAX != nPos )
@@ -162,7 +144,6 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
GetAttrList().AddAttribute( rMap.GetAttrNameByKey( nPos ), rMap.GetNameByKey( nPos ) );
nPos = GetNamespaceMap().GetNextKey( nPos );
}
-#endif
const sal_Char* pVersion = 0;
switch( getDefaultVersion() )
@@ -173,7 +154,7 @@ sal_uInt32 XMLMetaExportComponent::exportDoc( enum XMLTokenEnum )
case SvtSaveOptions::ODFVER_010: break;
default:
- DBG_ERROR("xmloff::XMLMetaExportComponent::exportDoc(), unexpected odf default version!");
+ OSL_FAIL("xmloff::XMLMetaExportComponent::exportDoc(), unexpected odf default version!");
}
if( pVersion )
@@ -228,8 +209,6 @@ uno::Reference< uno::XInterface > SAL_CALL XMLMetaExportComponent_createInstance
const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
throw( uno::Exception )
{
- // #110680#
- // return (cppu::OWeakObject*)new XMLMetaExportComponent;
return (cppu::OWeakObject*)new XMLMetaExportComponent(rSMgr, EXPORT_META|EXPORT_OASIS);
}
@@ -251,8 +230,7 @@ uno::Reference< uno::XInterface > SAL_CALL XMLMetaExportOOO_createInstance(
const uno::Reference< lang::XMultiServiceFactory > & rSMgr)
throw( uno::Exception )
{
- // #110680#
- // return (cppu::OWeakObject*)new XMLMetaExportComponent;
return (cppu::OWeakObject*)new XMLMetaExportComponent(rSMgr, EXPORT_META);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/meta/MetaImportComponent.cxx b/xmloff/source/meta/MetaImportComponent.cxx
index d27d2c33b239..a58cecb1f707 100644
--- a/xmloff/source/meta/MetaImportComponent.cxx
+++ b/xmloff/source/meta/MetaImportComponent.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.
@@ -64,13 +65,13 @@ SvXMLImportContext* XMLMetaImportComponent::CreateContext(
IsXMLToken(rLocalName, XML_DOCUMENT_META) )
{
if (!mxDocProps.is()) {
- throw uno::RuntimeException(::rtl::OUString::createFromAscii(
+ throw uno::RuntimeException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"XMLMetaImportComponent::CreateContext: setTargetDocument "
- "has not been called"), *this);
+ "has not been called")), *this);
}
uno::Reference<xml::sax::XDocumentHandler> xDocBuilder(
- mxServiceFactory->createInstance(::rtl::OUString::createFromAscii(
- "com.sun.star.xml.dom.SAXDocumentBuilder")),
+ mxServiceFactory->createInstance(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.xml.dom.SAXDocumentBuilder"))),
uno::UNO_QUERY_THROW);
return new SvXMLMetaDocumentContext(
*this, nPrefix, rLocalName, mxDocProps, xDocBuilder);
@@ -87,9 +88,9 @@ void SAL_CALL XMLMetaImportComponent::setTargetDocument(
{
mxDocProps = uno::Reference< document::XDocumentProperties >::query( xDoc );
if( !mxDocProps.is() )
- throw lang::IllegalArgumentException(::rtl::OUString::createFromAscii(
+ throw lang::IllegalArgumentException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"XMLMetaImportComponent::setTargetDocument: argument is no "
- "XDocumentProperties"), uno::Reference<uno::XInterface>(*this), 0);
+ "XDocumentProperties")), uno::Reference<uno::XInterface>(*this), 0);
}
uno::Sequence< rtl::OUString > SAL_CALL
@@ -112,7 +113,7 @@ uno::Reference< uno::XInterface > SAL_CALL XMLMetaImportComponent_createInstance
throw( uno::Exception )
{
// #110680#
- // return (cppu::OWeakObject*)new XMLMetaImportComponent;
return (cppu::OWeakObject*)new XMLMetaImportComponent(rSMgr);
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/meta/xmlmetae.cxx b/xmloff/source/meta/xmlmetae.cxx
index 55e7cd97f810..e50be583d072 100644
--- a/xmloff/source/meta/xmlmetae.cxx
+++ b/xmloff/source/meta/xmlmetae.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.
@@ -350,7 +351,6 @@ SvXMLMetaExport::~SvXMLMetaExport()
void SvXMLMetaExport::Export()
{
-// exportDom(xDOM, mrExport); // this would not work (root node, namespaces)
uno::Reference< xml::sax::XSAXSerializable> xSAXable(mxDocProps,
uno::UNO_QUERY);
if (xSAXable.is()) {
@@ -365,7 +365,7 @@ void SvXMLMetaExport::Export()
} else if (attrname.equalsAsciiL(s_xmlns, strlen(s_xmlns))) {
// default initialized empty string
} else {
- DBG_ERROR("namespace attribute not starting with xmlns unexpected");
+ OSL_FAIL("namespace attribute not starting with xmlns unexpected");
}
ns.Second = rNsMap.GetNameByKey(key);
namespaces.push_back(ns);
@@ -526,3 +526,4 @@ SvXMLMetaExport::setDocumentLocator(const uno::Reference<xml::sax::XLocator>&)
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx
index 9f5aebece935..4e2024c3cf5e 100644
--- a/xmloff/source/meta/xmlmetai.cxx
+++ b/xmloff/source/meta/xmlmetai.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.
@@ -150,9 +151,9 @@ lcl_initDocumentProperties(SvXMLImport & rImport,
throw;
} catch (uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString::createFromAscii(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
"SvXMLMetaDocumentContext::initDocumentProperties: "
- "properties init exception"),
+ "properties init exception")),
rImport, makeAny(e));
}
}
@@ -184,8 +185,8 @@ lcl_initGenerator(SvXMLImport & rImport,
throw;
} catch (uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- ::rtl::OUString::createFromAscii(
- "SvXMLMetaDocumentContext::initGenerator: exception"),
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "SvXMLMetaDocumentContext::initGenerator: exception")),
rImport, makeAny(e));
}
}
@@ -292,11 +293,11 @@ void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, con
(i_rBuildId.compareToAscii(
RTL_CONSTASCII_STRINGPARAM("OpenOffice.org 1") ) == 0))
{
- sBuildId = OUString::createFromAscii( "645$8687" );
+ sBuildId = OUString(RTL_CONSTASCII_USTRINGPARAM("645$8687"));
}
if ((i_rBuildId.compareToAscii( RTL_CONSTASCII_STRINGPARAM("NeoOffice/2") ) == 0) )
{
- sBuildId = OUString::createFromAscii( "680$9134" ); // fake NeoOffice as OpenOffice.org 2.2 release
+ sBuildId = OUString(RTL_CONSTASCII_USTRINGPARAM("680$9134")); // fake NeoOffice as OpenOffice.org 2.2 release
}
}
@@ -316,3 +317,4 @@ void SvXMLMetaDocumentContext::setBuildId(::rtl::OUString const& i_rBuildId, con
}
}
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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: */