ooo-build r14825 - in trunk: . patches/dev300 patches/vba
- From: noelpwer svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r14825 - in trunk: . patches/dev300 patches/vba
- Date: Thu, 11 Dec 2008 13:13:15 +0000 (UTC)
Author: noelpwer
Date: Thu Dec 11 13:13:15 2008
New Revision: 14825
URL: http://svn.gnome.org/viewvc/ooo-build?rev=14825&view=rev
Log:
2008-12-11 Noel Power <noel power novell com>
* patches/dev300/apply: add patchfile below
* patches/vba/vba-servicemacros-rework.diff: some rework on the service
macros
Added:
trunk/patches/vba/vba-servicemacros-rework.diff
Modified:
trunk/ChangeLog
trunk/patches/dev300/apply
Modified: trunk/patches/dev300/apply
==============================================================================
--- trunk/patches/dev300/apply (original)
+++ trunk/patches/dev300/apply Thu Dec 11 13:13:15 2008
@@ -1703,6 +1703,8 @@
vba-xls-formula-parser.diff, n#422145, kohei
vba-fix-docmodule-import-crash.diff, n#447560
+vba-servicemacros-rework.diff
+
[ VBAObjects ]
# vba for word support
vba-word-support.diff, Fong
Added: trunk/patches/vba/vba-servicemacros-rework.diff
==============================================================================
--- (empty file)
+++ trunk/patches/vba/vba-servicemacros-rework.diff Thu Dec 11 13:13:15 2008
@@ -0,0 +1,251 @@
+diff --git comphelper/inc/comphelper/servicedecl.hxx comphelper/inc/comphelper/servicedecl.hxx
+index bbfb1c8..bd114be 100644
+--- comphelper/inc/comphelper/servicedecl.hxx
++++ comphelper/inc/comphelper/servicedecl.hxx
+@@ -169,21 +169,20 @@ template <bool> struct with_args;
+
+ /// @internal
+ namespace detail {
+-
+ template <typename ImplT>
+-class ServiceImpl
+- : public ::cppu::ImplInheritanceHelper1<ImplT, css::lang::XServiceInfo>,
++class OwnServiceImpl
++ : public ImplT,
+ private ::boost::noncopyable
+ {
+- typedef ::cppu::ImplInheritanceHelper1<ImplT,css::lang::XServiceInfo> BaseT;
++ typedef ImplT BaseT;
+
+ public:
+- ServiceImpl(
++ OwnServiceImpl(
+ ServiceDecl const& rServiceDecl,
+ css::uno::Sequence<css::uno::Any> const& args,
+ css::uno::Reference<css::uno::XComponentContext> const& xContext )
+- : BaseT(args, xContext), m_rServiceDecl(rServiceDecl) {}
+- ServiceImpl(
++ :BaseT(args, xContext), m_rServiceDecl(rServiceDecl) {}
++ OwnServiceImpl(
+ ServiceDecl const& rServiceDecl,
+ css::uno::Reference<css::uno::XComponentContext> const& xContext )
+ : BaseT(xContext), m_rServiceDecl(rServiceDecl) {}
+@@ -206,6 +205,22 @@ private:
+ ServiceDecl const& m_rServiceDecl;
+ };
+
++template <typename ImplT>
++class ServiceImpl : public OwnServiceImpl< ::cppu::ImplInheritanceHelper1<ImplT,css::lang::XServiceInfo> >
++{
++typedef OwnServiceImpl< ::cppu::ImplInheritanceHelper1<ImplT,css::lang::XServiceInfo> > ServiceImpl_BASE;
++public:
++ ServiceImpl(
++ ServiceDecl const& rServiceDecl,
++ css::uno::Sequence<css::uno::Any> const& args,
++ css::uno::Reference<css::uno::XComponentContext> const& xContext )
++ : ServiceImpl_BASE(rServiceDecl, args, xContext) {}
++ ServiceImpl(
++ ServiceDecl const& rServiceDecl,
++ css::uno::Reference<css::uno::XComponentContext> const& xContext )
++ : ServiceImpl_BASE(rServiceDecl, xContext) {}
++};
++
+ template <typename ServiceImplT>
+ struct PostProcessDefault {
+ css::uno::Reference<css::uno::XInterface>
+@@ -230,7 +245,7 @@ struct CreateFunc<ImplT, PostProcessFuncT, with_args<false> > {
+ const& xContext ) const
+ {
+ return m_postProcessFunc(
+- new ServiceImpl<ImplT>( rServiceDecl, xContext ) );
++ new ImplT( rServiceDecl, xContext ) );
+ }
+ };
+
+@@ -247,7 +262,7 @@ struct CreateFunc<ImplT, PostProcessFuncT, with_args<true> > {
+ const& xContext ) const
+ {
+ return m_postProcessFunc(
+- new ServiceImpl<ImplT>( rServiceDecl, args, xContext ) );
++ new ImplT( rServiceDecl, args, xContext ) );
+ }
+ };
+
+@@ -261,18 +276,17 @@ struct CreateFunc<ImplT, PostProcessFuncT, with_args<true> > {
+ or just (uno::Reference<uno::XComponentContext>)
+ */
+ template <typename ImplT_, typename WithArgsT = with_args<false> >
+-struct class_ {
++struct serviceimpl_base {
+ typedef ImplT_ ImplT;
+- typedef detail::ServiceImpl<ImplT_> ServiceImplT;
+
+ detail::CreateFuncF const m_createFunc;
+
+- typedef detail::PostProcessDefault<ServiceImplT> PostProcessDefaultT;
++ typedef detail::PostProcessDefault<ImplT> PostProcessDefaultT;
+
+ /** Default ctor. Implementation class without args, expecting
+ component context as single argument.
+ */
+- class_() : m_createFunc(
++ serviceimpl_base() : m_createFunc(
+ detail::CreateFunc<ImplT, PostProcessDefaultT, WithArgsT>(
+ PostProcessDefaultT() ) ) {}
+
+@@ -284,11 +298,29 @@ struct class_ {
+ uno::Reference<uno::XInterface>
+ */
+ template <typename PostProcessFuncT>
+- explicit class_( PostProcessFuncT const& postProcessFunc )
++ explicit serviceimpl_base( PostProcessFuncT const& postProcessFunc )
+ : m_createFunc( detail::CreateFunc<ImplT, PostProcessFuncT, WithArgsT>(
+ postProcessFunc ) ) {}
+ };
+
++template <typename ImplT_, typename WithArgsT = with_args<false> >
++struct class_ : public serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT >
++{
++ typedef serviceimpl_base< detail::ServiceImpl<ImplT_>, WithArgsT > baseT;
++ /** Default ctor. Implementation class without args, expecting
++ component context as single argument.
++ */
++ class_() : baseT() {}
++ template <typename PostProcessFuncT>
++ /** Ctor to pass a post processing function/functor.
++
++ @tpl PostProcessDefaultT let your compiler deduce this
++ @param postProcessFunc function/functor that gets the yet unacquired
++ ImplT_ pointer returning a
++ uno::Reference<uno::XInterface>
++ */
++ explicit class_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {}
++};
+
+ //
+ // component_... helpers with arbitrary service declarations:
+diff --git sc/source/ui/vba/helperdecl.hxx sc/source/ui/vba/helperdecl.hxx
+index 1581e66..c3c1007 100644
+--- sc/source/ui/vba/helperdecl.hxx
++++ sc/source/ui/vba/helperdecl.hxx
+@@ -32,107 +32,25 @@
+
+ namespace comphelper {
+ namespace service_decl {
+-
+-namespace detail {
+-namespace css = ::com::sun::star;
+-template <typename ImplT>
+-class OwnServiceImpl
+- : public ImplT,
+- private ::boost::noncopyable
+-{
+- typedef ImplT BaseT;
+-
+-public:
+- OwnServiceImpl(
+- ServiceDecl const& rServiceDecl,
+- css::uno::Sequence<css::uno::Any> const& args,
+- css::uno::Reference<css::uno::XComponentContext> const& xContext )
+- :BaseT(args, xContext), m_rServiceDecl(rServiceDecl) {}
+- OwnServiceImpl(
+- ServiceDecl const& rServiceDecl,
+- css::uno::Reference<css::uno::XComponentContext> const& xContext )
+- : BaseT(xContext), m_rServiceDecl(rServiceDecl) {}
+-
+- // XServiceInfo
+- virtual ::rtl::OUString SAL_CALL getImplementationName()
+- throw (css::uno::RuntimeException) {
+- return m_rServiceDecl.getImplementationName();
+- }
+- virtual sal_Bool SAL_CALL supportsService( ::rtl::OUString const& name )
+- throw (css::uno::RuntimeException) {
+- return m_rServiceDecl.supportsService(name);
+- }
+- virtual css::uno::Sequence< ::rtl::OUString>
+- SAL_CALL getSupportedServiceNames() throw (css::uno::RuntimeException) {
+- return m_rServiceDecl.getSupportedServiceNames();
+- }
+-
+-private:
+- ServiceDecl const& m_rServiceDecl;
+-};
+-
+-
+-template <typename ImplT, typename WithArgsT>
+-struct OwnCreateFunc;
+-
+-template <typename ImplT>
+-struct OwnCreateFunc<ImplT, with_args<false> > {
+- explicit OwnCreateFunc( )
+- {}
+-
+- css::uno::Reference<css::uno::XInterface>
+- operator()( ServiceDecl const& rServiceDecl,
+- css::uno::Sequence<css::uno::Any> const&,
+- css::uno::Reference<css::uno::XComponentContext>
+- const& xContext ) const
+- {
+- return css::uno::Reference< ooo::vba::XHelperInterface >(new OwnServiceImpl<ImplT>( rServiceDecl, xContext ));
+- }
+-};
+-
+-template <typename ImplT>
+-struct OwnCreateFunc<ImplT, with_args<true> > {
+- explicit OwnCreateFunc( )
+- {}
+-
+- css::uno::Reference<css::uno::XInterface>
+- operator()( ServiceDecl const& rServiceDecl,
+- css::uno::Sequence<css::uno::Any> const& args,
+- css::uno::Reference<css::uno::XComponentContext>
+- const& xContext ) const
+- {
+- css::uno::Reference< ooo::vba::XHelperInterface > xHelp(
+- new OwnServiceImpl<ImplT>( rServiceDecl, args, xContext ) );
+- css::uno::Reference< css::uno::XInterface > xIf( xHelp, css::uno::UNO_QUERY ) ;
+- return xIf;
+- }
+-};
+-
+-} // namespace detail
+-
+-/** Defines a service implementation class.
+-
+- @tpl ImplT_ service implementation class
+- @WithArgsT whether the implementation class ctor expects arguments
+- (uno::Sequence<uno::Any>, uno::Reference<uno::XComponentContext>)
+- or just (uno::Reference<uno::XComponentContext>)
+-*/
+ template <typename ImplT_, typename WithArgsT = with_args<false> >
+-struct vba_service_class_ {
+- typedef ImplT_ ImplT;
+- typedef detail::OwnServiceImpl<ImplT_ > ServiceImplT;
+-
+- detail::CreateFuncF const m_createFunc;
+-
++struct vba_service_class_ : public serviceimpl_base< detail::OwnServiceImpl<ImplT_>, WithArgsT >
++{
++ typedef serviceimpl_base< detail::OwnServiceImpl<ImplT_>, WithArgsT > baseT;
+ /** Default ctor. Implementation class without args, expecting
+ component context as single argument.
+ */
+- vba_service_class_() : m_createFunc(
+- detail::OwnCreateFunc<ImplT, WithArgsT>() ) {}
+-
++ vba_service_class_() : baseT() {}
++ template <typename PostProcessFuncT>
++ /** Ctor to pass a post processing function/functor.
++
++ @tpl PostProcessDefaultT let your compiler deduce this
++ @param postProcessFunc function/functor that gets the yet unacquired
++ ImplT_ pointer returning a
++ uno::Reference<uno::XInterface>
++ */
++ explicit vba_service_class_( PostProcessFuncT const& postProcessFunc ) : baseT( postProcessFunc ) {}
+ };
+
+-
+ } // namespace service_decl
+ } // namespace comphelper
+
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]