Version 7.6.3.2-android, tag libreoffice-7.6.3.2-android
[LibreOffice.git] / forms / source / component / Columns.cxx
blobc14b96191be6a316771c39f0128aad3c882c7f2c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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>
39 #include <utility>
42 namespace frm
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::awt;
50 using namespace ::com::sun::star::io;
51 using namespace ::com::sun::star::lang;
52 using namespace ::com::sun::star::util;
53 using namespace ::com::sun::star::text;
54 using namespace ::com::sun::star::form::binding;
56 const sal_uInt16 WIDTH = 0x0001;
57 const sal_uInt16 ALIGN = 0x0002;
58 const sal_uInt16 OLD_HIDDEN = 0x0004;
59 const sal_uInt16 COMPATIBLE_HIDDEN = 0x0008;
62 const css::uno::Sequence<OUString>& getColumnTypes()
64 static css::uno::Sequence<OUString> aColumnTypes = []()
66 css::uno::Sequence<OUString> tmp(10);
67 OUString* pNames = tmp.getArray();
68 pNames[TYPE_CHECKBOX] = "CheckBox";
69 pNames[TYPE_COMBOBOX] = "ComboBox";
70 pNames[TYPE_CURRENCYFIELD] = "CurrencyField";
71 pNames[TYPE_DATEFIELD] = "DateField";
72 pNames[TYPE_FORMATTEDFIELD] = "FormattedField";
73 pNames[TYPE_LISTBOX] = "ListBox";
74 pNames[TYPE_NUMERICFIELD] = "NumericField";
75 pNames[TYPE_PATTERNFIELD] = "PatternField";
76 pNames[TYPE_TEXTFIELD] = "TextField";
77 pNames[TYPE_TIMEFIELD] = "TimeField";
78 return tmp;
79 }();
80 return aColumnTypes;
84 sal_Int32 getColumnTypeByModelName(const OUString& aModelName)
86 static const OUStringLiteral aModelPrefix (u"com.sun.star.form.component.");
87 static const OUStringLiteral aCompatibleModelPrefix (u"stardiv.one.form.component.");
89 sal_Int32 nTypeId = -1;
90 if (aModelName == FRM_COMPONENT_EDIT)
91 nTypeId = TYPE_TEXTFIELD;
92 else
94 sal_Int32 nPrefixPos = aModelName.indexOf(aModelPrefix);
95 #ifdef DBG_UTIL
96 sal_Int32 nCompatiblePrefixPos = aModelName.indexOf(aCompatibleModelPrefix);
97 DBG_ASSERT( (nPrefixPos != -1) || (nCompatiblePrefixPos != -1),
98 "::getColumnTypeByModelName() : wrong service!");
99 #endif
101 OUString aColumnType = (nPrefixPos != -1)
102 ? aModelName.copy(aModelPrefix.getLength())
103 : aModelName.copy(aCompatibleModelPrefix.getLength());
105 const css::uno::Sequence<OUString>& rColumnTypes = getColumnTypes();
106 nTypeId = ::detail::findPos(aColumnType, rColumnTypes);
108 return nTypeId;
111 const Sequence<sal_Int8>& OGridColumn::getUnoTunnelId()
113 static const comphelper::UnoIdInit theOGridColumnImplementationId;
114 return theOGridColumnImplementationId.getSeq();
118 sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence<sal_Int8>& _rIdentifier)
120 sal_Int64 nReturn(0);
122 if ( comphelper::isUnoTunnelId<OGridColumn>(_rIdentifier) )
124 nReturn = comphelper::getSomething_cast(this);
126 else
128 Reference< XUnoTunnel > xAggTunnel;
129 if ( query_aggregation( m_xAggregate, xAggTunnel ) )
130 return xAggTunnel->getSomething( _rIdentifier );
132 return nReturn;
136 Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId()
138 return css::uno::Sequence<sal_Int8>();
142 Sequence<Type> SAL_CALL OGridColumn::getTypes()
144 TypeBag aTypes( OGridColumn_BASE::getTypes() );
145 // erase the types which we do not support
146 aTypes.removeType( cppu::UnoType<XFormComponent>::get() );
147 aTypes.removeType( cppu::UnoType<XServiceInfo>::get() );
148 aTypes.removeType( cppu::UnoType<XBindableValue>::get() );
149 aTypes.removeType( cppu::UnoType<XPropertyContainer>::get() );
151 // but re-add their base class(es)
152 aTypes.addType( cppu::UnoType<XChild>::get() );
154 Reference< XTypeProvider > xProv;
155 if ( query_aggregation( m_xAggregate, xProv ))
156 aTypes.addTypes( xProv->getTypes() );
158 aTypes.removeType( cppu::UnoType<XTextRange>::get() );
159 aTypes.removeType( cppu::UnoType<XSimpleText>::get() );
160 aTypes.removeType( cppu::UnoType<XText>::get() );
162 return aTypes.getTypes();
166 Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType )
168 Any aReturn;
169 // some functionality at our aggregate cannot be reasonably fulfilled here.
170 if ( _rType.equals(cppu::UnoType<XFormComponent>::get())
171 || _rType.equals(cppu::UnoType<XServiceInfo>::get())
172 || _rType.equals(cppu::UnoType<XBindableValue>::get())
173 || _rType.equals(cppu::UnoType<XPropertyContainer>::get())
174 || comphelper::isAssignableFrom(cppu::UnoType<XTextRange>::get(),_rType)
176 return aReturn;
178 aReturn = OGridColumn_BASE::queryAggregation(_rType);
179 if (!aReturn.hasValue())
181 aReturn = OPropertySetAggregationHelper::queryInterface(_rType);
182 if (!aReturn.hasValue() && m_xAggregate.is())
183 aReturn = m_xAggregate->queryAggregation(_rType);
186 return aReturn;
190 OGridColumn::OGridColumn( const Reference<XComponentContext>& _rContext, OUString _sModelName )
191 :OGridColumn_BASE(m_aMutex)
192 ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper)
193 ,m_aHidden( Any( false ) )
194 ,m_aModelName(std::move(_sModelName))
197 // Create the UnoControlModel
198 if ( m_aModelName.isEmpty() ) // is there a to-be-aggregated model?
199 return;
201 osl_atomic_increment( &m_refCount );
204 m_xAggregate.set( _rContext->getServiceManager()->createInstanceWithContext( m_aModelName, _rContext ), UNO_QUERY );
205 setAggregation( m_xAggregate );
208 if ( m_xAggregate.is() )
209 { // don't omit those brackets - they ensure that the following temporary is properly deleted
210 m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
213 // Set refcount back to zero
214 osl_atomic_decrement( &m_refCount );
218 OGridColumn::OGridColumn( const OGridColumn* _pOriginal )
219 :OGridColumn_BASE( m_aMutex )
220 ,OPropertySetAggregationHelper( OGridColumn_BASE::rBHelper )
223 m_aWidth = _pOriginal->m_aWidth;
224 m_aAlign = _pOriginal->m_aAlign;
225 m_aHidden = _pOriginal->m_aHidden;
226 m_aModelName = _pOriginal->m_aModelName;
227 m_aLabel = _pOriginal->m_aLabel;
229 osl_atomic_increment( &m_refCount );
232 m_xAggregate = createAggregateClone( _pOriginal );
233 setAggregation( m_xAggregate );
236 if ( m_xAggregate.is() )
237 { // don't omit this brackets - they ensure that the following temporary is properly deleted
238 m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
241 osl_atomic_decrement( &m_refCount );
245 OGridColumn::~OGridColumn()
247 if (!OGridColumn_BASE::rBHelper.bDisposed)
249 acquire();
250 dispose();
253 // Free the aggregate
254 if (m_xAggregate.is())
256 css::uno::Reference<css::uno::XInterface> xIface;
257 m_xAggregate->setDelegator(xIface);
262 // XEventListener
264 void SAL_CALL OGridColumn::disposing(const EventObject& _rSource)
266 OPropertySetAggregationHelper::disposing(_rSource);
268 Reference<XEventListener> xEvtLstner;
269 if (query_aggregation(m_xAggregate, xEvtLstner))
270 xEvtLstner->disposing(_rSource);
273 // OGridColumn_BASE
275 void OGridColumn::disposing()
277 OGridColumn_BASE::disposing();
278 OPropertySetAggregationHelper::disposing();
280 Reference<XComponent> xComp;
281 if (query_aggregation(m_xAggregate, xComp))
282 xComp->dispose();
286 void OGridColumn::clearAggregateProperties( Sequence< Property >& _rProps, bool bAllowDropDown )
288 // some properties are not to be exposed to the outer world
289 static const o3tl::sorted_vector< OUString > aForbiddenProperties {
290 PROPERTY_ALIGN,
291 PROPERTY_AUTOCOMPLETE,
292 PROPERTY_BACKGROUNDCOLOR,
293 PROPERTY_BORDER,
294 PROPERTY_BORDERCOLOR,
295 PROPERTY_ECHO_CHAR,
296 PROPERTY_FILLCOLOR,
297 PROPERTY_FONT,
298 PROPERTY_FONT_NAME,
299 PROPERTY_FONT_STYLENAME,
300 PROPERTY_FONT_FAMILY,
301 PROPERTY_FONT_CHARSET,
302 PROPERTY_FONT_HEIGHT,
303 PROPERTY_FONT_WEIGHT,
304 PROPERTY_FONT_SLANT,
305 PROPERTY_FONT_UNDERLINE,
306 PROPERTY_FONT_STRIKEOUT,
307 PROPERTY_FONT_WORDLINEMODE,
308 PROPERTY_TEXTLINECOLOR,
309 PROPERTY_FONTEMPHASISMARK,
310 PROPERTY_FONTRELIEF,
311 PROPERTY_HARDLINEBREAKS,
312 PROPERTY_HSCROLL,
313 PROPERTY_LABEL,
314 PROPERTY_LINECOLOR,
315 PROPERTY_MULTISELECTION,
316 PROPERTY_PRINTABLE,
317 PROPERTY_TABINDEX,
318 PROPERTY_TABSTOP,
319 PROPERTY_TEXTCOLOR,
320 PROPERTY_VSCROLL,
321 PROPERTY_CONTROLLABEL,
322 PROPERTY_RICH_TEXT,
323 PROPERTY_VERTICAL_ALIGN,
324 PROPERTY_IMAGE_URL,
325 PROPERTY_IMAGE_POSITION,
326 PROPERTY_ENABLEVISIBLE
329 Sequence< Property > aNewProps( _rProps.getLength() );
330 Property* pNewProps = aNewProps.getArray();
332 const Property* pProps = _rProps.getConstArray();
333 const Property* pPropsEnd = pProps + _rProps.getLength();
334 for ( ; pProps != pPropsEnd; ++pProps )
336 if ( aForbiddenProperties.find( pProps->Name ) == aForbiddenProperties.end()
337 && (bAllowDropDown || pProps->Name != PROPERTY_DROPDOWN))
338 *pNewProps++ = *pProps;
341 aNewProps.realloc( pNewProps - aNewProps.getArray() );
342 _rProps = aNewProps;
346 void OGridColumn::setOwnProperties(Sequence<Property>& aDescriptor)
348 aDescriptor.realloc(5);
349 Property* pProperties = aDescriptor.getArray();
350 *pProperties++ = css::beans::Property(PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
351 *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);
352 *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);
353 *pProperties++ = css::beans::Property(PROPERTY_HIDDEN, PROPERTY_ID_HIDDEN, cppu::UnoType<bool>::get(),
354 css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
355 *pProperties++ = css::beans::Property(PROPERTY_COLUMNSERVICENAME, PROPERTY_ID_COLUMNSERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY);
358 // Reference<XPropertySet>
360 void OGridColumn::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) const
362 switch (nHandle)
364 case PROPERTY_ID_COLUMNSERVICENAME:
365 rValue <<= m_aModelName;
366 break;
367 case PROPERTY_ID_LABEL:
368 rValue <<= m_aLabel;
369 break;
370 case PROPERTY_ID_WIDTH:
371 rValue = m_aWidth;
372 break;
373 case PROPERTY_ID_ALIGN:
374 rValue = m_aAlign;
375 break;
376 case PROPERTY_ID_HIDDEN:
377 rValue = m_aHidden;
378 break;
379 default:
380 OPropertySetAggregationHelper::getFastPropertyValue(rValue, nHandle);
385 sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue,
386 sal_Int32 nHandle, const Any& rValue )
388 bool bModified(false);
389 switch (nHandle)
391 case PROPERTY_ID_LABEL:
392 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aLabel);
393 break;
394 case PROPERTY_ID_WIDTH:
395 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, cppu::UnoType<sal_Int32>::get());
396 break;
397 case PROPERTY_ID_ALIGN:
398 bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_aAlign, cppu::UnoType<sal_Int32>::get());
399 // strange enough, css.awt.TextAlign is a 32-bit integer, while the Align property (both here for grid controls
400 // and for ordinary toolkit controls) is a 16-bit integer. So, allow for 32 bit, but normalize it to 16 bit
401 if ( bModified )
403 sal_Int32 nAlign( 0 );
404 if ( rConvertedValue >>= nAlign )
405 rConvertedValue <<= static_cast<sal_Int16>(nAlign);
407 break;
408 case PROPERTY_ID_HIDDEN:
409 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, getBOOL(m_aHidden));
410 break;
412 return bModified;
416 void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue )
418 switch (nHandle)
420 case PROPERTY_ID_LABEL:
421 DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" );
422 rValue >>= m_aLabel;
423 break;
424 case PROPERTY_ID_WIDTH:
425 m_aWidth = rValue;
426 break;
427 case PROPERTY_ID_ALIGN:
428 m_aAlign = rValue;
429 break;
430 case PROPERTY_ID_HIDDEN:
431 m_aHidden = rValue;
432 break;
437 // XPropertyState
439 Any OGridColumn::getPropertyDefaultByHandle( sal_Int32 nHandle ) const
441 switch (nHandle)
443 case PROPERTY_ID_WIDTH:
444 case PROPERTY_ID_ALIGN:
445 return Any();
446 case PROPERTY_ID_HIDDEN:
447 return Any(false);
448 default:
449 return OPropertySetAggregationHelper::getPropertyDefaultByHandle(nHandle);
453 // XCloneable
455 Reference< XCloneable > SAL_CALL OGridColumn::createClone( )
457 return createCloneColumn();
460 // XPersistObject
462 void OGridColumn::write(const Reference<XObjectOutputStream>& _rxOutStream)
464 // 1. Write the UnoControl
465 Reference<XMarkableStream> xMark(_rxOutStream, UNO_QUERY);
466 sal_Int32 nMark = xMark->createMark();
468 sal_Int32 nLen = 0;
469 _rxOutStream->writeLong(nLen);
471 Reference<XPersistObject> xPersist;
472 if (query_aggregation(m_xAggregate, xPersist))
473 xPersist->write(_rxOutStream);
475 // Calculate the length
476 nLen = xMark->offsetToMark(nMark) - 4;
477 xMark->jumpToMark(nMark);
478 _rxOutStream->writeLong(nLen);
479 xMark->jumpToFurthest();
480 xMark->deleteMark(nMark);
482 // 2. Write a version number
483 _rxOutStream->writeShort(0x0002);
485 sal_uInt16 nAnyMask = 0;
486 if (m_aWidth.getValueType().getTypeClass() == TypeClass_LONG)
487 nAnyMask |= WIDTH;
489 if (m_aAlign.getValueTypeClass() == TypeClass_SHORT)
490 nAnyMask |= ALIGN;
492 nAnyMask |= COMPATIBLE_HIDDEN;
494 _rxOutStream->writeShort(nAnyMask);
496 if (nAnyMask & WIDTH)
497 _rxOutStream->writeLong(getINT32(m_aWidth));
498 if (nAnyMask & ALIGN)
499 _rxOutStream->writeShort(getINT16(m_aAlign));
501 // Name
502 _rxOutStream << m_aLabel;
504 // the new place for the hidden flag : after m_aLabel, so older office version read the correct label, too
505 if (nAnyMask & COMPATIBLE_HIDDEN)
506 _rxOutStream->writeBoolean(getBOOL(m_aHidden));
510 void OGridColumn::read(const Reference<XObjectInputStream>& _rxInStream)
512 // 1. Read the UnoControl
513 sal_Int32 nLen = _rxInStream->readLong();
514 if (nLen)
516 Reference<XMarkableStream> xMark(_rxInStream, UNO_QUERY);
517 sal_Int32 nMark = xMark->createMark();
518 Reference<XPersistObject> xPersist;
519 if (query_aggregation(m_xAggregate, xPersist))
520 xPersist->read(_rxInStream);
522 xMark->jumpToMark(nMark);
523 _rxInStream->skipBytes(nLen);
524 xMark->deleteMark(nMark);
527 // 2. Write a version number
528 _rxInStream->readShort(); // version;
529 sal_uInt16 nAnyMask = _rxInStream->readShort();
531 if (nAnyMask & WIDTH)
533 sal_Int32 nValue = _rxInStream->readLong();
534 m_aWidth <<= nValue;
537 if (nAnyMask & ALIGN)
539 sal_Int16 nValue = _rxInStream->readShort();
540 m_aAlign <<= nValue;
542 if (nAnyMask & OLD_HIDDEN)
544 bool bValue = _rxInStream->readBoolean();
545 m_aHidden <<= bValue;
548 // Name
549 _rxInStream >> m_aLabel;
551 if (nAnyMask & COMPATIBLE_HIDDEN)
553 bool bValue = _rxInStream->readBoolean();
554 m_aHidden <<= bValue;
558 TextFieldColumn::TextFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
559 :OGridColumn(_rContext, FRM_SUN_COMPONENT_TEXTFIELD)
562 TextFieldColumn::TextFieldColumn(const TextFieldColumn* _pCloneFrom)
563 :OGridColumn( _pCloneFrom )
566 css::uno::Reference< css::beans::XPropertySetInfo> TextFieldColumn::getPropertySetInfo()
568 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
569 return xInfo;
571 ::cppu::IPropertyArrayHelper& TextFieldColumn::getInfoHelper()
573 return *getArrayHelper();
575 void TextFieldColumn::fillProperties(
576 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
577 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
578 ) const
580 if (m_xAggregateSet.is())
582 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
583 clearAggregateProperties(_rAggregateProps, false);
584 setOwnProperties(_rProps);
587 rtl::Reference<OGridColumn> TextFieldColumn::createCloneColumn() const
589 return new TextFieldColumn(this);
592 PatternFieldColumn::PatternFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
593 :OGridColumn(_rContext, FRM_SUN_COMPONENT_PATTERNFIELD)
596 PatternFieldColumn::PatternFieldColumn(const PatternFieldColumn* _pCloneFrom)
597 :OGridColumn( _pCloneFrom )
600 css::uno::Reference< css::beans::XPropertySetInfo> PatternFieldColumn::getPropertySetInfo()
602 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
603 return xInfo;
605 ::cppu::IPropertyArrayHelper& PatternFieldColumn::getInfoHelper()
607 return *getArrayHelper();
609 void PatternFieldColumn::fillProperties(
610 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
611 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
612 ) const
614 if (m_xAggregateSet.is())
616 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
617 clearAggregateProperties(_rAggregateProps, false);
618 setOwnProperties(_rProps);
621 rtl::Reference<OGridColumn> PatternFieldColumn::createCloneColumn() const
623 return new PatternFieldColumn(this);
626 DateFieldColumn::DateFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
627 :OGridColumn(_rContext, FRM_SUN_COMPONENT_DATEFIELD)
630 DateFieldColumn::DateFieldColumn(const DateFieldColumn* _pCloneFrom)
631 :OGridColumn( _pCloneFrom )
634 css::uno::Reference< css::beans::XPropertySetInfo> DateFieldColumn::getPropertySetInfo()
636 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
637 return xInfo;
639 ::cppu::IPropertyArrayHelper& DateFieldColumn::getInfoHelper()
641 return *getArrayHelper();
643 void DateFieldColumn::fillProperties(
644 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
645 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
646 ) const
648 if (m_xAggregateSet.is())
650 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
651 clearAggregateProperties(_rAggregateProps, true);
652 setOwnProperties(_rProps);
655 rtl::Reference<OGridColumn> DateFieldColumn::createCloneColumn() const
657 return new DateFieldColumn(this);
660 TimeFieldColumn::TimeFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
661 :OGridColumn(_rContext, FRM_SUN_COMPONENT_TIMEFIELD)
664 TimeFieldColumn::TimeFieldColumn(const TimeFieldColumn* _pCloneFrom)
665 :OGridColumn( _pCloneFrom )
668 css::uno::Reference< css::beans::XPropertySetInfo> TimeFieldColumn::getPropertySetInfo()
670 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
671 return xInfo;
673 ::cppu::IPropertyArrayHelper& TimeFieldColumn::getInfoHelper()
675 return *getArrayHelper();
677 void TimeFieldColumn::fillProperties(
678 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
679 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
680 ) const
682 if (m_xAggregateSet.is())
684 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
685 clearAggregateProperties(_rAggregateProps, false);
686 setOwnProperties(_rProps);
689 rtl::Reference<OGridColumn> TimeFieldColumn::createCloneColumn() const
691 return new TimeFieldColumn(this);
694 NumericFieldColumn::NumericFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
695 :OGridColumn(_rContext, FRM_SUN_COMPONENT_NUMERICFIELD)
698 NumericFieldColumn::NumericFieldColumn(const NumericFieldColumn* _pCloneFrom)
699 :OGridColumn( _pCloneFrom )
702 css::uno::Reference< css::beans::XPropertySetInfo> NumericFieldColumn::getPropertySetInfo()
704 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
705 return xInfo;
707 ::cppu::IPropertyArrayHelper& NumericFieldColumn::getInfoHelper()
709 return *getArrayHelper();
711 void NumericFieldColumn::fillProperties(
712 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
713 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
714 ) const
716 if (m_xAggregateSet.is())
718 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
719 clearAggregateProperties(_rAggregateProps, false);
720 setOwnProperties(_rProps);
723 rtl::Reference<OGridColumn> NumericFieldColumn::createCloneColumn() const
725 return new NumericFieldColumn(this);
728 CurrencyFieldColumn::CurrencyFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
729 :OGridColumn(_rContext, FRM_SUN_COMPONENT_CURRENCYFIELD)
732 CurrencyFieldColumn::CurrencyFieldColumn(const CurrencyFieldColumn* _pCloneFrom)
733 :OGridColumn( _pCloneFrom )
736 css::uno::Reference< css::beans::XPropertySetInfo> CurrencyFieldColumn::getPropertySetInfo()
738 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
739 return xInfo;
741 ::cppu::IPropertyArrayHelper& CurrencyFieldColumn::getInfoHelper()
743 return *getArrayHelper();
745 void CurrencyFieldColumn::fillProperties(
746 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
747 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
748 ) const
750 if (m_xAggregateSet.is())
752 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
753 clearAggregateProperties(_rAggregateProps, false);
754 setOwnProperties(_rProps);
757 rtl::Reference<OGridColumn> CurrencyFieldColumn::createCloneColumn() const
759 return new CurrencyFieldColumn(this);
762 CheckBoxColumn::CheckBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
763 :OGridColumn(_rContext, FRM_SUN_COMPONENT_CHECKBOX)
766 CheckBoxColumn::CheckBoxColumn(const CheckBoxColumn* _pCloneFrom)
767 :OGridColumn( _pCloneFrom )
770 css::uno::Reference< css::beans::XPropertySetInfo> CheckBoxColumn::getPropertySetInfo()
772 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
773 return xInfo;
775 ::cppu::IPropertyArrayHelper& CheckBoxColumn::getInfoHelper()
777 return *getArrayHelper();
779 void CheckBoxColumn::fillProperties(
780 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
781 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
782 ) const
784 if (m_xAggregateSet.is())
786 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
787 clearAggregateProperties(_rAggregateProps, false);
788 setOwnProperties(_rProps);
791 rtl::Reference<OGridColumn> CheckBoxColumn::createCloneColumn() const
793 return new CheckBoxColumn(this);
796 ComboBoxColumn::ComboBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
797 :OGridColumn(_rContext, FRM_SUN_COMPONENT_COMBOBOX)
800 ComboBoxColumn::ComboBoxColumn(const ComboBoxColumn* _pCloneFrom)
801 :OGridColumn( _pCloneFrom )
804 css::uno::Reference< css::beans::XPropertySetInfo> ComboBoxColumn::getPropertySetInfo()
806 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
807 return xInfo;
809 ::cppu::IPropertyArrayHelper& ComboBoxColumn::getInfoHelper()
811 return *getArrayHelper();
813 void ComboBoxColumn::fillProperties(
814 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
815 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
816 ) const
818 if (m_xAggregateSet.is())
820 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
821 clearAggregateProperties(_rAggregateProps, false);
822 setOwnProperties(_rProps);
825 rtl::Reference<OGridColumn> ComboBoxColumn::createCloneColumn() const
827 return new ComboBoxColumn(this);
830 ListBoxColumn::ListBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
831 :OGridColumn(_rContext, FRM_SUN_COMPONENT_LISTBOX)
834 ListBoxColumn::ListBoxColumn(const ListBoxColumn* _pCloneFrom)
835 :OGridColumn( _pCloneFrom )
838 css::uno::Reference< css::beans::XPropertySetInfo> ListBoxColumn::getPropertySetInfo()
840 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
841 return xInfo;
843 ::cppu::IPropertyArrayHelper& ListBoxColumn::getInfoHelper()
845 return *getArrayHelper();
847 void ListBoxColumn::fillProperties(
848 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
849 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
850 ) const
852 if (m_xAggregateSet.is())
854 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
855 clearAggregateProperties(_rAggregateProps, false);
856 setOwnProperties(_rProps);
859 rtl::Reference<OGridColumn> ListBoxColumn::createCloneColumn() const
861 return new ListBoxColumn(this);
864 FormattedFieldColumn::FormattedFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
865 :OGridColumn(_rContext, FRM_SUN_COMPONENT_FORMATTEDFIELD)
868 FormattedFieldColumn::FormattedFieldColumn(const FormattedFieldColumn* _pCloneFrom)
869 :OGridColumn( _pCloneFrom )
872 css::uno::Reference< css::beans::XPropertySetInfo> FormattedFieldColumn::getPropertySetInfo()
874 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
875 return xInfo;
877 ::cppu::IPropertyArrayHelper& FormattedFieldColumn::getInfoHelper()
879 return *getArrayHelper();
881 void FormattedFieldColumn::fillProperties(
882 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
883 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
884 ) const
886 if (m_xAggregateSet.is())
888 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
889 clearAggregateProperties(_rAggregateProps, false);
890 setOwnProperties(_rProps);
893 rtl::Reference<OGridColumn> FormattedFieldColumn::createCloneColumn() const
895 return new FormattedFieldColumn(this);
898 } // namespace frm
901 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */