diff options
author | Rüdiger Timm <rt@openoffice.org> | 2007-01-29 15:25:48 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2007-01-29 15:25:48 +0000 |
commit | 13dae42a4ad711e34e0c702bcfe37bceaf2cfe0a (patch) | |
tree | dadd05ad44f764a9014e293c8a4231f3d48fa2aa /toolkit/source/controls | |
parent | 49d4e4a0f7c2f698945983b564da77322175fa34 (diff) |
INTEGRATION: CWS ab32 (1.15.4); FILE MERGED
2007/01/10 10:31:20 cd 1.15.4.1: #i73067# Language dependent dialog properties explictly be notified
Diffstat (limited to 'toolkit/source/controls')
-rw-r--r-- | toolkit/source/controls/dialogcontrol.cxx | 47 |
1 files changed, 45 insertions, 2 deletions
diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index fa34f7e7b24e..7dd4119cac2a 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -4,9 +4,9 @@ * * $RCSfile: dialogcontrol.cxx,v $ * - * $Revision: 1.15 $ + * $Revision: 1.16 $ * - * last change: $Author: hr $ $Date: 2007-01-02 15:34:44 $ + * last change: $Author: rt $ $Date: 2007-01-29 16:25:48 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -106,6 +106,21 @@ using namespace toolkit; #define PROPERTY_RESOURCERESOLVER rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "ResourceResolver" )) +struct LanguageDependentProp +{ + const char* pPropName; + sal_Int32 nPropNameLength; +}; + +// Attention: Please update both statics (count/array)! +static const sal_uInt32 nLanguageDependentDialogPropCount = 2; +static LanguageDependentProp aLanguageDependentDialogProp[] = +{ + { "Title", 5 }, + { "HelpText", 8 }, + { 0, 0 } +}; + // ---------------------------------------------------------------------------- // functor for disposing a control model struct DisposeControlModel : public ::std::unary_function< Reference< XControlModel >, void > @@ -1693,6 +1708,34 @@ void UnoDialogControl::ImplUpdateResourceResolver() } } } + + // propagate resource resolver changes to language dependent props of the dialog + Reference< XPropertySet > xPropertySet( getModel(), UNO_QUERY ); + if ( xPropertySet.is() ) + { + Reference< XMultiPropertySet > xMultiPropSet( xPropertySet, UNO_QUERY ); + Reference< XPropertiesChangeListener > xListener( xPropertySet, UNO_QUERY ); + + aPropNames.realloc( nLanguageDependentDialogPropCount ); + + sal_Int32 i = 0; + const LanguageDependentProp* pLangProps = aLanguageDependentDialogProp; + while ( pLangProps->pPropName != 0 ) + { + if ( aPropNames.getLength() == i ) + aPropNames.realloc(i+1); + aPropNames[i++] = rtl::OUString::createFromAscii( pLangProps->pPropName ); + ++pLangProps; + } + + try + { + xMultiPropSet->firePropertiesChangeEvent( aPropNames, xListener ); + } + catch ( NoSuchElementException& ) + { + } + } } } |