summaryrefslogtreecommitdiff
path: root/forms/source/component/Numeric.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'forms/source/component/Numeric.cxx')
-rw-r--r--forms/source/component/Numeric.cxx27
1 files changed, 16 insertions, 11 deletions
diff --git a/forms/source/component/Numeric.cxx b/forms/source/component/Numeric.cxx
index 9fb87e0b4695..b3465d7c940c 100644
--- a/forms/source/component/Numeric.cxx
+++ b/forms/source/component/Numeric.cxx
@@ -21,6 +21,8 @@
#include <services.hxx>
#include <property.hxx>
#include <comphelper/types.hxx>
+#include <tools/debug.hxx>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/form/FormComponentType.hpp>
namespace frm
@@ -30,13 +32,8 @@ using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::sdb;
using namespace ::com::sun::star::sdbc;
using namespace ::com::sun::star::beans;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::form;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::lang;
using namespace ::com::sun::star::util;
-using namespace ::com::sun::star::form::binding;
ONumericControl::ONumericControl(const Reference<XComponentContext>& _rxFactory)
:OBoundControl(_rxFactory, VCL_CONTROL_NUMERICFIELD)
@@ -59,7 +56,7 @@ css::uno::Sequence<OUString> ONumericControl::getSupportedServiceNames()
ONumericModel::ONumericModel(const Reference<XComponentContext>& _rxFactory)
:OEditBaseModel( _rxFactory, VCL_CONTROLMODEL_NUMERICFIELD, FRM_SUN_CONTROL_NUMERICFIELD, true, true )
- // use the old control name for compytibility reasons
+ // use the old control name for compatibility reasons
{
m_nClassId = FormComponentType::NUMERICFIELD;
@@ -79,7 +76,12 @@ ONumericModel::~ONumericModel()
// XCloneable
-IMPLEMENT_DEFAULT_CLONING( ONumericModel )
+css::uno::Reference< css::util::XCloneable > SAL_CALL ONumericModel::createClone()
+{
+ rtl::Reference<ONumericModel> pClone = new ONumericModel(this, getContext());
+ pClone->clonedFrom(this);
+ return pClone;
+}
// XServiceInfo
@@ -110,10 +112,13 @@ css::uno::Sequence<OUString> ONumericModel::getSupportedServiceNames()
void ONumericModel::describeFixedProperties( Sequence< Property >& _rProps ) const
{
- BEGIN_DESCRIBE_PROPERTIES( 2, OEditBaseModel )
- DECL_PROP3(DEFAULT_VALUE, double, BOUND, MAYBEDEFAULT, MAYBEVOID);
- DECL_PROP1(TABINDEX, sal_Int16, BOUND);
- END_DESCRIBE_PROPERTIES();
+ OEditBaseModel::describeFixedProperties( _rProps );
+ sal_Int32 nOldCount = _rProps.getLength();
+ _rProps.realloc( nOldCount + 2);
+ css::beans::Property* pProperties = _rProps.getArray() + nOldCount;
+ *pProperties++ = css::beans::Property(PROPERTY_DEFAULT_VALUE, PROPERTY_ID_DEFAULT_VALUE, cppu::UnoType<double>::get(), css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT | css::beans::PropertyAttribute::MAYBEVOID);
+ *pProperties++ = css::beans::Property(PROPERTY_TABINDEX, PROPERTY_ID_TABINDEX, cppu::UnoType<sal_Int16>::get(), css::beans::PropertyAttribute::BOUND);
+ DBG_ASSERT( pProperties == _rProps.getArray() + _rProps.getLength(), "<...>::describeFixedProperties/getInfoHelper: forgot to adjust the count ?");
}