diff options
author | Mathias Bauer <mba@openoffice.org> | 2009-12-02 13:40:39 +0100 |
---|---|---|
committer | Mathias Bauer <mba@openoffice.org> | 2009-12-02 13:40:39 +0100 |
commit | b09ad35b40b9de8f3e9f1d57abb6533a209c3ebd (patch) | |
tree | 6893176bab1d99dac3a4f6b16c27930deccfc093 /xmloff | |
parent | 726f87d603a38c988a8425d42f023b03bda725b1 (diff) | |
parent | 041210d90f162084e98b1fc0acbe744926ac8f60 (diff) |
merge with db33a
Diffstat (limited to 'xmloff')
-rw-r--r-- | xmloff/source/forms/gridcolumnproptranslator.cxx | 10 | ||||
-rw-r--r-- | xmloff/source/text/txtstyli.cxx | 60 |
2 files changed, 35 insertions, 35 deletions
diff --git a/xmloff/source/forms/gridcolumnproptranslator.cxx b/xmloff/source/forms/gridcolumnproptranslator.cxx index 766c2dd2483f..7e2476e6f054 100644 --- a/xmloff/source/forms/gridcolumnproptranslator.cxx +++ b/xmloff/source/forms/gridcolumnproptranslator.cxx @@ -235,9 +235,15 @@ namespace xmloff } //-------------------------------------------------------------------- - void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& aPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) + void SAL_CALL OGridColumnPropertyTranslator::setPropertyValue( const ::rtl::OUString& _rPropertyName, const Any& aValue ) throw (UnknownPropertyException, PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException) { - Sequence< ::rtl::OUString > aNames( &aPropertyName, 1 ); + // we implement this by delegating it to setPropertyValues, which is to ignore unknown properties. On the other hand, our + // contract requires us to throw a UnknownPropertyException for unknown properties, so check this first. + + if ( !getPropertySetInfo()->hasPropertyByName( _rPropertyName ) ) + throw UnknownPropertyException( _rPropertyName, *this ); + + Sequence< ::rtl::OUString > aNames( &_rPropertyName, 1 ); Sequence< Any > aValues( &aValue, 1 ); setPropertyValues( aNames, aValues ); } diff --git a/xmloff/source/text/txtstyli.cxx b/xmloff/source/text/txtstyli.cxx index c41d54bb00ed..2d3d1620afe1 100644 --- a/xmloff/source/text/txtstyli.cxx +++ b/xmloff/source/text/txtstyli.cxx @@ -30,34 +30,29 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_xmloff.hxx" -#include <com/sun/star/frame/XModel.hpp> -#include <com/sun/star/style/XStyle.hpp> + +#include "XMLTextPropertySetContext.hxx" +#include "xmlnmspe.hxx" +#include "xmloff/XMLEventsImportContext.hxx" +#include "xmloff/attrlist.hxx" +#include "xmloff/families.hxx" +#include "xmloff/txtprmap.hxx" +#include "xmloff/txtstyli.hxx" +#include "xmloff/xmlimp.hxx" +#include "xmloff/xmltkmap.hxx" +#include "xmloff/xmltoken.hxx" +#include "xmloff/xmluconv.hxx" + +#include <com/sun/star/beans/XMultiPropertySet.hpp> #include <com/sun/star/container/XNameContainer.hpp> +#include <com/sun/star/document/XEventsSupplier.hpp> +#include <com/sun/star/frame/XModel.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/style/ParagraphStyleCategory.hpp> -#ifndef _COM_SUN_STAR_DOCUMENT_XEVENTSSUPPLIER_HPP -#include <com/sun/star/document/XEventsSupplier.hpp> -#endif -#include <com/sun/star/beans/XMultiPropertySet.hpp> -#include "xmlnmspe.hxx" -#include <xmloff/xmltoken.hxx> -#ifndef _XMLOFF_FAMILIES_HXX -#include <xmloff/families.hxx> -#endif -#include "XMLTextPropertySetContext.hxx" -#include <xmloff/xmltkmap.hxx> -#include <xmloff/xmlimp.hxx> -#include <xmloff/xmluconv.hxx> - -#ifndef _XMLOFF_TXTPRMAP_HXX -#include <xmloff/txtprmap.hxx> -#endif -#ifndef _XMLOFF_TXTSTYLI_HXX -#include <xmloff/txtstyli.hxx> -#endif -#include <xmloff/attrlist.hxx> -#include <xmloff/XMLEventsImportContext.hxx> +#include <com/sun/star/style/XStyle.hpp> + #include <tools/debug.hxx> +#include <tools/diagnose_ex.h> // STL includes #include <algorithm> @@ -464,6 +459,9 @@ void XMLTextStyleContext::FillPropertySet( { -1, -1 } }; + // get property set info + Reference< XPropertySetInfo > xInfo( rPropSet->getPropertySetInfo(), UNO_SET_THROW ); + bool bAutomatic = false; if( ((SvXMLStylesContext *)GetStyles())->IsAutomaticStyle() && ( GetFamily() == XML_STYLE_FAMILY_TEXT_TEXT || GetFamily() == XML_STYLE_FAMILY_TEXT_PARAGRAPH ) ) @@ -476,11 +474,15 @@ void XMLTextStyleContext::FillPropertySet( OUString( RTL_CONSTASCII_USTRINGPARAM("ParaAutoStyleName") ); try { - rPropSet->setPropertyValue( sAutoProp, makeAny(GetAutoName()) ); + if ( xInfo->hasPropertyByName( sAutoProp ) ) + rPropSet->setPropertyValue( sAutoProp, makeAny(GetAutoName()) ); + else + bAutomatic = false; } catch( const RuntimeException& ) { throw; } catch( const Exception& ) { + DBG_UNHANDLED_EXCEPTION(); bAutomatic = false; } } @@ -499,9 +501,6 @@ void XMLTextStyleContext::FillPropertySet( bHasCombinedCharactersLetter = bVal; } - // get property set info - Reference< XPropertySetInfo > xInfo; - // keep-together: the application default is different from // the file format default. Hence, if we always set this // value; if we didn't find one, we'll set to false, the file @@ -534,9 +533,6 @@ void XMLTextStyleContext::FillPropertySet( // check for StarBats and StarMath fonts - if (!xInfo.is()) - xInfo.set(rPropSet->getPropertySetInfo()); - // iterate over aContextIDs entries 3..6 for ( sal_Int32 i = 3; i < 7; i++ ) { @@ -572,8 +568,6 @@ void XMLTextStyleContext::FillPropertySet( // set property OUString rPropertyName( rPropMapper->GetEntryAPIName(nMapperIndex) ); - if( !xInfo.is() ) - xInfo = rPropSet->getPropertySetInfo(); if ( xInfo->hasPropertyByName( rPropertyName ) ) { rPropSet->setPropertyValue( rPropertyName, aAny ); |