LanguageTool: don't crash if REST protocol isn't set
[LibreOffice.git] / forms / source / component / Columns.cxx
blob190af02c15c0507d6608a3578a2fea8127540adb
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/io/XPersistObject.hpp>
25 #include <com/sun/star/io/XMarkableStream.hpp>
26 #include <com/sun/star/form/XFormComponent.hpp>
27 #include <com/sun/star/lang/XServiceInfo.hpp>
28 #include <com/sun/star/form/binding/XBindableValue.hpp>
29 #include <com/sun/star/beans/XPropertyContainer.hpp>
30 #include <com/sun/star/text/XText.hpp>
31 #include <comphelper/property.hxx>
32 #include <comphelper/basicio.hxx>
33 #include <comphelper/servicehelper.hxx>
34 #include <comphelper/types.hxx>
35 #include <services.hxx>
36 #include <tools/debug.hxx>
37 #include <o3tl/sorted_vector.hxx>
40 namespace frm
43 using namespace ::com::sun::star::uno;
44 using namespace ::com::sun::star::beans;
45 using namespace ::com::sun::star::container;
46 using namespace ::com::sun::star::form;
47 using namespace ::com::sun::star::awt;
48 using namespace ::com::sun::star::io;
49 using namespace ::com::sun::star::lang;
50 using namespace ::com::sun::star::util;
51 using namespace ::com::sun::star::text;
52 using namespace ::com::sun::star::form::binding;
54 const sal_uInt16 WIDTH = 0x0001;
55 const sal_uInt16 ALIGN = 0x0002;
56 const sal_uInt16 OLD_HIDDEN = 0x0004;
57 const sal_uInt16 COMPATIBLE_HIDDEN = 0x0008;
60 const css::uno::Sequence<OUString>& getColumnTypes()
62 static css::uno::Sequence<OUString> aColumnTypes = []()
64 css::uno::Sequence<OUString> tmp(10);
65 OUString* pNames = tmp.getArray();
66 pNames[TYPE_CHECKBOX] = "CheckBox";
67 pNames[TYPE_COMBOBOX] = "ComboBox";
68 pNames[TYPE_CURRENCYFIELD] = "CurrencyField";
69 pNames[TYPE_DATEFIELD] = "DateField";
70 pNames[TYPE_FORMATTEDFIELD] = "FormattedField";
71 pNames[TYPE_LISTBOX] = "ListBox";
72 pNames[TYPE_NUMERICFIELD] = "NumericField";
73 pNames[TYPE_PATTERNFIELD] = "PatternField";
74 pNames[TYPE_TEXTFIELD] = "TextField";
75 pNames[TYPE_TIMEFIELD] = "TimeField";
76 return tmp;
77 }();
78 return aColumnTypes;
82 sal_Int32 getColumnTypeByModelName(const OUString& aModelName)
84 static const OUStringLiteral aModelPrefix (u"com.sun.star.form.component.");
85 static const OUStringLiteral aCompatibleModelPrefix (u"stardiv.one.form.component.");
87 sal_Int32 nTypeId = -1;
88 if (aModelName == FRM_COMPONENT_EDIT)
89 nTypeId = TYPE_TEXTFIELD;
90 else
92 sal_Int32 nPrefixPos = aModelName.indexOf(aModelPrefix);
93 #ifdef DBG_UTIL
94 sal_Int32 nCompatiblePrefixPos = aModelName.indexOf(aCompatibleModelPrefix);
95 DBG_ASSERT( (nPrefixPos != -1) || (nCompatiblePrefixPos != -1),
96 "::getColumnTypeByModelName() : wrong service!");
97 #endif
99 OUString aColumnType = (nPrefixPos != -1)
100 ? aModelName.copy(aModelPrefix.getLength())
101 : aModelName.copy(aCompatibleModelPrefix.getLength());
103 const css::uno::Sequence<OUString>& rColumnTypes = getColumnTypes();
104 nTypeId = ::detail::findPos(aColumnType, rColumnTypes);
106 return nTypeId;
109 const Sequence<sal_Int8>& OGridColumn::getUnoTunnelId()
111 static const comphelper::UnoIdInit theOGridColumnImplementationId;
112 return theOGridColumnImplementationId.getSeq();
116 sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence<sal_Int8>& _rIdentifier)
118 sal_Int64 nReturn(0);
120 if ( comphelper::isUnoTunnelId<OGridColumn>(_rIdentifier) )
122 nReturn = comphelper::getSomething_cast(this);
124 else
126 Reference< XUnoTunnel > xAggTunnel;
127 if ( query_aggregation( m_xAggregate, xAggTunnel ) )
128 return xAggTunnel->getSomething( _rIdentifier );
130 return nReturn;
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 Reference< XTypeProvider > xProv;
153 if ( query_aggregation( m_xAggregate, xProv ))
154 aTypes.addTypes( xProv->getTypes() );
156 aTypes.removeType( cppu::UnoType<XTextRange>::get() );
157 aTypes.removeType( cppu::UnoType<XSimpleText>::get() );
158 aTypes.removeType( cppu::UnoType<XText>::get() );
160 return aTypes.getTypes();
164 Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType )
166 Any aReturn;
167 // some functionality at our aggregate cannot be reasonably fulfilled here.
168 if ( _rType.equals(cppu::UnoType<XFormComponent>::get())
169 || _rType.equals(cppu::UnoType<XServiceInfo>::get())
170 || _rType.equals(cppu::UnoType<XBindableValue>::get())
171 || _rType.equals(cppu::UnoType<XPropertyContainer>::get())
172 || comphelper::isAssignableFrom(cppu::UnoType<XTextRange>::get(),_rType)
174 return aReturn;
176 aReturn = OGridColumn_BASE::queryAggregation(_rType);
177 if (!aReturn.hasValue())
179 aReturn = OPropertySetAggregationHelper::queryInterface(_rType);
180 if (!aReturn.hasValue() && m_xAggregate.is())
181 aReturn = m_xAggregate->queryAggregation(_rType);
184 return aReturn;
188 OGridColumn::OGridColumn( const Reference<XComponentContext>& _rContext, const OUString& _sModelName )
189 :OGridColumn_BASE(m_aMutex)
190 ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper)
191 ,m_aHidden( makeAny( false ) )
192 ,m_aModelName(_sModelName)
195 // Create the UnoControlModel
196 if ( m_aModelName.isEmpty() ) // is there a to-be-aggregated model?
197 return;
199 osl_atomic_increment( &m_refCount );
202 m_xAggregate.set( _rContext->getServiceManager()->createInstanceWithContext( m_aModelName, _rContext ), UNO_QUERY );
203 setAggregation( m_xAggregate );
206 if ( m_xAggregate.is() )
207 { // don't omit those brackets - they ensure that the following temporary is properly deleted
208 m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
211 // Set refcount back to zero
212 osl_atomic_decrement( &m_refCount );
216 OGridColumn::OGridColumn( const OGridColumn* _pOriginal )
217 :OGridColumn_BASE( m_aMutex )
218 ,OPropertySetAggregationHelper( OGridColumn_BASE::rBHelper )
221 m_aWidth = _pOriginal->m_aWidth;
222 m_aAlign = _pOriginal->m_aAlign;
223 m_aHidden = _pOriginal->m_aHidden;
224 m_aModelName = _pOriginal->m_aModelName;
225 m_aLabel = _pOriginal->m_aLabel;
227 osl_atomic_increment( &m_refCount );
230 m_xAggregate = createAggregateClone( _pOriginal );
231 setAggregation( m_xAggregate );
234 if ( m_xAggregate.is() )
235 { // don't omit this brackets - they ensure that the following temporary is properly deleted
236 m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
239 osl_atomic_decrement( &m_refCount );
243 OGridColumn::~OGridColumn()
245 if (!OGridColumn_BASE::rBHelper.bDisposed)
247 acquire();
248 dispose();
251 // Free the aggregate
252 if (m_xAggregate.is())
254 css::uno::Reference<css::uno::XInterface> xIface;
255 m_xAggregate->setDelegator(xIface);
260 // XEventListener
262 void SAL_CALL OGridColumn::disposing(const EventObject& _rSource)
264 OPropertySetAggregationHelper::disposing(_rSource);
266 Reference<XEventListener> xEvtLstner;
267 if (query_aggregation(m_xAggregate, xEvtLstner))
268 xEvtLstner->disposing(_rSource);
271 // OGridColumn_BASE
273 void OGridColumn::disposing()
275 OGridColumn_BASE::disposing();
276 OPropertySetAggregationHelper::disposing();
278 Reference<XComponent> xComp;
279 if (query_aggregation(m_xAggregate, xComp))
280 xComp->dispose();
284 void OGridColumn::clearAggregateProperties( Sequence< Property >& _rProps, bool bAllowDropDown )
286 // some properties are not to be exposed to the outer world
287 static const o3tl::sorted_vector< OUString > aForbiddenProperties {
288 PROPERTY_ALIGN,
289 PROPERTY_AUTOCOMPLETE,
290 PROPERTY_BACKGROUNDCOLOR,
291 PROPERTY_BORDER,
292 PROPERTY_BORDERCOLOR,
293 PROPERTY_ECHO_CHAR,
294 PROPERTY_FILLCOLOR,
295 PROPERTY_FONT,
296 PROPERTY_FONT_NAME,
297 PROPERTY_FONT_STYLENAME,
298 PROPERTY_FONT_FAMILY,
299 PROPERTY_FONT_CHARSET,
300 PROPERTY_FONT_HEIGHT,
301 PROPERTY_FONT_WEIGHT,
302 PROPERTY_FONT_SLANT,
303 PROPERTY_FONT_UNDERLINE,
304 PROPERTY_FONT_STRIKEOUT,
305 PROPERTY_FONT_WORDLINEMODE,
306 PROPERTY_TEXTLINECOLOR,
307 PROPERTY_FONTEMPHASISMARK,
308 PROPERTY_FONTRELIEF,
309 PROPERTY_HARDLINEBREAKS,
310 PROPERTY_HSCROLL,
311 PROPERTY_LABEL,
312 PROPERTY_LINECOLOR,
313 PROPERTY_MULTISELECTION,
314 PROPERTY_PRINTABLE,
315 PROPERTY_TABINDEX,
316 PROPERTY_TABSTOP,
317 PROPERTY_TEXTCOLOR,
318 PROPERTY_VSCROLL,
319 PROPERTY_CONTROLLABEL,
320 PROPERTY_RICH_TEXT,
321 PROPERTY_VERTICAL_ALIGN,
322 PROPERTY_IMAGE_URL,
323 PROPERTY_IMAGE_POSITION,
324 PROPERTY_ENABLEVISIBLE
327 Sequence< Property > aNewProps( _rProps.getLength() );
328 Property* pNewProps = aNewProps.getArray();
330 const Property* pProps = _rProps.getConstArray();
331 const Property* pPropsEnd = pProps + _rProps.getLength();
332 for ( ; pProps != pPropsEnd; ++pProps )
334 if ( aForbiddenProperties.find( pProps->Name ) == aForbiddenProperties.end()
335 && (bAllowDropDown || pProps->Name != PROPERTY_DROPDOWN))
336 *pNewProps++ = *pProps;
339 aNewProps.realloc( pNewProps - aNewProps.getArray() );
340 _rProps = aNewProps;
344 void OGridColumn::setOwnProperties(Sequence<Property>& aDescriptor)
346 aDescriptor.realloc(5);
347 Property* pProperties = aDescriptor.getArray();
348 *pProperties++ = css::beans::Property(PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
349 *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);
350 *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);
351 *pProperties++ = css::beans::Property(PROPERTY_HIDDEN, PROPERTY_ID_HIDDEN, cppu::UnoType<bool>::get(),
352 css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
353 *pProperties++ = css::beans::Property(PROPERTY_COLUMNSERVICENAME, PROPERTY_ID_COLUMNSERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY);
356 // Reference<XPropertySet>
358 void OGridColumn::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) const
360 switch (nHandle)
362 case PROPERTY_ID_COLUMNSERVICENAME:
363 rValue <<= m_aModelName;
364 break;
365 case PROPERTY_ID_LABEL:
366 rValue <<= m_aLabel;
367 break;
368 case PROPERTY_ID_WIDTH:
369 rValue = m_aWidth;
370 break;
371 case PROPERTY_ID_ALIGN:
372 rValue = m_aAlign;
373 break;
374 case PROPERTY_ID_HIDDEN:
375 rValue = m_aHidden;
376 break;
377 default:
378 OPropertySetAggregationHelper::getFastPropertyValue(rValue, nHandle);
383 sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue,
384 sal_Int32 nHandle, const Any& rValue )
386 bool bModified(false);
387 switch (nHandle)
389 case PROPERTY_ID_LABEL:
390 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aLabel);
391 break;
392 case PROPERTY_ID_WIDTH:
393 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, cppu::UnoType<sal_Int32>::get());
394 break;
395 case PROPERTY_ID_ALIGN:
396 bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_aAlign, cppu::UnoType<sal_Int32>::get());
397 // strange enough, css.awt.TextAlign is a 32-bit integer, while the Align property (both here for grid controls
398 // and for ordinary toolkit controls) is a 16-bit integer. So, allow for 32 bit, but normalize it to 16 bit
399 if ( bModified )
401 sal_Int32 nAlign( 0 );
402 if ( rConvertedValue >>= nAlign )
403 rConvertedValue <<= static_cast<sal_Int16>(nAlign);
405 break;
406 case PROPERTY_ID_HIDDEN:
407 bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, getBOOL(m_aHidden));
408 break;
410 return bModified;
414 void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue )
416 switch (nHandle)
418 case PROPERTY_ID_LABEL:
419 DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" );
420 rValue >>= m_aLabel;
421 break;
422 case PROPERTY_ID_WIDTH:
423 m_aWidth = rValue;
424 break;
425 case PROPERTY_ID_ALIGN:
426 m_aAlign = rValue;
427 break;
428 case PROPERTY_ID_HIDDEN:
429 m_aHidden = rValue;
430 break;
435 // XPropertyState
437 Any OGridColumn::getPropertyDefaultByHandle( sal_Int32 nHandle ) const
439 switch (nHandle)
441 case PROPERTY_ID_WIDTH:
442 case PROPERTY_ID_ALIGN:
443 return Any();
444 case PROPERTY_ID_HIDDEN:
445 return makeAny(false);
446 default:
447 return OPropertySetAggregationHelper::getPropertyDefaultByHandle(nHandle);
451 // XCloneable
453 Reference< XCloneable > SAL_CALL OGridColumn::createClone( )
455 return createCloneColumn();
458 // XPersistObject
460 void OGridColumn::write(const Reference<XObjectOutputStream>& _rxOutStream)
462 // 1. Write the UnoControl
463 Reference<XMarkableStream> xMark(_rxOutStream, UNO_QUERY);
464 sal_Int32 nMark = xMark->createMark();
466 sal_Int32 nLen = 0;
467 _rxOutStream->writeLong(nLen);
469 Reference<XPersistObject> xPersist;
470 if (query_aggregation(m_xAggregate, xPersist))
471 xPersist->write(_rxOutStream);
473 // Calculate the length
474 nLen = xMark->offsetToMark(nMark) - 4;
475 xMark->jumpToMark(nMark);
476 _rxOutStream->writeLong(nLen);
477 xMark->jumpToFurthest();
478 xMark->deleteMark(nMark);
480 // 2. Write a version number
481 _rxOutStream->writeShort(0x0002);
483 sal_uInt16 nAnyMask = 0;
484 if (m_aWidth.getValueType().getTypeClass() == TypeClass_LONG)
485 nAnyMask |= WIDTH;
487 if (m_aAlign.getValueTypeClass() == TypeClass_SHORT)
488 nAnyMask |= ALIGN;
490 nAnyMask |= COMPATIBLE_HIDDEN;
492 _rxOutStream->writeShort(nAnyMask);
494 if (nAnyMask & WIDTH)
495 _rxOutStream->writeLong(getINT32(m_aWidth));
496 if (nAnyMask & ALIGN)
497 _rxOutStream->writeShort(getINT16(m_aAlign));
499 // Name
500 _rxOutStream << m_aLabel;
502 // the new place for the hidden flag : after m_aLabel, so older office version read the correct label, too
503 if (nAnyMask & COMPATIBLE_HIDDEN)
504 _rxOutStream->writeBoolean(getBOOL(m_aHidden));
508 void OGridColumn::read(const Reference<XObjectInputStream>& _rxInStream)
510 // 1. Read the UnoControl
511 sal_Int32 nLen = _rxInStream->readLong();
512 if (nLen)
514 Reference<XMarkableStream> xMark(_rxInStream, UNO_QUERY);
515 sal_Int32 nMark = xMark->createMark();
516 Reference<XPersistObject> xPersist;
517 if (query_aggregation(m_xAggregate, xPersist))
518 xPersist->read(_rxInStream);
520 xMark->jumpToMark(nMark);
521 _rxInStream->skipBytes(nLen);
522 xMark->deleteMark(nMark);
525 // 2. Write a version number
526 _rxInStream->readShort(); // version;
527 sal_uInt16 nAnyMask = _rxInStream->readShort();
529 if (nAnyMask & WIDTH)
531 sal_Int32 nValue = _rxInStream->readLong();
532 m_aWidth <<= nValue;
535 if (nAnyMask & ALIGN)
537 sal_Int16 nValue = _rxInStream->readShort();
538 m_aAlign <<= nValue;
540 if (nAnyMask & OLD_HIDDEN)
542 bool bValue = _rxInStream->readBoolean();
543 m_aHidden <<= bValue;
546 // Name
547 _rxInStream >> m_aLabel;
549 if (nAnyMask & COMPATIBLE_HIDDEN)
551 bool bValue = _rxInStream->readBoolean();
552 m_aHidden <<= bValue;
556 TextFieldColumn::TextFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
557 :OGridColumn(_rContext, FRM_SUN_COMPONENT_TEXTFIELD)
560 TextFieldColumn::TextFieldColumn(const TextFieldColumn* _pCloneFrom)
561 :OGridColumn( _pCloneFrom )
564 css::uno::Reference< css::beans::XPropertySetInfo> TextFieldColumn::getPropertySetInfo()
566 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
567 return xInfo;
569 ::cppu::IPropertyArrayHelper& TextFieldColumn::getInfoHelper()
571 return *getArrayHelper();
573 void TextFieldColumn::fillProperties(
574 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
575 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
576 ) const
578 if (m_xAggregateSet.is())
580 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
581 clearAggregateProperties(_rAggregateProps, false);
582 setOwnProperties(_rProps);
585 rtl::Reference<OGridColumn> TextFieldColumn::createCloneColumn() const
587 return new TextFieldColumn(this);
590 PatternFieldColumn::PatternFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
591 :OGridColumn(_rContext, FRM_SUN_COMPONENT_PATTERNFIELD)
594 PatternFieldColumn::PatternFieldColumn(const PatternFieldColumn* _pCloneFrom)
595 :OGridColumn( _pCloneFrom )
598 css::uno::Reference< css::beans::XPropertySetInfo> PatternFieldColumn::getPropertySetInfo()
600 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
601 return xInfo;
603 ::cppu::IPropertyArrayHelper& PatternFieldColumn::getInfoHelper()
605 return *getArrayHelper();
607 void PatternFieldColumn::fillProperties(
608 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
609 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
610 ) const
612 if (m_xAggregateSet.is())
614 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
615 clearAggregateProperties(_rAggregateProps, false);
616 setOwnProperties(_rProps);
619 rtl::Reference<OGridColumn> PatternFieldColumn::createCloneColumn() const
621 return new PatternFieldColumn(this);
624 DateFieldColumn::DateFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
625 :OGridColumn(_rContext, FRM_SUN_COMPONENT_DATEFIELD)
628 DateFieldColumn::DateFieldColumn(const DateFieldColumn* _pCloneFrom)
629 :OGridColumn( _pCloneFrom )
632 css::uno::Reference< css::beans::XPropertySetInfo> DateFieldColumn::getPropertySetInfo()
634 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
635 return xInfo;
637 ::cppu::IPropertyArrayHelper& DateFieldColumn::getInfoHelper()
639 return *getArrayHelper();
641 void DateFieldColumn::fillProperties(
642 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
643 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
644 ) const
646 if (m_xAggregateSet.is())
648 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
649 clearAggregateProperties(_rAggregateProps, true);
650 setOwnProperties(_rProps);
653 rtl::Reference<OGridColumn> DateFieldColumn::createCloneColumn() const
655 return new DateFieldColumn(this);
658 TimeFieldColumn::TimeFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
659 :OGridColumn(_rContext, FRM_SUN_COMPONENT_TIMEFIELD)
662 TimeFieldColumn::TimeFieldColumn(const TimeFieldColumn* _pCloneFrom)
663 :OGridColumn( _pCloneFrom )
666 css::uno::Reference< css::beans::XPropertySetInfo> TimeFieldColumn::getPropertySetInfo()
668 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
669 return xInfo;
671 ::cppu::IPropertyArrayHelper& TimeFieldColumn::getInfoHelper()
673 return *getArrayHelper();
675 void TimeFieldColumn::fillProperties(
676 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
677 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
678 ) const
680 if (m_xAggregateSet.is())
682 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
683 clearAggregateProperties(_rAggregateProps, false);
684 setOwnProperties(_rProps);
687 rtl::Reference<OGridColumn> TimeFieldColumn::createCloneColumn() const
689 return new TimeFieldColumn(this);
692 NumericFieldColumn::NumericFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
693 :OGridColumn(_rContext, FRM_SUN_COMPONENT_NUMERICFIELD)
696 NumericFieldColumn::NumericFieldColumn(const NumericFieldColumn* _pCloneFrom)
697 :OGridColumn( _pCloneFrom )
700 css::uno::Reference< css::beans::XPropertySetInfo> NumericFieldColumn::getPropertySetInfo()
702 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
703 return xInfo;
705 ::cppu::IPropertyArrayHelper& NumericFieldColumn::getInfoHelper()
707 return *getArrayHelper();
709 void NumericFieldColumn::fillProperties(
710 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
711 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
712 ) const
714 if (m_xAggregateSet.is())
716 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
717 clearAggregateProperties(_rAggregateProps, false);
718 setOwnProperties(_rProps);
721 rtl::Reference<OGridColumn> NumericFieldColumn::createCloneColumn() const
723 return new NumericFieldColumn(this);
726 CurrencyFieldColumn::CurrencyFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
727 :OGridColumn(_rContext, FRM_SUN_COMPONENT_CURRENCYFIELD)
730 CurrencyFieldColumn::CurrencyFieldColumn(const CurrencyFieldColumn* _pCloneFrom)
731 :OGridColumn( _pCloneFrom )
734 css::uno::Reference< css::beans::XPropertySetInfo> CurrencyFieldColumn::getPropertySetInfo()
736 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
737 return xInfo;
739 ::cppu::IPropertyArrayHelper& CurrencyFieldColumn::getInfoHelper()
741 return *getArrayHelper();
743 void CurrencyFieldColumn::fillProperties(
744 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
745 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
746 ) const
748 if (m_xAggregateSet.is())
750 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
751 clearAggregateProperties(_rAggregateProps, false);
752 setOwnProperties(_rProps);
755 rtl::Reference<OGridColumn> CurrencyFieldColumn::createCloneColumn() const
757 return new CurrencyFieldColumn(this);
760 CheckBoxColumn::CheckBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
761 :OGridColumn(_rContext, FRM_SUN_COMPONENT_CHECKBOX)
764 CheckBoxColumn::CheckBoxColumn(const CheckBoxColumn* _pCloneFrom)
765 :OGridColumn( _pCloneFrom )
768 css::uno::Reference< css::beans::XPropertySetInfo> CheckBoxColumn::getPropertySetInfo()
770 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
771 return xInfo;
773 ::cppu::IPropertyArrayHelper& CheckBoxColumn::getInfoHelper()
775 return *getArrayHelper();
777 void CheckBoxColumn::fillProperties(
778 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
779 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
780 ) const
782 if (m_xAggregateSet.is())
784 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
785 clearAggregateProperties(_rAggregateProps, false);
786 setOwnProperties(_rProps);
789 rtl::Reference<OGridColumn> CheckBoxColumn::createCloneColumn() const
791 return new CheckBoxColumn(this);
794 ComboBoxColumn::ComboBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
795 :OGridColumn(_rContext, FRM_SUN_COMPONENT_COMBOBOX)
798 ComboBoxColumn::ComboBoxColumn(const ComboBoxColumn* _pCloneFrom)
799 :OGridColumn( _pCloneFrom )
802 css::uno::Reference< css::beans::XPropertySetInfo> ComboBoxColumn::getPropertySetInfo()
804 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
805 return xInfo;
807 ::cppu::IPropertyArrayHelper& ComboBoxColumn::getInfoHelper()
809 return *getArrayHelper();
811 void ComboBoxColumn::fillProperties(
812 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
813 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
814 ) const
816 if (m_xAggregateSet.is())
818 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
819 clearAggregateProperties(_rAggregateProps, false);
820 setOwnProperties(_rProps);
823 rtl::Reference<OGridColumn> ComboBoxColumn::createCloneColumn() const
825 return new ComboBoxColumn(this);
828 ListBoxColumn::ListBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
829 :OGridColumn(_rContext, FRM_SUN_COMPONENT_LISTBOX)
832 ListBoxColumn::ListBoxColumn(const ListBoxColumn* _pCloneFrom)
833 :OGridColumn( _pCloneFrom )
836 css::uno::Reference< css::beans::XPropertySetInfo> ListBoxColumn::getPropertySetInfo()
838 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
839 return xInfo;
841 ::cppu::IPropertyArrayHelper& ListBoxColumn::getInfoHelper()
843 return *getArrayHelper();
845 void ListBoxColumn::fillProperties(
846 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
847 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
848 ) const
850 if (m_xAggregateSet.is())
852 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
853 clearAggregateProperties(_rAggregateProps, false);
854 setOwnProperties(_rProps);
857 rtl::Reference<OGridColumn> ListBoxColumn::createCloneColumn() const
859 return new ListBoxColumn(this);
862 FormattedFieldColumn::FormattedFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
863 :OGridColumn(_rContext, FRM_SUN_COMPONENT_FORMATTEDFIELD)
866 FormattedFieldColumn::FormattedFieldColumn(const FormattedFieldColumn* _pCloneFrom)
867 :OGridColumn( _pCloneFrom )
870 css::uno::Reference< css::beans::XPropertySetInfo> FormattedFieldColumn::getPropertySetInfo()
872 css::uno::Reference< css::beans::XPropertySetInfo> xInfo( createPropertySetInfo( getInfoHelper() ) );
873 return xInfo;
875 ::cppu::IPropertyArrayHelper& FormattedFieldColumn::getInfoHelper()
877 return *getArrayHelper();
879 void FormattedFieldColumn::fillProperties(
880 css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
881 css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
882 ) const
884 if (m_xAggregateSet.is())
886 _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
887 clearAggregateProperties(_rAggregateProps, false);
888 setOwnProperties(_rProps);
891 rtl::Reference<OGridColumn> FormattedFieldColumn::createCloneColumn() const
893 return new FormattedFieldColumn(this);
896 } // namespace frm
899 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */