1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include "Columns.hxx"
21 #include <property.hxx>
22 #include <componenttools.hxx>
23 #include "findpos.hxx"
24 #include <com/sun/star/beans/PropertyAttribute.hpp>
25 #include <com/sun/star/io/XPersistObject.hpp>
26 #include <com/sun/star/io/XMarkableStream.hpp>
27 #include <com/sun/star/form/XFormComponent.hpp>
28 #include <com/sun/star/lang/XServiceInfo.hpp>
29 #include <com/sun/star/form/binding/XBindableValue.hpp>
30 #include <com/sun/star/beans/XPropertyContainer.hpp>
31 #include <com/sun/star/text/XText.hpp>
32 #include <comphelper/property.hxx>
33 #include <comphelper/basicio.hxx>
34 #include <comphelper/servicehelper.hxx>
35 #include <comphelper/types.hxx>
36 #include <services.hxx>
37 #include <tools/debug.hxx>
38 #include <o3tl/sorted_vector.hxx>
45 using namespace ::com::sun::star::uno
;
46 using namespace ::com::sun::star::beans
;
47 using namespace ::com::sun::star::container
;
48 using namespace ::com::sun::star::form
;
49 using namespace ::com::sun::star::io
;
50 using namespace ::com::sun::star::lang
;
51 using namespace ::com::sun::star::util
;
52 using namespace ::com::sun::star::text
;
53 using namespace ::com::sun::star::form::binding
;
55 const sal_uInt16 WIDTH
= 0x0001;
56 const sal_uInt16 ALIGN
= 0x0002;
57 const sal_uInt16 OLD_HIDDEN
= 0x0004;
58 const sal_uInt16 COMPATIBLE_HIDDEN
= 0x0008;
61 const css::uno::Sequence
<OUString
>& getColumnTypes()
63 static css::uno::Sequence
<OUString
> aColumnTypes
= []()
65 css::uno::Sequence
<OUString
> tmp(10);
66 OUString
* pNames
= tmp
.getArray();
67 pNames
[TYPE_CHECKBOX
] = "CheckBox";
68 pNames
[TYPE_COMBOBOX
] = "ComboBox";
69 pNames
[TYPE_CURRENCYFIELD
] = "CurrencyField";
70 pNames
[TYPE_DATEFIELD
] = "DateField";
71 pNames
[TYPE_FORMATTEDFIELD
] = "FormattedField";
72 pNames
[TYPE_LISTBOX
] = "ListBox";
73 pNames
[TYPE_NUMERICFIELD
] = "NumericField";
74 pNames
[TYPE_PATTERNFIELD
] = "PatternField";
75 pNames
[TYPE_TEXTFIELD
] = "TextField";
76 pNames
[TYPE_TIMEFIELD
] = "TimeField";
83 sal_Int32
getColumnTypeByModelName(const OUString
& aModelName
)
85 static constexpr OUString
aModelPrefix (u
"com.sun.star.form.component."_ustr
);
86 static constexpr OUString
aCompatibleModelPrefix (u
"stardiv.one.form.component."_ustr
);
88 sal_Int32 nTypeId
= -1;
89 if (aModelName
== FRM_COMPONENT_EDIT
)
90 nTypeId
= TYPE_TEXTFIELD
;
93 sal_Int32 nPrefixPos
= aModelName
.indexOf(aModelPrefix
);
95 sal_Int32 nCompatiblePrefixPos
= aModelName
.indexOf(aCompatibleModelPrefix
);
96 DBG_ASSERT( (nPrefixPos
!= -1) || (nCompatiblePrefixPos
!= -1),
97 "::getColumnTypeByModelName() : wrong service!");
100 OUString aColumnType
= (nPrefixPos
!= -1)
101 ? aModelName
.copy(aModelPrefix
.getLength())
102 : aModelName
.copy(aCompatibleModelPrefix
.getLength());
104 const css::uno::Sequence
<OUString
>& rColumnTypes
= getColumnTypes();
105 nTypeId
= ::detail::findPos(aColumnType
, rColumnTypes
);
110 const Sequence
<sal_Int8
>& OGridColumn::getUnoTunnelId()
112 static const comphelper::UnoIdInit theOGridColumnImplementationId
;
113 return theOGridColumnImplementationId
.getSeq();
117 sal_Int64 SAL_CALL
OGridColumn::getSomething( const Sequence
<sal_Int8
>& _rIdentifier
)
119 sal_Int64
nReturn(0);
121 if ( comphelper::isUnoTunnelId
<OGridColumn
>(_rIdentifier
) )
123 nReturn
= comphelper::getSomething_cast(this);
127 if (auto xAggTunnel
= query_aggregation
<XUnoTunnel
>(m_xAggregate
))
128 return xAggTunnel
->getSomething( _rIdentifier
);
134 Sequence
<sal_Int8
> SAL_CALL
OGridColumn::getImplementationId()
136 return css::uno::Sequence
<sal_Int8
>();
140 Sequence
<Type
> SAL_CALL
OGridColumn::getTypes()
142 TypeBag
aTypes( OGridColumn_BASE::getTypes() );
143 // erase the types which we do not support
144 aTypes
.removeType( cppu::UnoType
<XFormComponent
>::get() );
145 aTypes
.removeType( cppu::UnoType
<XServiceInfo
>::get() );
146 aTypes
.removeType( cppu::UnoType
<XBindableValue
>::get() );
147 aTypes
.removeType( cppu::UnoType
<XPropertyContainer
>::get() );
149 // but re-add their base class(es)
150 aTypes
.addType( cppu::UnoType
<XChild
>::get() );
152 if (auto xProv
= query_aggregation
<XTypeProvider
>(m_xAggregate
))
153 aTypes
.addTypes( xProv
->getTypes() );
155 aTypes
.removeType( cppu::UnoType
<XTextRange
>::get() );
156 aTypes
.removeType( cppu::UnoType
<XSimpleText
>::get() );
157 aTypes
.removeType( cppu::UnoType
<XText
>::get() );
159 return aTypes
.getTypes();
163 Any SAL_CALL
OGridColumn::queryAggregation( const Type
& _rType
)
166 // some functionality at our aggregate cannot be reasonably fulfilled here.
167 if ( _rType
.equals(cppu::UnoType
<XFormComponent
>::get())
168 || _rType
.equals(cppu::UnoType
<XServiceInfo
>::get())
169 || _rType
.equals(cppu::UnoType
<XBindableValue
>::get())
170 || _rType
.equals(cppu::UnoType
<XPropertyContainer
>::get())
171 || comphelper::isAssignableFrom(cppu::UnoType
<XTextRange
>::get(),_rType
)
175 aReturn
= OGridColumn_BASE::queryAggregation(_rType
);
176 if (!aReturn
.hasValue())
178 aReturn
= OPropertySetAggregationHelper::queryInterface(_rType
);
179 if (!aReturn
.hasValue() && m_xAggregate
.is())
180 aReturn
= m_xAggregate
->queryAggregation(_rType
);
187 OGridColumn::OGridColumn( const Reference
<XComponentContext
>& _rContext
, OUString _sModelName
)
188 :OGridColumn_BASE(m_aMutex
)
189 ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper
)
190 ,m_aHidden( Any( false ) )
191 ,m_aModelName(std::move(_sModelName
))
194 // Create the UnoControlModel
195 if ( m_aModelName
.isEmpty() ) // is there a to-be-aggregated model?
198 osl_atomic_increment( &m_refCount
);
201 m_xAggregate
.set( _rContext
->getServiceManager()->createInstanceWithContext( m_aModelName
, _rContext
), UNO_QUERY
);
202 setAggregation( m_xAggregate
);
205 if ( m_xAggregate
.is() )
206 { // don't omit those brackets - they ensure that the following temporary is properly deleted
207 m_xAggregate
->setDelegator( static_cast< ::cppu::OWeakObject
* >( this ) );
210 // Set refcount back to zero
211 osl_atomic_decrement( &m_refCount
);
215 OGridColumn::OGridColumn( const OGridColumn
* _pOriginal
)
216 :OGridColumn_BASE( m_aMutex
)
217 ,OPropertySetAggregationHelper( OGridColumn_BASE::rBHelper
)
220 m_aWidth
= _pOriginal
->m_aWidth
;
221 m_aAlign
= _pOriginal
->m_aAlign
;
222 m_aHidden
= _pOriginal
->m_aHidden
;
223 m_aModelName
= _pOriginal
->m_aModelName
;
224 m_aLabel
= _pOriginal
->m_aLabel
;
226 osl_atomic_increment( &m_refCount
);
229 m_xAggregate
= createAggregateClone( _pOriginal
);
230 setAggregation( m_xAggregate
);
233 if ( m_xAggregate
.is() )
234 { // don't omit this brackets - they ensure that the following temporary is properly deleted
235 m_xAggregate
->setDelegator( static_cast< ::cppu::OWeakObject
* >( this ) );
238 osl_atomic_decrement( &m_refCount
);
242 OGridColumn::~OGridColumn()
244 if (!OGridColumn_BASE::rBHelper
.bDisposed
)
250 // Free the aggregate
251 if (m_xAggregate
.is())
253 css::uno::Reference
<css::uno::XInterface
> xIface
;
254 m_xAggregate
->setDelegator(xIface
);
261 void SAL_CALL
OGridColumn::disposing(const EventObject
& _rSource
)
263 OPropertySetAggregationHelper::disposing(_rSource
);
265 if (auto xEvtLstner
= query_aggregation
<XEventListener
>(m_xAggregate
))
266 xEvtLstner
->disposing(_rSource
);
271 void OGridColumn::disposing()
273 OGridColumn_BASE::disposing();
274 OPropertySetAggregationHelper::disposing();
276 if (auto xComp
= query_aggregation
<XComponent
>(m_xAggregate
))
281 void OGridColumn::clearAggregateProperties( Sequence
< Property
>& _rProps
, bool bAllowDropDown
)
283 // some properties are not to be exposed to the outer world
284 static const o3tl::sorted_vector
< OUString
> aForbiddenProperties
{
286 PROPERTY_AUTOCOMPLETE
,
287 PROPERTY_BACKGROUNDCOLOR
,
289 PROPERTY_BORDERCOLOR
,
294 PROPERTY_FONT_STYLENAME
,
295 PROPERTY_FONT_FAMILY
,
296 PROPERTY_FONT_CHARSET
,
297 PROPERTY_FONT_HEIGHT
,
298 PROPERTY_FONT_WEIGHT
,
300 PROPERTY_FONT_UNDERLINE
,
301 PROPERTY_FONT_STRIKEOUT
,
302 PROPERTY_FONT_WORDLINEMODE
,
303 PROPERTY_TEXTLINECOLOR
,
304 PROPERTY_FONTEMPHASISMARK
,
306 PROPERTY_HARDLINEBREAKS
,
310 PROPERTY_MULTISELECTION
,
316 PROPERTY_CONTROLLABEL
,
318 PROPERTY_VERTICAL_ALIGN
,
320 PROPERTY_IMAGE_POSITION
,
321 PROPERTY_ENABLEVISIBLE
324 Sequence
< Property
> aNewProps( _rProps
.getLength() );
325 Property
* pNewProps
= aNewProps
.getArray();
327 const Property
* pProps
= _rProps
.getConstArray();
328 const Property
* pPropsEnd
= pProps
+ _rProps
.getLength();
329 for ( ; pProps
!= pPropsEnd
; ++pProps
)
331 if ( aForbiddenProperties
.find( pProps
->Name
) == aForbiddenProperties
.end()
332 && (bAllowDropDown
|| pProps
->Name
!= PROPERTY_DROPDOWN
))
333 *pNewProps
++ = *pProps
;
336 aNewProps
.realloc( pNewProps
- aNewProps
.getArray() );
337 _rProps
= std::move(aNewProps
);
341 void OGridColumn::setOwnProperties(Sequence
<Property
>& aDescriptor
)
343 aDescriptor
.realloc(5);
344 Property
* pProperties
= aDescriptor
.getArray();
345 *pProperties
++ = css::beans::Property(PROPERTY_LABEL
, PROPERTY_ID_LABEL
, cppu::UnoType
<OUString
>::get(), css::beans::PropertyAttribute::BOUND
);
346 *pProperties
++ = css::beans::Property(PROPERTY_WIDTH
, PROPERTY_ID_WIDTH
, cppu::UnoType
<sal_Int32
>::get(), css::beans::PropertyAttribute::BOUND
| css::beans::PropertyAttribute::MAYBEVOID
| css::beans::PropertyAttribute::MAYBEDEFAULT
);
347 *pProperties
++ = css::beans::Property(PROPERTY_ALIGN
, PROPERTY_ID_ALIGN
, cppu::UnoType
<sal_Int16
>::get(), css::beans::PropertyAttribute::BOUND
| css::beans::PropertyAttribute::MAYBEVOID
| css::beans::PropertyAttribute::MAYBEDEFAULT
);
348 *pProperties
++ = css::beans::Property(PROPERTY_HIDDEN
, PROPERTY_ID_HIDDEN
, cppu::UnoType
<bool>::get(),
349 css::beans::PropertyAttribute::BOUND
| css::beans::PropertyAttribute::MAYBEDEFAULT
);
350 *pProperties
++ = css::beans::Property(PROPERTY_COLUMNSERVICENAME
, PROPERTY_ID_COLUMNSERVICENAME
, cppu::UnoType
<OUString
>::get(), css::beans::PropertyAttribute::READONLY
);
353 // Reference<XPropertySet>
355 void OGridColumn::getFastPropertyValue(Any
& rValue
, sal_Int32 nHandle
) const
359 case PROPERTY_ID_COLUMNSERVICENAME
:
360 rValue
<<= m_aModelName
;
362 case PROPERTY_ID_LABEL
:
365 case PROPERTY_ID_WIDTH
:
368 case PROPERTY_ID_ALIGN
:
371 case PROPERTY_ID_HIDDEN
:
375 OPropertySetAggregationHelper::getFastPropertyValue(rValue
, nHandle
);
380 sal_Bool
OGridColumn::convertFastPropertyValue( Any
& rConvertedValue
, Any
& rOldValue
,
381 sal_Int32 nHandle
, const Any
& rValue
)
383 bool bModified(false);
386 case PROPERTY_ID_LABEL
:
387 bModified
= tryPropertyValue(rConvertedValue
, rOldValue
, rValue
, m_aLabel
);
389 case PROPERTY_ID_WIDTH
:
390 bModified
= tryPropertyValue(rConvertedValue
, rOldValue
, rValue
, m_aWidth
, cppu::UnoType
<sal_Int32
>::get());
392 case PROPERTY_ID_ALIGN
:
393 bModified
= tryPropertyValue( rConvertedValue
, rOldValue
, rValue
, m_aAlign
, cppu::UnoType
<sal_Int32
>::get());
394 // strange enough, css.awt.TextAlign is a 32-bit integer, while the Align property (both here for grid controls
395 // and for ordinary toolkit controls) is a 16-bit integer. So, allow for 32 bit, but normalize it to 16 bit
398 sal_Int32
nAlign( 0 );
399 if ( rConvertedValue
>>= nAlign
)
400 rConvertedValue
<<= static_cast<sal_Int16
>(nAlign
);
403 case PROPERTY_ID_HIDDEN
:
404 bModified
= tryPropertyValue(rConvertedValue
, rOldValue
, rValue
, getBOOL(m_aHidden
));
411 void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle
, const Any
& rValue
)
415 case PROPERTY_ID_LABEL
:
416 DBG_ASSERT(rValue
.getValueTypeClass() == TypeClass_STRING
, "invalid type" );
419 case PROPERTY_ID_WIDTH
:
422 case PROPERTY_ID_ALIGN
:
425 case PROPERTY_ID_HIDDEN
:
434 Any
OGridColumn::getPropertyDefaultByHandle( sal_Int32 nHandle
) const
438 case PROPERTY_ID_WIDTH
:
439 case PROPERTY_ID_ALIGN
:
441 case PROPERTY_ID_HIDDEN
:
444 return OPropertySetAggregationHelper::getPropertyDefaultByHandle(nHandle
);
450 Reference
< XCloneable
> SAL_CALL
OGridColumn::createClone( )
452 return createCloneColumn();
457 void OGridColumn::write(const Reference
<XObjectOutputStream
>& _rxOutStream
)
459 // 1. Write the UnoControl
460 Reference
<XMarkableStream
> xMark(_rxOutStream
, UNO_QUERY
);
461 sal_Int32 nMark
= xMark
->createMark();
464 _rxOutStream
->writeLong(nLen
);
466 if (auto xPersist
= query_aggregation
<XPersistObject
>(m_xAggregate
))
467 xPersist
->write(_rxOutStream
);
469 // Calculate the length
470 nLen
= xMark
->offsetToMark(nMark
) - 4;
471 xMark
->jumpToMark(nMark
);
472 _rxOutStream
->writeLong(nLen
);
473 xMark
->jumpToFurthest();
474 xMark
->deleteMark(nMark
);
476 // 2. Write a version number
477 _rxOutStream
->writeShort(0x0002);
479 sal_uInt16 nAnyMask
= 0;
480 if (m_aWidth
.getValueTypeClass() == TypeClass_LONG
)
483 if (m_aAlign
.getValueTypeClass() == TypeClass_SHORT
)
486 nAnyMask
|= COMPATIBLE_HIDDEN
;
488 _rxOutStream
->writeShort(nAnyMask
);
490 if (nAnyMask
& WIDTH
)
491 _rxOutStream
->writeLong(getINT32(m_aWidth
));
492 if (nAnyMask
& ALIGN
)
493 _rxOutStream
->writeShort(getINT16(m_aAlign
));
496 _rxOutStream
<< m_aLabel
;
498 // the new place for the hidden flag : after m_aLabel, so older office version read the correct label, too
499 if (nAnyMask
& COMPATIBLE_HIDDEN
)
500 _rxOutStream
->writeBoolean(getBOOL(m_aHidden
));
504 void OGridColumn::read(const Reference
<XObjectInputStream
>& _rxInStream
)
506 // 1. Read the UnoControl
507 sal_Int32 nLen
= _rxInStream
->readLong();
510 Reference
<XMarkableStream
> xMark(_rxInStream
, UNO_QUERY
);
511 sal_Int32 nMark
= xMark
->createMark();
512 if (auto xPersist
= query_aggregation
<XPersistObject
>(m_xAggregate
))
513 xPersist
->read(_rxInStream
);
515 xMark
->jumpToMark(nMark
);
516 _rxInStream
->skipBytes(nLen
);
517 xMark
->deleteMark(nMark
);
520 // 2. Write a version number
521 _rxInStream
->readShort(); // version;
522 sal_uInt16 nAnyMask
= _rxInStream
->readShort();
524 if (nAnyMask
& WIDTH
)
526 sal_Int32 nValue
= _rxInStream
->readLong();
530 if (nAnyMask
& ALIGN
)
532 sal_Int16 nValue
= _rxInStream
->readShort();
535 if (nAnyMask
& OLD_HIDDEN
)
537 bool bValue
= _rxInStream
->readBoolean();
538 m_aHidden
<<= bValue
;
542 _rxInStream
>> m_aLabel
;
544 if (nAnyMask
& COMPATIBLE_HIDDEN
)
546 bool bValue
= _rxInStream
->readBoolean();
547 m_aHidden
<<= bValue
;
551 TextFieldColumn::TextFieldColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
552 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_TEXTFIELD
)
555 TextFieldColumn::TextFieldColumn(const TextFieldColumn
* _pCloneFrom
)
556 :OGridColumn( _pCloneFrom
)
559 css::uno::Reference
< css::beans::XPropertySetInfo
> TextFieldColumn::getPropertySetInfo()
561 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
564 ::cppu::IPropertyArrayHelper
& TextFieldColumn::getInfoHelper()
566 return *getArrayHelper();
568 void TextFieldColumn::fillProperties(
569 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
570 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
573 if (m_xAggregateSet
.is())
575 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
576 clearAggregateProperties(_rAggregateProps
, false);
577 setOwnProperties(_rProps
);
580 rtl::Reference
<OGridColumn
> TextFieldColumn::createCloneColumn() const
582 return new TextFieldColumn(this);
585 PatternFieldColumn::PatternFieldColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
586 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_PATTERNFIELD
)
589 PatternFieldColumn::PatternFieldColumn(const PatternFieldColumn
* _pCloneFrom
)
590 :OGridColumn( _pCloneFrom
)
593 css::uno::Reference
< css::beans::XPropertySetInfo
> PatternFieldColumn::getPropertySetInfo()
595 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
598 ::cppu::IPropertyArrayHelper
& PatternFieldColumn::getInfoHelper()
600 return *getArrayHelper();
602 void PatternFieldColumn::fillProperties(
603 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
604 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
607 if (m_xAggregateSet
.is())
609 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
610 clearAggregateProperties(_rAggregateProps
, false);
611 setOwnProperties(_rProps
);
614 rtl::Reference
<OGridColumn
> PatternFieldColumn::createCloneColumn() const
616 return new PatternFieldColumn(this);
619 DateFieldColumn::DateFieldColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
620 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_DATEFIELD
)
623 DateFieldColumn::DateFieldColumn(const DateFieldColumn
* _pCloneFrom
)
624 :OGridColumn( _pCloneFrom
)
627 css::uno::Reference
< css::beans::XPropertySetInfo
> DateFieldColumn::getPropertySetInfo()
629 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
632 ::cppu::IPropertyArrayHelper
& DateFieldColumn::getInfoHelper()
634 return *getArrayHelper();
636 void DateFieldColumn::fillProperties(
637 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
638 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
641 if (m_xAggregateSet
.is())
643 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
644 clearAggregateProperties(_rAggregateProps
, true);
645 setOwnProperties(_rProps
);
648 rtl::Reference
<OGridColumn
> DateFieldColumn::createCloneColumn() const
650 return new DateFieldColumn(this);
653 TimeFieldColumn::TimeFieldColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
654 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_TIMEFIELD
)
657 TimeFieldColumn::TimeFieldColumn(const TimeFieldColumn
* _pCloneFrom
)
658 :OGridColumn( _pCloneFrom
)
661 css::uno::Reference
< css::beans::XPropertySetInfo
> TimeFieldColumn::getPropertySetInfo()
663 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
666 ::cppu::IPropertyArrayHelper
& TimeFieldColumn::getInfoHelper()
668 return *getArrayHelper();
670 void TimeFieldColumn::fillProperties(
671 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
672 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
675 if (m_xAggregateSet
.is())
677 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
678 clearAggregateProperties(_rAggregateProps
, false);
679 setOwnProperties(_rProps
);
682 rtl::Reference
<OGridColumn
> TimeFieldColumn::createCloneColumn() const
684 return new TimeFieldColumn(this);
687 NumericFieldColumn::NumericFieldColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
688 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_NUMERICFIELD
)
691 NumericFieldColumn::NumericFieldColumn(const NumericFieldColumn
* _pCloneFrom
)
692 :OGridColumn( _pCloneFrom
)
695 css::uno::Reference
< css::beans::XPropertySetInfo
> NumericFieldColumn::getPropertySetInfo()
697 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
700 ::cppu::IPropertyArrayHelper
& NumericFieldColumn::getInfoHelper()
702 return *getArrayHelper();
704 void NumericFieldColumn::fillProperties(
705 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
706 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
709 if (m_xAggregateSet
.is())
711 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
712 clearAggregateProperties(_rAggregateProps
, false);
713 setOwnProperties(_rProps
);
716 rtl::Reference
<OGridColumn
> NumericFieldColumn::createCloneColumn() const
718 return new NumericFieldColumn(this);
721 CurrencyFieldColumn::CurrencyFieldColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
722 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_CURRENCYFIELD
)
725 CurrencyFieldColumn::CurrencyFieldColumn(const CurrencyFieldColumn
* _pCloneFrom
)
726 :OGridColumn( _pCloneFrom
)
729 css::uno::Reference
< css::beans::XPropertySetInfo
> CurrencyFieldColumn::getPropertySetInfo()
731 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
734 ::cppu::IPropertyArrayHelper
& CurrencyFieldColumn::getInfoHelper()
736 return *getArrayHelper();
738 void CurrencyFieldColumn::fillProperties(
739 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
740 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
743 if (m_xAggregateSet
.is())
745 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
746 clearAggregateProperties(_rAggregateProps
, false);
747 setOwnProperties(_rProps
);
750 rtl::Reference
<OGridColumn
> CurrencyFieldColumn::createCloneColumn() const
752 return new CurrencyFieldColumn(this);
755 CheckBoxColumn::CheckBoxColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
756 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_CHECKBOX
)
759 CheckBoxColumn::CheckBoxColumn(const CheckBoxColumn
* _pCloneFrom
)
760 :OGridColumn( _pCloneFrom
)
763 css::uno::Reference
< css::beans::XPropertySetInfo
> CheckBoxColumn::getPropertySetInfo()
765 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
768 ::cppu::IPropertyArrayHelper
& CheckBoxColumn::getInfoHelper()
770 return *getArrayHelper();
772 void CheckBoxColumn::fillProperties(
773 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
774 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
777 if (m_xAggregateSet
.is())
779 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
780 clearAggregateProperties(_rAggregateProps
, false);
781 setOwnProperties(_rProps
);
784 rtl::Reference
<OGridColumn
> CheckBoxColumn::createCloneColumn() const
786 return new CheckBoxColumn(this);
789 ComboBoxColumn::ComboBoxColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
790 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_COMBOBOX
)
793 ComboBoxColumn::ComboBoxColumn(const ComboBoxColumn
* _pCloneFrom
)
794 :OGridColumn( _pCloneFrom
)
797 css::uno::Reference
< css::beans::XPropertySetInfo
> ComboBoxColumn::getPropertySetInfo()
799 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
802 ::cppu::IPropertyArrayHelper
& ComboBoxColumn::getInfoHelper()
804 return *getArrayHelper();
806 void ComboBoxColumn::fillProperties(
807 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
808 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
811 if (m_xAggregateSet
.is())
813 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
814 clearAggregateProperties(_rAggregateProps
, false);
815 setOwnProperties(_rProps
);
818 rtl::Reference
<OGridColumn
> ComboBoxColumn::createCloneColumn() const
820 return new ComboBoxColumn(this);
823 ListBoxColumn::ListBoxColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
824 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_LISTBOX
)
827 ListBoxColumn::ListBoxColumn(const ListBoxColumn
* _pCloneFrom
)
828 :OGridColumn( _pCloneFrom
)
831 css::uno::Reference
< css::beans::XPropertySetInfo
> ListBoxColumn::getPropertySetInfo()
833 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
836 ::cppu::IPropertyArrayHelper
& ListBoxColumn::getInfoHelper()
838 return *getArrayHelper();
840 void ListBoxColumn::fillProperties(
841 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
842 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
845 if (m_xAggregateSet
.is())
847 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
848 clearAggregateProperties(_rAggregateProps
, false);
849 setOwnProperties(_rProps
);
852 rtl::Reference
<OGridColumn
> ListBoxColumn::createCloneColumn() const
854 return new ListBoxColumn(this);
857 FormattedFieldColumn::FormattedFieldColumn(const css::uno::Reference
<css::uno::XComponentContext
>& _rContext
)
858 :OGridColumn(_rContext
, FRM_SUN_COMPONENT_FORMATTEDFIELD
)
861 FormattedFieldColumn::FormattedFieldColumn(const FormattedFieldColumn
* _pCloneFrom
)
862 :OGridColumn( _pCloneFrom
)
865 css::uno::Reference
< css::beans::XPropertySetInfo
> FormattedFieldColumn::getPropertySetInfo()
867 css::uno::Reference
< css::beans::XPropertySetInfo
> xInfo( createPropertySetInfo( getInfoHelper() ) );
870 ::cppu::IPropertyArrayHelper
& FormattedFieldColumn::getInfoHelper()
872 return *getArrayHelper();
874 void FormattedFieldColumn::fillProperties(
875 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rProps
,
876 css::uno::Sequence
< css::beans::Property
>& /* [out] */ _rAggregateProps
879 if (m_xAggregateSet
.is())
881 _rAggregateProps
= m_xAggregateSet
->getPropertySetInfo()->getProperties();
882 clearAggregateProperties(_rAggregateProps
, false);
883 setOwnProperties(_rProps
);
886 rtl::Reference
<OGridColumn
> FormattedFieldColumn::createCloneColumn() const
888 return new FormattedFieldColumn(this);
894 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */