summaryrefslogtreecommitdiffstats
path: root/forms/source/component/Columns.cxx
blob: 190af02c15c0507d6608a3578a2fea8127540adb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
/* -*- 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 .
 */

#include "Columns.hxx"
#include <property.hxx>
#include <componenttools.hxx>
#include "findpos.hxx"
#include <com/sun/star/io/XPersistObject.hpp>
#include <com/sun/star/io/XMarkableStream.hpp>
#include <com/sun/star/form/XFormComponent.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/form/binding/XBindableValue.hpp>
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/text/XText.hpp>
#include <comphelper/property.hxx>
#include <comphelper/basicio.hxx>
#include <comphelper/servicehelper.hxx>
#include <comphelper/types.hxx>
#include <services.hxx>
#include <tools/debug.hxx>
#include <o3tl/sorted_vector.hxx>


namespace frm
{

using namespace ::com::sun::star::uno;
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::text;
using namespace ::com::sun::star::form::binding;

const sal_uInt16 WIDTH              = 0x0001;
const sal_uInt16 ALIGN              = 0x0002;
const sal_uInt16 OLD_HIDDEN         = 0x0004;
const sal_uInt16 COMPATIBLE_HIDDEN  = 0x0008;


const css::uno::Sequence<OUString>& getColumnTypes()
{
    static css::uno::Sequence<OUString> aColumnTypes = []()
    {
        css::uno::Sequence<OUString> tmp(10);
        OUString* pNames = tmp.getArray();
        pNames[TYPE_CHECKBOX]       = "CheckBox";
        pNames[TYPE_COMBOBOX]       = "ComboBox";
        pNames[TYPE_CURRENCYFIELD]  = "CurrencyField";
        pNames[TYPE_DATEFIELD]      = "DateField";
        pNames[TYPE_FORMATTEDFIELD] = "FormattedField";
        pNames[TYPE_LISTBOX]        = "ListBox";
        pNames[TYPE_NUMERICFIELD]   = "NumericField";
        pNames[TYPE_PATTERNFIELD]   = "PatternField";
        pNames[TYPE_TEXTFIELD]      = "TextField";
        pNames[TYPE_TIMEFIELD]      = "TimeField";
        return tmp;
    }();
    return aColumnTypes;
}


sal_Int32 getColumnTypeByModelName(const OUString& aModelName)
{
    static const OUStringLiteral aModelPrefix (u"com.sun.star.form.component.");
    static const OUStringLiteral aCompatibleModelPrefix (u"stardiv.one.form.component.");

    sal_Int32 nTypeId = -1;
    if (aModelName == FRM_COMPONENT_EDIT)
        nTypeId = TYPE_TEXTFIELD;
    else
    {
        sal_Int32 nPrefixPos = aModelName.indexOf(aModelPrefix);
#ifdef DBG_UTIL
        sal_Int32 nCompatiblePrefixPos = aModelName.indexOf(aCompatibleModelPrefix);
        DBG_ASSERT( (nPrefixPos != -1) ||   (nCompatiblePrefixPos != -1),
                "::getColumnTypeByModelName() : wrong service!");
#endif

        OUString aColumnType = (nPrefixPos != -1)
            ? aModelName.copy(aModelPrefix.getLength())
            : aModelName.copy(aCompatibleModelPrefix.getLength());

        const css::uno::Sequence<OUString>& rColumnTypes = getColumnTypes();
        nTypeId = ::detail::findPos(aColumnType, rColumnTypes);
    }
    return nTypeId;
}

const Sequence<sal_Int8>& OGridColumn::getUnoTunnelId()
{
    static const comphelper::UnoIdInit theOGridColumnImplementationId;
    return theOGridColumnImplementationId.getSeq();
}


sal_Int64 SAL_CALL OGridColumn::getSomething( const Sequence<sal_Int8>& _rIdentifier)
{
    sal_Int64 nReturn(0);

    if ( comphelper::isUnoTunnelId<OGridColumn>(_rIdentifier) )
    {
        nReturn = comphelper::getSomething_cast(this);
    }
    else
    {
        Reference< XUnoTunnel > xAggTunnel;
        if ( query_aggregation( m_xAggregate, xAggTunnel ) )
            return xAggTunnel->getSomething( _rIdentifier );
    }
    return nReturn;
}


Sequence<sal_Int8> SAL_CALL OGridColumn::getImplementationId()
{
    return css::uno::Sequence<sal_Int8>();
}


Sequence<Type> SAL_CALL OGridColumn::getTypes()
{
    TypeBag aTypes( OGridColumn_BASE::getTypes() );
    // erase the types which we do not support
    aTypes.removeType( cppu::UnoType<XFormComponent>::get() );
    aTypes.removeType( cppu::UnoType<XServiceInfo>::get() );
    aTypes.removeType( cppu::UnoType<XBindableValue>::get() );
    aTypes.removeType( cppu::UnoType<XPropertyContainer>::get() );

    // but re-add their base class(es)
    aTypes.addType( cppu::UnoType<XChild>::get() );

    Reference< XTypeProvider > xProv;
    if ( query_aggregation( m_xAggregate, xProv ))
        aTypes.addTypes( xProv->getTypes() );

    aTypes.removeType( cppu::UnoType<XTextRange>::get() );
    aTypes.removeType( cppu::UnoType<XSimpleText>::get() );
    aTypes.removeType( cppu::UnoType<XText>::get() );

    return aTypes.getTypes();
}


Any SAL_CALL OGridColumn::queryAggregation( const Type& _rType )
{
    Any aReturn;
    // some functionality at our aggregate cannot be reasonably fulfilled here.
    if  (   _rType.equals(cppu::UnoType<XFormComponent>::get())
        ||  _rType.equals(cppu::UnoType<XServiceInfo>::get())
        ||  _rType.equals(cppu::UnoType<XBindableValue>::get())
        ||  _rType.equals(cppu::UnoType<XPropertyContainer>::get())
        ||  comphelper::isAssignableFrom(cppu::UnoType<XTextRange>::get(),_rType)
        )
        return aReturn;

    aReturn = OGridColumn_BASE::queryAggregation(_rType);
    if (!aReturn.hasValue())
    {
        aReturn = OPropertySetAggregationHelper::queryInterface(_rType);
        if (!aReturn.hasValue() && m_xAggregate.is())
            aReturn = m_xAggregate->queryAggregation(_rType);
    }

    return aReturn;
}


OGridColumn::OGridColumn( const Reference<XComponentContext>& _rContext, const OUString& _sModelName )
    :OGridColumn_BASE(m_aMutex)
    ,OPropertySetAggregationHelper(OGridColumn_BASE::rBHelper)
    ,m_aHidden( makeAny( false ) )
    ,m_aModelName(_sModelName)
{

    // Create the UnoControlModel
    if ( m_aModelName.isEmpty() ) // is there a to-be-aggregated model?
        return;

    osl_atomic_increment( &m_refCount );

    {
        m_xAggregate.set( _rContext->getServiceManager()->createInstanceWithContext( m_aModelName, _rContext ), UNO_QUERY );
        setAggregation( m_xAggregate );
    }

    if ( m_xAggregate.is() )
    {   // don't omit those brackets - they ensure that the following temporary is properly deleted
        m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
    }

    // Set refcount back to zero
    osl_atomic_decrement( &m_refCount );
}


OGridColumn::OGridColumn( const OGridColumn* _pOriginal )
    :OGridColumn_BASE( m_aMutex )
    ,OPropertySetAggregationHelper( OGridColumn_BASE::rBHelper )
{

    m_aWidth = _pOriginal->m_aWidth;
    m_aAlign = _pOriginal->m_aAlign;
    m_aHidden = _pOriginal->m_aHidden;
    m_aModelName = _pOriginal->m_aModelName;
    m_aLabel = _pOriginal->m_aLabel;

    osl_atomic_increment( &m_refCount );
    {
        {
            m_xAggregate = createAggregateClone( _pOriginal );
            setAggregation( m_xAggregate );
        }

        if ( m_xAggregate.is() )
        {   // don't omit this brackets - they ensure that the following temporary is properly deleted
            m_xAggregate->setDelegator( static_cast< ::cppu::OWeakObject* >( this ) );
        }
    }
    osl_atomic_decrement( &m_refCount );
}


OGridColumn::~OGridColumn()
{
    if (!OGridColumn_BASE::rBHelper.bDisposed)
    {
        acquire();
        dispose();
    }

    // Free the aggregate
    if (m_xAggregate.is())
    {
        css::uno::Reference<css::uno::XInterface>  xIface;
        m_xAggregate->setDelegator(xIface);
    }

}

// XEventListener

void SAL_CALL OGridColumn::disposing(const EventObject& _rSource)
{
    OPropertySetAggregationHelper::disposing(_rSource);

    Reference<XEventListener>  xEvtLstner;
    if (query_aggregation(m_xAggregate, xEvtLstner))
        xEvtLstner->disposing(_rSource);
}

// OGridColumn_BASE

void OGridColumn::disposing()
{
    OGridColumn_BASE::disposing();
    OPropertySetAggregationHelper::disposing();

    Reference<XComponent>  xComp;
    if (query_aggregation(m_xAggregate, xComp))
        xComp->dispose();
}


void OGridColumn::clearAggregateProperties( Sequence< Property >& _rProps, bool bAllowDropDown )
{
    // some properties are not to be exposed to the outer world
    static const o3tl::sorted_vector< OUString > aForbiddenProperties {
      PROPERTY_ALIGN,
      PROPERTY_AUTOCOMPLETE,
      PROPERTY_BACKGROUNDCOLOR,
      PROPERTY_BORDER,
      PROPERTY_BORDERCOLOR,
      PROPERTY_ECHO_CHAR,
      PROPERTY_FILLCOLOR,
      PROPERTY_FONT,
      PROPERTY_FONT_NAME,
      PROPERTY_FONT_STYLENAME,
      PROPERTY_FONT_FAMILY,
      PROPERTY_FONT_CHARSET,
      PROPERTY_FONT_HEIGHT,
      PROPERTY_FONT_WEIGHT,
      PROPERTY_FONT_SLANT,
      PROPERTY_FONT_UNDERLINE,
      PROPERTY_FONT_STRIKEOUT,
      PROPERTY_FONT_WORDLINEMODE,
      PROPERTY_TEXTLINECOLOR,
      PROPERTY_FONTEMPHASISMARK,
      PROPERTY_FONTRELIEF,
      PROPERTY_HARDLINEBREAKS,
      PROPERTY_HSCROLL,
      PROPERTY_LABEL,
      PROPERTY_LINECOLOR,
      PROPERTY_MULTISELECTION,
      PROPERTY_PRINTABLE,
      PROPERTY_TABINDEX,
      PROPERTY_TABSTOP,
      PROPERTY_TEXTCOLOR,
      PROPERTY_VSCROLL,
      PROPERTY_CONTROLLABEL,
      PROPERTY_RICH_TEXT,
      PROPERTY_VERTICAL_ALIGN,
      PROPERTY_IMAGE_URL,
      PROPERTY_IMAGE_POSITION,
      PROPERTY_ENABLEVISIBLE
    };

    Sequence< Property > aNewProps( _rProps.getLength() );
    Property* pNewProps = aNewProps.getArray();

    const Property* pProps = _rProps.getConstArray();
    const Property* pPropsEnd = pProps + _rProps.getLength();
    for ( ; pProps != pPropsEnd; ++pProps )
    {
        if ( aForbiddenProperties.find( pProps->Name ) == aForbiddenProperties.end()
            && (bAllowDropDown || pProps->Name != PROPERTY_DROPDOWN))
            *pNewProps++ = *pProps;
    }

    aNewProps.realloc( pNewProps - aNewProps.getArray() );
    _rProps = aNewProps;
}


void OGridColumn::setOwnProperties(Sequence<Property>& aDescriptor)
{
    aDescriptor.realloc(5);
    Property* pProperties = aDescriptor.getArray();
    *pProperties++ = css::beans::Property(PROPERTY_LABEL, PROPERTY_ID_LABEL, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::BOUND);
    *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);
    *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);
    *pProperties++ = css::beans::Property(PROPERTY_HIDDEN, PROPERTY_ID_HIDDEN, cppu::UnoType<bool>::get(),
                                          css::beans::PropertyAttribute::BOUND | css::beans::PropertyAttribute::MAYBEDEFAULT);
    *pProperties++ = css::beans::Property(PROPERTY_COLUMNSERVICENAME, PROPERTY_ID_COLUMNSERVICENAME, cppu::UnoType<OUString>::get(), css::beans::PropertyAttribute::READONLY);
}

// Reference<XPropertySet>

void OGridColumn::getFastPropertyValue(Any& rValue, sal_Int32 nHandle ) const
{
    switch (nHandle)
    {
        case PROPERTY_ID_COLUMNSERVICENAME:
            rValue <<= m_aModelName;
            break;
        case PROPERTY_ID_LABEL:
            rValue <<= m_aLabel;
            break;
        case PROPERTY_ID_WIDTH:
            rValue = m_aWidth;
            break;
        case PROPERTY_ID_ALIGN:
            rValue = m_aAlign;
            break;
        case PROPERTY_ID_HIDDEN:
            rValue = m_aHidden;
            break;
        default:
            OPropertySetAggregationHelper::getFastPropertyValue(rValue, nHandle);
    }
}


sal_Bool OGridColumn::convertFastPropertyValue( Any& rConvertedValue, Any& rOldValue,
                                            sal_Int32 nHandle, const Any& rValue )
{
    bool bModified(false);
    switch (nHandle)
    {
        case PROPERTY_ID_LABEL:
            bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aLabel);
            break;
        case PROPERTY_ID_WIDTH:
            bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, m_aWidth, cppu::UnoType<sal_Int32>::get());
            break;
        case PROPERTY_ID_ALIGN:
            bModified = tryPropertyValue( rConvertedValue, rOldValue, rValue, m_aAlign, cppu::UnoType<sal_Int32>::get());
            // strange enough, css.awt.TextAlign is a 32-bit integer, while the Align property (both here for grid controls
            // and for ordinary toolkit controls) is a 16-bit integer. So, allow for 32 bit, but normalize it to 16 bit
            if ( bModified )
            {
                sal_Int32 nAlign( 0 );
                if ( rConvertedValue >>= nAlign )
                    rConvertedValue <<= static_cast<sal_Int16>(nAlign);
            }
            break;
        case PROPERTY_ID_HIDDEN:
            bModified = tryPropertyValue(rConvertedValue, rOldValue, rValue, getBOOL(m_aHidden));
            break;
    }
    return bModified;
}


void OGridColumn::setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const Any& rValue )
{
    switch (nHandle)
    {
        case PROPERTY_ID_LABEL:
            DBG_ASSERT(rValue.getValueType().getTypeClass() == TypeClass_STRING, "invalid type" );
            rValue >>= m_aLabel;
            break;
        case PROPERTY_ID_WIDTH:
            m_aWidth = rValue;
            break;
        case PROPERTY_ID_ALIGN:
            m_aAlign = rValue;
            break;
        case PROPERTY_ID_HIDDEN:
            m_aHidden = rValue;
            break;
    }
}


// XPropertyState

Any OGridColumn::getPropertyDefaultByHandle( sal_Int32 nHandle ) const
{
    switch (nHandle)
    {
        case PROPERTY_ID_WIDTH:
        case PROPERTY_ID_ALIGN:
            return Any();
        case PROPERTY_ID_HIDDEN:
            return makeAny(false);
        default:
            return OPropertySetAggregationHelper::getPropertyDefaultByHandle(nHandle);
    }
}

// XCloneable

Reference< XCloneable > SAL_CALL OGridColumn::createClone(  )
{
    return createCloneColumn();
}

// XPersistObject

void OGridColumn::write(const Reference<XObjectOutputStream>& _rxOutStream)
{
    // 1. Write the UnoControl
    Reference<XMarkableStream>  xMark(_rxOutStream, UNO_QUERY);
    sal_Int32 nMark = xMark->createMark();

    sal_Int32 nLen = 0;
    _rxOutStream->writeLong(nLen);

    Reference<XPersistObject>  xPersist;
    if (query_aggregation(m_xAggregate, xPersist))
        xPersist->write(_rxOutStream);

    // Calculate the length
    nLen = xMark->offsetToMark(nMark) - 4;
    xMark->jumpToMark(nMark);
    _rxOutStream->writeLong(nLen);
    xMark->jumpToFurthest();
    xMark->deleteMark(nMark);

    // 2. Write a version number
    _rxOutStream->writeShort(0x0002);

    sal_uInt16 nAnyMask = 0;
    if (m_aWidth.getValueType().getTypeClass() == TypeClass_LONG)
        nAnyMask |= WIDTH;

    if (m_aAlign.getValueTypeClass() == TypeClass_SHORT)
        nAnyMask |= ALIGN;

    nAnyMask |= COMPATIBLE_HIDDEN;

    _rxOutStream->writeShort(nAnyMask);

    if (nAnyMask & WIDTH)
        _rxOutStream->writeLong(getINT32(m_aWidth));
    if (nAnyMask & ALIGN)
        _rxOutStream->writeShort(getINT16(m_aAlign));

    // Name
    _rxOutStream << m_aLabel;

    // the new place for the hidden flag : after m_aLabel, so older office version read the correct label, too
    if (nAnyMask & COMPATIBLE_HIDDEN)
        _rxOutStream->writeBoolean(getBOOL(m_aHidden));
}


void OGridColumn::read(const Reference<XObjectInputStream>& _rxInStream)
{
    // 1. Read the UnoControl
    sal_Int32 nLen = _rxInStream->readLong();
    if (nLen)
    {
        Reference<XMarkableStream>  xMark(_rxInStream, UNO_QUERY);
        sal_Int32 nMark = xMark->createMark();
        Reference<XPersistObject>  xPersist;
        if (query_aggregation(m_xAggregate, xPersist))
            xPersist->read(_rxInStream);

        xMark->jumpToMark(nMark);
        _rxInStream->skipBytes(nLen);
        xMark->deleteMark(nMark);
    }

    // 2. Write a version number
    _rxInStream->readShort(); // version;
    sal_uInt16 nAnyMask = _rxInStream->readShort();

    if (nAnyMask & WIDTH)
    {
        sal_Int32 nValue = _rxInStream->readLong();
        m_aWidth <<= nValue;
    }

    if (nAnyMask & ALIGN)
    {
        sal_Int16 nValue = _rxInStream->readShort();
        m_aAlign <<= nValue;
    }
    if (nAnyMask & OLD_HIDDEN)
    {
        bool bValue = _rxInStream->readBoolean();
        m_aHidden <<= bValue;
    }

    // Name
    _rxInStream >> m_aLabel;

    if (nAnyMask & COMPATIBLE_HIDDEN)
    {
        bool bValue = _rxInStream->readBoolean();
        m_aHidden <<= bValue;
    }
}

TextFieldColumn::TextFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_TEXTFIELD)
{
}
TextFieldColumn::TextFieldColumn(const TextFieldColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> TextFieldColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& TextFieldColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void TextFieldColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> TextFieldColumn::createCloneColumn() const
{
    return new TextFieldColumn(this);
}

PatternFieldColumn::PatternFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_PATTERNFIELD)
{
}
PatternFieldColumn::PatternFieldColumn(const PatternFieldColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> PatternFieldColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& PatternFieldColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void PatternFieldColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> PatternFieldColumn::createCloneColumn() const
{
    return new PatternFieldColumn(this);
}

DateFieldColumn::DateFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_DATEFIELD)
{
}
DateFieldColumn::DateFieldColumn(const DateFieldColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> DateFieldColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& DateFieldColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void DateFieldColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, true);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> DateFieldColumn::createCloneColumn() const
{
    return new DateFieldColumn(this);
}

TimeFieldColumn::TimeFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_TIMEFIELD)
{
}
TimeFieldColumn::TimeFieldColumn(const TimeFieldColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> TimeFieldColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& TimeFieldColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void TimeFieldColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> TimeFieldColumn::createCloneColumn() const
{
    return new TimeFieldColumn(this);
}

NumericFieldColumn::NumericFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_NUMERICFIELD)
{
}
NumericFieldColumn::NumericFieldColumn(const NumericFieldColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> NumericFieldColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& NumericFieldColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void NumericFieldColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> NumericFieldColumn::createCloneColumn() const
{
    return new NumericFieldColumn(this);
}

CurrencyFieldColumn::CurrencyFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_CURRENCYFIELD)
{
}
CurrencyFieldColumn::CurrencyFieldColumn(const CurrencyFieldColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> CurrencyFieldColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& CurrencyFieldColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void CurrencyFieldColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> CurrencyFieldColumn::createCloneColumn() const
{
    return new CurrencyFieldColumn(this);
}

CheckBoxColumn::CheckBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_CHECKBOX)
{
}
CheckBoxColumn::CheckBoxColumn(const CheckBoxColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> CheckBoxColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& CheckBoxColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void CheckBoxColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> CheckBoxColumn::createCloneColumn() const
{
    return new CheckBoxColumn(this);
}

ComboBoxColumn::ComboBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_COMBOBOX)
{
}
ComboBoxColumn::ComboBoxColumn(const ComboBoxColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> ComboBoxColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& ComboBoxColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void ComboBoxColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> ComboBoxColumn::createCloneColumn() const
{
    return new ComboBoxColumn(this);
}

ListBoxColumn::ListBoxColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_LISTBOX)
{
}
ListBoxColumn::ListBoxColumn(const ListBoxColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> ListBoxColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& ListBoxColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void ListBoxColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> ListBoxColumn::createCloneColumn() const
{
    return new ListBoxColumn(this);
}

FormattedFieldColumn::FormattedFieldColumn(const css::uno::Reference<css::uno::XComponentContext>& _rContext)
                                :OGridColumn(_rContext, FRM_SUN_COMPONENT_FORMATTEDFIELD)
{
}
FormattedFieldColumn::FormattedFieldColumn(const FormattedFieldColumn* _pCloneFrom)
                                :OGridColumn( _pCloneFrom )
{
}
css::uno::Reference< css::beans::XPropertySetInfo> FormattedFieldColumn::getPropertySetInfo()
{
    css::uno::Reference< css::beans::XPropertySetInfo>  xInfo( createPropertySetInfo( getInfoHelper() ) );
    return xInfo;
}
::cppu::IPropertyArrayHelper& FormattedFieldColumn::getInfoHelper()
{
    return *getArrayHelper();
}
void FormattedFieldColumn::fillProperties(
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rProps,
    css::uno::Sequence< css::beans::Property >& /* [out] */ _rAggregateProps
    ) const
{
    if (m_xAggregateSet.is())
    {
        _rAggregateProps = m_xAggregateSet->getPropertySetInfo()->getProperties();
        clearAggregateProperties(_rAggregateProps, false);
        setOwnProperties(_rProps);
    }
}
rtl::Reference<OGridColumn> FormattedFieldColumn::createCloneColumn() const
{
    return new FormattedFieldColumn(this);
}

}   // namespace frm


/* vim:set shiftwidth=4 softtabstop=4 expandtab: */