ooo-build r12054 - in trunk: . patches/src680



Author: jonp
Date: Sat Mar 29 20:17:14 2008
New Revision: 12054
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12054&view=rev

Log:
	* patches/src680/forms-radio-button-group-names.diff: Added; adds a
	  GroupName property to RadioButton controls.  If GroupName is present, it
	  controls grouping behavior (where only one RadioButton in a group can be
	  selected).
	* patches/src680/apply: Add forms-option-button-group-names.diff.
	* patches/src680/radiobutton-group-hack.diff: Remove the forms-specific
	  functionality (as forms-radio-button-group-names.diff has a working
	  version).


Added:
   trunk/patches/src680/forms-radio-button-group-names.diff
Modified:
   trunk/ChangeLog
   trunk/patches/src680/apply
   trunk/patches/src680/radiobutton-group-hack.diff

Modified: trunk/patches/src680/apply
==============================================================================
--- trunk/patches/src680/apply	(original)
+++ trunk/patches/src680/apply	Sat Mar 29 20:17:14 2008
@@ -461,6 +461,10 @@
 # screws things up
 userform-scrollleftandtop.diff, i#87007, noelpwer
 
+# Add a GroupName property to RadioButtons so that RadioButtons don't need to
+# share the same name to be part of the same group.
+forms-radio-button-group-names.diff, n#310052, jonp
+
 [ SELinux ]
 # make OOo work under SELinux
 ooo80816.selinux.bridges.diff, i#80816

Added: trunk/patches/src680/forms-radio-button-group-names.diff
==============================================================================
--- (empty file)
+++ trunk/patches/src680/forms-radio-button-group-names.diff	Sat Mar 29 20:17:14 2008
@@ -0,0 +1,454 @@
+Index: extensions/inc/extensio.hrc
+===================================================================
+RCS file: /cvs/util/extensions/inc/extensio.hrc,v
+retrieving revision 1.33
+diff -u -p -r1.33 extensio.hrc
+--- extensions/inc/extensio.hrc	27 Nov 2007 11:51:34 -0000	1.33
++++ extensions/inc/extensio.hrc	29 Mar 2008 19:39:04 -0000
+@@ -162,7 +162,7 @@
+ 
+ //-----------------------------------------------------------------------
+     // FREE
+-    // FREE
++#define HID_PROP_GROUP_NAME                     (HID_FORMS_START +   1)
+ #define HID_PROP_GROUPBOX						(HID_FORMS_START +   2)
+ #define HID_PROP_CONTROLSOURCE					(HID_FORMS_START +   3)
+ #define HID_PROP_NAME							(HID_FORMS_START +   4)
+Index: extensions/source/propctrlr/formmetadata.hxx
+===================================================================
+RCS file: /cvs/util/extensions/source/propctrlr/formmetadata.hxx,v
+retrieving revision 1.34
+diff -u -p -r1.34 formmetadata.hxx
+--- extensions/source/propctrlr/formmetadata.hxx	27 Nov 2007 11:52:15 -0000	1.34
++++ extensions/source/propctrlr/formmetadata.hxx	29 Mar 2008 19:39:04 -0000
+@@ -178,6 +178,7 @@ namespace pcr
+ 	#define PROPERTY_ID_ALLOWADDITIONS		 20
+ 	#define PROPERTY_ID_ALLOWEDITS			 21
+ 	#define PROPERTY_ID_ALLOWDELETIONS		 22
++	#define PROPERTY_ID_GROUP_NAME    		 23
+ 	#define PROPERTY_ID_NAVIGATION			 24
+ 	#define PROPERTY_ID_CYCLE				 25
+ 	#define PROPERTY_ID_HIDDEN_VALUE		 26
+Index: extensions/source/propctrlr/formmetadata.cxx
+===================================================================
+RCS file: /cvs/util/extensions/source/propctrlr/formmetadata.cxx,v
+retrieving revision 1.47.18.1
+diff -u -p -r1.47.18.1 formmetadata.cxx
+--- extensions/source/propctrlr/formmetadata.cxx	11 Jan 2008 08:23:04 -0000	1.47.18.1
++++ extensions/source/propctrlr/formmetadata.cxx	29 Mar 2008 19:39:04 -0000
+@@ -154,6 +154,7 @@ namespace pcr
+         DEF_INFO_?( propname and id,   resoure id,         help id,           flags ),
+         */
+         DEF_INFO_3( NAME,              NAME,               NAME,              FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
++        DEF_INFO_3( GROUP_NAME,        GROUP_NAME,         GROUP_NAME,        FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
+         DEF_INFO_2( TITLE,             TITLE,              TITLE,             FORM_VISIBLE, DIALOG_VISIBLE ),
+         DEF_INFO_3( LABEL,             LABEL,              LABEL,             FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
+         DEF_INFO_2( CONTROLLABEL,      LABELCONTROL,       CONTROLLABEL,      FORM_VISIBLE, COMPOSEABLE ),
+Index: extensions/source/propctrlr/formstrings.hxx
+===================================================================
+RCS file: /cvs/util/extensions/source/propctrlr/formstrings.hxx,v
+retrieving revision 1.38
+diff -u -p -r1.38 formstrings.hxx
+--- extensions/source/propctrlr/formstrings.hxx	27 Nov 2007 11:53:16 -0000	1.38
++++ extensions/source/propctrlr/formstrings.hxx	29 Mar 2008 19:39:05 -0000
+@@ -57,6 +57,7 @@ namespace pcr
+ 	PCR_CONSTASCII_STRING( PROPERTY_TABINDEX,				"TabIndex");
+ 	PCR_CONSTASCII_STRING( PROPERTY_TAG,					"Tag");
+ 	PCR_CONSTASCII_STRING( PROPERTY_NAME,					"Name");
++	PCR_CONSTASCII_STRING( PROPERTY_GROUP_NAME,             "GroupName");
+ 	PCR_CONSTASCII_STRING( PROPERTY_VALUE,					"Value");
+ 	PCR_CONSTASCII_STRING( PROPERTY_TEXT,					"Text");
+ 	PCR_CONSTASCII_STRING( PROPERTY_NAVIGATION,				"NavigationBarMode");
+Index: extensions/source/propctrlr/formresid.hrc
+===================================================================
+RCS file: /cvs/util/extensions/source/propctrlr/formresid.hrc,v
+retrieving revision 1.36
+diff -u -p -r1.36 formresid.hrc
+--- extensions/source/propctrlr/formresid.hrc	27 Nov 2007 11:52:56 -0000	1.36
++++ extensions/source/propctrlr/formresid.hrc	29 Mar 2008 19:39:05 -0000
+@@ -152,7 +152,7 @@
+ #define RID_STR_TAG							( RID_FORMBROWSER_START + 116 )
+ #define RID_STR_HELPTEXT					( RID_FORMBROWSER_START + 117 )
+ #define RID_STR_HELPURL						( RID_FORMBROWSER_START + 118 )
+-    // FREE
++#define RID_STR_GROUP_NAME                  ( RID_FORMBROWSER_START + 119 )
+ #define RID_STR_UNCHECKEDREFVALUE           ( RID_FORMBROWSER_START + 120 )
+ #define RID_STR_CURSOR_TYPE					( RID_FORMBROWSER_START + 121 )
+     // FREE
+Index: extensions/source/propctrlr/formres.src
+===================================================================
+RCS file: /cvs/util/extensions/source/propctrlr/formres.src,v
+retrieving revision 1.81
+diff -u -p -r1.81 formres.src
+--- extensions/source/propctrlr/formres.src	27 Nov 2007 11:52:35 -0000	1.81
++++ extensions/source/propctrlr/formres.src	29 Mar 2008 19:39:05 -0000
+@@ -235,6 +235,10 @@ String RID_STR_NAME
+ {
+ 	Text [ en-US ] = "Name" ;
+ };
++String RID_STR_GROUP_NAME
++{
++	Text [ en-US ] = "Group Name" ;
++};
+ String RID_STR_TABINDEX
+ {
+ 	Text [ en-US ] = "Tab order" ;
+Index: forms/source/component/GroupManager.hxx
+===================================================================
+RCS file: /cvs/gsl/forms/source/component/GroupManager.hxx,v
+retrieving revision 1.11
+diff -u -p -r1.11 GroupManager.hxx
+--- forms/source/component/GroupManager.hxx	12 Oct 2006 11:12:12 -0000	1.11
++++ forms/source/component/GroupManager.hxx	29 Mar 2008 19:39:05 -0000
+@@ -248,6 +248,8 @@ public:
+ 	void getGroup(sal_Int32 nGroup, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup, ::rtl::OUString& Name);
+ 	void getGroupByName(const ::rtl::OUString& Name, ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> >& _rGroup);
+ 	::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel> > getControlModels();
++
++	static void GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent, ::rtl::OUString& sGroupName );
+ };
+ 
+ 
+Index: forms/source/component/GroupManager.cxx
+===================================================================
+RCS file: /cvs/gsl/forms/source/component/GroupManager.cxx,v
+retrieving revision 1.17
+diff -u -p -r1.17 GroupManager.cxx
+--- forms/source/component/GroupManager.cxx	16 Sep 2006 23:51:13 -0000	1.17
++++ forms/source/component/GroupManager.cxx	29 Mar 2008 19:39:05 -0000
+@@ -155,7 +155,7 @@ OGroupComp::OGroupComp(const Reference<X
+ 			// Indices kleiner 0 werden wie 0 behandelt
+ 			m_nTabIndex = Max(getINT16(m_xComponent->getPropertyValue( PROPERTY_TABINDEX )) , sal_Int16(0));
+ 
+-		m_xComponent->getPropertyValue( PROPERTY_NAME ) >>= m_aName;
++		OGroupManager::GetGroupName (m_xComponent, m_aName);
+ 	}
+ }
+ 
+@@ -342,7 +342,8 @@ void OGroupManager::removeFromGroupMap(c
+ 		aFind->second.RemoveComponent( _xSet );
+ 
+ 		// Wenn Anzahl der Gruppenelemente == 1 ist, Gruppe deaktivieren
+-		if ( aFind->second.Count() == 1 )
++		int nCount = aFind->second.Count();
++		if ( nCount == 1 || nCount == 0 )
+ 		{
+ 			OActiveGroups::iterator aActiveFind = ::std::find(
+                 m_aActiveGroupMap.begin(),
+@@ -353,7 +354,7 @@ void OGroupManager::removeFromGroupMap(c
+             {
+                 // the group is active. Deactivate it if the remaining component
+                 // is *no* radio button
+-                if ( !isRadioButton( aFind->second.GetObject( 0 ) ) )
++                if ( nCount == 0 || !isRadioButton( aFind->second.GetObject( 0 ) ) )
+ 				    m_aActiveGroupMap.erase( aActiveFind );
+             }
+ 		}
+@@ -362,6 +363,8 @@ void OGroupManager::removeFromGroupMap(c
+ 
+ 	// Bei Component als PropertyChangeListener abmelden
+ 	_xSet->removePropertyChangeListener( PROPERTY_NAME, this );
++	if (hasProperty(PROPERTY_GROUP_NAME, _xSet))
++		_xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this );
+ 	if (hasProperty(PROPERTY_TABINDEX, _xSet))
+ 		_xSet->removePropertyChangeListener( PROPERTY_TABINDEX, this );
+ }
+@@ -369,13 +372,25 @@ void OGroupManager::removeFromGroupMap(c
+ void SAL_CALL OGroupManager::propertyChange(const PropertyChangeEvent& evt) throw ( ::com::sun::star::uno::RuntimeException)
+ {
+ 	Reference<XPropertySet>  xSet(evt.Source, UNO_QUERY);
+-
+ 	// Component aus Gruppe entfernen
+ 	::rtl::OUString		sGroupName;
+-	if (evt.PropertyName == PROPERTY_NAME)
++	if (hasProperty( PROPERTY_GROUP_NAME, xSet ))
++		xSet->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
++	if (evt.PropertyName == PROPERTY_NAME) {
++		if (sGroupName.getLength() > 0)
++			return; // group hasn't changed; ignore this name change.
++		// no GroupName; use Name as GroupNme
++		evt.OldValue >>= sGroupName;
++	}
++	else if (evt.PropertyName == PROPERTY_GROUP_NAME) {
+ 		evt.OldValue >>= sGroupName;
++		if (sGroupName.getLength() == 0) {
++			// No prior GroupName; fallback to Nme
++			xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
++		}
++	}
+ 	else
+-		xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
++		GetGroupName (xSet, sGroupName);
+ 
+ 	removeFromGroupMap(sGroupName,xSet);
+ 
+@@ -459,7 +474,7 @@ void OGroupManager::InsertElement( const
+ 
+ 	// Component in Gruppe aufnehmen
+ 	::rtl::OUString sGroupName;
+-	xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
++	GetGroupName (xSet, sGroupName);
+ 
+ 	OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
+ 
+@@ -497,6 +512,8 @@ void OGroupManager::InsertElement( const
+ 
+ 	// Bei Component als PropertyChangeListener anmelden
+ 	xSet->addPropertyChangeListener( PROPERTY_NAME, this );
++	if (hasProperty(PROPERTY_GROUP_NAME, xSet))
++		xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this );
+ 
+     // Tabindex muss nicht jeder unterstuetzen
+ 	if (hasProperty(PROPERTY_TABINDEX, xSet))
+@@ -514,11 +531,22 @@ void OGroupManager::RemoveElement( const
+ 
+ 	// Component aus Gruppe entfernen
+ 	::rtl::OUString		sGroupName;
+-	xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
++	GetGroupName (xSet, sGroupName);
+ 
+ 	removeFromGroupMap(sGroupName,xSet);
+ }
+ 
++void OGroupManager::GetGroupName (::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent, ::rtl::OUString& sGroupName)
++{
++    if (hasProperty( PROPERTY_GROUP_NAME, xComponent )) {
++        xComponent->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
++        if (sGroupName.getLength() == 0)
++            xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
++    }
++    else
++        xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
++}
++
+ //.........................................................................
+ }	// namespace frm
+ //.........................................................................
+Index: forms/source/component/RadioButton.hxx
+===================================================================
+RCS file: /cvs/gsl/forms/source/component/RadioButton.hxx,v
+retrieving revision 1.11
+diff -u -p -r1.11 RadioButton.hxx
+--- forms/source/component/RadioButton.hxx	9 Mar 2007 13:31:41 -0000	1.11
++++ forms/source/component/RadioButton.hxx	29 Mar 2008 19:39:05 -0000
+@@ -49,6 +49,9 @@ namespace frm
+ //==================================================================
+ class ORadioButtonModel		:public OReferenceValueComponent
+ {
++protected:
++	::rtl::OUString m_sGroupName;
++
+ public:
+ 	DECLARE_DEFAULT_LEAF_XTOR( ORadioButtonModel );
+ 
+@@ -57,6 +60,10 @@ public:
+ 	virtual StringSequence SAL_CALL	getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
+ 
+ 	// OPropertySetHelper
++	virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const;
++	virtual sal_Bool SAL_CALL convertFastPropertyValue(
++				::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue )
++				throw (::com::sun::star::lang::IllegalArgumentException);
+ 	virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
+ 				throw (::com::sun::star::uno::Exception);
+ 
+Index: forms/source/component/RadioButton.cxx
+===================================================================
+RCS file: /cvs/gsl/forms/source/component/RadioButton.cxx,v
+retrieving revision 1.21
+diff -u -p -r1.21 RadioButton.cxx
+--- forms/source/component/RadioButton.cxx	9 Mar 2007 13:31:25 -0000	1.21
++++ forms/source/component/RadioButton.cxx	29 Mar 2008 19:39:05 -0000
+@@ -39,6 +39,9 @@
+ #ifndef _FORMS_RADIOBUTTON_HXX_
+ #include "RadioButton.hxx"
+ #endif
++#ifndef _FRM_GROUPMANAGER_HXX_
++#include "GroupManager.hxx"
++#endif
+ #ifndef _FRM_PROPERTY_HXX_
+ #include "property.hxx"
+ #endif
+@@ -150,6 +153,7 @@ ORadioButtonModel::ORadioButtonModel(con
+ //------------------------------------------------------------------
+ ORadioButtonModel::ORadioButtonModel( const ORadioButtonModel* _pOriginal, const Reference<XMultiServiceFactory>& _rxFactory )
+ 	:OReferenceValueComponent( _pOriginal, _rxFactory )
++	,m_sGroupName( _pOriginal->m_sGroupName )
+ {
+ 	DBG_CTOR( ORadioButtonModel, NULL );
+ }
+@@ -192,7 +196,7 @@ StringSequence SAL_CALL	ORadioButtonMode
+ void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const Any& rValue)
+ {
+ 	// mein Name
+-	::rtl::OUString sMyName(m_aName);
++	::rtl::OUString sMyGroup( m_sGroupName.getLength() > 0 ? m_sGroupName : m_aName);
+ 
+ 	// meine Siblings durchiterieren
+ 	Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
+@@ -200,8 +204,9 @@ void ORadioButtonModel::SetSiblingPropsT
+ 	{
+ 		Reference<XPropertySet> xMyProps;
+ 		query_interface(static_cast<XWeak*>(this), xMyProps);
+-		::rtl::OUString	sCurrentName;
+-		for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
++		::rtl::OUString	sCurrentGroup;
++		int nNumSiblings = xIndexAccess->getCount();
++		for (sal_Int32 i=0; i<nNumSiblings; ++i)
+ 		{
+ 			Reference<XPropertySet>	xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
+ 			if (!xSiblingProperties.is())
+@@ -218,34 +223,64 @@ void ORadioButtonModel::SetSiblingPropsT
+ 				continue;
+ 
+ 			// das 'zur selben Gruppe gehoeren' wird am Namen festgemacht
+-			xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sCurrentName;
+-			if (sCurrentName == sMyName)
++			OGroupManager::GetGroupName( xSiblingProperties, sCurrentGroup );
++			if (sCurrentGroup == sMyGroup)
+ 				xSiblingProperties->setPropertyValue(rPropName, rValue);
+ 		}
+ 	}
+ }
+ 
+ //------------------------------------------------------------------------------
+-void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) throw (Exception)
++void ORadioButtonModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const
+ {
+-	OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
++	switch (nHandle)
++	{
++		case PROPERTY_ID_GROUP_NAME:
++			rValue <<= m_sGroupName;
++			break;
++		default:
++			OReferenceValueComponent::getFastPropertyValue(rValue, nHandle);
++			break;
++	}
++}
+ 
+-	// if the label control changed ...
+-	if (nHandle == PROPERTY_ID_CONTROLLABEL)
+-	{	// ... forward this to our siblings
+-		SetSiblingPropsTo(PROPERTY_CONTROLLABEL, rValue);
++sal_Bool ORadioButtonModel::convertFastPropertyValue(
++                Any& _rConvertedValue, Any& _rOldValue,
++                sal_Int32 _nHandle,
++                const Any& _rValue)
++        throw (com::sun::star::lang::IllegalArgumentException)
++{
++	sal_Bool bModified(sal_False);
++	switch (_nHandle)
++	{
++    case PROPERTY_ID_GROUP_NAME:
++			bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_sGroupName);
++      break;
++		default:
++			bModified = OReferenceValueComponent::convertFastPropertyValue(_rConvertedValue, _rOldValue, _nHandle, _rValue);
++      break;
+ 	}
++	return bModified;
++}
+ 
++void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) throw (Exception)
++{
++	if (nHandle != PROPERTY_ID_GROUP_NAME)
++		OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
++	switch (nHandle) {
++	case PROPERTY_ID_CONTROLLABEL:
++		SetSiblingPropsTo(PROPERTY_CONTROLLABEL, rValue);
++		break;
+ 	// wenn sich die ControlSource-Eigenschaft geaendert hat ...
+-	if (nHandle == PROPERTY_ID_CONTROLSOURCE)
+-	{	// ... muss ich allen meinen Siblings, die in der selben RadioButton-Gruppe sind wie ich, auch die
++	case PROPERTY_ID_CONTROLSOURCE:
++		// ... muss ich allen meinen Siblings, die in der selben RadioButton-Gruppe sind wie ich, auch die
+ 		// neue ControlSource mitgeben
+ 		SetSiblingPropsTo(PROPERTY_CONTROLSOURCE, rValue);
+-	}
+-
++		break;
+ 	// die andere Richtung : wenn sich mein Name aendert ...
+-	if (nHandle == PROPERTY_ID_NAME)
+-	{
++	case PROPERTY_ID_GROUP_NAME:
++		rValue >>= m_sGroupName;
++	case PROPERTY_ID_NAME: {
+ 		// ... muss ich testen, ob ich Siblings mit dem selben Namen habe, damit ich deren ControlSource uebernehmen kann
+ 		Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
+ 		if (xIndexAccess.is())
+@@ -271,7 +306,7 @@ void ORadioButtonModel::setFastPropertyV
+ 					// nur Radio-Buttons
+ 					continue;
+ 
+-				xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sName;
++				xSiblingProperties->getPropertyValue(nHandle == PROPERTY_ID_NAME ? PROPERTY_NAME : PROPERTY_GROUP_NAME) >>= sName;
+ 				// Control, das zur gleichen Gruppe gehoert ?
+ 				if (rValue == sName)
+ 				{
+@@ -280,10 +315,9 @@ void ORadioButtonModel::setFastPropertyV
+ 				}
+ 			}
+ 		}
++		break;
+ 	}
+-
+-	if (nHandle == PROPERTY_ID_DEFAULTCHECKED)
+-	{
++	case PROPERTY_ID_DEFAULTCHECKED: {
+ 		sal_Int16 nValue;
+ 		rValue >>= nValue;
+ 		if (1 == nValue)
+@@ -294,14 +328,20 @@ void ORadioButtonModel::setFastPropertyV
+ 			aZero <<= nValue;
+ 			SetSiblingPropsTo(PROPERTY_DEFAULTCHECKED, aZero);
+ 		}
++		break;
++	}
++	default:  
++		// OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
++		break;
+ 	}
+ }
+ 
+ //------------------------------------------------------------------------------
+ void ORadioButtonModel::describeFixedProperties( Sequence< Property >& _rProps ) const
+ {
+-	BEGIN_DESCRIBE_PROPERTIES( 1, OReferenceValueComponent )
++	BEGIN_DESCRIBE_PROPERTIES( 2, OReferenceValueComponent )
+ 		DECL_PROP1(TABINDEX,			sal_Int16,					BOUND);
++		DECL_PROP1(GROUP_NAME,          ::rtl::OUString,            BOUND);
+ 	END_DESCRIBE_PROPERTIES();
+ }
+ 
+Index: forms/source/inc/frm_strings.hxx
+===================================================================
+RCS file: /cvs/gsl/forms/source/inc/frm_strings.hxx,v
+retrieving revision 1.15.14.1
+diff -u -p -r1.15.14.1 frm_strings.hxx
+--- forms/source/inc/frm_strings.hxx	18 Jan 2008 15:11:23 -0000	1.15.14.1
++++ forms/source/inc/frm_strings.hxx	29 Mar 2008 19:39:05 -0000
+@@ -109,6 +109,7 @@ namespace frm
+     FORMS_CONSTASCII_STRING( PROPERTY_TABINDEX,                 "TabIndex" );
+     FORMS_CONSTASCII_STRING( PROPERTY_TAG,                      "Tag" );
+     FORMS_CONSTASCII_STRING( PROPERTY_NAME,                     "Name" );
++    FORMS_CONSTASCII_STRING( PROPERTY_GROUP_NAME,               "GroupName" );
+     FORMS_CONSTASCII_STRING( PROPERTY_CLASSID,                  "ClassId" );
+     FORMS_CONSTASCII_STRING( PROPERTY_FETCHSIZE,                "FetchSize" );
+     FORMS_CONSTASCII_STRING( PROPERTY_VALUE,                    "Value" );
+Index: forms/source/inc/property.hrc
+===================================================================
+RCS file: /cvs/gsl/forms/source/inc/property.hrc,v
+retrieving revision 1.20
+diff -u -p -r1.20 property.hrc
+--- forms/source/inc/property.hrc	31 Jan 2006 18:36:51 -0000	1.20
++++ forms/source/inc/property.hrc	29 Mar 2008 19:39:05 -0000
+@@ -65,7 +65,7 @@ namespace frm
+ #define PROPERTY_ID_ALLOWEDITS          (PROPERTY_ID_START + 16)
+ #define PROPERTY_ID_ALLOWDELETIONS      (PROPERTY_ID_START + 17)
+ #define PROPERTY_ID_NATIVE_LOOK         (PROPERTY_ID_START + 18)
+-    // free
++#define PROPERTY_ID_GROUP_NAME          (PROPERTY_ID_START + 19)
+     // free
+     // free
+     // free

Modified: trunk/patches/src680/radiobutton-group-hack.diff
==============================================================================
--- trunk/patches/src680/radiobutton-group-hack.diff	(original)
+++ trunk/patches/src680/radiobutton-group-hack.diff	Sat Mar 29 20:17:14 2008
@@ -1,351 +1,3 @@
---- forms/source/component/GroupManager.cxx	2006-09-16 19:51:13.000000000 -0400
-+++ forms/source/component/GroupManager.cxx	2008-01-30 19:08:58.000000000 -0500
-@@ -62,6 +62,7 @@
- #include "property.hrc"
- 
- #include <algorithm>
-+#include <stdio.h>
- 
- //.........................................................................
- namespace frm
-@@ -91,6 +92,21 @@ namespace
-         }
-         return bIs;
-     }
-+
-+	#define CHAR_POINTER(THE_OUSTRING) ::rtl::OUStringToOString (THE_OUSTRING, RTL_TEXTENCODING_UTF8).pData->buffer
-+    void GetGroupName (::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent, ::rtl::OUString& sGroupName)
-+    {
-+          try // we seem to call ( and worse generate a core from the uncaught exception ) the method for objects that don't support the property
-+          {
-+		xComponent->getPropertyValue( PROPERTY_GROUP_NAME ) >>= sGroupName;
-+		if (sGroupName.getLength() == 0)
-+			xComponent->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
-+		rtl::OUString name;
-+		xComponent->getPropertyValue( PROPERTY_NAME ) >>= name;
-+		OSL_TRACE ("# GetGroupName: Name=%s; sGroupName=%s", CHAR_POINTER(name), CHAR_POINTER(sGroupName));
-+          }
-+          catch ( Exception& ) {} 
-+    }
- }
- 
- //========================================================================
-@@ -155,7 +167,7 @@ OGroupComp::OGroupComp(const Reference<X
- 			// Indices kleiner 0 werden wie 0 behandelt
- 			m_nTabIndex = Max(getINT16(m_xComponent->getPropertyValue( PROPERTY_TABINDEX )) , sal_Int16(0));
- 
--		m_xComponent->getPropertyValue( PROPERTY_NAME ) >>= m_aName;
-+		GetGroupName (m_xComponent, m_aName);
- 	}
- }
- 
-@@ -331,6 +343,9 @@ void OGroupManager::disposing(const Even
- // -----------------------------------------------------------------------------
- void OGroupManager::removeFromGroupMap(const ::rtl::OUString& _sGroupName,const Reference<XPropertySet>& _xSet)
- {
-+	rtl::OUString name;
-+	_xSet->getPropertyValue (PROPERTY_NAME) >>= name;
-+	OSL_TRACE ("# removeFromGroupMap: Name=%s; GroupName=%s; Set=%p", CHAR_POINTER(name), CHAR_POINTER(_sGroupName), (void*) &_xSet); 
- 	// Component aus CompGroup entfernen
- 	m_pCompGroup->RemoveComponent( _xSet );
- 
-@@ -362,6 +377,11 @@ void OGroupManager::removeFromGroupMap(c
- 
- 	// Bei Component als PropertyChangeListener abmelden
- 	_xSet->removePropertyChangeListener( PROPERTY_NAME, this );
-+       try // we seem to try and get/set listeners for the property even on objects that don't support it ( results in core from uncaught exception )
-+       {
-+	_xSet->removePropertyChangeListener( PROPERTY_GROUP_NAME, this );
-+       }
-+       catch( Exception& e ){}
- 	if (hasProperty(PROPERTY_TABINDEX, _xSet))
- 		_xSet->removePropertyChangeListener( PROPERTY_TABINDEX, this );
- }
-@@ -369,13 +385,21 @@ void OGroupManager::removeFromGroupMap(c
- void SAL_CALL OGroupManager::propertyChange(const PropertyChangeEvent& evt) throw ( ::com::sun::star::uno::RuntimeException)
- {
- 	Reference<XPropertySet>  xSet(evt.Source, UNO_QUERY);
-+	rtl::OUString o, n;
-+	evt.OldValue >>= o;
-+	evt.NewValue >>= n;
-+	OSL_TRACE ("# propertyChange: PropertyName=%s; OldValue=%s; NewValue=%s",
-+			CHAR_POINTER(evt.PropertyName), CHAR_POINTER(o), CHAR_POINTER(n));
- 
- 	// Component aus Gruppe entfernen
- 	::rtl::OUString		sGroupName;
--	if (evt.PropertyName == PROPERTY_NAME)
-+	if (evt.PropertyName == PROPERTY_NAME) {
-+		rtl::OUString n;
-+	}
-+	else if (evt.PropertyName == PROPERTY_GROUP_NAME)
- 		evt.OldValue >>= sGroupName;
- 	else
--		xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
-+		GetGroupName (xSet, sGroupName);
- 
- 	removeFromGroupMap(sGroupName,xSet);
- 
-@@ -459,7 +483,7 @@ void OGroupManager::InsertElement( const
- 
- 	// Component in Gruppe aufnehmen
- 	::rtl::OUString sGroupName;
--	xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
-+	GetGroupName (xSet, sGroupName);
- 
- 	OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
- 
-@@ -495,8 +519,16 @@ void OGroupManager::InsertElement( const
- 	}
- 
- 
-+	rtl::OUString name;
-+	xSet->getPropertyValue( PROPERTY_NAME ) >>= name;
-+	OSL_TRACE ("# InsertComponent: Name=%s; GroupName=%s; Set=%p", CHAR_POINTER(name), CHAR_POINTER(sGroupName), (void*) &xSet);
- 	// Bei Component als PropertyChangeListener anmelden
- 	xSet->addPropertyChangeListener( PROPERTY_NAME, this );
-+       try // we use this property on objects that dont support it, resulting in cores from uncaught exceptions
-+       {
-+	xSet->addPropertyChangeListener( PROPERTY_GROUP_NAME, this );
-+       }
-+       catch( Exception& ){}
- 
-     // Tabindex muss nicht jeder unterstuetzen
- 	if (hasProperty(PROPERTY_TABINDEX, xSet))
-@@ -514,7 +542,7 @@ void OGroupManager::RemoveElement( const
- 
- 	// Component aus Gruppe entfernen
- 	::rtl::OUString		sGroupName;
--	xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
-+	GetGroupName (xSet, sGroupName);
- 
- 	removeFromGroupMap(sGroupName,xSet);
- }
---- forms/source/component/RadioButton.cxx	2007-03-09 08:31:25.000000000 -0500
-+++ forms/source/component/RadioButton.cxx	2008-01-29 19:13:03.000000000 -0500
-@@ -65,6 +65,9 @@
- #include <com/sun/star/awt/XVclWindowPeer.hpp>
- #endif
- 
-+#include <stdio.h>
-+	#define CHAR_POINTER(THE_OUSTRING) ::rtl::OUStringToOString (THE_OUSTRING, RTL_TEXTENCODING_UTF8).pData->buffer
-+
- //.........................................................................
- namespace frm
- {
-@@ -226,26 +229,59 @@ void ORadioButtonModel::SetSiblingPropsT
- }
- 
- //------------------------------------------------------------------------------
--void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) throw (Exception)
-+void ORadioButtonModel::getFastPropertyValue(Any& rValue, sal_Int32 nHandle) const
- {
--	OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-+	switch (nHandle)
-+	{
-+		case PROPERTY_ID_GROUP_NAME:
-+			rValue <<= m_sGroupName;
-+			break;
-+		default:
-+			OReferenceValueComponent::getFastPropertyValue(rValue, nHandle);
-+      break;
-+	}
-+}
- 
--	// if the label control changed ...
--	if (nHandle == PROPERTY_ID_CONTROLLABEL)
--	{	// ... forward this to our siblings
--		SetSiblingPropsTo(PROPERTY_CONTROLLABEL, rValue);
-+sal_Bool ORadioButtonModel::convertFastPropertyValue(
-+                Any& _rConvertedValue, Any& _rOldValue,
-+                sal_Int32 _nHandle,
-+                const Any& _rValue)
-+        throw (com::sun::star::lang::IllegalArgumentException)
-+{
-+	sal_Bool bModified(sal_False);
-+	switch (_nHandle)
-+	{
-+    case PROPERTY_ID_GROUP_NAME:
-+			bModified = tryPropertyValue(_rConvertedValue, _rOldValue, _rValue, m_sGroupName);
-+      break;
-+		default:
-+			bModified = OReferenceValueComponent::convertFastPropertyValue(_rConvertedValue, _rOldValue, _nHandle, _rValue);
-+      break;
- 	}
-+	return bModified;
-+}
- 
-+void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) throw (Exception)
-+{
-+	::rtl::OUString s;
-+	rValue >>= s;
-+	OSL_TRACE ("# setFastPropertyValue_NoBroadcast: nHandle=%i; rValue=%s", nHandle, CHAR_POINTER(s));
-+	if (nHandle != PROPERTY_ID_GROUP_NAME)
-+		OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-+	switch (nHandle) {
-+	case PROPERTY_ID_CONTROLLABEL:
-+		SetSiblingPropsTo(PROPERTY_CONTROLLABEL, rValue);
-+		break;
- 	// wenn sich die ControlSource-Eigenschaft geaendert hat ...
--	if (nHandle == PROPERTY_ID_CONTROLSOURCE)
--	{	// ... muss ich allen meinen Siblings, die in der selben RadioButton-Gruppe sind wie ich, auch die
-+	case PROPERTY_ID_CONTROLSOURCE:
-+		// ... muss ich allen meinen Siblings, die in der selben RadioButton-Gruppe sind wie ich, auch die
- 		// neue ControlSource mitgeben
- 		SetSiblingPropsTo(PROPERTY_CONTROLSOURCE, rValue);
--	}
--
-+		break;
- 	// die andere Richtung : wenn sich mein Name aendert ...
--	if (nHandle == PROPERTY_ID_NAME)
--	{
-+	case PROPERTY_ID_GROUP_NAME:
-+		rValue >>= m_sGroupName;
-+	case PROPERTY_ID_NAME: {
- 		// ... muss ich testen, ob ich Siblings mit dem selben Namen habe, damit ich deren ControlSource uebernehmen kann
- 		Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
- 		if (xIndexAccess.is())
-@@ -271,7 +307,7 @@ void ORadioButtonModel::setFastPropertyV
- 					// nur Radio-Buttons
- 					continue;
- 
--				xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sName;
-+				xSiblingProperties->getPropertyValue(nHandle == PROPERTY_ID_NAME ? PROPERTY_NAME : PROPERTY_GROUP_NAME) >>= sName;
- 				// Control, das zur gleichen Gruppe gehoert ?
- 				if (rValue == sName)
- 				{
-@@ -280,10 +316,9 @@ void ORadioButtonModel::setFastPropertyV
- 				}
- 			}
- 		}
-+		break;
- 	}
--
--	if (nHandle == PROPERTY_ID_DEFAULTCHECKED)
--	{
-+	case PROPERTY_ID_DEFAULTCHECKED: {
- 		sal_Int16 nValue;
- 		rValue >>= nValue;
- 		if (1 == nValue)
-@@ -294,14 +329,20 @@ void ORadioButtonModel::setFastPropertyV
- 			aZero <<= nValue;
- 			SetSiblingPropsTo(PROPERTY_DEFAULTCHECKED, aZero);
- 		}
-+		break;
-+	}
-+	default:  
-+		// OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-+		break;
- 	}
- }
- 
- //------------------------------------------------------------------------------
- void ORadioButtonModel::describeFixedProperties( Sequence< Property >& _rProps ) const
- {
--	BEGIN_DESCRIBE_PROPERTIES( 1, OReferenceValueComponent )
-+	BEGIN_DESCRIBE_PROPERTIES( 2, OReferenceValueComponent )
- 		DECL_PROP1(TABINDEX,			sal_Int16,					BOUND);
-+		DECL_PROP1( GROUP_NAME,   ::rtl::OUString,    BOUND);
- 	END_DESCRIBE_PROPERTIES();
- }
- 
---- forms/source/component/RadioButton.hxx	2007-03-09 08:31:41.000000000 -0500
-+++ forms/source/component/RadioButton.hxx	2008-01-25 16:46:16.000000000 -0500
-@@ -49,6 +49,9 @@ namespace frm
- //==================================================================
- class ORadioButtonModel		:public OReferenceValueComponent
- {
-+protected:
-+	::rtl::OUString m_sGroupName;
-+
- public:
- 	DECLARE_DEFAULT_LEAF_XTOR( ORadioButtonModel );
- 
-@@ -57,6 +60,10 @@ public:
- 	virtual StringSequence SAL_CALL	getSupportedServiceNames() throw(::com::sun::star::uno::RuntimeException);
- 
- 	// OPropertySetHelper
-+	virtual void SAL_CALL getFastPropertyValue(::com::sun::star::uno::Any& rValue, sal_Int32 nHandle) const;
-+	virtual sal_Bool SAL_CALL convertFastPropertyValue(
-+				::com::sun::star::uno::Any& _rConvertedValue, ::com::sun::star::uno::Any& _rOldValue, sal_Int32 _nHandle, const ::com::sun::star::uno::Any& _rValue )
-+				throw (::com::sun::star::lang::IllegalArgumentException);
- 	virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 nHandle, const ::com::sun::star::uno::Any& rValue )
- 				throw (::com::sun::star::uno::Exception);
- 
---- forms/source/inc/frm_strings.hxx	2007-11-01 10:57:09.000000000 -0400
-+++ forms/source/inc/frm_strings.hxx	2008-01-24 18:56:37.000000000 -0500
-@@ -109,6 +109,7 @@ namespace frm
-     FORMS_CONSTASCII_STRING( PROPERTY_TABINDEX,                 "TabIndex" );
-     FORMS_CONSTASCII_STRING( PROPERTY_TAG,                      "Tag" );
-     FORMS_CONSTASCII_STRING( PROPERTY_NAME,                     "Name" );
-+    FORMS_CONSTASCII_STRING( PROPERTY_GROUP_NAME,               "GroupName" );
-     FORMS_CONSTASCII_STRING( PROPERTY_CLASSID,                  "ClassId" );
-     FORMS_CONSTASCII_STRING( PROPERTY_FETCHSIZE,                "FetchSize" );
-     FORMS_CONSTASCII_STRING( PROPERTY_VALUE,                    "Value" );
---- forms/source/inc/property.hrc	2006-01-31 13:36:51.000000000 -0500
-+++ forms/source/inc/property.hrc	2008-01-24 18:56:43.000000000 -0500
-@@ -65,7 +65,7 @@ namespace frm
- #define PROPERTY_ID_ALLOWEDITS          (PROPERTY_ID_START + 16)
- #define PROPERTY_ID_ALLOWDELETIONS      (PROPERTY_ID_START + 17)
- #define PROPERTY_ID_NATIVE_LOOK         (PROPERTY_ID_START + 18)
--    // free
-+#define PROPERTY_ID_GROUP_NAME          (PROPERTY_ID_START + 19)
-     // free
-     // free
-     // free
---- extensions/inc/extensio.hrc	2007-11-27 06:51:34.000000000 -0500
-+++ extensions/inc/extensio.hrc	2008-01-27 22:12:29.000000000 -0500
-@@ -162,7 +162,7 @@
- 
- //-----------------------------------------------------------------------
-     // FREE
--    // FREE
-+#define HID_PROP_GROUP_NAME                     (HID_FORMS_START +   1)
- #define HID_PROP_GROUPBOX						(HID_FORMS_START +   2)
- #define HID_PROP_CONTROLSOURCE					(HID_FORMS_START +   3)
- #define HID_PROP_NAME							(HID_FORMS_START +   4)
-Only in ooh680-m3/extensions/inc: extensio.hrc~
-diff -rup -x '*.d*' -x '*.o*' -x 'CVS*' -x '*.mk' -x '*.cmd' -x '*.l*' -x '*.s*' ooo-build/build/ooh680-m3.bk/extensions/source/propctrlr/formmetadata.cxx ooh680-m3/extensions/source/propctrlr/formmetadata.cxx
---- extensions/source/propctrlr/formmetadata.cxx	2008-01-11 03:23:04.000000000 -0500
-+++ extensions/source/propctrlr/formmetadata.cxx	2008-01-27 22:12:41.000000000 -0500
-@@ -154,6 +154,7 @@ namespace pcr
-         DEF_INFO_?( propname and id,   resoure id,         help id,           flags ),
-         */
-         DEF_INFO_3( NAME,              NAME,               NAME,              FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
-+        DEF_INFO_3( GROUP_NAME,        GROUP_NAME,         GROUP_NAME,        FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
-         DEF_INFO_2( TITLE,             TITLE,              TITLE,             FORM_VISIBLE, DIALOG_VISIBLE ),
-         DEF_INFO_3( LABEL,             LABEL,              LABEL,             FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
-         DEF_INFO_2( CONTROLLABEL,      LABELCONTROL,       CONTROLLABEL,      FORM_VISIBLE, COMPOSEABLE ),
---- extensions/source/propctrlr/formmetadata.hxx	2007-11-27 06:52:15.000000000 -0500
-+++ extensions/source/propctrlr/formmetadata.hxx	2008-01-27 22:09:03.000000000 -0500
-@@ -178,6 +178,7 @@ namespace pcr
- 	#define PROPERTY_ID_ALLOWADDITIONS		 20
- 	#define PROPERTY_ID_ALLOWEDITS			 21
- 	#define PROPERTY_ID_ALLOWDELETIONS		 22
-+	#define PROPERTY_ID_GROUP_NAME    		 23
- 	#define PROPERTY_ID_NAVIGATION			 24
- 	#define PROPERTY_ID_CYCLE				 25
- 	#define PROPERTY_ID_HIDDEN_VALUE		 26
---- extensions/source/propctrlr/formresid.hrc	2007-11-27 06:52:56.000000000 -0500
-+++ extensions/source/propctrlr/formresid.hrc	2008-01-28 14:16:41.000000000 -0500
-@@ -152,7 +152,7 @@
- #define RID_STR_TAG							( RID_FORMBROWSER_START + 116 )
- #define RID_STR_HELPTEXT					( RID_FORMBROWSER_START + 117 )
- #define RID_STR_HELPURL						( RID_FORMBROWSER_START + 118 )
--    // FREE
-+#define RID_STR_GROUP_NAME                  ( RID_FORMBROWSER_START + 119 )
- #define RID_STR_UNCHECKEDREFVALUE           ( RID_FORMBROWSER_START + 120 )
- #define RID_STR_CURSOR_TYPE					( RID_FORMBROWSER_START + 121 )
-     // FREE
---- extensions/source/propctrlr/formstrings.hxx	2007-11-27 06:53:16.000000000 -0500
-+++ extensions/source/propctrlr/formstrings.hxx	2008-01-27 22:03:53.000000000 -0500
-@@ -57,6 +57,7 @@ namespace pcr
- 	PCR_CONSTASCII_STRING( PROPERTY_TABINDEX,				"TabIndex");
- 	PCR_CONSTASCII_STRING( PROPERTY_TAG,					"Tag");
- 	PCR_CONSTASCII_STRING( PROPERTY_NAME,					"Name");
-+	PCR_CONSTASCII_STRING( PROPERTY_GROUP_NAME,   "GroupName");
- 	PCR_CONSTASCII_STRING( PROPERTY_VALUE,					"Value");
- 	PCR_CONSTASCII_STRING( PROPERTY_TEXT,					"Text");
- 	PCR_CONSTASCII_STRING( PROPERTY_NAVIGATION,				"NavigationBarMode");
 --- svx/source/msfilter/msocximex.cxx	2007-09-27 14:02:19.000000000 +0100
 +++ svx/source/msfilter/msocximex.cxx	2008-02-04 23:56:17.000000000 +0000
 @@ -1758,11 +1758,15 @@ sal_Bool OCX_OptionButton::Import(com::s



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]