New patch attached.
Major changes include the addition of "native" ODF support (i.e.
a //form:radio/@form:group-name attribute to store the group name), and
the GroupName property is imported from OLE controls (the
svx/source/msfilter/msocximex.cxx change).
On Wed, 2008-04-02 at 13:44 +0200, Frank Schönheit - Sun Microsystems
Germany wrote:
> - The DIALOG_VISIBLE flag in formmetadata.cxx suggests this property
> should also be visible also in the Dialog Editor - which isn't
> necessary since the "normal" controls as used in the Basic/UNO dialogs
> do not support this new property
Where is this visible in the dialog editor? For that matter, is the
dialog editor what appears when you click (in Calc) Tools -> Macros ->
Organize Dialogs -> [ select dialog ] -> Edit?
If so, where would I find GroupName, as I couldn't find it when
DIALOG_VISIBLE was set.
Regardless, I've removed this flag.
> - looking at the spelling of the other properties in the UI, "Group
> name" is probably better / more consistent than "Group Name"
Done.
> - please adhere to the style used in the files you modify. In
> particular, please do
> if ( foo )
> {
> ...
> instead of
> if ( foo ) {
> ...
> This helps ensuring a consistent look of the file, and thus better
> readability
I didn't see any occurrences with `if', though I did see a `switch' that
wasn't formatted properly.
> - nNumSiblings in ORadioButtonModel::SetSiblingPropsTo should be a
> sal_Int32 instead of "int". While int probably has at least 32 bits on
> all supported platforms, it's a general rule to not use those types
> whose concrete size depends on the platform, as this potentially
> causes hassle when doing ports to new platforms.
Done.
> - Any reason why GetGroupName doesn't return the string, but takes it as
> out-parameter?
A mis-begotten sense of efficiency to avoid extra OUString constructor
and destructor calls. It returns the string now.
> - you need to add HID_PROP_GROUP_NAME to extensions/util/hidother.src,
> else our automation QA will complain later
Done, though after making this change nothing was rebuilt. Odd.
> - please try avoiding TABs, the guidelines for OOo code say TABs are to
> be expanded to 4 spaces
This is...more problematic. :-)
In accordance with your 3rd bullet (use consistent style), I tried to
use the same indentation as the surrounding function used (as this
usually makes the diff easier to read). Unfortunately many of these
files don't use a consistent indent character within the same
*function*, never mind the same file, and I find it rather annoying
having spaces and tabs mixed in the same function (makes it murder to
read if you don't have 4-space tabs, and 8 space tabs are the default
when `cat'ing to the shell, reading email attachments, etc.).
So which is better: dogmatic consistency with the "spaces not tabs"
guideline, or being consistent with the surrounding code? I opted for
the latter; should I go for the former?
Thanks,
- Jon
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 5 Apr 2008 11:15:13 -0000
@@ -157,6 +157,7 @@ namespace pcr
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 ),
+ DEF_INFO_2( GROUP_NAME, GROUP_NAME, GROUP_NAME, FORM_VISIBLE, COMPOSEABLE ),
DEF_INFO_2( TEXT, TEXT, TEXT, DIALOG_VISIBLE, COMPOSEABLE ),
DEF_INFO_3( MAXTEXTLEN, MAXTEXTLEN, MAXTEXTLEN, FORM_VISIBLE, DIALOG_VISIBLE, COMPOSEABLE ),
DEF_INFO_3( EDITMASK, EDITMASK, EDITMASK, FORM_VISIBLE, DIALOG_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: extensions/util/hidother.src
===================================================================
RCS file: /cvs/util/extensions/util/hidother.src,v
retrieving revision 1.20
diff -u -p -r1.20 hidother.src
--- extensions/util/hidother.src 27 Nov 2007 11:53:36 -0000 1.20
+++ extensions/util/hidother.src 5 Apr 2008 11:15:14 -0000
@@ -311,3 +311,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; }
hidspecial HID_PROP_NOLABEL { HelpId = HID_PROP_NOLABEL; }
+hidspecial HID_PROP_GROUP_NAME { HelpId = HID_PROP_GROUP_NAME; }
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 5 Apr 2008 11:21:51 -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 ::rtl::OUString GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent );
};
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 5 Apr 2008 11:27:06 -0000
@@ -148,14 +148,13 @@ OGroupComp::OGroupComp(const Reference<X
,m_xControlModel(rxSet,UNO_QUERY)
,m_nPos( nInsertPos )
,m_nTabIndex(0)
+ ,m_aName( OGroupManager::GetGroupName( rxSet ) )
{
if (m_xComponent.is())
{
if (hasProperty( PROPERTY_TABINDEX, m_xComponent ) )
// 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;
}
}
@@ -342,7 +341,8 @@ void OGroupManager::removeFromGroupMap(c
aFind->second.RemoveComponent( _xSet );
// Wenn Anzahl der Gruppenelemente == 1 ist, Gruppe deaktivieren
- if ( aFind->second.Count() == 1 )
+ sal_Int32 nCount = aFind->second.Count();
+ if ( nCount == 1 || nCount == 0 )
{
OActiveGroups::iterator aActiveFind = ::std::find(
m_aActiveGroupMap.begin(),
@@ -353,7 +353,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 +362,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 );
}
@@ -372,10 +374,23 @@ void SAL_CALL OGroupManager::propertyCha
// 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;
+ sGroupName = GetGroupName( xSet );
removeFromGroupMap(sGroupName,xSet);
@@ -458,8 +473,7 @@ void OGroupManager::InsertElement( const
m_pCompGroup->InsertComponent( xSet );
// Component in Gruppe aufnehmen
- ::rtl::OUString sGroupName;
- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
+ ::rtl::OUString sGroupName( GetGroupName( xSet ) );
OGroupArr::iterator aFind = m_aGroupArr.find(sGroupName);
@@ -497,6 +511,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))
@@ -513,12 +529,26 @@ void OGroupManager::RemoveElement( const
return;
// Component aus Gruppe entfernen
- ::rtl::OUString sGroupName;
- xSet->getPropertyValue( PROPERTY_NAME ) >>= sGroupName;
+ ::rtl::OUString sGroupName( GetGroupName( xSet ) );
removeFromGroupMap(sGroupName,xSet);
}
+::rtl::OUString OGroupManager::GetGroupName( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet> xComponent )
+{
+ if (!xComponent.is())
+ return ::rtl::OUString();
+ ::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;
+ return 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 5 Apr 2008 11:27:06 -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;
+ sal_Int32 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,65 @@ void ORadioButtonModel::SetSiblingPropsT
continue;
// das 'zur selben Gruppe gehoeren' wird am Namen festgemacht
- xSiblingProperties->getPropertyValue(PROPERTY_NAME) >>= sCurrentName;
- if (sCurrentName == sMyName)
+ sCurrentGroup = OGroupManager::GetGroupName( xSiblingProperties );
+ 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 );
-
- // if the label control changed ...
- if (nHandle == PROPERTY_ID_CONTROLLABEL)
- { // ... forward this to our siblings
- SetSiblingPropsTo(PROPERTY_CONTROLLABEL, rValue);
+ switch (nHandle)
+ {
+ case PROPERTY_ID_GROUP_NAME:
+ rValue <<= m_sGroupName;
+ break;
+ default:
+ OReferenceValueComponent::getFastPropertyValue(rValue, nHandle);
+ break;
}
+}
+
+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 +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();
}
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
Index: xmloff/source/forms/formattributes.hxx
===================================================================
RCS file: /cvs/xml/xmloff/source/forms/formattributes.hxx,v
retrieving revision 1.13
diff -u -p -r1.13 formattributes.hxx
--- xmloff/source/forms/formattributes.hxx 9 Sep 2005 14:08:11 -0000 1.13
+++ xmloff/source/forms/formattributes.hxx 5 Apr 2008 11:32:23 -0000
@@ -137,6 +137,7 @@ namespace xmloff
#define SCA_MAX_VALUE 0x00000002
#define SCA_MIN_VALUE 0x00000004
#define SCA_VALIDATION 0x00000008
+ #define SCA_GROUP_NAME 0x00000010
#define SCA_MULTI_LINE 0x00000020
#define SCA_AUTOMATIC_COMPLETION 0x00000080
#define SCA_MULTIPLE 0x00000100
Index: xmloff/source/forms/formattributes.cxx
===================================================================
RCS file: /cvs/xml/xmloff/source/forms/formattributes.cxx,v
retrieving revision 1.20
diff -u -p -r1.20 formattributes.cxx
--- xmloff/source/forms/formattributes.cxx 27 Jun 2007 15:14:38 -0000 1.20
+++ xmloff/source/forms/formattributes.cxx 5 Apr 2008 11:32:23 -0000
@@ -207,6 +207,7 @@ namespace xmloff
case SCA_MAX_VALUE: return "max-value";
case SCA_MIN_VALUE: return "min-value";
case SCA_VALIDATION: return "validation";
+ case SCA_GROUP_NAME: return "group-name";
case SCA_MULTI_LINE: return "multi-line";
case SCA_AUTOMATIC_COMPLETION: return "auto-complete";
case SCA_MULTIPLE: return "multiple";
Index: xmloff/source/forms/strings.hxx
===================================================================
RCS file: /cvs/xml/xmloff/source/forms/strings.hxx,v
retrieving revision 1.17
diff -u -p -r1.17 strings.hxx
--- xmloff/source/forms/strings.hxx 9 Sep 2005 14:16:39 -0000 1.17
+++ xmloff/source/forms/strings.hxx 5 Apr 2008 11:32:23 -0000
@@ -213,6 +213,7 @@ namespace xmloff
XMLFORM_CONSTASCII_STRING( PROPERTY_VISUAL_EFFECT, "VisualEffect");
XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_POSITION, "ImagePosition");
XMLFORM_CONSTASCII_STRING( PROPERTY_IMAGE_ALIGN, "ImageAlign");
+ XMLFORM_CONSTASCII_STRING( PROPERTY_GROUP_NAME, "GroupName");
XMLFORM_CONSTASCII_STRING( PROPERTY_BOUND_CELL, "BoundCell");
XMLFORM_CONSTASCII_STRING( PROPERTY_LIST_CELL_RANGE, "CellRange");
Index: xmloff/source/forms/elementexport.cxx
===================================================================
RCS file: /cvs/xml/xmloff/source/forms/elementexport.cxx,v
retrieving revision 1.46.108.1
diff -u -p -r1.46.108.1 elementexport.cxx
--- xmloff/source/forms/elementexport.cxx 18 Jan 2008 15:10:42 -0000 1.46.108.1
+++ xmloff/source/forms/elementexport.cxx 5 Apr 2008 11:32:23 -0000
@@ -1194,6 +1194,39 @@ namespace xmloff
}
// ----------------------------------
+ // the string properties
+ {
+ static sal_Int32 nStringPropertyAttributeIds[] =
+ { // attribute flags
+ SCA_GROUP_NAME
+ };
+ static const ::rtl::OUString* pStringPropertyNames[] =
+ { // property names
+ &PROPERTY_GROUP_NAME
+ };
+
+ sal_Int32 nIdCount = sizeof( nStringPropertyAttributeIds ) / sizeof( nStringPropertyAttributeIds[0] );
+ #if OSL_DEBUG_LEVEL > 0
+ sal_Int32 nNameCount = sizeof( pStringPropertyNames ) / sizeof( pStringPropertyNames[0] );
+ OSL_ENSURE( ( nIdCount == nNameCount ),
+ "OControlExport::exportSpecialAttributes: somebody tampered with the maps (2)!" );
+ #endif
+ for ( i = 0; i < nIdCount; ++i )
+ if ( nStringPropertyAttributeIds[i] & m_nIncludeSpecial )
+ {
+ exportStringPropertyAttribute(
+ OAttributeMetaData::getSpecialAttributeNamespace( nStringPropertyAttributeIds[i] ),
+ OAttributeMetaData::getSpecialAttributeName( nStringPropertyAttributeIds[i] ),
+ *( pStringPropertyNames[i] )
+ );
+ #if OSL_DEBUG_LEVEL > 0
+ // reset the bit for later checking
+ m_nIncludeSpecial = m_nIncludeSpecial & ~nStringPropertyAttributeIds[i];
+ #endif
+ }
+ }
+
+ // ----------------------------------
if ((SCA_MIN_VALUE | SCA_MAX_VALUE) & m_nIncludeSpecial)
{
// need to export the min value and the max value as attributes
@@ -1653,6 +1686,8 @@ namespace xmloff
}
if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_IMAGE_POSITION ) )
m_nIncludeSpecial |= SCA_IMAGE_POSITION;
+ if ( m_xPropertyInfo->hasPropertyByName( PROPERTY_GROUP_NAME ) )
+ m_nIncludeSpecial |= SCA_GROUP_NAME;
m_nIncludeDatabase = DA_DATA_FIELD;
m_nIncludeEvents = EA_CONTROL_EVENTS | EA_ON_CHANGE;
break;
Index: svx/source/msfilter/msocximex.cxx
===================================================================
RCS file: /cvs/graphics/svx/source/msfilter/msocximex.cxx,v
retrieving revision 1.35
diff -u -p -r1.35 msocximex.cxx
--- svx/source/msfilter/msocximex.cxx 27 Sep 2007 13:02:19 -0000 1.35
+++ svx/source/msfilter/msocximex.cxx 1 Apr 2008 12:53:10 -0000
@@ -1763,6 +1763,12 @@ sal_Bool OCX_OptionButton::Import(com::s
aTmp <<= ::com::sun::star::style::VerticalAlignment_MIDDLE;
rPropSet->setPropertyValue( WW8_ASCII2STR("VerticalAlign"), aTmp );
+ if ( pGroupName )
+ {
+ aTmp <<= lclCreateOUString( pGroupName, nGroupNameLen );
+ rPropSet->setPropertyValue( WW8_ASCII2STR("GroupName"), aTmp);
+ }
+
aFontData.Import(rPropSet);
return sal_True;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]