Kaydet (Commit) 39c4b278 authored tarafından Matúš Kukan's avatar Matúš Kukan

forms: Replace these macros

Change-Id: I656905cf6f0e3647824ff3836fcea93920251264
üst a9535fe9
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
#include "componenttools.hxx" #include "componenttools.hxx"
#include "DatabaseForm.hxx" #include "DatabaseForm.hxx"
#include "EventThread.hxx" #include "EventThread.hxx"
#include "frm_module.hxx"
#include "frm_resource.hrc" #include "frm_resource.hrc"
#include "frm_resource.hxx" #include "frm_resource.hxx"
#include "GroupManager.hxx" #include "GroupManager.hxx"
......
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
#include "Filter.hxx" #include "Filter.hxx"
#include "FormComponent.hxx" #include "FormComponent.hxx"
#include "frm_module.hxx"
#include "frm_resource.hrc" #include "frm_resource.hrc"
#include "frm_resource.hxx" #include "frm_resource.hxx"
#include "property.hrc" #include "property.hrc"
......
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
*/ */
#include "navigationbar.hxx" #include "navigationbar.hxx"
#include "frm_module.hxx"
#include <com/sun/star/text/WritingMode2.hpp> #include <com/sun/star/text/WritingMode2.hpp>
......
...@@ -106,13 +106,28 @@ namespace frm ...@@ -106,13 +106,28 @@ namespace frm
{ {
} }
OUString SAL_CALL OScrollBarModel::getImplementationName() throw ( RuntimeException, std::exception )
{
return OUString( "com.sun.star.comp.forms.OScrollBarModel" );
}
IMPLEMENT_SERVICE_REGISTRATION_2( OScrollBarModel, OControlModel, FRM_SUN_COMPONENT_SCROLLBAR, BINDABLE_INTEGER_VALUE_RANGE )
// note that we're passing OControlModel as "base class". This is because // note that we're passing OControlModel as "base class". This is because
// OBoundControlModel, our real base class, claims to support the DataAwareControlModel // OBoundControlModel, our real base class, claims to support the DataAwareControlModel
// service, which isn't really true for us. We only derive from this class // service, which isn't really true for us. We only derive from this class
// to benefit from the functionality for binding to spreadsheet cells // to benefit from the functionality for binding to spreadsheet cells
Sequence< OUString > SAL_CALL OScrollBarModel::getSupportedServiceNames() throw (RuntimeException, std::exception)
{
Sequence< OUString > aOwnNames( 2 );
aOwnNames[ 0 ] = FRM_SUN_COMPONENT_SCROLLBAR;
aOwnNames[ 1 ] = BINDABLE_INTEGER_VALUE_RANGE;
return ::comphelper::combineSequences(
getAggregateServiceNames(),
::comphelper::concatSequences(
OControlModel::getSupportedServiceNames_Static(),
aOwnNames)
);
}
IMPLEMENT_DEFAULT_CLONING( OScrollBarModel ) IMPLEMENT_DEFAULT_CLONING( OScrollBarModel )
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define INCLUDED_FORMS_SOURCE_COMPONENT_SCROLLBAR_HXX #define INCLUDED_FORMS_SOURCE_COMPONENT_SCROLLBAR_HXX
#include "FormComponent.hxx" #include "FormComponent.hxx"
#include "frm_module.hxx"
namespace frm namespace frm
{ {
...@@ -37,7 +36,8 @@ namespace frm ...@@ -37,7 +36,8 @@ namespace frm
protected: protected:
// XServiceInfo // XServiceInfo
DECLARE_SERVICE_REGISTRATION( OScrollBarModel ) virtual OUString SAL_CALL getImplementationName() throw (::css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XPersistObject // XPersistObject
DECLARE_XPERSISTOBJECT() DECLARE_XPERSISTOBJECT()
......
...@@ -59,13 +59,29 @@ namespace frm ...@@ -59,13 +59,29 @@ namespace frm
{ {
} }
OUString SAL_CALL OSpinButtonModel::getImplementationName() throw ( RuntimeException, std::exception )
{
return OUString( "com.sun.star.comp.forms.OSpinButtonModel" );
}
IMPLEMENT_SERVICE_REGISTRATION_2( OSpinButtonModel, OControlModel, FRM_SUN_COMPONENT_SPINBUTTON, BINDABLE_INTEGER_VALUE_RANGE )
// note that we're passing OControlModel as "base class". This is because // note that we're passing OControlModel as "base class". This is because
// OBoundControlModel, our real base class, claims to support the DataAwareControlModel // OBoundControlModel, our real base class, claims to support the DataAwareControlModel
// service, which isn't really true for us. We only derive from this class // service, which isn't really true for us. We only derive from this class
// to benefit from the functionality for binding to spreadsheet cells // to benefit from the functionality for binding to spreadsheet cells
Sequence< OUString > SAL_CALL OSpinButtonModel::getSupportedServiceNames() throw (RuntimeException, std::exception)
{
Sequence< OUString > aOwnNames( 2 );
aOwnNames[ 0 ] = FRM_SUN_COMPONENT_SPINBUTTON;
aOwnNames[ 1 ] = BINDABLE_INTEGER_VALUE_RANGE;
return ::comphelper::combineSequences(
getAggregateServiceNames(),
::comphelper::concatSequences(
OControlModel::getSupportedServiceNames_Static(),
aOwnNames
)
);
}
IMPLEMENT_DEFAULT_CLONING( OSpinButtonModel ) IMPLEMENT_DEFAULT_CLONING( OSpinButtonModel )
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define INCLUDED_FORMS_SOURCE_COMPONENT_SPINBUTTON_HXX #define INCLUDED_FORMS_SOURCE_COMPONENT_SPINBUTTON_HXX
#include "FormComponent.hxx" #include "FormComponent.hxx"
#include "frm_module.hxx"
namespace frm namespace frm
...@@ -38,7 +37,8 @@ namespace frm ...@@ -38,7 +37,8 @@ namespace frm
protected: protected:
// XServiceInfo // XServiceInfo
DECLARE_SERVICE_REGISTRATION( OSpinButtonModel ) virtual OUString SAL_CALL getImplementationName( ) throw (::css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XPersistObject // XPersistObject
DECLARE_XPERSISTOBJECT() DECLARE_XPERSISTOBJECT()
......
/* -*- 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 .
*/
#define DECLARE_SERVICE_REGISTRATION( classname ) \
virtual OUString SAL_CALL getImplementationName( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; \
virtual ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; \
\
static OUString SAL_CALL getImplementationName_Static(); \
static ::com::sun::star::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames_Static(); \
#define IMPLEMENT_SERVICE_REGISTRATION_BASE( classname, baseclass ) \
\
OUString SAL_CALL classname::getImplementationName( ) throw ( RuntimeException, std::exception ) \
{ return getImplementationName_Static(); } \
\
Sequence< OUString > SAL_CALL classname::getSupportedServiceNames( ) throw (RuntimeException, std::exception) \
{ \
return ::comphelper::combineSequences( \
getAggregateServiceNames(), \
getSupportedServiceNames_Static() \
); \
} \
\
OUString SAL_CALL classname::getImplementationName_Static() \
{ return OUString( "com.sun.star.comp.forms."#classname ); } \
\
#define IMPLEMENT_SERVICE_REGISTRATION_2( classname, baseclass, service1, service2 ) \
IMPLEMENT_SERVICE_REGISTRATION_BASE( classname, baseclass ) \
\
Sequence< OUString > SAL_CALL classname::getSupportedServiceNames_Static() \
{ \
Sequence< OUString > aOwnNames( 2 ); \
aOwnNames[ 0 ] = service1; \
aOwnNames[ 1 ] = service2; \
\
return ::comphelper::concatSequences( \
baseclass::getSupportedServiceNames_Static(), \
aOwnNames \
); \
} \
#define IMPLEMENT_SERVICE_REGISTRATION_8( classname, baseclass, service1, service2, service3, service4 , service5, service6, service7, service8 ) \
IMPLEMENT_SERVICE_REGISTRATION_BASE( classname, baseclass ) \
\
Sequence< OUString > SAL_CALL classname::getSupportedServiceNames_Static() \
{ \
Sequence< OUString > aOwnNames( 8 ); \
aOwnNames[ 0 ] = service1; \
aOwnNames[ 1 ] = service2; \
aOwnNames[ 2 ] = service3; \
aOwnNames[ 3 ] = service4; \
aOwnNames[ 4 ] = service5; \
aOwnNames[ 5 ] = service6; \
aOwnNames[ 6 ] = service7; \
aOwnNames[ 7 ] = service8; \
\
return ::comphelper::concatSequences( \
baseclass::getSupportedServiceNames_Static(), \
aOwnNames \
); \
} \
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* -*- 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_FORMS_SOURCE_INC_FRM_MODULE_HXX
#define INCLUDED_FORMS_SOURCE_INC_FRM_MODULE_HXX
#include "forms_module.hxx"
#endif // INCLUDED_FORMS_SOURCE_INC_FRM_MODULE_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
...@@ -18,7 +18,6 @@ ...@@ -18,7 +18,6 @@
*/ */
#include "richtextcontrol.hxx" #include "richtextcontrol.hxx"
#include "frm_module.hxx"
#include "property.hrc" #include "property.hrc"
#include "services.hxx" #include "services.hxx"
......
...@@ -222,18 +222,30 @@ namespace frm ...@@ -222,18 +222,30 @@ namespace frm
IMPLEMENT_FORWARD_XTYPEPROVIDER2( ORichTextModel, OControlModel, ORichTextModel_BASE ) IMPLEMENT_FORWARD_XTYPEPROVIDER2( ORichTextModel, OControlModel, ORichTextModel_BASE )
OUString SAL_CALL ORichTextModel::getImplementationName() throw ( RuntimeException, std::exception )
{
return OUString( "com.sun.star.comp.forms.ORichTextModel" );
}
IMPLEMENT_SERVICE_REGISTRATION_8( ORichTextModel, OControlModel, Sequence< OUString > SAL_CALL ORichTextModel::getSupportedServiceNames() throw (RuntimeException, std::exception)
FRM_SUN_COMPONENT_RICHTEXTCONTROL, {
"com.sun.star.text.TextRange", Sequence< OUString > aOwnNames( 8 );
"com.sun.star.style.CharacterProperties", aOwnNames[ 0 ] = FRM_SUN_COMPONENT_RICHTEXTCONTROL;
"com.sun.star.style.ParagraphProperties", aOwnNames[ 1 ] = "com.sun.star.text.TextRange";
"com.sun.star.style.CharacterPropertiesAsian", aOwnNames[ 2 ] = "com.sun.star.style.CharacterProperties";
"com.sun.star.style.CharacterPropertiesComplex", aOwnNames[ 3 ] = "com.sun.star.style.ParagraphProperties";
"com.sun.star.style.ParagraphPropertiesAsian", aOwnNames[ 4 ] = "com.sun.star.style.CharacterPropertiesAsian";
"com.sun.star.style.ParagraphPropertiesComplex" aOwnNames[ 5 ] = "com.sun.star.style.CharacterPropertiesComplex";
) aOwnNames[ 6 ] = "com.sun.star.style.ParagraphPropertiesAsian";
aOwnNames[ 7 ] = "com.sun.star.style.ParagraphPropertiesComplex";
return ::comphelper::combineSequences(
getAggregateServiceNames(),
::comphelper::concatSequences(
OControlModel::getSupportedServiceNames_Static(),
aOwnNames)
);
}
IMPLEMENT_DEFAULT_CLONING( ORichTextModel ) IMPLEMENT_DEFAULT_CLONING( ORichTextModel )
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#define INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTMODEL_HXX #define INCLUDED_FORMS_SOURCE_RICHTEXT_RICHTEXTMODEL_HXX
#include "FormComponent.hxx" #include "FormComponent.hxx"
#include "frm_module.hxx"
#include "formcontrolfont.hxx" #include "formcontrolfont.hxx"
#include "richtextunowrapper.hxx" #include "richtextunowrapper.hxx"
#include <comphelper/propertycontainerhelper.hxx> #include <comphelper/propertycontainerhelper.hxx>
...@@ -109,7 +108,8 @@ namespace frm ...@@ -109,7 +108,8 @@ namespace frm
virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE; virtual ::com::sun::star::uno::Any SAL_CALL queryAggregation( const ::com::sun::star::uno::Type& _rType ) throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XServiceInfo // XServiceInfo
DECLARE_SERVICE_REGISTRATION( ORichTextModel ) virtual OUString SAL_CALL getImplementationName() throw (::css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
virtual ::css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() throw (::css::uno::RuntimeException, std::exception) SAL_OVERRIDE;
// XPersistObject // XPersistObject
DECLARE_XPERSISTOBJECT() DECLARE_XPERSISTOBJECT()
......
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
#include "frm_strings.hxx" #include "frm_strings.hxx"
#include "frm_resource.hxx" #include "frm_resource.hxx"
#include "frm_resource.hrc" #include "frm_resource.hrc"
#include "frm_module.hxx"
#include "services.hxx" #include "services.hxx"
#include <com/sun/star/ucb/AlreadyInitializedException.hpp> #include <com/sun/star/ucb/AlreadyInitializedException.hpp>
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
#include "navbarcontrol.hxx" #include "navbarcontrol.hxx"
#include "frm_strings.hxx" #include "frm_strings.hxx"
#include "frm_module.hxx"
#include "FormComponent.hxx" #include "FormComponent.hxx"
#include "componenttools.hxx" #include "componenttools.hxx"
#include "navtoolbar.hxx" #include "navtoolbar.hxx"
......
...@@ -24,7 +24,6 @@ ...@@ -24,7 +24,6 @@
#include "extension.hxx" #include "extension.hxx"
#include "xpathlib.hxx" #include "xpathlib.hxx"
#include "services.hxx" #include "services.hxx"
#include "frm_module.hxx"
using namespace com::sun::star::uno; using namespace com::sun::star::uno;
using namespace com::sun::star::lang; using namespace com::sun::star::lang;
......
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