diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-03-31 11:19:30 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-03-31 11:19:30 +0000 |
commit | c955d8fc73d655a464f2ed906642378cefb5b909 (patch) | |
tree | d9af1c66748723a93fe047b672b4f332b94633ae /extensions/source/propctrlr/formcomponenthandler.cxx | |
parent | f67e7666acfdd6a65288f8fe2a543f1281d26fc3 (diff) |
INTEGRATION: CWS dba203b (1.2.6); FILE MERGED
2006/03/22 15:54:52 fs 1.2.6.1: #i63283# properly handle the Font property, so it is really composeable
Diffstat (limited to 'extensions/source/propctrlr/formcomponenthandler.cxx')
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index d08f9f44bddd..48dc65cea734 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -4,9 +4,9 @@ * * $RCSfile: formcomponenthandler.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: vg $ $Date: 2006-03-14 11:23:06 $ + * last change: $Author: vg $ $Date: 2006-03-31 12:19:30 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -329,7 +329,18 @@ namespace pcr ::osl::MutexGuard aGuard( m_aMutex ); PropertyId nPropId( impl_getPropertyId_throw( _rPropertyName ) ); - m_xComponent->setPropertyValue( _rPropertyName, _rValue ); + if ( PROPERTY_ID_FONT_NAME == nPropId ) + { + // special handling, the value is a faked value we generated ourself in impl_executeFontDialog_nothrow + Sequence< NamedValue > aFontPropertyValues; + OSL_VERIFY( _rValue >>= aFontPropertyValues ); + const NamedValue* fontPropertyValue = aFontPropertyValues.getConstArray(); + const NamedValue* fontPropertyValueEnd = fontPropertyValue + aFontPropertyValues.getLength(); + for ( ; fontPropertyValue != fontPropertyValueEnd; ++fontPropertyValue ) + m_xComponent->setPropertyValue( fontPropertyValue->Name, fontPropertyValue->Value ); + } + else + m_xComponent->setPropertyValue( _rPropertyName, _rValue ); } //-------------------------------------------------------------------- @@ -1209,8 +1220,8 @@ namespace pcr break; case PROPERTY_ID_FONT_NAME: - if ( impl_changeFont_nothrow( aGuard ) ) - eResult = InteractiveSelectionResult_Success; + if ( impl_executeFontDialog_nothrow( _rData, aGuard ) ) + eResult = InteractiveSelectionResult_ObtainedValue; break; case PROPERTY_ID_DATASOURCE: @@ -2530,7 +2541,7 @@ namespace pcr } //------------------------------------------------------------------------ - bool FormComponentPropertyHandler::impl_changeFont_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const + bool FormComponentPropertyHandler::impl_executeFontDialog_nothrow( Any& _out_rNewValue, ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { bool bSuccess = false; @@ -2548,8 +2559,13 @@ namespace pcr if ( RET_OK == aDlg.Execute() ) { const SfxItemSet* pOut = aDlg.GetOutputItemSet(); - ControlCharacterDialog::translatePropertiesToItems(pOut, m_xComponent); - bSuccess = true; + if ( pOut ) + { + Sequence< NamedValue > aFontPropertyValues; + ControlCharacterDialog::translateItemsToProperties( *pOut, aFontPropertyValues ); + _out_rNewValue <<= aFontPropertyValues; + bSuccess = true; + } } } |