Kaydet (Commit) 7de2366a authored tarafından David Tardon's avatar David Tardon

use consistent style for writerperfect

Change-Id: I47089586094b58c39a128e44e2671d69c2d50177
üst 2c75925a
......@@ -4,3 +4,9 @@ This collection of filters is here in this folder in addition to the
WordPerfect filter that gave the module its (humorous) name "writerperfect"
because the libraries they use all have the same "style" of API and are
developed, at least partially, by the same person or group of persons.
This module uses astyle to keep consistent coding style. Please run
astyle --options=astyle.options \*.?xx
before committing.
# formatting options
style=allman
indent=spaces=4
align-pointer=name
break-closing-brackets
pad-header
unpad-paren
max-instatement-indent=120
# processing options
recursive
suffix=none
......@@ -73,7 +73,7 @@ shared_ptr<RVNGInputStream> lcl_createStream()
{
using comphelper::SequenceInputStream;
const css::uno::Sequence<sal_Int8> aData(reinterpret_cast<const sal_Int8*>(aText), sizeof aText);
const css::uno::Sequence<sal_Int8> aData(reinterpret_cast<const sal_Int8 *>(aText), sizeof aText);
const uno::Reference<io::XInputStream> xInputStream(new SequenceInputStream(aData));
shared_ptr<RVNGInputStream> pInputStream;
......@@ -90,8 +90,8 @@ const shared_ptr<RVNGInputStream> lcl_createStreamForURL(const rtl::OUString &rU
const Reference<uno::XComponentContext> xContext(comphelper::getProcessComponentContext(), UNO_QUERY_THROW);
const Reference<ucb::XSimpleFileAccess> xFileAccess(
xContext->getServiceManager()->createInstanceWithContext("com.sun.star.ucb.SimpleFileAccess", xContext),
UNO_QUERY_THROW);
xContext->getServiceManager()->createInstanceWithContext("com.sun.star.ucb.SimpleFileAccess", xContext),
UNO_QUERY_THROW);
const Reference<io::XInputStream> xInputStream(xFileAccess->openFileRead(rURL), UNO_QUERY_THROW);
const shared_ptr<RVNGInputStream> pInput(new WPXSvInputStream(xInputStream));
......@@ -122,9 +122,9 @@ void WPXSvStreamTest::testRead()
const unsigned long nLen = sizeof aText;
unsigned long nReadBytes = 0;
const unsigned char* pData = 0;
const unsigned char* const pTextOrig = reinterpret_cast<const unsigned char*>(aText);
const unsigned char* pText = pTextOrig;
const unsigned char *pData = 0;
const unsigned char *const pTextOrig = reinterpret_cast<const unsigned char *>(aText);
const unsigned char *pText = pTextOrig;
// reading by small pieces
pData = pInput->read(1UL, nReadBytes);
......@@ -176,7 +176,7 @@ void WPXSvStreamTest::testRead()
pData = pInput->read(0UL, nReadBytes);
CPPUNIT_ASSERT_EQUAL(0UL, nReadBytes);
CPPUNIT_ASSERT_EQUAL(0L, pInput->tell());
CPPUNIT_ASSERT_EQUAL(pData, static_cast<const unsigned char*>(0));
CPPUNIT_ASSERT_EQUAL(pData, static_cast<const unsigned char *>(0));
CPPUNIT_ASSERT(!pInput->isEnd());
}
......
......@@ -60,8 +60,8 @@ void WpftImportTestBase::setUp()
m_xDesktop = frame::theDesktop::get(m_xContext);
const uno::Reference<document::XTypeDetection> xTypeDetection(
m_xFactory->createInstanceWithContext("com.sun.star.document.TypeDetection", m_xContext),
uno::UNO_QUERY_THROW);
m_xFactory->createInstanceWithContext("com.sun.star.document.TypeDetection", m_xContext),
uno::UNO_QUERY_THROW);
m_xTypeMap.set(xTypeDetection, uno::UNO_QUERY_THROW);
}
......@@ -73,12 +73,12 @@ void WpftImportTestBase::tearDown()
}
bool WpftImportTestBase::load(const OUString &, const OUString &rURL, const OUString &,
unsigned int, unsigned int, unsigned int)
unsigned int, unsigned int, unsigned int)
{
// create an empty frame
const uno::Reference<lang::XComponent> xDoc(
m_xDesktop->loadComponentFromURL(m_aFactoryURL, "_blank", 0, uno::Sequence<beans::PropertyValue>()),
uno::UNO_QUERY_THROW);
m_xDesktop->loadComponentFromURL(m_aFactoryURL, "_blank", 0, uno::Sequence<beans::PropertyValue>()),
uno::UNO_QUERY_THROW);
// Find the model and frame. We need them later.
uno::Reference<frame::XFrame> xFrame(xDoc, uno::UNO_QUERY);
......
......@@ -19,13 +19,35 @@
#include <unotest/filters-test.hxx>
namespace com { namespace sun { namespace star {
namespace beans { struct PropertyValue; }
namespace container { class XNameAccess; }
namespace document { class XFilter; }
namespace frame { class XDesktop2; }
namespace ucb { class XSimpleFileAccess; }
} } }
namespace com
{
namespace sun
{
namespace star
{
namespace beans
{
struct PropertyValue;
}
namespace container
{
class XNameAccess;
}
namespace document
{
class XFilter;
}
namespace frame
{
class XDesktop2;
}
namespace ucb
{
class XSimpleFileAccess;
}
}
}
}
namespace writerperfect
{
......@@ -47,7 +69,7 @@ protected:
private:
virtual bool load(const OUString &, const OUString &rURL, const OUString &,
unsigned int, unsigned int, unsigned int) SAL_OVERRIDE;
unsigned int, unsigned int, unsigned int) SAL_OVERRIDE;
void impl_detectFilterName(com::sun::star::uno::Sequence<com::sun::star::beans::PropertyValue> &rDescriptor, const rtl::OUString &rTypeName);
......
......@@ -50,8 +50,8 @@ using com::sun::star::xml::sax::XParser;
using writerperfect::DocumentHandler;
using writerperfect::WPXSvInputStream;
ImportFilterImpl::ImportFilterImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext )
: mxContext( rxContext )
ImportFilterImpl::ImportFilterImpl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
: mxContext(rxContext)
{
}
......@@ -59,20 +59,20 @@ ImportFilterImpl::~ImportFilterImpl()
{
}
sal_Bool SAL_CALL ImportFilterImpl::filter( const Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
sal_Bool SAL_CALL ImportFilterImpl::filter(const Sequence< ::com::sun::star::beans::PropertyValue > &aDescriptor)
throw (RuntimeException, std::exception)
{
sal_Int32 nLength = aDescriptor.getLength();
const PropertyValue *pValue = aDescriptor.getConstArray();
Reference < XInputStream > xInputStream;
for ( sal_Int32 i = 0 ; i < nLength; i++)
for (sal_Int32 i = 0 ; i < nLength; i++)
{
if ( pValue[i].Name == "InputStream" )
if (pValue[i].Name == "InputStream")
pValue[i].Value >>= xInputStream;
}
if ( !xInputStream.is() )
if (!xInputStream.is())
{
OSL_ASSERT( false );
OSL_ASSERT(false);
return sal_False;
}
......@@ -84,13 +84,13 @@ throw (RuntimeException, std::exception)
// The XImporter sets up an empty target document for XDocumentHandler to write to..
Reference < XImporter > xImporter(xInternalHandler, UNO_QUERY);
xImporter->setTargetDocument( mxDoc );
xImporter->setTargetDocument(mxDoc);
// OO Graphics Handler: abstract class to handle document SAX messages, concrete implementation here
// writes to in-memory target doc
DocumentHandler xHandler(xInternalHandler);
WPXSvInputStream input( xInputStream );
WPXSvInputStream input(xInputStream);
OdsGenerator exporter;
exporter.addDocumentHandler(&xHandler, ODF_FLAT_XML);
......@@ -100,45 +100,45 @@ throw (RuntimeException, std::exception)
return doImportDocument(input, exporter);
}
void SAL_CALL ImportFilterImpl::cancel( )
void SAL_CALL ImportFilterImpl::cancel()
throw (RuntimeException, std::exception)
{
}
// XImporter
void SAL_CALL ImportFilterImpl::setTargetDocument( const Reference< ::com::sun::star::lang::XComponent >& xDoc )
void SAL_CALL ImportFilterImpl::setTargetDocument(const Reference< ::com::sun::star::lang::XComponent > &xDoc)
throw (::com::sun::star::lang::IllegalArgumentException, RuntimeException, std::exception)
{
mxDoc = xDoc;
}
// XExtendedFilterDetection
OUString SAL_CALL ImportFilterImpl::detect( com::sun::star::uno::Sequence< PropertyValue >& Descriptor )
throw( com::sun::star::uno::RuntimeException, std::exception )
OUString SAL_CALL ImportFilterImpl::detect(com::sun::star::uno::Sequence< PropertyValue > &Descriptor)
throw(com::sun::star::uno::RuntimeException, std::exception)
{
OUString sTypeName;
sal_Int32 nLength = Descriptor.getLength();
sal_Int32 location = nLength;
const PropertyValue *pValue = Descriptor.getConstArray();
Reference < XInputStream > xInputStream;
for ( sal_Int32 i = 0 ; i < nLength; i++)
for (sal_Int32 i = 0 ; i < nLength; i++)
{
if ( pValue[i].Name == "TypeName" )
if (pValue[i].Name == "TypeName")
location=i;
else if ( pValue[i].Name == "InputStream" )
else if (pValue[i].Name == "InputStream")
pValue[i].Value >>= xInputStream;
}
if (!xInputStream.is())
return OUString();
WPXSvInputStream input( xInputStream );
WPXSvInputStream input(xInputStream);
if ( doDetectFormat( input, sTypeName ) )
if (doDetectFormat(input, sTypeName))
{
assert (!sTypeName.isEmpty());
assert(!sTypeName.isEmpty());
if ( location == nLength )
if (location == nLength)
{
Descriptor.realloc(nLength+1);
Descriptor[location].Name = "TypeName";
......@@ -152,18 +152,18 @@ throw( com::sun::star::uno::RuntimeException, std::exception )
// XInitialization
void SAL_CALL ImportFilterImpl::initialize( const Sequence< Any >& aArguments )
void SAL_CALL ImportFilterImpl::initialize(const Sequence< Any > &aArguments)
throw (Exception, RuntimeException, std::exception)
{
Sequence < PropertyValue > aAnySeq;
sal_Int32 nLength = aArguments.getLength();
if ( nLength && ( aArguments[0] >>= aAnySeq ) )
if (nLength && (aArguments[0] >>= aAnySeq))
{
const PropertyValue *pValue = aAnySeq.getConstArray();
nLength = aAnySeq.getLength();
for ( sal_Int32 i = 0 ; i < nLength; i++)
for (sal_Int32 i = 0 ; i < nLength; i++)
{
if ( pValue[i].Name == "Type" )
if (pValue[i].Name == "Type")
{
pValue[i].Value >>= msFilterName;
break;
......@@ -172,7 +172,7 @@ throw (Exception, RuntimeException, std::exception)
}
}
void ImportFilterImpl::doRegisterHandlers( OdsGenerator & )
void ImportFilterImpl::doRegisterHandlers(OdsGenerator &)
{
}
......
......@@ -20,24 +20,34 @@
#include <cppuhelper/implbase1.hxx>
#include <cppuhelper/implbase4.hxx>
namespace com { namespace sun { namespace star {
namespace com
{
namespace sun
{
namespace star
{
namespace beans
{
struct PropertyValue;
struct PropertyValue;
}
namespace lang
{
class XComponent;
class XComponent;
}
namespace uno
{
class XComponentContext;
class XComponentContext;
}
namespace xml
{
namespace sax
{
class XDocumentHandler;
}
}
}
namespace xml { namespace sax {
class XDocumentHandler;
}
}
} } }
class OdsGenerator;
......@@ -58,31 +68,31 @@ class ImportFilterImpl : public cppu::WeakImplHelper4
>
{
public:
ImportFilterImpl( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext );
ImportFilterImpl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext);
virtual ~ImportFilterImpl();
// XFilter
virtual sal_Bool SAL_CALL filter( const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aDescriptor )
virtual sal_Bool SAL_CALL filter(const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue > &aDescriptor)
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual void SAL_CALL cancel( )
virtual void SAL_CALL cancel()
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XImporter
virtual void SAL_CALL setTargetDocument( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent >& xDoc )
virtual void SAL_CALL setTargetDocument(const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XComponent > &xDoc)
throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
//XExtendedFilterDetection
virtual OUString SAL_CALL detect( com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue >& Descriptor )
throw( com::sun::star::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
virtual OUString SAL_CALL detect(com::sun::star::uno::Sequence< com::sun::star::beans::PropertyValue > &Descriptor)
throw(com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XInitialization
virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArguments )
virtual void SAL_CALL initialize(const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &aArguments)
throw (::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private:
virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) = 0;
virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator ) = 0;
virtual void doRegisterHandlers( OdsGenerator &rGenerator );
virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) = 0;
virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator) = 0;
virtual void doRegisterHandlers(OdsGenerator &rGenerator);
private:
::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > mxContext;
......
......@@ -24,12 +24,12 @@ using com::sun::star::uno::Exception;
using com::sun::star::uno::RuntimeException;
using com::sun::star::uno::XComponentContext;
bool MSWorksCalcImportFilter::doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator )
bool MSWorksCalcImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator)
{
return libwps::WPS_OK == libwps::WPSDocument::parse(&rInput, &rGenerator);
}
bool MSWorksCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName )
bool MSWorksCalcImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName)
{
libwps::WPSKind kind = libwps::WPS_TEXT;
const libwps::WPSConfidence confidence = libwps::WPSDocument::isFileFormatSupported(&rInput, kind);
......@@ -43,17 +43,17 @@ bool MSWorksCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInpu
return false;
}
void MSWorksCalcImportFilter::doRegisterHandlers( OdsGenerator & )
void MSWorksCalcImportFilter::doRegisterHandlers(OdsGenerator &)
{
}
OUString MSWorksCalcImportFilter_getImplementationName ()
OUString MSWorksCalcImportFilter_getImplementationName()
throw (RuntimeException)
{
return OUString ( "com.sun.star.comp.Calc.MSWorksCalcImportFilter" );
return OUString("com.sun.star.comp.Calc.MSWorksCalcImportFilter");
}
Sequence< OUString > SAL_CALL MSWorksCalcImportFilter_getSupportedServiceNames( )
Sequence< OUString > SAL_CALL MSWorksCalcImportFilter_getSupportedServiceNames()
throw (RuntimeException)
{
Sequence < OUString > aRet(2);
......@@ -65,24 +65,24 @@ throw (RuntimeException)
#undef SERVICE_NAME2
#undef SERVICE_NAME1
Reference< XInterface > SAL_CALL MSWorksCalcImportFilter_createInstance( const Reference< XComponentContext > & rContext)
throw( Exception )
Reference< XInterface > SAL_CALL MSWorksCalcImportFilter_createInstance(const Reference< XComponentContext > &rContext)
throw(Exception)
{
return (cppu::OWeakObject *) new MSWorksCalcImportFilter( rContext );
return (cppu::OWeakObject *) new MSWorksCalcImportFilter(rContext);
}
// XServiceInfo
OUString SAL_CALL MSWorksCalcImportFilter::getImplementationName( )
OUString SAL_CALL MSWorksCalcImportFilter::getImplementationName()
throw (RuntimeException, std::exception)
{
return MSWorksCalcImportFilter_getImplementationName();
}
sal_Bool SAL_CALL MSWorksCalcImportFilter::supportsService( const OUString &rServiceName )
sal_Bool SAL_CALL MSWorksCalcImportFilter::supportsService(const OUString &rServiceName)
throw (RuntimeException, std::exception)
{
return cppu::supportsService( this, rServiceName );
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL MSWorksCalcImportFilter::getSupportedServiceNames( )
Sequence< OUString > SAL_CALL MSWorksCalcImportFilter::getSupportedServiceNames()
throw (RuntimeException, std::exception)
{
return MSWorksCalcImportFilter_getSupportedServiceNames();
......
......@@ -21,32 +21,32 @@
class MSWorksCalcImportFilter : public writerperfect::calc::ImportFilterBase
{
public:
MSWorksCalcImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext )
: writerperfect::calc::ImportFilterBase( rxContext ) {}
MSWorksCalcImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
: writerperfect::calc::ImportFilterBase(rxContext) {}
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( )
virtual OUString SAL_CALL getImplementationName()
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual sal_Bool SAL_CALL supportsService( const OUString &ServiceName )
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName)
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private:
virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) SAL_OVERRIDE;
virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator ) SAL_OVERRIDE;
virtual void doRegisterHandlers( OdsGenerator &rGenerator ) SAL_OVERRIDE;
virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator) SAL_OVERRIDE;
virtual void doRegisterHandlers(OdsGenerator &rGenerator) SAL_OVERRIDE;
};
OUString MSWorksCalcImportFilter_getImplementationName()
throw ( ::com::sun::star::uno::RuntimeException );
throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Sequence< OUString > SAL_CALL MSWorksCalcImportFilter_getSupportedServiceNames( )
throw ( ::com::sun::star::uno::RuntimeException );
::com::sun::star::uno::Sequence< OUString > SAL_CALL MSWorksCalcImportFilter_getSupportedServiceNames()
throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
SAL_CALL MSWorksCalcImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > & rContext)
throw ( ::com::sun::star::uno::Exception );
SAL_CALL MSWorksCalcImportFilter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rContext)
throw (::com::sun::star::uno::Exception);
#endif
......
......@@ -39,12 +39,12 @@ static bool handleEmbeddedMWAWSpreadsheetObject(const librevenge::RVNGBinaryData
return MWAWDocument::decodeSpreadsheet(data, &exporter);
}
bool MWAWCalcImportFilter::doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator )
bool MWAWCalcImportFilter::doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator)
{
return MWAWDocument::MWAW_R_OK == MWAWDocument::parse(&rInput, &rGenerator);
}
bool MWAWCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName )
bool MWAWCalcImportFilter::doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName)
{
rTypeName = "";
......@@ -54,7 +54,7 @@ bool MWAWCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput,
if (confidence == MWAWDocument::MWAW_C_EXCELLENT)
{
if ( docKind == MWAWDocument::MWAW_K_SPREADSHEET || docKind == MWAWDocument::MWAW_K_DATABASE )
if (docKind == MWAWDocument::MWAW_K_SPREADSHEET || docKind == MWAWDocument::MWAW_K_DATABASE)
{
switch (docType)
{
......@@ -143,19 +143,19 @@ bool MWAWCalcImportFilter::doDetectFormat( librevenge::RVNGInputStream &rInput,
return !rTypeName.isEmpty();
}
void MWAWCalcImportFilter::doRegisterHandlers( OdsGenerator &rGenerator )
void MWAWCalcImportFilter::doRegisterHandlers(OdsGenerator &rGenerator)
{
rGenerator.registerEmbeddedObjectHandler("image/mwaw-odg", &handleEmbeddedMWAWGraphicObject);
rGenerator.registerEmbeddedObjectHandler("image/mwaw-ods", &handleEmbeddedMWAWSpreadsheetObject);
}
OUString MWAWCalcImportFilter_getImplementationName ()
OUString MWAWCalcImportFilter_getImplementationName()
throw (RuntimeException)
{
return OUString ( "com.sun.star.comp.Calc.MWAWCalcImportFilter" );
return OUString("com.sun.star.comp.Calc.MWAWCalcImportFilter");
}
Sequence< OUString > SAL_CALL MWAWCalcImportFilter_getSupportedServiceNames( )
Sequence< OUString > SAL_CALL MWAWCalcImportFilter_getSupportedServiceNames()
throw (RuntimeException)
{
Sequence < OUString > aRet(2);
......@@ -165,24 +165,24 @@ throw (RuntimeException)
return aRet;
}
Reference< XInterface > SAL_CALL MWAWCalcImportFilter_createInstance( const Reference< XComponentContext > &rContext)
throw( Exception )
Reference< XInterface > SAL_CALL MWAWCalcImportFilter_createInstance(const Reference< XComponentContext > &rContext)
throw(Exception)
{
return (cppu::OWeakObject *) new MWAWCalcImportFilter( rContext );
return (cppu::OWeakObject *) new MWAWCalcImportFilter(rContext);
}
// XServiceInfo
OUString SAL_CALL MWAWCalcImportFilter::getImplementationName( )
OUString SAL_CALL MWAWCalcImportFilter::getImplementationName()
throw (RuntimeException, std::exception)
{
return MWAWCalcImportFilter_getImplementationName();
}
sal_Bool SAL_CALL MWAWCalcImportFilter::supportsService( const OUString &rServiceName )
sal_Bool SAL_CALL MWAWCalcImportFilter::supportsService(const OUString &rServiceName)
throw (RuntimeException, std::exception)
{
return cppu::supportsService( this, rServiceName );
return cppu::supportsService(this, rServiceName);
}
Sequence< OUString > SAL_CALL MWAWCalcImportFilter::getSupportedServiceNames( )
Sequence< OUString > SAL_CALL MWAWCalcImportFilter::getSupportedServiceNames()
throw (RuntimeException, std::exception)
{
return MWAWCalcImportFilter_getSupportedServiceNames();
......
......@@ -21,32 +21,32 @@
class MWAWCalcImportFilter : public writerperfect::calc::ImportFilterBase
{
public:
MWAWCalcImportFilter( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext )
: writerperfect::calc::ImportFilterBase( rxContext ) {}
MWAWCalcImportFilter(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rxContext)
: writerperfect::calc::ImportFilterBase(rxContext) {}
// XServiceInfo
virtual OUString SAL_CALL getImplementationName( )
virtual OUString SAL_CALL getImplementationName()
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual sal_Bool SAL_CALL supportsService( const OUString &ServiceName )
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName)
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( )
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames()
throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
private:
virtual bool doDetectFormat( librevenge::RVNGInputStream &rInput, OUString &rTypeName ) SAL_OVERRIDE;
virtual bool doImportDocument( librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator ) SAL_OVERRIDE;
virtual void doRegisterHandlers( OdsGenerator &rGenerator ) SAL_OVERRIDE;
virtual bool doDetectFormat(librevenge::RVNGInputStream &rInput, OUString &rTypeName) SAL_OVERRIDE;
virtual bool doImportDocument(librevenge::RVNGInputStream &rInput, librevenge::RVNGSpreadsheetInterface &rGenerator) SAL_OVERRIDE;
virtual void doRegisterHandlers(OdsGenerator &rGenerator) SAL_OVERRIDE;
};
OUString MWAWCalcImportFilter_getImplementationName()
throw ( ::com::sun::star::uno::RuntimeException );
throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Sequence< OUString > SAL_CALL MWAWCalcImportFilter_getSupportedServiceNames( )
throw ( ::com::sun::star::uno::RuntimeException );
::com::sun::star::uno::Sequence< OUString > SAL_CALL MWAWCalcImportFilter_getSupportedServiceNames()
throw (::com::sun::star::uno::RuntimeException);
::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >
SAL_CALL MWAWCalcImportFilter_createInstance( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rContext)
throw ( ::com::sun::star::uno::Exception );
SAL_CALL MWAWCalcImportFilter_createInstance(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > &rContext)
throw (::com::sun::star::uno::Exception);
#endif
......
......@@ -32,24 +32,31 @@
#include "MSWorksCalcImportFilter.hxx"
#include "MWAWCalcImportFilter.hxx"
namespace {
namespace
{
static cppu::ImplementationEntry const services[] = {
{ &MSWorksCalcImportFilter_createInstance, &MSWorksCalcImportFilter_getImplementationName,
&MSWorksCalcImportFilter_getSupportedServiceNames,
&cppu::createSingleComponentFactory, 0, 0 },
{ &MWAWCalcImportFilter_createInstance, &MWAWCalcImportFilter_getImplementationName,
&MWAWCalcImportFilter_getSupportedServiceNames,
&cppu::createSingleComponentFactory, 0, 0 },
{ 0, 0, 0, 0, 0, 0 } };
static cppu::ImplementationEntry const services[] =
{
{
&MSWorksCalcImportFilter_createInstance, &MSWorksCalcImportFilter_getImplementationName,
&MSWorksCalcImportFilter_getSupportedServiceNames,
&cppu::createSingleComponentFactory, 0, 0