summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-04-14 14:15:12 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-04-14 14:15:12 +0200
commite13022a825917ad9bf1d2b16af6b88a4fa97b1cd (patch)
treeafbfe96a9f49a518a1e27751d1dff6d6f71571cd /oox
parent6a9271ff833798927d6f5d1b64f836933c87ff73 (diff)
Clean up function declarations and some unused functions
Change-Id: I2f5b3144e8d4ce3e497a030aa102985c3bc81645
Diffstat (limited to 'oox')
-rw-r--r--oox/inc/services.hxx45
-rw-r--r--oox/source/core/contexthandler2.cxx1
-rw-r--r--oox/source/core/fasttokenhandler.cxx2
-rw-r--r--oox/source/core/filterbase.cxx8
-rw-r--r--oox/source/core/filterdetect.cxx2
-rw-r--r--oox/source/core/services.cxx24
-rw-r--r--oox/source/docprop/ooxmldocpropimport.cxx3
-rw-r--r--oox/source/export/chartexport.cxx2
-rw-r--r--oox/source/ole/vbamodule.cxx68
-rw-r--r--oox/source/ppt/dgmimport.cxx6
-rw-r--r--oox/source/ppt/dgmlayout.cxx6
-rw-r--r--oox/source/ppt/pptimport.cxx6
-rw-r--r--oox/source/shape/ShapeContextHandler.cxx3
13 files changed, 71 insertions, 105 deletions
diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
new file mode 100644
index 000000000000..9090a5bc890d
--- /dev/null
+++ b/oox/inc/services.hxx
@@ -0,0 +1,45 @@
+/* -*- 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: */
diff --git a/oox/source/core/contexthandler2.cxx b/oox/source/core/contexthandler2.cxx
index 4e5bf80d7594..0d74d66a8519 100644
--- a/oox/source/core/contexthandler2.cxx
+++ b/oox/source/core/contexthandler2.cxx
@@ -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) {}
};
diff --git a/oox/source/core/fasttokenhandler.cxx b/oox/source/core/fasttokenhandler.cxx
index 5bf6102d8405..9764ff3de4ff 100644
--- a/oox/source/core/fasttokenhandler.cxx
+++ b/oox/source/core/fasttokenhandler.cxx
@@ -24,6 +24,8 @@
#include "oox/token/tokenmap.hxx"
#include <cppuhelper/supportsservice.hxx>
+#include <services.hxx>
+
namespace oox {
namespace core {
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx
index 1b45ea282597..6f2b1ae117cf 100644
--- a/oox/source/core/filterbase.cxx
+++ b/oox/source/core/filterbase.cxx
@@ -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;
};
diff --git a/oox/source/core/filterdetect.cxx b/oox/source/core/filterdetect.cxx
index 4a2dc970602d..fb2d14d45d0d 100644
--- a/oox/source/core/filterdetect.cxx
+++ b/oox/source/core/filterdetect.cxx
@@ -34,6 +34,8 @@
#include <com/sun/star/uri/UriReferenceFactory.hpp>
+#include <services.hxx>
+
namespace oox {
namespace core {
diff --git a/oox/source/core/services.cxx b/oox/source/core/services.cxx
index d655b3dd39e4..0b8fee074f14 100644
--- a/oox/source/core/services.cxx
+++ b/oox/source/core/services.cxx
@@ -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 {
diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx
index 51bd6d5c3925..4253498f51d6 100644
--- a/oox/source/docprop/ooxmldocpropimport.cxx
+++ b/oox/source/docprop/ooxmldocpropimport.cxx
@@ -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 ) );
}
diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx
index 822eb9080d4e..79e3dbaeb1f4 100644
--- a/oox/source/export/chartexport.cxx
+++ b/oox/source/export/chartexport.cxx
@@ -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 >
diff --git a/oox/source/ole/vbamodule.cxx b/oox/source/ole/vbamodule.cxx
index abb1f0abaac7..465d9652cffc 100644
--- a/oox/source/ole/vbamodule.cxx
+++ b/oox/source/ole/vbamodule.cxx
@@ -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 ) :
diff --git a/oox/source/ppt/dgmimport.cxx b/oox/source/ppt/dgmimport.cxx
index 602fb72fca32..7ff543cfbbb7 100644
--- a/oox/source/ppt/dgmimport.cxx
+++ b/oox/source/ppt/dgmimport.cxx
@@ -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 );
diff --git a/oox/source/ppt/dgmlayout.cxx b/oox/source/ppt/dgmlayout.cxx
index 3fec83658de9..1fbafdc21520 100644
--- a/oox/source/ppt/dgmlayout.cxx
+++ b/oox/source/ppt/dgmlayout.cxx
@@ -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 );
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 7f32e6e95fe4..4c0a8e7e1275 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -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";
diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx
index 57eb98bbdcbd..4d9b91ad69b2 100644
--- a/oox/source/shape/ShapeContextHandler.cxx
+++ b/oox/source/shape/ShapeContextHandler.cxx
@@ -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) );
}