summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorRelease Engineers <releng@openoffice.org>2008-12-01 15:44:36 +0000
committerRelease Engineers <releng@openoffice.org>2008-12-01 15:44:36 +0000
commitbbbbee3b5ebca6344d91d1a2b45332fc72893327 (patch)
treeead003509fba63251e06f76729955d4c88e4db78 /sfx2
parent9e41c41d89954d55f3b741e6c921d4b685e478be (diff)
CWS-TOOLING: integrate CWS sw301bf03_DEV300
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/qa/complex/DocumentMetaData.java6
-rw-r--r--sfx2/source/doc/SfxDocumentMetaData.cxx12
2 files changed, 10 insertions, 8 deletions
diff --git a/sfx2/qa/complex/DocumentMetaData.java b/sfx2/qa/complex/DocumentMetaData.java
index 5e99a4d17d..8a4c1a91bd 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 98dd3cd31e..d1d0b45d16 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);
}
}