[Libreoffice-commits] core.git: oox/inc oox/source

Stephan Bergmann sbergman at redhat.com
Mon Apr 14 05:15:41 PDT 2014


 oox/inc/services.hxx                      |   45 +++++++++++++++++++
 oox/source/core/contexthandler2.cxx       |    1 
 oox/source/core/fasttokenhandler.cxx      |    2 
 oox/source/core/filterbase.cxx            |    8 +--
 oox/source/core/filterdetect.cxx          |    2 
 oox/source/core/services.cxx              |   24 ----------
 oox/source/docprop/ooxmldocpropimport.cxx |    3 -
 oox/source/export/chartexport.cxx         |    2 
 oox/source/ole/vbamodule.cxx              |   68 ------------------------------
 oox/source/ppt/dgmimport.cxx              |    6 +-
 oox/source/ppt/dgmlayout.cxx              |    6 +-
 oox/source/ppt/pptimport.cxx              |    6 +-
 oox/source/shape/ShapeContextHandler.cxx  |    3 -
 13 files changed, 71 insertions(+), 105 deletions(-)

New commits:
commit e13022a825917ad9bf1d2b16af6b88a4fa97b1cd
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Apr 14 14:15:12 2014 +0200

    Clean up function declarations and some unused functions
    
    Change-Id: I2f5b3144e8d4ce3e497a030aa102985c3bc81645

diff --git a/oox/inc/services.hxx b/oox/inc/services.hxx
new file mode 100644
index 0000000..9090a5b
--- /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 4e5bf80..0d74d66 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 5bf6102..9764ff3 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 1b45ea2..6f2b1ae 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 4a2dc97..fb2d14d 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 d655b3d..0b8fee0 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 51bd6d5..4253498 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 822eb90..79e3dba 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 abb1f0a..465d965 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 602fb72..7ff543c 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 3fec836..1fbafdc 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 7f32e6e..4c0a8e7 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 57eb98b..4d9b91a 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) );
 }


More information about the Libreoffice-commits mailing list