View | Details | Raw Unified | Return to issue 30823
Collapse All | Expand All

(-)extensions/inc/extensio.hrc (-1 / +1 lines)
Lines 157-163 Link Here
157
157
158
//-----------------------------------------------------------------------
158
//-----------------------------------------------------------------------
159
    // FREE
159
    // FREE
160
    // FREE
160
#define HID_PROP_GROUP_NAME                     (HID_FORMS_START +   1)
161
#define HID_PROP_GROUPBOX						(HID_FORMS_START +   2)
161
#define HID_PROP_GROUPBOX						(HID_FORMS_START +   2)
162
#define HID_PROP_CONTROLSOURCE					(HID_FORMS_START +   3)
162
#define HID_PROP_CONTROLSOURCE					(HID_FORMS_START +   3)
163
#define HID_PROP_NAME							(HID_FORMS_START +   4)
163
#define HID_PROP_NAME							(HID_FORMS_START +   4)
(-)extensions/source/propctrlr/formmetadata.hxx (+1 lines)
Lines 166-171 namespace pcr Link Here
166
	#define PROPERTY_ID_ALLOWADDITIONS		 20
166
	#define PROPERTY_ID_ALLOWADDITIONS		 20
167
	#define PROPERTY_ID_ALLOWEDITS			 21
167
	#define PROPERTY_ID_ALLOWEDITS			 21
168
	#define PROPERTY_ID_ALLOWDELETIONS		 22
168
	#define PROPERTY_ID_ALLOWDELETIONS		 22
169
	#define PROPERTY_ID_GROUP_NAME    		 23
169
	#define PROPERTY_ID_NAVIGATION			 24
170
	#define PROPERTY_ID_NAVIGATION			 24
170
	#define PROPERTY_ID_CYCLE				 25
171
	#define PROPERTY_ID_CYCLE				 25
171
	#define PROPERTY_ID_HIDDEN_VALUE		 26
172
	#define PROPERTY_ID_HIDDEN_VALUE		 26
(-)extensions/source/propctrlr/formmetadata.cxx (+1 lines)
Lines 142-147 namespace pcr Link Here
142
        DEF_INFO_2( TITLE,             TITLE,              TITLE,             FORM_VISIBLE, DIALOG_VISIBLE ),
142
        DEF_INFO_2( TITLE,             TITLE,              TITLE,             FORM_VISIBLE, DIALOG_VISIBLE ),
143
        DEF_INFO_3( LABEL,             LABEL,              LABEL,             FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
143
        DEF_INFO_3( LABEL,             LABEL,              LABEL,             FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
144
        DEF_INFO_2( CONTROLLABEL,      LABELCONTROL,       CONTROLLABEL,      FORM_VISIBLE, COMPOSEABLE ),
144
        DEF_INFO_2( CONTROLLABEL,      LABELCONTROL,       CONTROLLABEL,      FORM_VISIBLE, COMPOSEABLE ),
145
        DEF_INFO_3( GROUP_NAME,        GROUP_NAME,         GROUP_NAME,        FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
145
        DEF_INFO_2( TEXT,              TEXT,               TEXT,              DIALOG_VISIBLE, COMPOSEABLE ),
146
        DEF_INFO_2( TEXT,              TEXT,               TEXT,              DIALOG_VISIBLE, COMPOSEABLE ),
146
        DEF_INFO_3( MAXTEXTLEN,        MAXTEXTLEN,         MAXTEXTLEN,        FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
147
        DEF_INFO_3( MAXTEXTLEN,        MAXTEXTLEN,         MAXTEXTLEN,        FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
147
        DEF_INFO_3( EDITMASK,          EDITMASK,           EDITMASK,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
148
        DEF_INFO_3( EDITMASK,          EDITMASK,           EDITMASK,          FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
(-)extensions/source/propctrlr/formstrings.hxx (+1 lines)
Lines 50-55 namespace pcr Link Here
50
	PCR_CONSTASCII_STRING( PROPERTY_TABINDEX,				"TabIndex");
50
	PCR_CONSTASCII_STRING( PROPERTY_TABINDEX,				"TabIndex");
51
	PCR_CONSTASCII_STRING( PROPERTY_TAG,					"Tag");
51
	PCR_CONSTASCII_STRING( PROPERTY_TAG,					"Tag");
52
	PCR_CONSTASCII_STRING( PROPERTY_NAME,					"Name");
52
	PCR_CONSTASCII_STRING( PROPERTY_NAME,					"Name");
53
	PCR_CONSTASCII_STRING( PROPERTY_GROUP_NAME,             "GroupName");
53
	PCR_CONSTASCII_STRING( PROPERTY_VALUE,					"Value");
54
	PCR_CONSTASCII_STRING( PROPERTY_VALUE,					"Value");
54
	PCR_CONSTASCII_STRING( PROPERTY_TEXT,					"Text");
55
	PCR_CONSTASCII_STRING( PROPERTY_TEXT,					"Text");
55
	PCR_CONSTASCII_STRING( PROPERTY_NAVIGATION,				"NavigationBarMode");
56
	PCR_CONSTASCII_STRING( PROPERTY_NAVIGATION,				"NavigationBarMode");
(-)extensions/source/propctrlr/formresid.hrc (-1 / +1 lines)
Lines 147-153 Link Here
147
#define RID_STR_TAG							( RID_FORMBROWSER_START + 116 )
147
#define RID_STR_TAG							( RID_FORMBROWSER_START + 116 )
148
#define RID_STR_HELPTEXT					( RID_FORMBROWSER_START + 117 )
148
#define RID_STR_HELPTEXT					( RID_FORMBROWSER_START + 117 )
149
#define RID_STR_HELPURL						( RID_FORMBROWSER_START + 118 )
149
#define RID_STR_HELPURL						( RID_FORMBROWSER_START + 118 )
150
    // FREE
150
#define RID_STR_GROUP_NAME                  ( RID_FORMBROWSER_START + 119 )
151
#define RID_STR_UNCHECKEDREFVALUE           ( RID_FORMBROWSER_START + 120 )
151
#define RID_STR_UNCHECKEDREFVALUE           ( RID_FORMBROWSER_START + 120 )
152
#define RID_STR_CURSOR_TYPE					( RID_FORMBROWSER_START + 121 )
152
#define RID_STR_CURSOR_TYPE					( RID_FORMBROWSER_START + 121 )
153
    // FREE
153
    // FREE
(-)extensions/source/propctrlr/formres.src (+4 lines)
Lines 230-235 String RID_STR_NAME Link Here
230
{
230
{
231
	Text [ en-US ] = "Name" ;
231
	Text [ en-US ] = "Name" ;
232
};
232
};
233
String RID_STR_GROUP_NAME
234
{
235
	Text [ en-US ] = "Group name" ;
236
};
233
String RID_STR_TABINDEX
237
String RID_STR_TABINDEX
234
{
238
{
235
	Text [ en-US ] = "Tab order" ;
239
	Text [ en-US ] = "Tab order" ;
(-)extensions/util/hidother.src (+1 lines)
Lines 306-308 hidspecial HID_CHECK_FOR_UPD_STATUS Link Here
306
hidspecial HID_CHECK_FOR_UPD_DESCRIPTION        { HelpId = HID_CHECK_FOR_UPD_DESCRIPTION; }
306
hidspecial HID_CHECK_FOR_UPD_DESCRIPTION        { HelpId = HID_CHECK_FOR_UPD_DESCRIPTION; }
307
hidspecial HID_CHECK_FOR_UPD_CANCEL             { HelpId = HID_CHECK_FOR_UPD_CANCEL; }
307
hidspecial HID_CHECK_FOR_UPD_CANCEL             { HelpId = HID_CHECK_FOR_UPD_CANCEL; }
308
hidspecial HID_PROP_NOLABEL                     { HelpId = HID_PROP_NOLABEL; }
308
hidspecial HID_PROP_NOLABEL                     { HelpId = HID_PROP_NOLABEL; }
309
hidspecial HID_PROP_GROUP_NAME                  { HelpId = HID_PROP_GROUP_NAME; }
(-)forms/source/component/GroupManager.hxx (+2 lines)
Lines 220-225 public: Link Here
220
	void getGroup(sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup, ::rtl::OUString& Name);
220
	void getGroup(sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup, ::rtl::OUString& Name);
221
	void getGroupByName(const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup);
221
	void getGroupByName(const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup);
222
	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> > getControlModels();
222
	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> > getControlModels();
223
224
	static ::rtl::OUString GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent );
223
};
225
};
224
226
225
227
(-)forms/source/component/GroupManager.cxx (-10 / +40 lines)
Lines 127-140 OGroupComp::OGroupComp(const Reference<X Link Here
127
    ,m_xControlModel(rxSet,UNO_QUERY)
127
    ,m_xControlModel(rxSet,UNO_QUERY)
128
    ,m_nPos( nInsertPos )
128
    ,m_nPos( nInsertPos )
129
    ,m_nTabIndex(0)
129
    ,m_nTabIndex(0)
130
    ,m_aName( OGroupManager::GetGroupName( rxSet ) )
130
{
131
{
131
	if (m_xComponent.is())
132
	if (m_xComponent.is())
132
	{
133
	{
133
		if (hasProperty( PROPERTY_TABINDEX, m_xComponent ) )
134
		if (hasProperty( PROPERTY_TABINDEX, m_xComponent ) )
134
			// Indices kleiner 0 werden wie 0 behandelt
135
			// Indices kleiner 0 werden wie 0 behandelt
135
			m_nTabIndex = Max(getINT16(m_xComponent->getPropertyValue( PROPERTY_TABINDEX )) , sal_Int16(0));
136
			m_nTabIndex = Max(getINT16(m_xComponent->getPropertyValue( PROPERTY_TABINDEX )) , sal_Int16(0));
136
137
		m_xComponent->getPropertyValue( PROPERTY_NAME ) >>= m_aName;
138
	}
137
	}
139
}
138
}
140
139
Lines 321-327 void OGroupManager::removeFromGroupMap(c Link Here
321
		aFind->second.RemoveComponent( _xSet );
320
		aFind->second.RemoveComponent( _xSet );
322
321
323
		// Wenn Anzahl der Gruppenelemente == 1 ist, Gruppe deaktivieren
322
		// Wenn Anzahl der Gruppenelemente == 1 ist, Gruppe deaktivieren
324
		if ( aFind->second.Count() == 1 )
323
		sal_Int32 nCount = aFind->second.Count();
324
		if ( nCount == 1 || nCount == 0 )
325
		{
325
		{
326
			OActiveGroups::iterator aActiveFind = ::std::find(
326
			OActiveGroups::iterator aActiveFind = ::std::find(
327
                m_aActiveGroupMap.begin(),
327
                m_aActiveGroupMap.begin(),
Lines 332-338 void OGroupManager::removeFromGroupMap(c Link Here
332
            {
332
            {
333
                // the group is active. Deactivate it if the remaining component
333
                // the group is active. Deactivate it if the remaining component
334
                // is *no* radio button
334
                // is *no* radio button
335
                if ( !isRadioButton( aFind->second.GetObject( 0 ) ) )
335
                if ( nCount == 0 || !isRadioButton( aFind->second.GetObject( 0 ) ) )
336
				    m_aActiveGroupMap.erase( aActiveFind );
336
				    m_aActiveGroupMap.erase( aActiveFind );
337
            }
337
            }
338
		}
338
		}
Lines 341-346 void OGroupManager::removeFromGroupMap(c Link Here
341
341
342
	// Bei Component als PropertyChangeListener abmelden
342
	// Bei Component als PropertyChangeListener abmelden
343
	_xSet->removePropertyChangeListener( PROPERTY_NAME, this );
343
	_xSet->removePropertyChangeListener( PROPERTY_NAME, this );
344
	if (hasProperty(PROPERTY_GROUP_NAME, _xSet))
345
		_xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this );
344
	if (hasProperty(PROPERTY_TABINDEX, _xSet))
346
	if (hasProperty(PROPERTY_TABINDEX, _xSet))
345
		_xSet->removePropertyChangeListener( PROPERTY_TABINDEX, this );
347
		_xSet->removePropertyChangeListener( PROPERTY_TABINDEX, this );
346
}
348
}
Lines 351-360 void SAL_CALL OGroupManager::propertyCha Link Here
351
353
352
	// Component aus Gruppe entfernen
354
	// Component aus Gruppe entfernen
353
	::rtl::OUString		sGroupName;
355
	::rtl::OUString		sGroupName;
354
	if (evt.PropertyName == PROPERTY_NAME)
356
	if (hasProperty( PROPERTY_GROUP_NAME, xSet ))
357
		xSet->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
358
	if (evt.PropertyName == PROPERTY_NAME) {
359
		if (sGroupName.getLength() > 0)
360
			return; // group hasn't changed; ignore this name change.
361
		// no GroupName; use Name as GroupNme
362
		evt.OldValue >>= sGroupName;
363
	}
364
	else if (evt.PropertyName == PROPERTY_GROUP_NAME) {
355
		evt.OldValue >>= sGroupName;
365
		evt.OldValue >>= sGroupName;
366
		if (sGroupName.getLength() == 0) {
367
			// No prior GroupName; fallback to Nme
368
			xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
369
		}
370
	}
356
	else
371
	else
357
		xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
372
		sGroupName = GetGroupName( xSet );
358
373
359
	removeFromGroupMap(sGroupName,xSet);
374
	removeFromGroupMap(sGroupName,xSet);
360
375
Lines 437-444 void OGroupManager::InsertElement( const Link Here
437
	m_pCompGroup->InsertComponent( xSet );
452
	m_pCompGroup->InsertComponent( xSet );
438
453
439
	// Component in Gruppe aufnehmen
454
	// Component in Gruppe aufnehmen
440
	::rtl::OUString sGroupName;
455
	::rtl::OUString sGroupName( GetGroupName( xSet ) );
441
	xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
442
456
443
	OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
457
	OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
444
458
Lines 476-481 void OGroupManager::InsertElement( const Link Here
476
490
477
	// Bei Component als PropertyChangeListener anmelden
491
	// Bei Component als PropertyChangeListener anmelden
478
	xSet->addPropertyChangeListener( PROPERTY_NAME, this );
492
	xSet->addPropertyChangeListener( PROPERTY_NAME, this );
493
	if (hasProperty(PROPERTY_GROUP_NAME, xSet))
494
		xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this );
479
495
480
    // Tabindex muss nicht jeder unterstuetzen
496
    // Tabindex muss nicht jeder unterstuetzen
481
	if (hasProperty(PROPERTY_TABINDEX, xSet))
497
	if (hasProperty(PROPERTY_TABINDEX, xSet))
Lines 492-503 void OGroupManager::RemoveElement( const Link Here
492
		return;
508
		return;
493
509
494
	// Component aus Gruppe entfernen
510
	// Component aus Gruppe entfernen
495
	::rtl::OUString		sGroupName;
511
	::rtl::OUString		sGroupName( GetGroupName( xSet ) );
496
	xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
497
512
498
	removeFromGroupMap(sGroupName,xSet);
513
	removeFromGroupMap(sGroupName,xSet);
499
}
514
}
500
515
516
::rtl::OUString OGroupManager::GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent )
517
{
518
    if (!xComponent.is())
519
        return ::rtl::OUString();
520
    ::rtl::OUString sGroupName;
521
    if (hasProperty( PROPERTY_GROUP_NAME, xComponent )) {
522
        xComponent->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
523
        if (sGroupName.getLength() == 0)
524
            xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
525
    }
526
    else
527
        xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
528
    return sGroupName;
529
}
530
501
//.........................................................................
531
//.........................................................................
502
}	// namespace frm
532
}	// namespace frm
503
//.........................................................................
533
//.........................................................................
(-)forms/source/component/RadioButton.hxx (+2 lines)
Lines 87-92 private: Link Here
87
            our mutex is aquired exactly once
87
            our mutex is aquired exactly once
88
    */
88
    */
89
    void    setNewAggregateState( const ::com::sun::star::uno::Any& _rValue );
89
    void    setNewAggregateState( const ::com::sun::star::uno::Any& _rValue );
90
91
    void setControlSource();
90
};
92
};
91
93
92
//==================================================================
94
//==================================================================
(-)forms/source/component/RadioButton.cxx (-39 / +66 lines)
Lines 31-36 Link Here
31
// MARKER(update_precomp.py): autogen include statement, do not remove
31
// MARKER(update_precomp.py): autogen include statement, do not remove
32
#include "precompiled_forms.hxx"
32
#include "precompiled_forms.hxx"
33
#include "RadioButton.hxx"
33
#include "RadioButton.hxx"
34
#include "GroupManager.hxx"
34
#include "property.hxx"
35
#include "property.hxx"
35
#ifndef _FRM_PROPERTY_HRC_
36
#ifndef _FRM_PROPERTY_HRC_
36
#include "property.hrc"
37
#include "property.hrc"
Lines 122-127 ORadioButtonModel::ORadioButtonModel(con Link Here
122
	m_nClassId = FormComponentType::RADIOBUTTON;
123
	m_nClassId = FormComponentType::RADIOBUTTON;
123
	m_aLabelServiceName = FRM_SUN_COMPONENT_GROUPBOX;
124
	m_aLabelServiceName = FRM_SUN_COMPONENT_GROUPBOX;
124
	initValueProperty( PROPERTY_STATE, PROPERTY_ID_STATE );
125
	initValueProperty( PROPERTY_STATE, PROPERTY_ID_STATE );
126
	startAggregatePropertyListening( PROPERTY_GROUP_NAME );
125
}
127
}
126
128
127
//------------------------------------------------------------------
129
//------------------------------------------------------------------
Lines 169-175 StringSequence SAL_CALL ORadioButtonMode Link Here
169
void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const Any& rValue)
171
void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const Any& rValue)
170
{
172
{
171
	// mein Name
173
	// mein Name
172
	::rtl::OUString sMyName(m_aName);
174
    ::rtl::OUString sMyGroup;
175
    if (hasProperty(PROPERTY_GROUP_NAME, this))
176
        this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sMyGroup;
177
    if (sMyGroup.getLength() == 0)
178
        sMyGroup = m_aName;
173
179
174
	// meine Siblings durchiterieren
180
	// meine Siblings durchiterieren
175
	Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
181
	Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
Lines 177-184 void ORadioButtonModel::SetSiblingPropsT Link Here
177
	{
183
	{
178
		Reference<XPropertySet> xMyProps;
184
		Reference<XPropertySet> xMyProps;
179
		query_interface(static_cast<XWeak*>(this), xMyProps);
185
		query_interface(static_cast<XWeak*>(this), xMyProps);
180
		::rtl::OUString	sCurrentName;
186
		::rtl::OUString	sCurrentGroup;
181
		for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
187
		sal_Int32 nNumSiblings = xIndexAccess->getCount();
188
		for (sal_Int32 i=0; i<nNumSiblings; ++i)
182
		{
189
		{
183
			Reference<XPropertySet>	xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
190
			Reference<XPropertySet>	xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
184
			if (!xSiblingProperties.is())
191
			if (!xSiblingProperties.is())
Lines 195-202 void ORadioButtonModel::SetSiblingPropsT Link Here
195
				continue;
202
				continue;
196
203
197
			// das 'zur selben Gruppe gehoeren' wird am Namen festgemacht
204
			// das 'zur selben Gruppe gehoeren' wird am Namen festgemacht
198
			xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sCurrentName;
205
			sCurrentGroup = OGroupManager::GetGroupName( xSiblingProperties );
199
			if (sCurrentName == sMyName)
206
			if (sCurrentGroup == sMyGroup)
200
				xSiblingProperties->setPropertyValue(rPropName, rValue);
207
				xSiblingProperties->setPropertyValue(rPropName, rValue);
201
		}
208
		}
202
	}
209
	}
Lines 223-262 void ORadioButtonModel::setFastPropertyV Link Here
223
	// die andere Richtung : wenn sich mein Name aendert ...
230
	// die andere Richtung : wenn sich mein Name aendert ...
224
	if (nHandle == PROPERTY_ID_NAME)
231
	if (nHandle == PROPERTY_ID_NAME)
225
	{
232
	{
226
		// ... muss ich testen, ob ich Siblings mit dem selben Namen habe, damit ich deren ControlSource uebernehmen kann
233
        setControlSource();
227
		Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
228
		if (xIndexAccess.is())
229
		{
230
			::rtl::OUString			sName;
231
			::rtl::OUString			sControlSource;
232
233
			Reference<XPropertySet> xMyProps;
234
			query_interface(static_cast<XWeak*>(this), xMyProps);
235
			for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
236
			{
237
				Reference<XPropertySet>	xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
238
				if (!xSiblingProperties.is())
239
					continue;
240
241
				if (xMyProps == xSiblingProperties)
242
					// nur wenn ich nicht mich selber gefunden habe
243
					continue;
244
245
				sal_Int16 nType = 0;
246
				xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType;
247
				if (nType != FormComponentType::RADIOBUTTON)
248
					// nur Radio-Buttons
249
					continue;
250
251
				xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sName;
252
				// Control, das zur gleichen Gruppe gehoert ?
253
				if (rValue == sName)
254
				{
255
					setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE));
256
					break;
257
				}
258
			}
259
		}
260
	}
234
	}
261
235
262
	if (nHandle == PROPERTY_ID_DEFAULTCHECKED)
236
	if (nHandle == PROPERTY_ID_DEFAULTCHECKED)
Lines 274-279 void ORadioButtonModel::setFastPropertyV Link Here
274
	}
248
	}
275
}
249
}
276
250
251
void ORadioButtonModel::setControlSource()
252
{
253
    Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
254
    if (xIndexAccess.is())
255
    {
256
        ::rtl::OUString sName, sGroupName;
257
258
        if (hasProperty(PROPERTY_GROUP_NAME, this))
259
            this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sGroupName;
260
        this->getPropertyValue(PROPERTY_NAME) >>= sName;
261
262
        Reference<XPropertySet> xMyProps;
263
        query_interface(static_cast<XWeak*>(this), xMyProps);
264
        for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
265
        {
266
            Reference<XPropertySet>	xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
267
            if (!xSiblingProperties.is())
268
                continue;
269
270
            if (xMyProps == xSiblingProperties)
271
                // nur wenn ich nicht mich selber gefunden habe
272
                continue;
273
274
            sal_Int16 nType = 0;
275
            xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType;
276
            if (nType != FormComponentType::RADIOBUTTON)
277
                // nur Radio-Buttons
278
                continue;
279
280
            ::rtl::OUString sSiblingName, sSiblingGroupName;
281
            if (hasProperty(PROPERTY_GROUP_NAME, xSiblingProperties))
282
                xSiblingProperties->getPropertyValue(PROPERTY_GROUP_NAME) >>= sSiblingGroupName;
283
            xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sSiblingName;
284
285
            if ((sGroupName.getLength() == 0 && sSiblingGroupName.getLength() == 0 &&   // (no group name
286
                 sName == sSiblingName) ||                                              //  names match) or
287
                (sGroupName.getLength() != 0 && sSiblingGroupName.getLength() != 0 &&   // (have group name
288
                 sGroupName == sSiblingGroupName))                                      //  they match)
289
            {
290
                setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE));
291
                break;
292
            }
293
        }
294
    }
295
}
296
277
//------------------------------------------------------------------------------
297
//------------------------------------------------------------------------------
278
void ORadioButtonModel::describeFixedProperties( Sequence< Property >& _rProps ) const
298
void ORadioButtonModel::describeFixedProperties( Sequence< Property >& _rProps ) const
279
{
299
{
Lines 363-368 void ORadioButtonModel::_propertyChanged Link Here
363
			SetSiblingPropsTo( PROPERTY_STATE, aZero );
383
			SetSiblingPropsTo( PROPERTY_STATE, aZero );
364
		}
384
		}
365
	}
385
	}
386
    else if ( _rEvent.PropertyName.equals( PROPERTY_GROUP_NAME ) )
387
    {
388
        setControlSource();
389
        // Can't call OReferenceValueComponent::_propertyChanged(), as it
390
        // doesn't know what to do with the GroupName property.
391
        return;
392
    }
366
393
367
    OReferenceValueComponent::_propertyChanged( _rEvent );
394
    OReferenceValueComponent::_propertyChanged( _rEvent );
368
}
395
}
(-)forms/source/inc/frm_strings.hxx (+1 lines)
Lines 100-105 namespace frm Link Here
100
    FORMS_CONSTASCII_STRING( PROPERTY_TABINDEX,                 "TabIndex" );
100
    FORMS_CONSTASCII_STRING( PROPERTY_TABINDEX,                 "TabIndex" );
101
    FORMS_CONSTASCII_STRING( PROPERTY_TAG,                      "Tag" );
101
    FORMS_CONSTASCII_STRING( PROPERTY_TAG,                      "Tag" );
102
    FORMS_CONSTASCII_STRING( PROPERTY_NAME,                     "Name" );
102
    FORMS_CONSTASCII_STRING( PROPERTY_NAME,                     "Name" );
103
    FORMS_CONSTASCII_STRING( PROPERTY_GROUP_NAME,               "GroupName" );
103
    FORMS_CONSTASCII_STRING( PROPERTY_CLASSID,                  "ClassId" );
104
    FORMS_CONSTASCII_STRING( PROPERTY_CLASSID,                  "ClassId" );
104
    FORMS_CONSTASCII_STRING( PROPERTY_FETCHSIZE,                "FetchSize" );
105
    FORMS_CONSTASCII_STRING( PROPERTY_FETCHSIZE,                "FetchSize" );
105
    FORMS_CONSTASCII_STRING( PROPERTY_VALUE,                    "Value" );
106
    FORMS_CONSTASCII_STRING( PROPERTY_VALUE,                    "Value" );
(-)forms/source/inc/property.hrc (-1 / +1 lines)
Lines 60-66 namespace frm Link Here
60
#define PROPERTY_ID_ALLOWEDITS          (PROPERTY_ID_START + 16)
60
#define PROPERTY_ID_ALLOWEDITS          (PROPERTY_ID_START + 16)
61
#define PROPERTY_ID_ALLOWDELETIONS      (PROPERTY_ID_START + 17)
61
#define PROPERTY_ID_ALLOWDELETIONS      (PROPERTY_ID_START + 17)
62
#define PROPERTY_ID_NATIVE_LOOK         (PROPERTY_ID_START + 18)
62
#define PROPERTY_ID_NATIVE_LOOK         (PROPERTY_ID_START + 18)
63
    // free
63
#define PROPERTY_ID_GROUP_NAME          (PROPERTY_ID_START + 19)
64
    // free
64
    // free
65
    // free
65
    // free
66
    // free
66
    // free
(-)xmloff/source/forms/formattributes.hxx (+1 lines)
Lines 124-129 namespace xmloff Link Here
124
	#define SCA_MAX_VALUE				0x00000002
125
	#define SCA_MAX_VALUE				0x00000002
125
	#define SCA_MIN_VALUE				0x00000004
126
	#define SCA_MIN_VALUE				0x00000004
126
	#define SCA_VALIDATION				0x00000008
127
	#define SCA_VALIDATION				0x00000008
128
    #define SCA_GROUP_NAME              0x00000010
127
	#define SCA_MULTI_LINE				0x00000020
129
	#define SCA_MULTI_LINE				0x00000020
128
	#define SCA_AUTOMATIC_COMPLETION	0x00000080
130
	#define SCA_AUTOMATIC_COMPLETION	0x00000080
129
	#define SCA_MULTIPLE				0x00000100
131
	#define SCA_MULTIPLE				0x00000100
(-)xmloff/source/forms/formattributes.cxx (+1 lines)
Lines 193-198 namespace xmloff Link Here
193
			case SCA_MAX_VALUE:				return "max-value";
194
			case SCA_MAX_VALUE:				return "max-value";
194
			case SCA_MIN_VALUE:				return "min-value";
195
			case SCA_MIN_VALUE:				return "min-value";
195
			case SCA_VALIDATION:			return "validation";
196
			case SCA_VALIDATION:			return "validation";
197
            case SCA_GROUP_NAME:            return "group-name";
196
			case SCA_MULTI_LINE:			return "multi-line";
198
			case SCA_MULTI_LINE:			return "multi-line";
197
			case SCA_AUTOMATIC_COMPLETION:	return "auto-complete";
199
			case SCA_AUTOMATIC_COMPLETION:	return "auto-complete";
198
			case SCA_MULTIPLE: 				return "multiple";
200
			case SCA_MULTIPLE: 				return "multiple";
(-)xmloff/source/forms/strings.hxx (+1 lines)
Lines 204-209 namespace xmloff Link Here
204
    XMLFORM_CONSTASCII_STRING( PROPERTY_VISUAL_EFFECT,      "VisualEffect");
205
    XMLFORM_CONSTASCII_STRING( PROPERTY_VISUAL_EFFECT,      "VisualEffect");
205
    XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION,     "ImagePosition");
206
    XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION,     "ImagePosition");
206
    XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_ALIGN,        "ImageAlign");
207
    XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_ALIGN,        "ImageAlign");
208
    XMLFORM_CONSTASCII_STRING( PROPERTY_GROUP_NAME,         "GroupName");
207
209
208
    XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL,		    "BoundCell");
210
    XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL,		    "BoundCell");
209
    XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE,    "CellRange");
211
    XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE,    "CellRange");
(-)xmloff/source/forms/elementexport.cxx (+35 lines)
Lines 1110-1115 namespace xmloff Link Here
1110
		}
1110
		}
1111
1111
1112
		// ----------------------------------
1112
		// ----------------------------------
1113
		// the string properties
1114
		{
1115
			static sal_Int32 nStringPropertyAttributeIds[] =
1116
			{	// attribute flags
1117
				SCA_GROUP_NAME
1118
			};
1119
			static const ::rtl::OUString* pStringPropertyNames[] =
1120
			{	// property names
1121
				&PROPERTY_GROUP_NAME
1122
			};
1123
1124
			sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
1125
		#if OSL_DEBUG_LEVEL > 0
1126
			sal_Int32 nNameCount = sizeof( pStringPropertyNames ) / sizeof( pStringPropertyNames[0] );
1127
			OSL_ENSURE( ( nIdCount == nNameCount ),
1128
				"OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
1129
		#endif
1130
			for ( i = 0; i < nIdCount; ++i )
1131
				if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial )
1132
				{
1133
					exportStringPropertyAttribute(
1134
						OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ),
1135
						OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ),
1136
						*( pStringPropertyNames[i] )
1137
					);
1138
			#if OSL_DEBUG_LEVEL > 0
1139
				//  reset the bit for later checking
1140
				m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i];
1141
			#endif
1142
				}
1143
		}
1144
1145
		// ----------------------------------
1113
		if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
1146
		if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
1114
		{
1147
		{
1115
			// need to export the min value and the max value as attributes
1148
			// need to export the min value and the max value as attributes
Lines 1569-1574 namespace xmloff Link Here
1569
				}
1602
				}
1570
                if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
1603
                if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
1571
                    m_nIncludeSpecial |= SCA_IMAGE_POSITION;
1604
                    m_nIncludeSpecial |= SCA_IMAGE_POSITION;
1605
                if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) )
1606
                    m_nIncludeSpecial |= SCA_GROUP_NAME;
1572
				m_nIncludeDatabase = DA_DATA_FIELD;
1607
				m_nIncludeDatabase = DA_DATA_FIELD;
1573
				m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
1608
				m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
1574
				break;
1609
				break;
(-)a/xmloff/source/forms/layerimport.cxx (+2 lines)
Lines 97-102 namespace xmloff Link Here
97
		m_aAttributeMetaData.addStringProperty(
97
		m_aAttributeMetaData.addStringProperty(
98
			OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME);
98
			OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME);
99
		m_aAttributeMetaData.addStringProperty(
99
		m_aAttributeMetaData.addStringProperty(
100
			OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_GROUP_NAME);
101
		m_aAttributeMetaData.addStringProperty(
100
			OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
102
			OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
101
		m_aAttributeMetaData.addStringProperty(
103
		m_aAttributeMetaData.addStringProperty(
102
			OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL);
104
			OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL);
(-)svx/source/msfilter/msocximex.cxx (+6 lines)
Lines 1701-1706 sal_Bool OCX_OptionButton::Import(com::s Link Here
1701
    aTmp <<= ::com::sun::star::style::VerticalAlignment_MIDDLE;
1701
    aTmp <<= ::com::sun::star::style::VerticalAlignment_MIDDLE;
1702
    rPropSet->setPropertyValue( WW8_ASCII2STR("VerticalAlign"), aTmp );
1702
    rPropSet->setPropertyValue( WW8_ASCII2STR("VerticalAlign"), aTmp );
1703
1703
1704
    if ( pGroupName )
1705
    {
1706
        aTmp <<= lclCreateOUString( pGroupName, nGroupNameLen );
1707
        rPropSet->setPropertyValue( WW8_ASCII2STR("GroupName"), aTmp);
1708
    }
1709
1704
	aFontData.Import(rPropSet);
1710
	aFontData.Import(rPropSet);
1705
	return sal_True;
1711
	return sal_True;
1706
}
1712
}
(-)toolkit/inc/toolkit/helper/property.hxx (+1 lines)
Lines 192-197 namespace rtl { Link Here
192
#define BASEPROPERTY_UNIT                           135  // ::awt::FieldUnit
192
#define BASEPROPERTY_UNIT                           135  // ::awt::FieldUnit
193
#define BASEPROPERTY_CUSTOMUNITTEXT                 136  // ::rtl::OUString
193
#define BASEPROPERTY_CUSTOMUNITTEXT                 136  // ::rtl::OUString
194
#define BASEPROPERTY_ENABLEVISIBLE                  137  // sal_Bool
194
#define BASEPROPERTY_ENABLEVISIBLE                  137  // sal_Bool
195
#define BASEPROPERTY_GROUPNAME                      138  // ::rtl::OUString
195
196
196
// Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen.
197
// Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen.
197
#define BASEPROPERTY_FONTDESCRIPTORPART_START			1000
198
#define BASEPROPERTY_FONTDESCRIPTORPART_START			1000
(-)toolkit/source/helper/property.cxx (+1 lines)
Lines 179-184 ImplPropertyInfo* ImplGetPropertyInfos( Link Here
179
            DECL_PROP_3     ( "FormatsSupplier",        FORMATSSUPPLIER,    Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
179
            DECL_PROP_3     ( "FormatsSupplier",        FORMATSSUPPLIER,    Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
180
180
181
            DECL_PROP_2     ( "Graphic",                GRAPHIC,            Reference< ::com::sun::star::graphic::XGraphic >, BOUND, TRANSIENT ),
181
            DECL_PROP_2     ( "Graphic",                GRAPHIC,            Reference< ::com::sun::star::graphic::XGraphic >, BOUND, TRANSIENT ),
182
            DECL_PROP_2     ( "GroupName",              GROUPNAME,          ::rtl::OUString,    BOUND, MAYBEDEFAULT ),
182
            DECL_PROP_2     ( "HelpText",               HELPTEXT,           ::rtl::OUString,    BOUND, MAYBEDEFAULT ),
183
            DECL_PROP_2     ( "HelpText",               HELPTEXT,           ::rtl::OUString,    BOUND, MAYBEDEFAULT ),
183
            DECL_PROP_2     ( "HelpURL",                HELPURL,            ::rtl::OUString,    BOUND, MAYBEDEFAULT ),
184
            DECL_PROP_2     ( "HelpURL",                HELPURL,            ::rtl::OUString,    BOUND, MAYBEDEFAULT ),
184
            DECL_PROP_2     ( "HideInactiveSelection",  HIDEINACTIVESELECTION, bool,            BOUND, MAYBEDEFAULT ),
185
            DECL_PROP_2     ( "HideInactiveSelection",  HIDEINACTIVESELECTION, bool,            BOUND, MAYBEDEFAULT ),
(-)toolkit/source/awt/vclxwindows.cxx (+1 lines)
Lines 1079-1084 void VCLXRadioButton::ImplGetPropertyIds Link Here
1079
                     BASEPROPERTY_BACKGROUNDCOLOR,
1079
                     BASEPROPERTY_BACKGROUNDCOLOR,
1080
                     BASEPROPERTY_ALIGN,
1080
                     BASEPROPERTY_ALIGN,
1081
                     BASEPROPERTY_VERTICALALIGN,
1081
                     BASEPROPERTY_VERTICALALIGN,
1082
                     BASEPROPERTY_GROUPNAME,
1082
                     0);
1083
                     0);
1083
    VCLXImageConsumer::ImplGetPropertyIds( rIds );
1084
    VCLXImageConsumer::ImplGetPropertyIds( rIds );
1084
}
1085
}
(-)toolkit/inc/toolkit/controls/dialogcontrol.hxx (+9 lines)
Lines 51-56 Link Here
51
#include <cppuhelper/propshlp.hxx>
51
#include <cppuhelper/propshlp.hxx>
52
#include <cppuhelper/basemutex.hxx>
52
#include <cppuhelper/basemutex.hxx>
53
#include <list>
53
#include <list>
54
#include <map>
54
55
55
//	----------------------------------------------------
56
//	----------------------------------------------------
56
//	class UnoControlDialogModel
57
//	class UnoControlDialogModel
Lines 182-187 protected: Link Here
182
	void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor );
183
	void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor );
183
184
184
	void implUpdateGroupStructure();
185
	void implUpdateGroupStructure();
186
private:
187
    void AddRadioButtonToGroup (
188
            const ::com::sun::star::uno::Reference< XControlModel >& rControlModel,
189
            const ::rtl::OUString& rPropertyName,
190
            ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups,
191
            ModelGroup*& rpCurrentGroup );
192
    void AddRadioButtonGroup (
193
            ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups );
185
};
194
};
186
195
187
//	----------------------------------------------------
196
//	----------------------------------------------------
(-)toolkit/source/controls/dialogcontrol.cxx (-50 / +78 lines)
Lines 142-147 namespace Link Here
142
        return xGraphic;
142
        return xGraphic;
143
    }
143
    }
144
144
145
    static ::rtl::OUString lcl_GetStringProperty( const ::rtl::OUString& sProperty, const Reference< XPropertySet >& xSet )
146
    {
147
        ::rtl::OUString sValue;
148
        Reference< XPropertySetInfo > xPSI;
149
        if (xSet.is() && (xPSI = xSet->getPropertySetInfo()).is() && 
150
                xPSI->hasPropertyByName( sProperty ) )
151
        {
152
            xSet->getPropertyValue( sProperty ) >>= sValue;
153
        }
154
        return sValue;
155
    }
156
145
}
157
}
146
158
147
// ----------------------------------------------------------------------------
159
// ----------------------------------------------------------------------------
Lines 897-902 void UnoControlDialogModel::implNotifyTa Link Here
897
	}
909
	}
898
}
910
}
899
911
912
// ----------------------------------------------------------------------------
913
void UnoControlDialogModel::AddRadioButtonGroup ( 
914
        ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups )
915
{
916
    if ( rNamedGroups.size() == 0 )
917
        return;
918
919
    size_t nGroups = maGroups.size();
920
    maGroups.reserve( nGroups + rNamedGroups.size() );
921
    ::std::map< ::rtl::OUString, ModelGroup >::const_iterator i = rNamedGroups.begin(), e = rNamedGroups.end();
922
    for( ; i != e; ++i)
923
    {
924
            maGroups.push_back( i->second );
925
    }
926
927
    rNamedGroups.clear();
928
}
929
930
void UnoControlDialogModel::AddRadioButtonToGroup ( 
931
        const Reference< XControlModel >& rControlModel,
932
        const ::rtl::OUString& rPropertyName,
933
        ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups,
934
        ModelGroup*& rpCurrentGroup )
935
{
936
    Reference< XPropertySet > xCurProps( rControlModel, UNO_QUERY );
937
    ::rtl::OUString sGroup = lcl_GetStringProperty( rPropertyName, xCurProps );
938
    const sal_Int32 nControlModelStep = lcl_getDialogStep( rControlModel );
939
940
    if ( sGroup.getLength() == 0 )
941
    {
942
        // Create a new group if:
943
        if ( maGroups.size() == 0 ||                // no groups
944
                rpCurrentGroup == NULL ||           // previous group was closed
945
                (nControlModelStep != 0 &&          // control step matches current group
946
                 maGroups.back().size() > 0 &&      //  (group 0 == display everywhere)
947
                 nControlModelStep != lcl_getDialogStep( maGroups.back().back() ) ) )
948
        {
949
            size_t nGroups = maGroups.size();
950
            maGroups.resize( nGroups + 1 );
951
        }
952
        rpCurrentGroup = &maGroups.back();
953
    }
954
    else
955
    {
956
        // Different steps get different sets of named groups
957
        if ( rNamedGroups.size() > 0 &&
958
                rNamedGroups.begin()->second.size() > 0 )
959
        {
960
            const sal_Int32 nPrevStep = lcl_getDialogStep( rNamedGroups.begin()->second.front() );
961
            if ( nControlModelStep != nPrevStep )
962
                AddRadioButtonGroup( rNamedGroups );
963
        }
964
965
        rpCurrentGroup = &rNamedGroups[ sGroup ];
966
    }
967
    rpCurrentGroup->push_back( rControlModel );
968
}
900
969
901
// ----------------------------------------------------------------------------
970
// ----------------------------------------------------------------------------
902
void UnoControlDialogModel::implUpdateGroupStructure()
971
void UnoControlDialogModel::implUpdateGroupStructure()
Lines 921-930 void UnoControlDialogModel::implUpdateGr Link Here
921
990
922
	GroupingMachineState eState = eLookingForGroup;		// the current state of our machine
991
	GroupingMachineState eState = eLookingForGroup;		// the current state of our machine
923
	Reference< XServiceInfo > xModelSI;					// for checking for a radion button
992
	Reference< XServiceInfo > xModelSI;					// for checking for a radion button
924
	AllGroups::iterator aCurrentGroup = maGroups.end();	// the group which we're currently building
993
	ModelGroup* aCurrentGroup = NULL;                   // the group which we're currently building
925
	sal_Int32	nCurrentGroupStep = -1;					// the step which all controls of the current group belong to
926
	sal_Bool	bIsRadioButton;							// is it a radio button?
994
	sal_Bool	bIsRadioButton;							// is it a radio button?
927
995
996
    const ::rtl::OUString GROUP_NAME( RTL_CONSTASCII_USTRINGPARAM( "GroupName" ) );
997
998
    ::std::map< ::rtl::OUString, ModelGroup > aNamedGroups;
999
928
#if OSL_DEBUG_LEVEL > 1
1000
#if OSL_DEBUG_LEVEL > 1
929
	::std::vector< ::rtl::OUString > aCurrentGroupLabels;
1001
	::std::vector< ::rtl::OUString > aCurrentGroupLabels;
930
#endif
1002
#endif
Lines 945-958 void UnoControlDialogModel::implUpdateGr Link Here
945
				// the current model is a radio button
1017
				// the current model is a radio button
946
				// -> we found the beginning of a new group
1018
				// -> we found the beginning of a new group
947
				// create the place for this group
1019
				// create the place for this group
948
				size_t nGroups = maGroups.size();
1020
                AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
949
				maGroups.resize( nGroups + 1 );
950
				aCurrentGroup = maGroups.begin() + nGroups;
951
				// and add the (only, til now) member
952
				aCurrentGroup->push_back( *pControlModels );
953
1021
954
				// get the step which all controls of this group now have to belong to
955
				nCurrentGroupStep = lcl_getDialogStep( *pControlModels );
956
				// new state: looking for further members
1022
				// new state: looking for further members
957
				eState = eExpandingGroup;
1023
				eState = eExpandingGroup;
958
1024
Lines 970-976 void UnoControlDialogModel::implUpdateGr Link Here
970
			{
1036
			{
971
				if ( !bIsRadioButton )
1037
				if ( !bIsRadioButton )
972
				{	// no radio button -> the group is done
1038
				{	// no radio button -> the group is done
973
					aCurrentGroup = maGroups.end();
1039
					aCurrentGroup = NULL;
974
					eState = eLookingForGroup;
1040
					eState = eLookingForGroup;
975
#if OSL_DEBUG_LEVEL > 1
1041
#if OSL_DEBUG_LEVEL > 1
976
					aCurrentGroupLabels.clear();
1042
					aCurrentGroupLabels.clear();
Lines 978-1025 void UnoControlDialogModel::implUpdateGr Link Here
978
					continue;
1044
					continue;
979
				}
1045
				}
980
1046
981
				// it is a radio button - is it on the proper page?
1047
                AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
982
				const sal_Int32 nThisModelStep = lcl_getDialogStep( *pControlModels );
983
				if	(	( nThisModelStep == nCurrentGroupStep )	// the current button is on the same dialog page
984
					||	( 0 == nThisModelStep )					// the current button appears on all pages
985
					)
986
				{
987
					// -> it belongs to the same group
988
					aCurrentGroup->push_back( *pControlModels );
989
					// state still is eExpandingGroup - we're looking for further elements
990
					eState = eExpandingGroup;
991
1048
992
#if OSL_DEBUG_LEVEL > 1
1049
#if OSL_DEBUG_LEVEL > 1
993
					Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
994
					::rtl::OUString sLabel;
995
					if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
996
						xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
997
					aCurrentGroupLabels.push_back( sLabel );
998
#endif
999
					continue;
1000
				}
1001
1002
				// it's a radio button, but on a different page
1003
				// -> we open a new group for it
1004
1005
				// close the old group
1006
				aCurrentGroup = maGroups.end();
1007
#if OSL_DEBUG_LEVEL > 1
1008
				aCurrentGroupLabels.clear();
1009
#endif
1010
1011
				// open a new group
1012
				size_t nGroups = maGroups.size();
1013
				maGroups.resize( nGroups + 1 );
1014
				aCurrentGroup = maGroups.begin() + nGroups;
1015
				// and add the (only, til now) member
1016
				aCurrentGroup->push_back( *pControlModels );
1017
1018
				nCurrentGroupStep = nThisModelStep;
1019
1020
				// state is the same: we still are looking for further elements of the current group
1021
				eState = eExpandingGroup;
1022
#if OSL_DEBUG_LEVEL > 1
1023
				Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
1050
				Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
1024
				::rtl::OUString sLabel;
1051
				::rtl::OUString sLabel;
1025
				if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
1052
				if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
Lines 1031-1036 void UnoControlDialogModel::implUpdateGr Link Here
1031
		}
1058
		}
1032
	}
1059
	}
1033
1060
1061
    AddRadioButtonGroup( aNamedGroups );
1034
	mbGroupsUpToDate = sal_True;
1062
	mbGroupsUpToDate = sal_True;
1035
}
1063
}
1036
1064
(-)toolkit/source/controls/unocontrolmodel.cxx (+1 lines)
Lines 341-346 void UnoControlModel::ImplPropertyChanged( sal_uInt16 ) Link Here
341
            case BASEPROPERTY_VISIBLE:
341
            case BASEPROPERTY_VISIBLE:
342
            case BASEPROPERTY_DECORATION:           aDefault <<= (sal_Bool) sal_True; break;
342
            case BASEPROPERTY_DECORATION:           aDefault <<= (sal_Bool) sal_True; break;
343
343
344
            case BASEPROPERTY_GROUPNAME:
344
            case BASEPROPERTY_HELPTEXT:
345
            case BASEPROPERTY_HELPTEXT:
345
            case BASEPROPERTY_HELPURL:
346
            case BASEPROPERTY_HELPURL:
346
	        case BASEPROPERTY_IMAGEURL:
347
	        case BASEPROPERTY_IMAGEURL:

Return to issue 30823