1 diff --git extensions/inc/extensio.hrc extensions/inc/extensio.hrc
2 index fe70aa3..c3dbd20 100644
3 --- extensions/inc/extensio.hrc
4 +++ extensions/inc/extensio.hrc
6 #define HID_PROP_IMAGEPOSITION (HID_FORMS_START + 339)
7 #define HID_PROP_NOLABEL (HID_FORMS_START + 340)
8 #define HID_PROP_WRITING_MODE (HID_FORMS_START + 341)
9 +#define HID_PROP_GROUP_NAME (HID_FORMS_START + 342)
10 // please adjust HID_LAST_FORMS_ID if you add new ids here!
12 -#define HID_LAST_FORMS_ID HID_PROP_WRITING_MODE
13 +#define HID_LAST_FORMS_ID HID_PROP_GROUP_NAME
15 #if HID_LAST_FORMS_ID > HID_FORMS_END
17 diff --git extensions/source/propctrlr/formmetadata.cxx extensions/source/propctrlr/formmetadata.cxx
18 index ae07c9a..1fe7db6 100644
19 --- extensions/source/propctrlr/formmetadata.cxx
20 +++ extensions/source/propctrlr/formmetadata.cxx
21 @@ -143,6 +143,7 @@ namespace pcr
22 DEF_INFO_3( LABEL, LABEL, LABEL, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
23 DEF_INFO_2( CONTROLLABEL, LABELCONTROL, CONTROLLABEL, FORM_VISIBLE, COMPOSEABLE ),
24 DEF_INFO_3( WRITING_MODE, WRITING_MODE, WRITING_MODE, FORM_VISIBLE, ENUM, COMPOSEABLE ),
25 + DEF_INFO_3( GROUP_NAME, GROUP_NAME, GROUP_NAME, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
26 DEF_INFO_2( TEXT, TEXT, TEXT, DIALOG_VISIBLE, COMPOSEABLE ),
27 DEF_INFO_3( MAXTEXTLEN, MAXTEXTLEN, MAXTEXTLEN, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
28 DEF_INFO_3( EDITMASK, EDITMASK, EDITMASK, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
29 diff --git extensions/source/propctrlr/formmetadata.hxx extensions/source/propctrlr/formmetadata.hxx
30 index 8ebacf4..ba9174f 100644
31 --- extensions/source/propctrlr/formmetadata.hxx
32 +++ extensions/source/propctrlr/formmetadata.hxx
33 @@ -166,6 +166,7 @@ namespace pcr
34 #define PROPERTY_ID_ALLOWADDITIONS 20
35 #define PROPERTY_ID_ALLOWEDITS 21
36 #define PROPERTY_ID_ALLOWDELETIONS 22
37 + #define PROPERTY_ID_GROUP_NAME 23
38 #define PROPERTY_ID_NAVIGATION 24
39 #define PROPERTY_ID_CYCLE 25
40 #define PROPERTY_ID_HIDDEN_VALUE 26
41 diff --git extensions/source/propctrlr/formres.src extensions/source/propctrlr/formres.src
42 index a52afa2..21a1288 100644
43 --- extensions/source/propctrlr/formres.src
44 +++ extensions/source/propctrlr/formres.src
45 @@ -230,6 +230,10 @@ String RID_STR_NAME
47 Text [ en-US ] = "Name" ;
49 +String RID_STR_GROUP_NAME
51 + Text [ en-US ] = "Group name" ;
53 String RID_STR_TABINDEX
55 Text [ en-US ] = "Tab order" ;
56 diff --git extensions/source/propctrlr/formresid.hrc extensions/source/propctrlr/formresid.hrc
57 index a889086..aed2207 100644
58 --- extensions/source/propctrlr/formresid.hrc
59 +++ extensions/source/propctrlr/formresid.hrc
61 #define RID_STR_INPUT_REQUIRED ( RID_FORMBROWSER_START + 119 )
62 #define RID_STR_UNCHECKEDREFVALUE ( RID_FORMBROWSER_START + 120 )
63 #define RID_STR_CURSOR_TYPE ( RID_FORMBROWSER_START + 121 )
64 #define RID_STR_ENABLE_VISIBLE ( RID_FORMBROWSER_START + 122 )
65 +#define RID_STR_GROUP_NAME ( RID_FORMBROWSER_START + 123 )
69 diff --git extensions/source/propctrlr/formstrings.hxx extensions/source/propctrlr/formstrings.hxx
70 index 606184e..fad672d 100644
71 --- extensions/source/propctrlr/formstrings.hxx
72 +++ extensions/source/propctrlr/formstrings.hxx
73 @@ -50,6 +50,7 @@ namespace pcr
74 PCR_CONSTASCII_STRING( PROPERTY_TABINDEX, "TabIndex");
75 PCR_CONSTASCII_STRING( PROPERTY_TAG, "Tag");
76 PCR_CONSTASCII_STRING( PROPERTY_NAME, "Name");
77 + PCR_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName");
78 PCR_CONSTASCII_STRING( PROPERTY_VALUE, "Value");
79 PCR_CONSTASCII_STRING( PROPERTY_TEXT, "Text");
80 PCR_CONSTASCII_STRING( PROPERTY_NAVIGATION, "NavigationBarMode");
81 diff --git extensions/util/hidother.src extensions/util/hidother.src
82 index b075f8c..624ae37 100644
83 --- extensions/util/hidother.src
84 +++ extensions/util/hidother.src
85 @@ -307,4 +307,5 @@ hidspecial HID_CHECK_FOR_UPD_DESCRIPTION { HelpId = HID_CHECK_FOR_UPD_DES
86 hidspecial HID_CHECK_FOR_UPD_CANCEL { HelpId = HID_CHECK_FOR_UPD_CANCEL; }
87 hidspecial HID_PROP_NOLABEL { HelpId = HID_PROP_NOLABEL; }
88 hidspecial HID_PROP_INPUT_REQUIRED { HelpId = HID_PROP_INPUT_REQUIRED; }
89 +hidspecial HID_PROP_GROUP_NAME { HelpId = HID_PROP_GROUP_NAME; }
90 hidspecial HID_PROP_WRITING_MODE { HelpId = HID_PROP_WRITING_MODE; }
91 diff --git forms/source/component/GroupManager.cxx forms/source/component/GroupManager.cxx
92 index d831a82..f5a9ecb 100644
93 --- forms/source/component/GroupManager.cxx
94 +++ forms/source/component/GroupManager.cxx
95 @@ -127,14 +127,13 @@ OGroupComp::OGroupComp(const Reference<XPropertySet>& rxSet, sal_Int32 nInsertPo
96 ,m_xControlModel(rxSet,UNO_QUERY)
99 + ,m_aName( OGroupManager::GetGroupName( rxSet ) )
101 if (m_xComponent.is())
103 if (hasProperty( PROPERTY_TABINDEX, m_xComponent ) )
104 // Indices kleiner 0 werden wie 0 behandelt
105 m_nTabIndex = Max(getINT16(m_xComponent->getPropertyValue( PROPERTY_TABINDEX )) , sal_Int16(0));
107 - m_xComponent->getPropertyValue( PROPERTY_NAME ) >>= m_aName;
111 @@ -321,7 +320,8 @@ void OGroupManager::removeFromGroupMap(const ::rtl::OUString& _sGroupName,const
112 aFind->second.RemoveComponent( _xSet );
114 // Wenn Anzahl der Gruppenelemente == 1 ist, Gruppe deaktivieren
115 - if ( aFind->second.Count() == 1 )
116 + sal_Int32 nCount = aFind->second.Count();
117 + if ( nCount == 1 || nCount == 0 )
119 OActiveGroups::iterator aActiveFind = ::std::find(
120 m_aActiveGroupMap.begin(),
121 @@ -332,7 +332,7 @@ void OGroupManager::removeFromGroupMap(const ::rtl::OUString& _sGroupName,const
123 // the group is active. Deactivate it if the remaining component
124 // is *no* radio button
125 - if ( !isRadioButton( aFind->second.GetObject( 0 ) ) )
126 + if ( nCount == 0 || !isRadioButton( aFind->second.GetObject( 0 ) ) )
127 m_aActiveGroupMap.erase( aActiveFind );
130 @@ -341,6 +341,8 @@ void OGroupManager::removeFromGroupMap(const ::rtl::OUString& _sGroupName,const
132 // Bei Component als PropertyChangeListener abmelden
133 _xSet->removePropertyChangeListener( PROPERTY_NAME, this );
134 + if (hasProperty(PROPERTY_GROUP_NAME, _xSet))
135 + _xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this );
136 if (hasProperty(PROPERTY_TABINDEX, _xSet))
137 _xSet->removePropertyChangeListener( PROPERTY_TABINDEX, this );
139 @@ -351,10 +353,23 @@ void SAL_CALL OGroupManager::propertyChange(const PropertyChangeEvent& evt) thro
141 // Component aus Gruppe entfernen
142 ::rtl::OUString sGroupName;
143 - if (evt.PropertyName == PROPERTY_NAME)
144 + if (hasProperty( PROPERTY_GROUP_NAME, xSet ))
145 + xSet->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
146 + if (evt.PropertyName == PROPERTY_NAME) {
147 + if (sGroupName.getLength() > 0)
148 + return; // group hasn't changed; ignore this name change.
149 + // no GroupName; use Name as GroupNme
150 + evt.OldValue >>= sGroupName;
152 + else if (evt.PropertyName == PROPERTY_GROUP_NAME) {
153 evt.OldValue >>= sGroupName;
154 + if (sGroupName.getLength() == 0) {
155 + // No prior GroupName; fallback to Nme
156 + xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
160 - xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
161 + sGroupName = GetGroupName( xSet );
163 removeFromGroupMap(sGroupName,xSet);
165 @@ -437,8 +452,7 @@ void OGroupManager::InsertElement( const Reference<XPropertySet>& xSet )
166 m_pCompGroup->InsertComponent( xSet );
168 // Component in Gruppe aufnehmen
169 - ::rtl::OUString sGroupName;
170 - xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
171 + ::rtl::OUString sGroupName( GetGroupName( xSet ) );
173 OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
175 @@ -476,6 +490,8 @@ void OGroupManager::InsertElement( const Reference<XPropertySet>& xSet )
177 // Bei Component als PropertyChangeListener anmelden
178 xSet->addPropertyChangeListener( PROPERTY_NAME, this );
179 + if (hasProperty(PROPERTY_GROUP_NAME, xSet))
180 + xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this );
182 // Tabindex muss nicht jeder unterstuetzen
183 if (hasProperty(PROPERTY_TABINDEX, xSet))
184 @@ -492,12 +508,26 @@ void OGroupManager::RemoveElement( const Reference<XPropertySet>& xSet )
187 // Component aus Gruppe entfernen
188 - ::rtl::OUString sGroupName;
189 - xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
190 + ::rtl::OUString sGroupName( GetGroupName( xSet ) );
192 removeFromGroupMap(sGroupName,xSet);
195 +::rtl::OUString OGroupManager::GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent )
197 + if (!xComponent.is())
198 + return ::rtl::OUString();
199 + ::rtl::OUString sGroupName;
200 + if (hasProperty( PROPERTY_GROUP_NAME, xComponent )) {
201 + xComponent->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
202 + if (sGroupName.getLength() == 0)
203 + xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
206 + xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
210 //.........................................................................
212 //.........................................................................
213 diff --git forms/source/component/GroupManager.hxx forms/source/component/GroupManager.hxx
214 index bc5a059..b139998 100644
215 --- forms/source/component/GroupManager.hxx
216 +++ forms/source/component/GroupManager.hxx
217 @@ -220,6 +220,8 @@ public:
218 void getGroup(sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup, ::rtl::OUString& Name);
219 void getGroupByName(const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup);
220 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> > getControlModels();
222 + static ::rtl::OUString GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent );
226 diff --git forms/source/component/RadioButton.cxx forms/source/component/RadioButton.cxx
227 index b77979b..d9674c5 100644
228 --- forms/source/component/RadioButton.cxx
229 +++ forms/source/component/RadioButton.cxx
231 // MARKER(update_precomp.py): autogen include statement, do not remove
232 #include "precompiled_forms.hxx"
233 #include "RadioButton.hxx"
234 +#include "GroupManager.hxx"
235 #include "property.hxx"
236 #ifndef _FRM_PROPERTY_HRC_
237 #include "property.hrc"
238 @@ -122,6 +123,7 @@ ORadioButtonModel::ORadioButtonModel(const Reference<XMultiServiceFactory>& _rxF
239 m_nClassId = FormComponentType::RADIOBUTTON;
240 m_aLabelServiceName = FRM_SUN_COMPONENT_GROUPBOX;
241 initValueProperty( PROPERTY_STATE, PROPERTY_ID_STATE );
242 + startAggregatePropertyListening( PROPERTY_GROUP_NAME );
245 //------------------------------------------------------------------
246 @@ -169,7 +171,11 @@ StringSequence SAL_CALL ORadioButtonModel::getSupportedServiceNames() throw(Runt
247 void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const Any& rValue)
250 - ::rtl::OUString sMyName(m_aName);
251 + ::rtl::OUString sMyGroup;
252 + if (hasProperty(PROPERTY_GROUP_NAME, this))
253 + this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sMyGroup;
254 + if (sMyGroup.getLength() == 0)
255 + sMyGroup = m_aName;
257 // meine Siblings durchiterieren
258 Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
259 @@ -177,8 +183,9 @@ void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, cons
261 Reference<XPropertySet> xMyProps;
262 query_interface(static_cast<XWeak*>(this), xMyProps);
263 - ::rtl::OUString sCurrentName;
264 - for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
265 + ::rtl::OUString sCurrentGroup;
266 + sal_Int32 nNumSiblings = xIndexAccess->getCount();
267 + for (sal_Int32 i=0; i<nNumSiblings; ++i)
269 Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
270 if (!xSiblingProperties.is())
271 @@ -195,8 +202,8 @@ void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, cons
274 // das 'zur selben Gruppe gehoeren' wird am Namen festgemacht
275 - xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sCurrentName;
276 - if (sCurrentName == sMyName)
277 + sCurrentGroup = OGroupManager::GetGroupName( xSiblingProperties );
278 + if (sCurrentGroup == sMyGroup)
279 xSiblingProperties->setPropertyValue(rPropName, rValue);
282 @@ -223,40 +230,7 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons
283 // die andere Richtung : wenn sich mein Name aendert ...
284 if (nHandle == PROPERTY_ID_NAME)
286 - // ... muss ich testen, ob ich Siblings mit dem selben Namen habe, damit ich deren ControlSource uebernehmen kann
287 - Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
288 - if (xIndexAccess.is())
290 - ::rtl::OUString sName;
291 - ::rtl::OUString sControlSource;
293 - Reference<XPropertySet> xMyProps;
294 - query_interface(static_cast<XWeak*>(this), xMyProps);
295 - for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
297 - Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
298 - if (!xSiblingProperties.is())
301 - if (xMyProps == xSiblingProperties)
302 - // nur wenn ich nicht mich selber gefunden habe
305 - sal_Int16 nType = 0;
306 - xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType;
307 - if (nType != FormComponentType::RADIOBUTTON)
308 - // nur Radio-Buttons
311 - xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sName;
312 - // Control, das zur gleichen Gruppe gehoert ?
313 - if (rValue == sName)
315 - setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE));
320 + setControlSource();
323 if (nHandle == PROPERTY_ID_DEFAULTCHECKED)
324 @@ -274,6 +248,52 @@ void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, cons
328 +void ORadioButtonModel::setControlSource()
330 + Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
331 + if (xIndexAccess.is())
333 + ::rtl::OUString sName, sGroupName;
335 + if (hasProperty(PROPERTY_GROUP_NAME, this))
336 + this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sGroupName;
337 + this->getPropertyValue(PROPERTY_NAME) >>= sName;
339 + Reference<XPropertySet> xMyProps;
340 + query_interface(static_cast<XWeak*>(this), xMyProps);
341 + for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
343 + Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
344 + if (!xSiblingProperties.is())
347 + if (xMyProps == xSiblingProperties)
348 + // nur wenn ich nicht mich selber gefunden habe
351 + sal_Int16 nType = 0;
352 + xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType;
353 + if (nType != FormComponentType::RADIOBUTTON)
354 + // nur Radio-Buttons
357 + ::rtl::OUString sSiblingName, sSiblingGroupName;
358 + if (hasProperty(PROPERTY_GROUP_NAME, xSiblingProperties))
359 + xSiblingProperties->getPropertyValue(PROPERTY_GROUP_NAME) >>= sSiblingGroupName;
360 + xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sSiblingName;
362 + if ((sGroupName.getLength() == 0 && sSiblingGroupName.getLength() == 0 && // (no group name
363 + sName == sSiblingName) || // names match) or
364 + (sGroupName.getLength() != 0 && sSiblingGroupName.getLength() != 0 && // (have group name
365 + sGroupName == sSiblingGroupName)) // they match)
367 + setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE));
374 //------------------------------------------------------------------------------
375 void ORadioButtonModel::describeFixedProperties( Sequence< Property >& _rProps ) const
377 @@ -363,6 +383,13 @@ void ORadioButtonModel::_propertyChanged(const PropertyChangeEvent& _rEvent) thr
378 SetSiblingPropsTo( PROPERTY_STATE, aZero );
381 + else if ( _rEvent.PropertyName.equals( PROPERTY_GROUP_NAME ) )
383 + setControlSource();
384 + // Can't call OReferenceValueComponent::_propertyChanged(), as it
385 + // doesn't know what to do with the GroupName property.
389 OReferenceValueComponent::_propertyChanged( _rEvent );
391 diff --git forms/source/component/RadioButton.hxx forms/source/component/RadioButton.hxx
392 index c193f8a..e1a7e7e 100644
393 --- forms/source/component/RadioButton.hxx
394 +++ forms/source/component/RadioButton.hxx
395 @@ -87,6 +87,8 @@ private:
396 our mutex is aquired exactly once
398 void setNewAggregateState( const ::com::sun::star::uno::Any& _rValue );
400 + void setControlSource();
403 //==================================================================
404 diff --git forms/source/inc/frm_strings.hxx forms/source/inc/frm_strings.hxx
405 index 864160f..4b2efb9 100644
406 --- forms/source/inc/frm_strings.hxx
407 +++ forms/source/inc/frm_strings.hxx
408 @@ -100,6 +100,7 @@ namespace frm
409 FORMS_CONSTASCII_STRING( PROPERTY_TABINDEX, "TabIndex" );
410 FORMS_CONSTASCII_STRING( PROPERTY_TAG, "Tag" );
411 FORMS_CONSTASCII_STRING( PROPERTY_NAME, "Name" );
412 + FORMS_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName" );
413 FORMS_CONSTASCII_STRING( PROPERTY_CLASSID, "ClassId" );
414 FORMS_CONSTASCII_STRING( PROPERTY_FETCHSIZE, "FetchSize" );
415 FORMS_CONSTASCII_STRING( PROPERTY_VALUE, "Value" );
416 diff --git forms/source/inc/property.hrc forms/source/inc/property.hrc
417 index d5e2476..20bdaf7 100644
418 --- forms/source/inc/property.hrc
419 +++ forms/source/inc/property.hrc
420 @@ -63,7 +63,7 @@ namespace frm
421 #define PROPERTY_ID_INPUT_REQUIRED (PROPERTY_ID_START + 19)
422 #define PROPERTY_ID_WRITING_MODE (PROPERTY_ID_START + 20)
423 #define PROPERTY_ID_CONTEXT_WRITING_MODE (PROPERTY_ID_START + 21)
425 +#define PROPERTY_ID_GROUP_NAME (PROPERTY_ID_START + 22)
429 diff --git svx/source/msfilter/msocximex.cxx svx/source/msfilter/msocximex.cxx
430 index fab7d46..37b720b 100644
431 --- svx/source/msfilter/msocximex.cxx
432 +++ svx/source/msfilter/msocximex.cxx
433 @@ -1709,6 +1709,12 @@ sal_Bool OCX_OptionButton::Import(com::sun::star::uno::Reference<
434 aTmp <<= ::com::sun::star::style::VerticalAlignment_MIDDLE;
435 rPropSet->setPropertyValue( WW8_ASCII2STR("VerticalAlign"), aTmp );
439 + aTmp <<= lclCreateOUString( pGroupName, nGroupNameLen );
440 + rPropSet->setPropertyValue( WW8_ASCII2STR("GroupName"), aTmp);
443 aFontData.Import(rPropSet);
446 diff --git toolkit/inc/toolkit/controls/dialogcontrol.hxx toolkit/inc/toolkit/controls/dialogcontrol.hxx
447 index 1e65e6f..1301975 100644
448 --- toolkit/inc/toolkit/controls/dialogcontrol.hxx
449 +++ toolkit/inc/toolkit/controls/dialogcontrol.hxx
451 #include <cppuhelper/propshlp.hxx>
452 #include <cppuhelper/basemutex.hxx>
456 // ----------------------------------------------------
457 // class UnoControlDialogModel
458 @@ -182,6 +183,14 @@ protected:
459 void implNotifyTabModelChange( const ::rtl::OUString& _rAccessor );
461 void implUpdateGroupStructure();
463 + void AddRadioButtonToGroup (
464 + const ::com::sun::star::uno::Reference< XControlModel >& rControlModel,
465 + const ::rtl::OUString& rPropertyName,
466 + ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups,
467 + ModelGroup*& rpCurrentGroup );
468 + void AddRadioButtonGroup (
469 + ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups );
472 // ----------------------------------------------------
473 diff --git toolkit/inc/toolkit/helper/property.hxx toolkit/inc/toolkit/helper/property.hxx
474 index 238b412..2835f10 100644
475 --- toolkit/inc/toolkit/helper/property.hxx
476 +++ toolkit/inc/toolkit/helper/property.hxx
477 @@ -192,6 +192,7 @@ namespace rtl {
478 #define BASEPROPERTY_WRITING_MODE 138
479 #define BASEPROPERTY_CONTEXT_WRITING_MODE 139
480 #define BASEPROPERTY_ENABLEVISIBLE 140 // sal_Bool
481 +#define BASEPROPERTY_GROUPNAME 141 // ::rtl::OUString
483 // Keine gebundenen Properties, werden immer aus der Property BASEPROPERTY_FONTDESCRIPTOR entnommen.
484 #define BASEPROPERTY_FONTDESCRIPTORPART_START 1000
485 diff --git toolkit/source/awt/vclxwindows.cxx toolkit/source/awt/vclxwindows.cxx
486 index bfa828b..206280b 100644
487 --- toolkit/source/awt/vclxwindows.cxx
488 +++ toolkit/source/awt/vclxwindows.cxx
489 @@ -1105,6 +1105,7 @@ void VCLXRadioButton::ImplGetPropertyIds( std::list< sal_uInt16 > &rIds )
490 BASEPROPERTY_VERTICALALIGN,
491 BASEPROPERTY_WRITING_MODE,
492 BASEPROPERTY_CONTEXT_WRITING_MODE,
493 + BASEPROPERTY_GROUPNAME,
495 VCLXImageConsumer::ImplGetPropertyIds( rIds );
497 diff --git toolkit/source/controls/dialogcontrol.cxx toolkit/source/controls/dialogcontrol.cxx
498 index 0aebfb8..3fd5723 100644
499 --- toolkit/source/controls/dialogcontrol.cxx
500 +++ toolkit/source/controls/dialogcontrol.cxx
501 @@ -142,6 +142,18 @@ namespace
505 + static ::rtl::OUString lcl_GetStringProperty( const ::rtl::OUString& sProperty, const Reference< XPropertySet >& xSet )
507 + ::rtl::OUString sValue;
508 + Reference< XPropertySetInfo > xPSI;
509 + if (xSet.is() && (xPSI = xSet->getPropertySetInfo()).is() &&
510 + xPSI->hasPropertyByName( sProperty ) )
512 + xSet->getPropertyValue( sProperty ) >>= sValue;
519 // ----------------------------------------------------------------------------
520 @@ -897,6 +909,63 @@ void UnoControlDialogModel::implNotifyTabModelChange( const ::rtl::OUString& _rA
524 +// ----------------------------------------------------------------------------
525 +void UnoControlDialogModel::AddRadioButtonGroup (
526 + ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups )
528 + if ( rNamedGroups.size() == 0 )
531 + size_t nGroups = maGroups.size();
532 + maGroups.reserve( nGroups + rNamedGroups.size() );
533 + ::std::map< ::rtl::OUString, ModelGroup >::const_iterator i = rNamedGroups.begin(), e = rNamedGroups.end();
534 + for( ; i != e; ++i)
536 + maGroups.push_back( i->second );
539 + rNamedGroups.clear();
542 +void UnoControlDialogModel::AddRadioButtonToGroup (
543 + const Reference< XControlModel >& rControlModel,
544 + const ::rtl::OUString& rPropertyName,
545 + ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups,
546 + ModelGroup*& rpCurrentGroup )
548 + Reference< XPropertySet > xCurProps( rControlModel, UNO_QUERY );
549 + ::rtl::OUString sGroup = lcl_GetStringProperty( rPropertyName, xCurProps );
550 + const sal_Int32 nControlModelStep = lcl_getDialogStep( rControlModel );
552 + if ( sGroup.getLength() == 0 )
554 + // Create a new group if:
555 + if ( maGroups.size() == 0 || // no groups
556 + rpCurrentGroup == NULL || // previous group was closed
557 + (nControlModelStep != 0 && // control step matches current group
558 + maGroups.back().size() > 0 && // (group 0 == display everywhere)
559 + nControlModelStep != lcl_getDialogStep( maGroups.back().back() ) ) )
561 + size_t nGroups = maGroups.size();
562 + maGroups.resize( nGroups + 1 );
564 + rpCurrentGroup = &maGroups.back();
568 + // Different steps get different sets of named groups
569 + if ( rNamedGroups.size() > 0 &&
570 + rNamedGroups.begin()->second.size() > 0 )
572 + const sal_Int32 nPrevStep = lcl_getDialogStep( rNamedGroups.begin()->second.front() );
573 + if ( nControlModelStep != nPrevStep )
574 + AddRadioButtonGroup( rNamedGroups );
577 + rpCurrentGroup = &rNamedGroups[ sGroup ];
579 + rpCurrentGroup->push_back( rControlModel );
582 // ----------------------------------------------------------------------------
583 void UnoControlDialogModel::implUpdateGroupStructure()
584 @@ -921,10 +990,13 @@ void UnoControlDialogModel::implUpdateGroupStructure()
586 GroupingMachineState eState = eLookingForGroup; // the current state of our machine
587 Reference< XServiceInfo > xModelSI; // for checking for a radion button
588 - AllGroups::iterator aCurrentGroup = maGroups.end(); // the group which we're currently building
589 - sal_Int32 nCurrentGroupStep = -1; // the step which all controls of the current group belong to
590 + ModelGroup* aCurrentGroup = NULL; // the group which we're currently building
591 sal_Bool bIsRadioButton; // is it a radio button?
593 + const ::rtl::OUString GROUP_NAME( RTL_CONSTASCII_USTRINGPARAM( "GroupName" ) );
595 + ::std::map< ::rtl::OUString, ModelGroup > aNamedGroups;
597 #if OSL_DEBUG_LEVEL > 1
598 ::std::vector< ::rtl::OUString > aCurrentGroupLabels;
600 @@ -945,14 +1017,8 @@ void UnoControlDialogModel::implUpdateGroupStructure()
601 // the current model is a radio button
602 // -> we found the beginning of a new group
603 // create the place for this group
604 - size_t nGroups = maGroups.size();
605 - maGroups.resize( nGroups + 1 );
606 - aCurrentGroup = maGroups.begin() + nGroups;
607 - // and add the (only, til now) member
608 - aCurrentGroup->push_back( *pControlModels );
610 - // get the step which all controls of this group now have to belong to
611 - nCurrentGroupStep = lcl_getDialogStep( *pControlModels );
612 + AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
614 // new state: looking for further members
615 eState = eExpandingGroup;
617 @@ -970,7 +1036,7 @@ void UnoControlDialogModel::implUpdateGroupStructure()
619 if ( !bIsRadioButton )
620 { // no radio button -> the group is done
621 - aCurrentGroup = maGroups.end();
622 + aCurrentGroup = NULL;
623 eState = eLookingForGroup;
624 #if OSL_DEBUG_LEVEL > 1
625 aCurrentGroupLabels.clear();
626 @@ -978,48 +1044,9 @@ void UnoControlDialogModel::implUpdateGroupStructure()
630 - // it is a radio button - is it on the proper page?
631 - const sal_Int32 nThisModelStep = lcl_getDialogStep( *pControlModels );
632 - if ( ( nThisModelStep == nCurrentGroupStep ) // the current button is on the same dialog page
633 - || ( 0 == nThisModelStep ) // the current button appears on all pages
636 - // -> it belongs to the same group
637 - aCurrentGroup->push_back( *pControlModels );
638 - // state still is eExpandingGroup - we're looking for further elements
639 - eState = eExpandingGroup;
640 + AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
642 #if OSL_DEBUG_LEVEL > 1
643 - Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
644 - ::rtl::OUString sLabel;
645 - if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
646 - xModelProps->getPropertyValue( ::rtl::OUString::createFromAscii( "Label" ) ) >>= sLabel;
647 - aCurrentGroupLabels.push_back( sLabel );
652 - // it's a radio button, but on a different page
653 - // -> we open a new group for it
655 - // close the old group
656 - aCurrentGroup = maGroups.end();
657 -#if OSL_DEBUG_LEVEL > 1
658 - aCurrentGroupLabels.clear();
661 - // open a new group
662 - size_t nGroups = maGroups.size();
663 - maGroups.resize( nGroups + 1 );
664 - aCurrentGroup = maGroups.begin() + nGroups;
665 - // and add the (only, til now) member
666 - aCurrentGroup->push_back( *pControlModels );
668 - nCurrentGroupStep = nThisModelStep;
670 - // state is the same: we still are looking for further elements of the current group
671 - eState = eExpandingGroup;
672 -#if OSL_DEBUG_LEVEL > 1
673 Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
674 ::rtl::OUString sLabel;
675 if ( xModelProps.is() && xModelProps->getPropertySetInfo().is() && xModelProps->getPropertySetInfo()->hasPropertyByName( ::rtl::OUString::createFromAscii( "Label" ) ) )
676 @@ -1031,6 +1058,7 @@ void UnoControlDialogModel::implUpdateGroupStructure()
680 + AddRadioButtonGroup( aNamedGroups );
681 mbGroupsUpToDate = sal_True;
684 diff --git toolkit/source/controls/unocontrolmodel.cxx toolkit/source/controls/unocontrolmodel.cxx
685 index 33e7b7b..453be84 100644
686 --- toolkit/source/controls/unocontrolmodel.cxx
687 +++ toolkit/source/controls/unocontrolmodel.cxx
688 @@ -348,6 +348,7 @@ void UnoControlModel::ImplPropertyChanged( sal_uInt16 )
689 case BASEPROPERTY_ENABLEVISIBLE:
690 case BASEPROPERTY_DECORATION: aDefault <<= (sal_Bool) sal_True; break;
692 + case BASEPROPERTY_GROUPNAME:
693 case BASEPROPERTY_HELPTEXT:
694 case BASEPROPERTY_HELPURL:
695 case BASEPROPERTY_IMAGEURL:
696 diff --git toolkit/source/helper/property.cxx toolkit/source/helper/property.cxx
697 index 0a26448..13102ff 100644
698 --- toolkit/source/helper/property.cxx
699 +++ toolkit/source/helper/property.cxx
700 @@ -180,6 +180,7 @@ ImplPropertyInfo* ImplGetPropertyInfos( sal_uInt16& rElementCount )
701 DECL_PROP_3 ( "FormatsSupplier", FORMATSSUPPLIER, Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
703 DECL_PROP_2 ( "Graphic", GRAPHIC, Reference< ::com::sun::star::graphic::XGraphic >, BOUND, TRANSIENT ),
704 + DECL_PROP_2 ( "GroupName", GROUPNAME, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
705 DECL_PROP_2 ( "HelpText", HELPTEXT, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
706 DECL_PROP_2 ( "HelpURL", HELPURL, ::rtl::OUString, BOUND, MAYBEDEFAULT ),
707 DECL_PROP_2 ( "HideInactiveSelection", HIDEINACTIVESELECTION, bool, BOUND, MAYBEDEFAULT ),
708 diff --git xmloff/inc/xmlnmspe.hxx xmloff/inc/xmlnmspe.hxx
709 index 060a5a5..88516fe 100644
710 --- xmloff/inc/xmlnmspe.hxx
711 +++ xmloff/inc/xmlnmspe.hxx
712 @@ -95,6 +95,7 @@ XML_OLD_NAMESPACE( META, 6U )
714 // experimental namespaces
715 XML_NAMESPACE( FIELD, 100U )
716 +XML_NAMESPACE( FORMX, 101U ) // form interop extensions
719 #endif // _XMLOFF_XMLNMSPE_HXX
720 diff --git xmloff/inc/xmloff/xmltoken.hxx xmloff/inc/xmloff/xmltoken.hxx
721 index 11116de..e710a61 100644
722 --- xmloff/inc/xmloff/xmltoken.hxx
723 +++ xmloff/inc/xmloff/xmltoken.hxx
724 @@ -142,6 +142,10 @@ namespace xmloff { namespace token {
728 + // jonp: 2008-09-24 Excel Interop
735 diff --git xmloff/source/core/xmlexp.cxx xmloff/source/core/xmlexp.cxx
736 index 694df43..1dc010d 100644
737 --- xmloff/source/core/xmlexp.cxx
738 +++ xmloff/source/core/xmlexp.cxx
739 @@ -314,6 +314,7 @@ void SvXMLExport::_InitCtor()
740 mpNamespaceMap->Add( GetXMLToken(XML_NP_XSD), GetXMLToken(XML_N_XSD), XML_NAMESPACE_XSD );
741 mpNamespaceMap->Add( GetXMLToken(XML_NP_XSI), GetXMLToken(XML_N_XSI), XML_NAMESPACE_XSI );
742 mpNamespaceMap->Add( GetXMLToken(XML_NP_FIELD), GetXMLToken(XML_N_FIELD), XML_NAMESPACE_FIELD );
743 + mpNamespaceMap->Add( GetXMLToken(XML_NP_FORMX), GetXMLToken(XML_N_FORMX), XML_NAMESPACE_FORMX );
745 if( (getExportFlags() & (EXPORT_STYLES|EXPORT_AUTOSTYLES|EXPORT_MASTERSTYLES|EXPORT_CONTENT) ) != 0 )
747 diff --git xmloff/source/core/xmlimp.cxx xmloff/source/core/xmlimp.cxx
748 index e3b116c..a827e5b 100644
749 --- xmloff/source/core/xmlimp.cxx
750 +++ xmloff/source/core/xmlimp.cxx
751 @@ -108,6 +108,7 @@ sal_Char __READONLY_DATA sXML_np__script[] = "_script";
752 sal_Char __READONLY_DATA sXML_np__config[] = "_config";
753 sal_Char __READONLY_DATA sXML_np__db[] = "_db";
754 sal_Char __READONLY_DATA sXML_np__xforms[] = "_xforms";
755 +sal_Char __READONLY_DATA sXML_np__formx[] = "_formx";
756 sal_Char __READONLY_DATA sXML_np__xsd[] = "_xsd";
757 sal_Char __READONLY_DATA sXML_np__xsi[] = "_xsi";
758 sal_Char __READONLY_DATA sXML_np__field[] = "_field";
759 @@ -283,6 +284,9 @@ void SvXMLImport::_InitCtor()
760 mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xforms) ),
761 GetXMLToken(XML_N_XFORMS_1_0),
762 XML_NAMESPACE_XFORMS );
763 + mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__formx) ),
764 + GetXMLToken( XML_N_FORMX ),
765 + XML_NAMESPACE_FORMX );
766 mpNamespaceMap->Add( OUString( RTL_CONSTASCII_USTRINGPARAM ( sXML_np__xsd) ),
767 GetXMLToken(XML_N_XSD),
769 diff --git xmloff/source/core/xmltoken.cxx xmloff/source/core/xmltoken.cxx
770 index 8d66db2..24faf3d 100644
771 --- xmloff/source/core/xmltoken.cxx
772 +++ xmloff/source/core/xmltoken.cxx
773 @@ -150,6 +150,10 @@ namespace xmloff { namespace token {
774 TOKEN( "rdfa", XML_NP_RDFA ),
775 TOKEN( "http://docs.oasis-open.org/opendocument/meta/rdfa#", XML_N_RDFA ),
777 + // jonp: 2008-09-24 Excel Interop
778 + TOKEN( "formx", XML_NP_FORMX ),
779 + TOKEN( "urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0", XML_N_FORMX ),
782 TOKEN( "mm", XML_UNIT_MM ),
783 TOKEN( "m", XML_UNIT_M ),
784 diff --git xmloff/source/forms/elementexport.cxx xmloff/source/forms/elementexport.cxx
785 index 357b434..cb859fb 100644
786 --- xmloff/source/forms/elementexport.cxx
787 +++ xmloff/source/forms/elementexport.cxx
788 @@ -1113,6 +1113,39 @@ namespace xmloff
791 // ----------------------------------
792 + // the string properties
794 + static sal_Int32 nStringPropertyAttributeIds[] =
795 + { // attribute flags
798 + static const ::rtl::OUString* pStringPropertyNames[] =
799 + { // property names
800 + &PROPERTY_GROUP_NAME
803 + sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
804 + #if OSL_DEBUG_LEVEL > 0
805 + sal_Int32 nNameCount = sizeof( pStringPropertyNames ) / sizeof( pStringPropertyNames[0] );
806 + OSL_ENSURE( ( nIdCount == nNameCount ),
807 + "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
809 + for ( i = 0; i < nIdCount; ++i )
810 + if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial )
812 + exportStringPropertyAttribute(
813 + OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ),
814 + OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ),
815 + *( pStringPropertyNames[i] )
817 + #if OSL_DEBUG_LEVEL > 0
818 + // reset the bit for later checking
819 + m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i];
824 + // ----------------------------------
825 if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
827 // need to export the min value and the max value as attributes
828 @@ -1570,6 +1603,8 @@ namespace xmloff
830 if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
831 m_nIncludeSpecial |= SCA_IMAGE_POSITION;
832 + if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) )
833 + m_nIncludeSpecial |= SCA_GROUP_NAME;
834 m_nIncludeDatabase = DA_DATA_FIELD | DA_INPUT_REQUIRED;
835 m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
837 diff --git xmloff/source/forms/formattributes.cxx xmloff/source/forms/formattributes.cxx
838 index 4314711..5df31ed 100644
839 --- xmloff/source/forms/formattributes.cxx
840 +++ xmloff/source/forms/formattributes.cxx
841 @@ -195,6 +195,7 @@ namespace xmloff
842 case SCA_MAX_VALUE: return "max-value";
843 case SCA_MIN_VALUE: return "min-value";
844 case SCA_VALIDATION: return "validation";
845 + case SCA_GROUP_NAME: return "group-name";
846 case SCA_MULTI_LINE: return "multi-line";
847 case SCA_AUTOMATIC_COMPLETION: return "auto-complete";
848 case SCA_MULTIPLE: return "multiple";
849 @@ -215,9 +216,12 @@ namespace xmloff
852 //---------------------------------------------------------------------
853 - sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 /*_nId*/)
854 + sal_uInt16 OAttributeMetaData::getSpecialAttributeNamespace(sal_Int32 _nId)
856 - // nothing special here
859 + case SCA_GROUP_NAME: return XML_NAMESPACE_FORMX;
861 return XML_NAMESPACE_FORM;
864 diff --git xmloff/source/forms/formattributes.hxx xmloff/source/forms/formattributes.hxx
865 index 50bad1b..ef6e7eb 100644
866 --- xmloff/source/forms/formattributes.hxx
867 +++ xmloff/source/forms/formattributes.hxx
868 @@ -126,6 +126,7 @@ namespace xmloff
869 #define SCA_MAX_VALUE 0x00000002
870 #define SCA_MIN_VALUE 0x00000004
871 #define SCA_VALIDATION 0x00000008
872 + #define SCA_GROUP_NAME 0x00000010
873 #define SCA_MULTI_LINE 0x00000020
874 #define SCA_AUTOMATIC_COMPLETION 0x00000080
875 #define SCA_MULTIPLE 0x00000100
876 diff --git xmloff/source/forms/layerimport.cxx xmloff/source/forms/layerimport.cxx
877 index 4381ddd..cf73233 100644
878 --- xmloff/source/forms/layerimport.cxx
879 +++ xmloff/source/forms/layerimport.cxx
880 @@ -97,6 +97,8 @@ namespace xmloff
881 m_aAttributeMetaData.addStringProperty(
882 OAttributeMetaData::getCommonControlAttributeName(CCA_NAME), PROPERTY_NAME);
883 m_aAttributeMetaData.addStringProperty(
884 + OAttributeMetaData::getSpecialAttributeName(SCA_GROUP_NAME), PROPERTY_GROUP_NAME);
885 + m_aAttributeMetaData.addStringProperty(
886 OAttributeMetaData::getCommonControlAttributeName(CCA_IMAGE_DATA), PROPERTY_IMAGEURL);
887 m_aAttributeMetaData.addStringProperty(
888 OAttributeMetaData::getCommonControlAttributeName(CCA_LABEL), PROPERTY_LABEL);
889 diff --git xmloff/source/forms/strings.hxx xmloff/source/forms/strings.hxx
890 index 5b992ef..b067c7b 100644
891 --- xmloff/source/forms/strings.hxx
892 +++ xmloff/source/forms/strings.hxx
893 @@ -207,6 +207,7 @@ namespace xmloff
894 XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition");
895 XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_ALIGN, "ImageAlign");
896 XMLFORM_CONSTASCII_STRING( PROPERTY_SCALE_IMAGE, "ScaleImage");
897 + XMLFORM_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName");
899 XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL, "BoundCell");
900 XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE, "CellRange");