diff options
author | Matúš Kukan <matus.kukan@gmail.com> | 2012-01-11 20:44:49 +0100 |
---|---|---|
committer | Matúš Kukan <matus.kukan@gmail.com> | 2012-01-11 20:44:49 +0100 |
commit | 0482c914c7480dcc3bcf739e19d8372ea3fad35c (patch) | |
tree | 38d8954a13f9d5b838d70667bccf29acd6a3b724 /extensions/source | |
parent | 134803653fecd62f64bb063df6b48713626e94b7 (diff) |
extensions: remove unused xmx library
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/xmlextract/xmx.component | 34 | ||||
-rw-r--r-- | extensions/source/xmlextract/xmxcom.hxx | 62 | ||||
-rw-r--r-- | extensions/source/xmlextract/xmxtrct.cxx | 198 | ||||
-rw-r--r-- | extensions/source/xmlextract/xmxtrct.hxx | 57 | ||||
-rw-r--r-- | extensions/source/xmlextract/xmxuno.cxx | 73 |
5 files changed, 0 insertions, 424 deletions
diff --git a/extensions/source/xmlextract/xmx.component b/extensions/source/xmlextract/xmx.component deleted file mode 100644 index 456ff33b6c06..000000000000 --- a/extensions/source/xmlextract/xmx.component +++ /dev/null @@ -1,34 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!--********************************************************************** -* -* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -* -* Copyright 2000, 2010 Oracle and/or its affiliates. -* -* OpenOffice.org - a multi-platform office productivity suite -* -* This file is part of OpenOffice.org. -* -* OpenOffice.org is free software: you can redistribute it and/or modify -* it under the terms of the GNU Lesser General Public License version 3 -* only, as published by the Free Software Foundation. -* -* OpenOffice.org is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU Lesser General Public License version 3 for more details -* (a copy is included in the LICENSE file that accompanied this code). -* -* You should have received a copy of the GNU Lesser General Public License -* version 3 along with OpenOffice.org. If not, see -* <http://www.openoffice.org/license.html> -* for a copy of the LGPLv3 License. -* -**********************************************************************--> - -<component loader="com.sun.star.loader.SharedLibrary" - xmlns="http://openoffice.org/2010/uno-components"> - <implementation name="com.sun.star.comp.io.XMLExtractor"> - <service name="com.sun.star.io.XMLExtractor"/> - </implementation> -</component> diff --git a/extensions/source/xmlextract/xmxcom.hxx b/extensions/source/xmlextract/xmxcom.hxx deleted file mode 100644 index da634b2bdce2..000000000000 --- a/extensions/source/xmlextract/xmxcom.hxx +++ /dev/null @@ -1,62 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _XMXCOM_HXX -#define _XMXCOM_HXX - -#include <cppuhelper/weak.hxx> -#include <rtl/ustring.hxx> -#include <tools/stream.hxx> -#include <cppuhelper/implbase1.hxx> - -#include <com/sun/star/uno/Reference.h> -#include <com/sun/star/uno/RuntimeException.hpp> -#include <com/sun/star/lang/XMultiServiceFactory.hpp> -#include <com/sun/star/registry/XRegistryKey.hpp> -#include <com/sun/star/lang/XComponent.hpp> -#include <com/sun/star/io/XInputStream.hpp> -#include <com/sun/star/io/XXMLExtractor.hpp> - -// ----------------------------------------------------------------------------- - -#define NMSP_CPPU ::cppu -#define NMSP_RTL ::rtl -#define NMSP_UNO ::com::sun::star::uno -#define NMSP_LANG ::com::sun::star::lang -#define NMSP_IO ::com::sun::star::io -#define NMSP_REGISTRY ::com::sun::star::registry - - -#define REF( _def_Obj ) NMSP_UNO::Reference< _def_Obj > -#define SEQ( _def_Obj ) NMSP_UNO::Sequence< _def_Obj > -#define ANY NMSP_UNO::Any -#define B2UCONST( _def_pChar ) (NMSP_RTL::OUString(RTL_CONSTASCII_USTRINGPARAM(_def_pChar ))) - -#endif // _XMXCOM_HXX - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/xmlextract/xmxtrct.cxx b/extensions/source/xmlextract/xmxtrct.cxx deleted file mode 100644 index 62abbea74899..000000000000 --- a/extensions/source/xmlextract/xmxtrct.cxx +++ /dev/null @@ -1,198 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "xmxtrct.hxx" - -#include <rtl/memory.h> -#include <tools/zcodec.hxx> -#include <unotools/streamhelper.hxx> -#include <sot/storage.hxx> - -// ---------------- -// - XMXLockBytes - -// ---------------- - -class XMXLockBytes : public SvLockBytes -{ - REF( NMSP_IO::XInputStream ) mxIStm; - SEQ( sal_Int8 ) maSeq; - - XMXLockBytes(); - -public: - - XMXLockBytes( const REF( NMSP_IO::XInputStream )& rxIStm ); - virtual ~XMXLockBytes(); - - virtual ErrCode ReadAt( sal_Size nPos, void* pBuffer, sal_Size nCount, sal_Size* pRead ) const; - virtual ErrCode WriteAt( sal_Size nPos, const void* pBuffer, sal_Size nCount, sal_Size* pWritten ); - virtual ErrCode Flush() const; - virtual ErrCode SetSize( sal_Size nSize ); - virtual ErrCode Stat( SvLockBytesStat*, SvLockBytesStatFlag ) const; -}; - -// ------------------------------------------------------------------------ - -XMXLockBytes::XMXLockBytes( const REF( NMSP_IO::XInputStream )& rxIStm ) : - mxIStm( rxIStm ) -{ - if( mxIStm.is() ) - { - const sal_uInt32 nBytesToRead = 65535; - sal_uInt32 nRead; - - do - { - SEQ( sal_Int8 ) aReadSeq; - - nRead = mxIStm->readSomeBytes( aReadSeq, nBytesToRead ); - - if( nRead ) - { - const sal_uInt32 nOldLength = maSeq.getLength(); - maSeq.realloc( nOldLength + nRead ); - rtl_copyMemory( maSeq.getArray() + nOldLength, aReadSeq.getConstArray(), aReadSeq.getLength() ); - } - } - while( nBytesToRead == nRead ); - } -} - -// ------------------------------------------------------------------------ - -XMXLockBytes::~XMXLockBytes() -{ -} - -// ------------------------------------------------------------------------ - -ErrCode XMXLockBytes::ReadAt( sal_Size nPos, void* pBuffer, sal_Size nCount, sal_Size* pRead ) const -{ - const sal_Size nSeqLen = maSeq.getLength(); - ErrCode nErr = ERRCODE_NONE; - - if( nPos < nSeqLen ) - { - if( ( nPos + nCount ) > nSeqLen ) - nCount = nSeqLen - nPos; - - rtl_copyMemory( pBuffer, maSeq.getConstArray() + nPos, nCount ); - *pRead = nCount; - } - else - *pRead = 0UL; - - return nErr; -} - -// ------------------------------------------------------------------------ - -ErrCode XMXLockBytes::WriteAt( sal_Size /*nPos*/, const void* /*pBuffer*/, sal_Size /*nCount*/, sal_Size* /*pWritten*/ ) -{ - return ERRCODE_IO_CANTWRITE; -} - -// ------------------------------------------------------------------------ - -ErrCode XMXLockBytes::Flush() const -{ - return ERRCODE_NONE; -} - -// ------------------------------------------------------------------------ - -ErrCode XMXLockBytes::SetSize( sal_Size /*nSize*/ ) -{ - return ERRCODE_IO_CANTWRITE; -} - -// ------------------------------------------------------------------------ - -ErrCode XMXLockBytes::Stat( SvLockBytesStat* pStat, SvLockBytesStatFlag /*eFlag*/ ) const -{ - pStat->nSize = maSeq.getLength(); - return ERRCODE_NONE; -} - -// ---------------- -// - XMLExtractor - -// ---------------- - -XMLExtractor::XMLExtractor( const REF( NMSP_LANG::XMultiServiceFactory )& rxMgr ) : - mxFact( rxMgr ) -{ -} - -// ----------------------------------------------------------------------------- - -XMLExtractor::~XMLExtractor() -{ -} - -// ----------------------------------------------------------------------------- - -REF( NMSP_IO::XInputStream ) SAL_CALL XMLExtractor::extract( const REF( NMSP_IO::XInputStream )& rxIStm ) throw( NMSP_UNO::RuntimeException ) -{ - REF( NMSP_IO::XInputStream ) xRet; - - if( rxIStm.is() ) - { - SvStream aIStm( new XMXLockBytes( rxIStm ) ); - SvStorageRef aStorage( new SvStorage( aIStm ) ); - String aStmName; - const String aFormat1( String::CreateFromAscii( "XMLFormat" ) ); - const String aFormat2( String::CreateFromAscii( "XMLFormat2" ) ); - - if( aStorage->IsContained( aFormat2 ) ) - aStmName = aFormat2; - else if( aStorage->IsContained( aFormat1 ) ) - aStmName = aFormat1; - - if( !aStorage->GetError() && aStmName.Len() && aStorage->IsStream( aStmName ) ) - { - SvStorageStreamRef xStream( aStorage->OpenSotStream( aStmName ) ); - - if( xStream.Is() ) - { - SvMemoryStream* pMemStm = new SvMemoryStream( 65535, 65535 ); - ZCodec aCodec; - - aCodec.BeginCompression( ZCODEC_BEST_COMPRESSION ); - aCodec.Decompress( *xStream, *pMemStm ); - aCodec.EndCompression(); - - xRet = new ::utl::OInputStreamHelper( new SvLockBytes( pMemStm, sal_True ), 65535 ); - } - } - } - - return xRet; -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/xmlextract/xmxtrct.hxx b/extensions/source/xmlextract/xmxtrct.hxx deleted file mode 100644 index 264609b8d6a7..000000000000 --- a/extensions/source/xmlextract/xmxtrct.hxx +++ /dev/null @@ -1,57 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _XMXTRCT_HXX -#define _XMXTRCT_HXX - -#include "xmxcom.hxx" - -// ---------------- -// - XMLExtractor - -// ---------------- - -class XMLExtractor : public ::cppu::WeakImplHelper1< NMSP_IO::XXMLExtractor > -{ -private: - - REF( NMSP_LANG::XMultiServiceFactory ) mxFact; - - XMLExtractor(); - -public: - - XMLExtractor( const REF( NMSP_LANG::XMultiServiceFactory )& rxMgr ); - virtual ~XMLExtractor(); - - // XXMLExtractor - virtual REF( NMSP_IO::XInputStream ) SAL_CALL extract( const REF( NMSP_IO::XInputStream )& rxIStm ) throw( NMSP_UNO::RuntimeException ); -}; - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/extensions/source/xmlextract/xmxuno.cxx b/extensions/source/xmlextract/xmxuno.cxx deleted file mode 100644 index e399cd485c83..000000000000 --- a/extensions/source/xmlextract/xmxuno.cxx +++ /dev/null @@ -1,73 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2000, 2010 Oracle and/or its affiliates. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - - -#include "xmxcom.hxx" -#include "xmxtrct.hxx" -#include <osl/diagnose.h> -#include <cppuhelper/factory.hxx> -#include <uno/mapping.hxx> - -// ------------------- -// - factory methods - -// ------------------- - -static REF( NMSP_UNO::XInterface ) SAL_CALL create_XMLExtractor( const REF( NMSP_LANG::XMultiServiceFactory )& rxFact ) -{ - return REF( NMSP_UNO::XInterface )( *new XMLExtractor( rxFact ) ); -} - -extern "C" -{ -SAL_DLLPUBLIC_EXPORT void * SAL_CALL component_getFactory( - const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ ) -{ - void * pRet = 0; - - if (rtl_str_compare( pImplName, "com.sun.star.comp.io.XMLExtractor" ) == 0) - { - NMSP_RTL::OUString aServiceName( B2UCONST( "com.sum.star.io.XMLExtractor" ) ); - - REF( NMSP_LANG::XSingleServiceFactory ) xFactory( NMSP_CPPU::createSingleFactory( - reinterpret_cast< NMSP_LANG::XMultiServiceFactory * >( pServiceManager ), - NMSP_RTL::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.io.XMLExtractor") ), - create_XMLExtractor, - SEQ( NMSP_RTL::OUString )( &aServiceName, 1 ) ) ); - - if (xFactory.is()) - { - xFactory->acquire(); - pRet = xFactory.get(); - } - } - - return pRet; -} -} - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |