ooo-build r12838 - in trunk: . patches/dev300
- From: jonp svn gnome org
- To: svn-commits-list gnome org
- Subject: ooo-build r12838 - in trunk: . patches/dev300
- Date: Mon, 9 Jun 2008 15:25:28 +0000 (UTC)
Author: jonp
Date: Mon Jun 9 15:25:28 2008
New Revision: 12838
URL: http://svn.gnome.org/viewvc/ooo-build?rev=12838&view=rev
Log:
* patches/dev300/forms-radio-button-group-names.diff: Cleanup the patch, in
accordance with Frank SchÃnheit's suggestions.
Modified:
trunk/ChangeLog
trunk/patches/dev300/forms-radio-button-group-names.diff
Modified: trunk/patches/dev300/forms-radio-button-group-names.diff
==============================================================================
--- trunk/patches/dev300/forms-radio-button-group-names.diff (original)
+++ trunk/patches/dev300/forms-radio-button-group-names.diff Mon Jun 9 15:25:28 2008
@@ -4,7 +4,7 @@
retrieving revision 1.34
diff -u -p -r1.34 extensio.hrc
--- extensions/inc/extensio.hrc 11 Apr 2008 09:15:58 -0000 1.34
-+++ extensions/inc/extensio.hrc 12 May 2008 06:43:27 -0000
++++ extensions/inc/extensio.hrc 6 Jun 2008 20:18:38 -0000
@@ -157,7 +157,7 @@
//-----------------------------------------------------------------------
@@ -20,7 +20,7 @@
retrieving revision 1.35
diff -u -p -r1.35 formmetadata.hxx
--- extensions/source/propctrlr/formmetadata.hxx 11 Apr 2008 10:58:41 -0000 1.35
-+++ extensions/source/propctrlr/formmetadata.hxx 12 May 2008 06:43:27 -0000
++++ extensions/source/propctrlr/formmetadata.hxx 6 Jun 2008 20:18:39 -0000
@@ -166,6 +166,7 @@ namespace pcr
#define PROPERTY_ID_ALLOWADDITIONS 20
#define PROPERTY_ID_ALLOWEDITS 21
@@ -35,7 +35,7 @@
retrieving revision 1.50
diff -u -p -r1.50 formmetadata.cxx
--- extensions/source/propctrlr/formmetadata.cxx 11 Apr 2008 10:58:09 -0000 1.50
-+++ extensions/source/propctrlr/formmetadata.cxx 12 May 2008 06:43:27 -0000
++++ extensions/source/propctrlr/formmetadata.cxx 6 Jun 2008 20:18:42 -0000
@@ -142,6 +142,7 @@ namespace pcr
DEF_INFO_2( TITLE, TITLE, TITLE, FORM_VISIBLE, DIALOG_VISIBLE ),
DEF_INFO_3( LABEL, LABEL, LABEL, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
@@ -50,7 +50,7 @@
retrieving revision 1.39
diff -u -p -r1.39 formstrings.hxx
--- extensions/source/propctrlr/formstrings.hxx 11 Apr 2008 11:01:21 -0000 1.39
-+++ extensions/source/propctrlr/formstrings.hxx 12 May 2008 06:43:27 -0000
++++ extensions/source/propctrlr/formstrings.hxx 6 Jun 2008 20:18:45 -0000
@@ -50,6 +50,7 @@ namespace pcr
PCR_CONSTASCII_STRING( PROPERTY_TABINDEX, "TabIndex");
PCR_CONSTASCII_STRING( PROPERTY_TAG, "Tag");
@@ -65,7 +65,7 @@
retrieving revision 1.37
diff -u -p -r1.37 formresid.hrc
--- extensions/source/propctrlr/formresid.hrc 11 Apr 2008 11:00:24 -0000 1.37
-+++ extensions/source/propctrlr/formresid.hrc 12 May 2008 06:43:27 -0000
++++ extensions/source/propctrlr/formresid.hrc 6 Jun 2008 20:18:46 -0000
@@ -147,7 +147,7 @@
#define RID_STR_TAG ( RID_FORMBROWSER_START + 116 )
#define RID_STR_HELPTEXT ( RID_FORMBROWSER_START + 117 )
@@ -81,7 +81,7 @@
retrieving revision 1.82
diff -u -p -r1.82 formres.src
--- extensions/source/propctrlr/formres.src 11 Apr 2008 10:59:33 -0000 1.82
-+++ extensions/source/propctrlr/formres.src 12 May 2008 06:43:27 -0000
++++ extensions/source/propctrlr/formres.src 6 Jun 2008 20:18:47 -0000
@@ -230,6 +230,10 @@ String RID_STR_NAME
{
Text [ en-US ] = "Name" ;
@@ -99,7 +99,7 @@
retrieving revision 1.21
diff -u -p -r1.21 hidother.src
--- extensions/util/hidother.src 11 Apr 2008 12:12:27 -0000 1.21
-+++ extensions/util/hidother.src 12 May 2008 06:43:27 -0000
++++ extensions/util/hidother.src 6 Jun 2008 20:18:48 -0000
@@ -306,3 +306,4 @@ hidspecial HID_CHECK_FOR_UPD_STATUS
hidspecial HID_CHECK_FOR_UPD_DESCRIPTION { HelpId = HID_CHECK_FOR_UPD_DESCRIPTION; }
hidspecial HID_CHECK_FOR_UPD_CANCEL { HelpId = HID_CHECK_FOR_UPD_CANCEL; }
@@ -111,7 +111,7 @@
retrieving revision 1.12
diff -u -p -r1.12 GroupManager.hxx
--- forms/source/component/GroupManager.hxx 11 Apr 2008 08:15:27 -0000 1.12
-+++ forms/source/component/GroupManager.hxx 12 May 2008 06:43:27 -0000
++++ forms/source/component/GroupManager.hxx 6 Jun 2008 20:18:49 -0000
@@ -220,6 +220,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);
@@ -127,7 +127,7 @@
retrieving revision 1.18
diff -u -p -r1.18 GroupManager.cxx
--- forms/source/component/GroupManager.cxx 11 Apr 2008 08:15:07 -0000 1.18
-+++ forms/source/component/GroupManager.cxx 12 May 2008 06:43:27 -0000
++++ forms/source/component/GroupManager.cxx 6 Jun 2008 20:18:50 -0000
@@ -127,14 +127,13 @@ OGroupComp::OGroupComp(const Reference<X
,m_xControlModel(rxSet,UNO_QUERY)
,m_nPos( nInsertPos )
@@ -246,13 +246,29 @@
//.........................................................................
} // namespace frm
//.........................................................................
+Index: forms/source/component/RadioButton.hxx
+===================================================================
+RCS file: /cvs/gsl/forms/source/component/RadioButton.hxx,v
+retrieving revision 1.12
+diff -u -p -r1.12 RadioButton.hxx
+--- forms/source/component/RadioButton.hxx 11 Apr 2008 08:19:23 -0000 1.12
++++ forms/source/component/RadioButton.hxx 6 Jun 2008 20:44:00 -0000
+@@ -87,6 +87,8 @@ private:
+ our mutex is aquired exactly once
+ */
+ void setNewAggregateState( const ::com::sun::star::uno::Any& _rValue );
++
++ void setControlSource();
+ };
+
+ //==================================================================
Index: forms/source/component/RadioButton.cxx
===================================================================
RCS file: /cvs/gsl/forms/source/component/RadioButton.cxx,v
retrieving revision 1.22
diff -u -p -r1.22 RadioButton.cxx
--- forms/source/component/RadioButton.cxx 11 Apr 2008 08:19:08 -0000 1.22
-+++ forms/source/component/RadioButton.cxx 12 May 2008 06:43:27 -0000
++++ forms/source/component/RadioButton.cxx 6 Jun 2008 20:18:51 -0000
@@ -31,6 +31,7 @@
// MARKER(update_precomp.py): autogen include statement, do not remove
#include "precompiled_forms.hxx"
@@ -261,7 +277,15 @@
#include "property.hxx"
#ifndef _FRM_PROPERTY_HRC_
#include "property.hrc"
-@@ -169,7 +170,11 @@ StringSequence SAL_CALL ORadioButtonMode
+@@ -122,6 +123,7 @@ ORadioButtonModel::ORadioButtonModel(con
+ m_nClassId = FormComponentType::RADIOBUTTON;
+ m_aLabelServiceName = FRM_SUN_COMPONENT_GROUPBOX;
+ initValueProperty( PROPERTY_STATE, PROPERTY_ID_STATE );
++ startAggregatePropertyListening( PROPERTY_GROUP_NAME );
+ }
+
+ //------------------------------------------------------------------
+@@ -169,7 +171,11 @@ StringSequence SAL_CALL ORadioButtonMode
void ORadioButtonModel::SetSiblingPropsTo(const ::rtl::OUString& rPropName, const Any& rValue)
{
// mein Name
@@ -274,7 +298,7 @@
// meine Siblings durchiterieren
Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
-@@ -177,8 +182,9 @@ void ORadioButtonModel::SetSiblingPropsT
+@@ -177,8 +183,9 @@ void ORadioButtonModel::SetSiblingPropsT
{
Reference<XPropertySet> xMyProps;
query_interface(static_cast<XWeak*>(this), xMyProps);
@@ -286,7 +310,7 @@
{
Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
if (!xSiblingProperties.is())
-@@ -195,8 +201,8 @@ void ORadioButtonModel::SetSiblingPropsT
+@@ -195,8 +202,8 @@ void ORadioButtonModel::SetSiblingPropsT
continue;
// das 'zur selben Gruppe gehoeren' wird am Namen festgemacht
@@ -297,94 +321,122 @@
xSiblingProperties->setPropertyValue(rPropName, rValue);
}
}
-@@ -205,24 +211,23 @@ void ORadioButtonModel::SetSiblingPropsT
- //------------------------------------------------------------------------------
- void ORadioButtonModel::setFastPropertyValue_NoBroadcast(sal_Int32 nHandle, const Any& rValue) throw (Exception)
- {
-- OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
+@@ -223,40 +230,7 @@ void ORadioButtonModel::setFastPropertyV
+ // die andere Richtung : wenn sich mein Name aendert ...
+ if (nHandle == 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())
+- {
+- ::rtl::OUString sName;
+- ::rtl::OUString sControlSource;
-
-- // if the label control changed ...
-- if (nHandle == PROPERTY_ID_CONTROLLABEL)
-- { // ... forward this to our siblings
-+ if (nHandle != PROPERTY_ID_GROUP_NAME)
-+ OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-+ switch (nHandle)
-+ {
-+ case PROPERTY_ID_CONTROLLABEL:
- SetSiblingPropsTo(PROPERTY_CONTROLLABEL, rValue);
-- }
+- Reference<XPropertySet> xMyProps;
+- query_interface(static_cast<XWeak*>(this), xMyProps);
+- for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
+- {
+- Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
+- if (!xSiblingProperties.is())
+- continue;
-
-+ 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);
-- }
+- if (xMyProps == xSiblingProperties)
+- // nur wenn ich nicht mich selber gefunden habe
+- continue;
+-
+- sal_Int16 nType = 0;
+- xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType;
+- if (nType != FormComponentType::RADIOBUTTON)
+- // nur Radio-Buttons
+- continue;
-
-+ break;
- // die andere Richtung : wenn sich mein Name aendert ...
-- if (nHandle == PROPERTY_ID_NAME)
-- {
-+ case PROPERTY_ID_GROUP_NAME:
-+ setPropertyValue( PROPERTY_GROUP_NAME, rValue );
-+ 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())
-@@ -248,7 +253,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)
- {
-@@ -257,10 +262,9 @@ void ORadioButtonModel::setFastPropertyV
- }
- }
- }
-+ break;
+- // Control, das zur gleichen Gruppe gehoert ?
+- if (rValue == sName)
+- {
+- setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE));
+- break;
+- }
+- }
+- }
++ setControlSource();
}
--
-- if (nHandle == PROPERTY_ID_DEFAULTCHECKED)
-- {
-+ case PROPERTY_ID_DEFAULTCHECKED: {
- sal_Int16 nValue;
- rValue >>= nValue;
- if (1 == nValue)
-@@ -271,14 +275,20 @@ void ORadioButtonModel::setFastPropertyV
- aZero <<= nValue;
- SetSiblingPropsTo(PROPERTY_DEFAULTCHECKED, aZero);
- }
-+ break;
-+ }
-+ default:
-+ // OReferenceValueComponent::setFastPropertyValue_NoBroadcast( nHandle, rValue );
-+ break;
+
+ if (nHandle == PROPERTY_ID_DEFAULTCHECKED)
+@@ -274,6 +248,52 @@ void ORadioButtonModel::setFastPropertyV
}
}
++void ORadioButtonModel::setControlSource()
++{
++ Reference<XIndexAccess> xIndexAccess(getParent(), UNO_QUERY);
++ if (xIndexAccess.is())
++ {
++ ::rtl::OUString sName, sGroupName;
++
++ if (hasProperty(PROPERTY_GROUP_NAME, this))
++ this->getPropertyValue(PROPERTY_GROUP_NAME) >>= sGroupName;
++ this->getPropertyValue(PROPERTY_NAME) >>= sName;
++
++ Reference<XPropertySet> xMyProps;
++ query_interface(static_cast<XWeak*>(this), xMyProps);
++ for (sal_Int32 i=0; i<xIndexAccess->getCount(); ++i)
++ {
++ Reference<XPropertySet> xSiblingProperties(*(InterfaceRef*)xIndexAccess->getByIndex(i).getValue(), UNO_QUERY);
++ if (!xSiblingProperties.is())
++ continue;
++
++ if (xMyProps == xSiblingProperties)
++ // nur wenn ich nicht mich selber gefunden habe
++ continue;
++
++ sal_Int16 nType = 0;
++ xSiblingProperties->getPropertyValue(PROPERTY_CLASSID) >>= nType;
++ if (nType != FormComponentType::RADIOBUTTON)
++ // nur Radio-Buttons
++ continue;
++
++ ::rtl::OUString sSiblingName, sSiblingGroupName;
++ if (hasProperty(PROPERTY_GROUP_NAME, xSiblingProperties))
++ xSiblingProperties->getPropertyValue(PROPERTY_GROUP_NAME) >>= sSiblingGroupName;
++ xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sSiblingName;
++
++ if ((sGroupName.getLength() == 0 && sSiblingGroupName.getLength() == 0 && // (no group name
++ sName == sSiblingName) || // names match) or
++ (sGroupName.getLength() != 0 && sSiblingGroupName.getLength() != 0 && // (have group name
++ sGroupName == sSiblingGroupName)) // they match)
++ {
++ setPropertyValue(PROPERTY_CONTROLSOURCE, xSiblingProperties->getPropertyValue(PROPERTY_CONTROLSOURCE));
++ 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();
- }
+@@ -363,6 +383,13 @@ void ORadioButtonModel::_propertyChanged
+ SetSiblingPropsTo( PROPERTY_STATE, aZero );
+ }
+ }
++ else if ( _rEvent.PropertyName.equals( PROPERTY_GROUP_NAME ) )
++ {
++ setControlSource();
++ // Can't call OReferenceValueComponent::_propertyChanged(), as it
++ // doesn't know what to do with the GroupName property.
++ return;
++ }
+ OReferenceValueComponent::_propertyChanged( _rEvent );
+ }
Index: forms/source/inc/frm_strings.hxx
===================================================================
RCS file: /cvs/gsl/forms/source/inc/frm_strings.hxx,v
retrieving revision 1.17
diff -u -p -r1.17 frm_strings.hxx
--- forms/source/inc/frm_strings.hxx 11 Apr 2008 08:34:01 -0000 1.17
-+++ forms/source/inc/frm_strings.hxx 12 May 2008 06:43:28 -0000
++++ forms/source/inc/frm_strings.hxx 6 Jun 2008 20:18:54 -0000
@@ -100,6 +100,7 @@ namespace frm
FORMS_CONSTASCII_STRING( PROPERTY_TABINDEX, "TabIndex" );
FORMS_CONSTASCII_STRING( PROPERTY_TAG, "Tag" );
@@ -399,7 +451,7 @@
retrieving revision 1.21
diff -u -p -r1.21 property.hrc
--- forms/source/inc/property.hrc 11 Apr 2008 08:35:13 -0000 1.21
-+++ forms/source/inc/property.hrc 12 May 2008 06:43:28 -0000
++++ forms/source/inc/property.hrc 6 Jun 2008 20:18:56 -0000
@@ -60,7 +60,7 @@ namespace frm
#define PROPERTY_ID_ALLOWEDITS (PROPERTY_ID_START + 16)
#define PROPERTY_ID_ALLOWDELETIONS (PROPERTY_ID_START + 17)
@@ -415,7 +467,7 @@
retrieving revision 1.14
diff -u -p -r1.14 formattributes.hxx
--- xmloff/source/forms/formattributes.hxx 10 Apr 2008 22:03:59 -0000 1.14
-+++ xmloff/source/forms/formattributes.hxx 12 May 2008 06:43:28 -0000
++++ xmloff/source/forms/formattributes.hxx 6 Jun 2008 20:18:57 -0000
@@ -124,6 +125,7 @@ namespace xmloff
#define SCA_MAX_VALUE 0x00000002
#define SCA_MIN_VALUE 0x00000004
@@ -430,7 +482,7 @@
retrieving revision 1.21
diff -u -p -r1.21 formattributes.cxx
--- xmloff/source/forms/formattributes.cxx 10 Apr 2008 22:03:42 -0000 1.21
-+++ xmloff/source/forms/formattributes.cxx 12 May 2008 06:43:28 -0000
++++ xmloff/source/forms/formattributes.cxx 6 Jun 2008 20:18:58 -0000
@@ -193,6 +194,7 @@ namespace xmloff
case SCA_MAX_VALUE: return "max-value";
case SCA_MIN_VALUE: return "min-value";
@@ -445,7 +497,7 @@
retrieving revision 1.18
diff -u -p -r1.18 strings.hxx
--- xmloff/source/forms/strings.hxx 10 Apr 2008 22:12:05 -0000 1.18
-+++ xmloff/source/forms/strings.hxx 12 May 2008 06:43:28 -0000
++++ xmloff/source/forms/strings.hxx 6 Jun 2008 20:18:59 -0000
@@ -204,6 +205,7 @@ namespace xmloff
XMLFORM_CONSTASCII_STRING( PROPERTY_VISUAL_EFFECT, "VisualEffect");
XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition");
@@ -460,7 +512,7 @@
retrieving revision 1.48
diff -u -p -r1.48 elementexport.cxx
--- xmloff/source/forms/elementexport.cxx 10 Apr 2008 22:00:18 -0000 1.48
-+++ xmloff/source/forms/elementexport.cxx 12 May 2008 06:43:28 -0000
++++ xmloff/source/forms/elementexport.cxx 6 Jun 2008 20:19:00 -0000
@@ -1110,6 +1110,39 @@ namespace xmloff
}
@@ -516,7 +568,7 @@
retrieving revision 1.37
diff -u -p -r1.37 msocximex.cxx
--- svx/source/msfilter/msocximex.cxx 11 Apr 2008 02:06:31 -0000 1.37
-+++ svx/source/msfilter/msocximex.cxx 12 May 2008 06:43:29 -0000
++++ svx/source/msfilter/msocximex.cxx 6 Jun 2008 20:19:02 -0000
@@ -1701,6 +1701,12 @@ sal_Bool OCX_OptionButton::Import(com::s
aTmp <<= ::com::sun::star::style::VerticalAlignment_MIDDLE;
rPropSet->setPropertyValue( WW8_ASCII2STR("VerticalAlign"), aTmp );
@@ -548,7 +600,7 @@
retrieving revision 1.42
diff -u -p -r1.42 property.cxx
--- toolkit/source/helper/property.cxx 11 Apr 2008 09:36:59 -0000 1.42
-+++ toolkit/source/helper/property.cxx 12 May 2008 06:43:29 -0000
++++ toolkit/source/helper/property.cxx 6 Jun 2008 20:19:03 -0000
@@ -179,6 +179,7 @@ ImplPropertyInfo* ImplGetPropertyInfos(
DECL_PROP_3 ( "FormatsSupplier", FORMATSSUPPLIER, Reference< ::com::sun::star::util::XNumberFormatsSupplier >, BOUND, MAYBEVOID, TRANSIENT ),
@@ -563,7 +615,7 @@
retrieving revision 1.68
diff -u -p -r1.68 vclxwindows.cxx
--- toolkit/source/awt/vclxwindows.cxx 11 Apr 2008 09:22:58 -0000 1.68
-+++ toolkit/source/awt/vclxwindows.cxx 12 May 2008 06:43:30 -0000
++++ toolkit/source/awt/vclxwindows.cxx 6 Jun 2008 20:19:05 -0000
@@ -1079,6 +1079,7 @@ void VCLXRadioButton::ImplGetPropertyIds
BASEPROPERTY_BACKGROUNDCOLOR,
BASEPROPERTY_ALIGN,
@@ -578,7 +630,7 @@
retrieving revision 1.9
diff -u -p -r1.9 dialogcontrol.hxx
--- toolkit/inc/toolkit/controls/dialogcontrol.hxx 11 Apr 2008 08:52:41 -0000 1.9
-+++ toolkit/inc/toolkit/controls/dialogcontrol.hxx 20 May 2008 00:39:17 -0000
++++ toolkit/inc/toolkit/controls/dialogcontrol.hxx 6 Jun 2008 20:19:06 -0000
@@ -51,6 +51,7 @@
#include <cppuhelper/propshlp.hxx>
#include <cppuhelper/basemutex.hxx>
@@ -595,10 +647,10 @@
+ void AddRadioButtonToGroup (
+ const ::com::sun::star::uno::Reference< XControlModel >& rControlModel,
+ const ::rtl::OUString& rPropertyName,
-+ ::std::map< ::rtl::OUString, ModelGroup >* pNamedGroups,
-+ ModelGroup** pCurrentGroup );
++ ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups,
++ ModelGroup*& rpCurrentGroup );
+ void AddRadioButtonGroup (
-+ ::std::map< ::rtl::OUString, ModelGroup >* pNamedGroups );
++ ::std::map< ::rtl::OUString, ModelGroup >& pNamedGroups );
};
// ----------------------------------------------------
@@ -608,7 +660,7 @@
retrieving revision 1.27
diff -u -p -r1.27 dialogcontrol.cxx
--- toolkit/source/controls/dialogcontrol.cxx 11 Apr 2008 09:24:40 -0000 1.27
-+++ toolkit/source/controls/dialogcontrol.cxx 20 May 2008 00:39:17 -0000
++++ toolkit/source/controls/dialogcontrol.cxx 6 Jun 2008 20:19:08 -0000
@@ -142,6 +142,18 @@ namespace
return xGraphic;
}
@@ -634,27 +686,27 @@
+// ----------------------------------------------------------------------------
+void UnoControlDialogModel::AddRadioButtonGroup (
-+ ::std::map< ::rtl::OUString, ModelGroup >* pNamedGroups )
++ ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups )
+{
-+ if ( pNamedGroups->size() == 0 )
++ if ( rNamedGroups.size() == 0 )
+ return;
+
+ size_t nGroups = maGroups.size();
-+ maGroups.reserve( nGroups + pNamedGroups->size() );
-+ ::std::map< ::rtl::OUString, ModelGroup >::const_iterator i = pNamedGroups->begin(), e = pNamedGroups->end();
-+ for ( ; i != e; ++i)
++ maGroups.reserve( nGroups + rNamedGroups.size() );
++ ::std::map< ::rtl::OUString, ModelGroup >::const_iterator i = rNamedGroups.begin(), e = rNamedGroups.end();
++ for( ; i != e; ++i)
+ {
-+ maGroups.push_back( i->second );
++ maGroups.push_back( i->second );
+ }
+
-+ pNamedGroups->clear();
++ rNamedGroups.clear();
+}
+
+void UnoControlDialogModel::AddRadioButtonToGroup (
+ const Reference< XControlModel >& rControlModel,
+ const ::rtl::OUString& rPropertyName,
-+ ::std::map< ::rtl::OUString, ModelGroup >* pNamedGroups,
-+ ModelGroup** pCurrentGroup )
++ ::std::map< ::rtl::OUString, ModelGroup >& rNamedGroups,
++ ModelGroup*& rpCurrentGroup )
+{
+ Reference< XPropertySet > xCurProps( rControlModel, UNO_QUERY );
+ ::rtl::OUString sGroup = lcl_GetStringProperty( rPropertyName, xCurProps );
@@ -664,7 +716,7 @@
+ {
+ // Create a new group if:
+ if ( maGroups.size() == 0 || // no groups
-+ *pCurrentGroup == NULL || // previous group was closed
++ rpCurrentGroup == NULL || // previous group was closed
+ (nControlModelStep != 0 && // control step matches current group
+ maGroups.back().size() > 0 && // (group 0 == display everywhere)
+ nControlModelStep != lcl_getDialogStep( maGroups.back().back() ) ) )
@@ -672,22 +724,22 @@
+ size_t nGroups = maGroups.size();
+ maGroups.resize( nGroups + 1 );
+ }
-+ *pCurrentGroup = &maGroups.back();
++ rpCurrentGroup = &maGroups.back();
+ }
+ else
+ {
+ // Different steps get different sets of named groups
-+ if ( pNamedGroups->size() > 0 &&
-+ pNamedGroups->begin()->second.size() > 0 )
++ if ( rNamedGroups.size() > 0 &&
++ rNamedGroups.begin()->second.size() > 0 )
+ {
-+ const sal_Int32 nPrevStep = lcl_getDialogStep( pNamedGroups->begin()->second.front() );
++ const sal_Int32 nPrevStep = lcl_getDialogStep( rNamedGroups.begin()->second.front() );
+ if ( nControlModelStep != nPrevStep )
-+ AddRadioButtonGroup( pNamedGroups );
++ AddRadioButtonGroup( rNamedGroups );
+ }
+
-+ *pCurrentGroup = & (*pNamedGroups)[ sGroup ];
++ rpCurrentGroup = &rNamedGroups[ sGroup ];
+ }
-+ (*pCurrentGroup)->push_back( rControlModel );
++ rpCurrentGroup->push_back( rControlModel );
+}
// ----------------------------------------------------------------------------
@@ -701,7 +753,7 @@
+ ModelGroup* aCurrentGroup = NULL; // the group which we're currently building
sal_Bool bIsRadioButton; // is it a radio button?
-+ const ::rtl::OUString GROUP_NAME (::rtl::OUString::createFromAscii( "GroupName" ) );
++ const ::rtl::OUString GROUP_NAME( RTL_CONSTASCII_USTRINGPARAM( "GroupName" ) );
+
+ ::std::map< ::rtl::OUString, ModelGroup > aNamedGroups;
+
@@ -717,7 +769,7 @@
- aCurrentGroup = maGroups.begin() + nGroups;
- // and add the (only, til now) member
- aCurrentGroup->push_back( *pControlModels );
-+ AddRadioButtonToGroup( *pControlModels, GROUP_NAME, &aNamedGroups, &aCurrentGroup );
++ AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
- // get the step which all controls of this group now have to belong to
- nCurrentGroupStep = lcl_getDialogStep( *pControlModels );
@@ -747,7 +799,7 @@
- aCurrentGroup->push_back( *pControlModels );
- // state still is eExpandingGroup - we're looking for further elements
- eState = eExpandingGroup;
-+ AddRadioButtonToGroup( *pControlModels, GROUP_NAME, &aNamedGroups, &aCurrentGroup );
++ AddRadioButtonToGroup( *pControlModels, GROUP_NAME, aNamedGroups, aCurrentGroup );
#if OSL_DEBUG_LEVEL > 1
- Reference< XPropertySet > xModelProps( *pControlModels, UNO_QUERY );
@@ -787,7 +839,7 @@
}
}
-+ AddRadioButtonGroup( &aNamedGroups );
++ AddRadioButtonGroup( aNamedGroups );
mbGroupsUpToDate = sal_True;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]