diff options
author | Release Engineers <releng@openoffice.org> | 2008-12-01 15:44:36 +0000 |
---|---|---|
committer | Release Engineers <releng@openoffice.org> | 2008-12-01 15:44:36 +0000 |
commit | 66faa30852ccf28403868557db1f8a4cc415b9cc (patch) | |
tree | c9ff148f4ac1c84c3ddab9166f6a95461a1d7f42 /sfx2 | |
parent | d56fd158a237b1707cba80bf5025db6c6eeb8223 (diff) |
CWS-TOOLING: integrate CWS sw301bf03_DEV300
Diffstat (limited to 'sfx2')
-rw-r--r-- | sfx2/qa/complex/DocumentMetaData.java | 6 | ||||
-rw-r--r-- | sfx2/source/doc/SfxDocumentMetaData.cxx | 12 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sfx2/qa/complex/DocumentMetaData.java b/sfx2/qa/complex/DocumentMetaData.java index 63f3c883bff2..8ecf28f37a5f 100644 --- a/sfx2/qa/complex/DocumentMetaData.java +++ b/sfx2/qa/complex/DocumentMetaData.java @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: DocumentMetaData.java,v $ - * $Revision: 1.3 $ + * $Revision: 1.3.170.1 $ * * This file is part of OpenOffice.org. * @@ -363,6 +363,8 @@ public class DocumentMetaData extends ComplexTestCase udpc.addProperty("Pi", PropertyAttribute.REMOVEABLE, new Double(d)); udpc.addProperty("Foo", PropertyAttribute.REMOVEABLE, "bar"); udpc.addProperty("Removed", PropertyAttribute.REMOVEABLE, "bar"); + // #i94175#: empty property name is valid ODF 1.1 + udpc.addProperty("", PropertyAttribute.REMOVEABLE, "eeeeek"); try { udpc.removeProperty("Info 1"); udpc.removeProperty("Removed"); @@ -389,6 +391,8 @@ public class DocumentMetaData extends ComplexTestCase udps.getPropertyValue("Pi"))); assure ("UserDefined string", "bar".equals( udps.getPropertyValue("Foo"))); + assure ("UserDefined empty name", "eeeeek".equals( + udps.getPropertyValue(""))); try { udps.getPropertyValue("Removed"); diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 51f0d51c41ff..03dcbc2c09bb 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -1229,10 +1229,14 @@ void SAL_CALL SfxDocumentMetaData::init( types[7] = ::cppu::UnoType<sal_Int16>::get(); types[8] = ::cppu::UnoType<sal_Int32>::get(); types[9] = ::cppu::UnoType<sal_Int64>::get(); - css::uno::Sequence<css::uno::Any> args(1); + css::uno::Sequence<css::uno::Any> args(2); args[0] <<= css::beans::NamedValue( ::rtl::OUString::createFromAscii("AllowedTypes"), css::uno::makeAny(types)); + // #i94175#: ODF 1.1 allows empty user-defined property names! + args[1] <<= css::beans::NamedValue( + ::rtl::OUString::createFromAscii("AllowEmptyPropertyName"), + css::uno::makeAny(sal_True)); m_xUserDefined.set( xMsf->createInstanceWithContext(::rtl::OUString::createFromAscii( "com.sun.star.beans.PropertyBag"), m_xContext), @@ -1307,15 +1311,9 @@ void SAL_CALL SfxDocumentMetaData::init( } catch (css::beans::IllegalTypeException &) { DBG_ERROR1("SfxDocumentMetaData: illegal type: %s", OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr()); - throw css::uno::RuntimeException(::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::init: cannot add property"), - *this); } catch (css::lang::IllegalArgumentException &) { DBG_ERROR1("SfxDocumentMetaData: illegal arg: %s", OUStringToOString(name, RTL_TEXTENCODING_UTF8).getStr()); - throw css::uno::RuntimeException(::rtl::OUString::createFromAscii( - "SfxDocumentMetaData::init: cannot add property"), - *this); } } |