Kaydet (Commit) e13022a8 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Clean up function declarations and some unused functions

Change-Id: I2f5b3144e8d4ce3e497a030aa102985c3bc81645
üst 6a9271ff
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef INCLUDED_OOX_SOURCE_CORE_SERVICES_HXX
#define INCLUDED_OOX_SOURCE_CORE_SERVICES_HXX
#include <sal/config.h>
#define DECLARE_FUNCTIONS( className ) \
extern OUString SAL_CALL className##_getImplementationName(); \
extern css::uno::Sequence< OUString > SAL_CALL className##_getSupportedServiceNames(); \
extern css::uno::Reference< css::uno::XInterface > SAL_CALL className##_createInstance( \
const css::uno::Reference< css::uno::XComponentContext >& rxContext ) throw (css::uno::Exception)
namespace oox {
namespace core { DECLARE_FUNCTIONS( FastTokenHandler ); }
namespace core { DECLARE_FUNCTIONS( FilterDetect ); }
namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport ); }
namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); }
namespace ppt { DECLARE_FUNCTIONS( QuickDiagrammingImport ); }
namespace ppt { DECLARE_FUNCTIONS( QuickDiagrammingLayout ); }
namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); }
}
#undef DECLARE_FUNCTIONS
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -39,7 +39,6 @@ struct ElementInfo
bool mbTrimSpaces; /// True = trims leading/trailing spaces from text data.
inline explicit ElementInfo() : maChars( 0), mnElement( XML_TOKEN_INVALID ), mbTrimSpaces( false ) {}
ElementInfo( sal_Int32 nElement ) : maChars( 0 ), mnElement( nElement ), mbTrimSpaces(false) {}
};
......
......@@ -24,6 +24,8 @@
#include "oox/token/tokenmap.hxx"
#include <cppuhelper/supportsservice.hxx>
#include <services.hxx>
namespace oox {
namespace core {
......
......@@ -17,6 +17,9 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <sal/config.h>
#include <boost/noncopyable.hpp>
#include <com/sun/star/container/XNameAccess.hpp>
#include <com/sun/star/drawing/XShape.hpp>
#include <com/sun/star/frame/XModel.hpp>
......@@ -68,7 +71,7 @@ struct UrlPool
struct StaticUrlPool : public ::rtl::Static< UrlPool, StaticUrlPool > {};
/** This guard prevents recursive loading/saving of the same document. */
class DocumentOpenedGuard
class DocumentOpenedGuard: private boost::noncopyable
{
public:
explicit DocumentOpenedGuard( const OUString& rUrl );
......@@ -77,9 +80,6 @@ public:
inline bool isValid() const { return mbValid; }
private:
DocumentOpenedGuard( const DocumentOpenedGuard& );
DocumentOpenedGuard& operator=( const DocumentOpenedGuard& );
OUString maUrl;
bool mbValid;
};
......
......@@ -34,6 +34,8 @@
#include <com/sun/star/uri/UriReferenceFactory.hpp>
#include <services.hxx>
namespace oox {
namespace core {
......
......@@ -19,29 +19,9 @@
#include <cppuhelper/implementationentry.hxx>
using namespace ::com::sun::star::uno;
// Declare static functions providing service information =====================
#define DECLARE_FUNCTIONS( className ) \
extern OUString SAL_CALL className##_getImplementationName() throw(); \
extern Sequence< OUString > SAL_CALL className##_getSupportedServiceNames() throw(); \
extern Reference< XInterface > SAL_CALL className##_createInstance( \
const Reference< XComponentContext >& rxContext ) throw (Exception)
namespace oox {
namespace core { DECLARE_FUNCTIONS( FastTokenHandler ); }
namespace core { DECLARE_FUNCTIONS( FilterDetect ); }
namespace docprop { DECLARE_FUNCTIONS( DocumentPropertiesImport ); }
namespace ppt { DECLARE_FUNCTIONS( PowerPointImport ); }
namespace ppt { DECLARE_FUNCTIONS( QuickDiagrammingImport ); }
namespace ppt { DECLARE_FUNCTIONS( QuickDiagrammingLayout ); }
namespace shape { DECLARE_FUNCTIONS( ShapeContextHandler ); }
}
#undef DECLARE_FUNCTIONS
#include <services.hxx>
using namespace ::com::sun::star::uno;
namespace {
......
......@@ -18,6 +18,7 @@
*/
#include "ooxmldocpropimport.hxx"
#include "services.hxx"
#include <vector>
#include <com/sun/star/embed/ElementModes.hpp>
......@@ -55,7 +56,7 @@ Sequence< OUString > SAL_CALL DocumentPropertiesImport_getSupportedServiceNames(
return aServices;
}
Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const Reference< XComponentContext >& rxContext ) SAL_THROW((Exception))
Reference< XInterface > SAL_CALL DocumentPropertiesImport_createInstance( const Reference< XComponentContext >& rxContext ) throw(Exception)
{
return static_cast< ::cppu::OWeakObject* >( new DocumentPropertiesImport( rxContext ) );
}
......
......@@ -110,8 +110,6 @@ using ::sax_fastparser::FSHelperPtr;
namespace cssc = com::sun::star::chart;
DBG(extern void dump_pset(Reference< XPropertySet > rXPropSet));
namespace oox { namespace drawingml {
class lcl_MatchesRole : public ::std::unary_function< Reference< chart2::data::XLabeledDataSequence >, bool >
......
......@@ -45,74 +45,6 @@ using namespace ::com::sun::star;
using ::com::sun::star::awt::KeyEvent;
typedef ::cppu::WeakImplHelper1< container::XIndexContainer > OleIdToNameContainer_BASE;
typedef boost::unordered_map< sal_Int32, OUString > ObjIdToName;
class OleIdToNameContainer : public OleIdToNameContainer_BASE
{
ObjIdToName ObjIdToNameHash;
::osl::Mutex m_aMutex;
bool hasByIndex( ::sal_Int32 Index )
{
::osl::MutexGuard aGuard( m_aMutex );
return ( ObjIdToNameHash.find( Index ) != ObjIdToNameHash.end() );
}
public:
OleIdToNameContainer() {}
// XIndexContainer Methods
virtual void SAL_CALL insertByIndex( ::sal_Int32 Index, const Any& Element ) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception) SAL_OVERRIDE
{
::osl::MutexGuard aGuard( m_aMutex );
OUString sOleName;
if ( !( Element >>= sOleName ) )
throw IllegalArgumentException();
ObjIdToNameHash[ Index ] = sOleName;
}
virtual void SAL_CALL removeByIndex( ::sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception) SAL_OVERRIDE
{
::osl::MutexGuard aGuard( m_aMutex );
if ( !hasByIndex( Index ) )
throw IndexOutOfBoundsException();
ObjIdToNameHash.erase( ObjIdToNameHash.find( Index ) );
}
// XIndexReplace Methods
virtual void SAL_CALL replaceByIndex( ::sal_Int32 Index, const Any& Element ) throw (IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception) SAL_OVERRIDE
{
::osl::MutexGuard aGuard( m_aMutex );
if ( !hasByIndex( Index ) )
throw IndexOutOfBoundsException();
OUString sOleName;
if ( !( Element >>= sOleName ) )
throw IllegalArgumentException();
ObjIdToNameHash[ Index ] = sOleName;
}
// XIndexAccess Methods
virtual ::sal_Int32 SAL_CALL getCount( ) throw (RuntimeException, std::exception) SAL_OVERRIDE
{
::osl::MutexGuard aGuard( m_aMutex );
return ObjIdToNameHash.size();
}
virtual Any SAL_CALL getByIndex( ::sal_Int32 Index ) throw (IndexOutOfBoundsException, WrappedTargetException, RuntimeException, std::exception) SAL_OVERRIDE
{
::osl::MutexGuard aGuard( m_aMutex );
if ( !hasByIndex( Index ) )
throw IndexOutOfBoundsException();
return makeAny( ObjIdToNameHash[ Index ] );
}
// XElementAccess Methods
virtual Type SAL_CALL getElementType( ) throw (RuntimeException, std::exception) SAL_OVERRIDE
{
return ::getCppuType( static_cast< const OUString* >( 0 ) );
}
virtual sal_Bool SAL_CALL hasElements( ) throw (RuntimeException, std::exception) SAL_OVERRIDE
{
::osl::MutexGuard aGuard( m_aMutex );
return ( getCount() > 0 );
}
};
VbaModule::VbaModule( const Reference< XComponentContext >& rxContext,
const Reference< frame::XModel >& rxDocModel,
const OUString& rName, rtl_TextEncoding eTextEnc, bool bExecutable ) :
......
......@@ -24,6 +24,8 @@
#include <com/sun/star/drawing/XShape.hpp>
#include <services.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
......@@ -31,12 +33,12 @@ using namespace oox::core;
namespace oox { namespace ppt {
OUString SAL_CALL QuickDiagrammingImport_getImplementationName() throw()
OUString SAL_CALL QuickDiagrammingImport_getImplementationName()
{
return OUString( "com.sun.star.comp.Impress.oox.QuickDiagrammingImport" );
}
uno::Sequence< OUString > SAL_CALL QuickDiagrammingImport_getSupportedServiceNames() throw()
uno::Sequence< OUString > SAL_CALL QuickDiagrammingImport_getSupportedServiceNames()
{
const OUString aServiceName = "com.sun.star.comp.ooxpptx.dgm.import";
const Sequence< OUString > aSeq( &aServiceName, 1 );
......
......@@ -29,6 +29,8 @@
#include <com/sun/star/xml/sax/XFastSAXSerializable.hpp>
#include <com/sun/star/container/XChild.hpp>
#include <services.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
......@@ -37,12 +39,12 @@ using namespace ::oox::drawingml;
namespace oox { namespace ppt {
OUString SAL_CALL QuickDiagrammingLayout_getImplementationName() throw()
OUString SAL_CALL QuickDiagrammingLayout_getImplementationName()
{
return OUString( "com.sun.star.comp.Impress.oox.QuickDiagrammingLayout" );
}
uno::Sequence< OUString > SAL_CALL QuickDiagrammingLayout_getSupportedServiceNames() throw()
uno::Sequence< OUString > SAL_CALL QuickDiagrammingLayout_getSupportedServiceNames()
{
const OUString aServiceName = "com.sun.star.comp.ooxpptx.dgm.layout";
const Sequence< OUString > aSeq( &aServiceName, 1 );
......
......@@ -27,6 +27,8 @@
#include "oox/helper/graphichelper.hxx"
#include "oox/ole/vbaproject.hxx"
#include <services.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::xml::sax;
......@@ -37,12 +39,12 @@ using ::com::sun::star::lang::XComponent;
namespace oox { namespace ppt {
OUString SAL_CALL PowerPointImport_getImplementationName() throw()
OUString SAL_CALL PowerPointImport_getImplementationName()
{
return OUString( "com.sun.star.comp.oox.ppt.PowerPointImport" );
}
uno::Sequence< OUString > SAL_CALL PowerPointImport_getSupportedServiceNames() throw()
uno::Sequence< OUString > SAL_CALL PowerPointImport_getSupportedServiceNames()
{
Sequence< OUString > aSeq( 2 );
aSeq[ 0 ] = "com.sun.star.document.ImportFilter";
......
......@@ -24,6 +24,7 @@
#include "LockedCanvasContext.hxx"
#include "WpsContext.hxx"
#include "WpgContext.hxx"
#include "services.hxx"
#include "oox/vml/vmldrawingfragment.hxx"
#include "oox/vml/vmlshape.hxx"
#include "oox/drawingml/themefragmenthandler.hxx"
......@@ -51,7 +52,7 @@ ShapeContextHandler_getSupportedServiceNames()
uno::Reference< uno::XInterface > SAL_CALL
ShapeContextHandler_createInstance( const uno::Reference< uno::XComponentContext > & context)
SAL_THROW((uno::Exception))
throw (uno::Exception)
{
return static_cast< ::cppu::OWeakObject* >( new ShapeContextHandler(context) );
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment