diff options
author | Rüdiger Timm <rt@openoffice.org> | 2004-09-20 09:17:34 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2004-09-20 09:17:34 +0000 |
commit | 3716d2cb9f9c3b5e6475a916c6da28d66896f4e7 (patch) | |
tree | a2c61bf857ef73c840bf07d75102262080c79577 /comphelper | |
parent | 15558a21dad48f196adc3e59f1d96b7913d75bd3 (diff) |
INTEGRATION: CWS keyconfig01 (1.2.62); FILE MERGED
2004/07/14 06:53:08 as 1.2.62.1: #i29863# support seq<any>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/misc/sequenceashashmap.cxx | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/comphelper/source/misc/sequenceashashmap.cxx b/comphelper/source/misc/sequenceashashmap.cxx index ff42e0efb746..31c2885b93cb 100644 --- a/comphelper/source/misc/sequenceashashmap.cxx +++ b/comphelper/source/misc/sequenceashashmap.cxx @@ -2,9 +2,9 @@ * * $RCSfile: sequenceashashmap.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: kz $ $Date: 2004-01-28 12:47:53 $ + * last change: $Author: rt $ $Date: 2004-09-20 10:17:34 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -92,6 +92,12 @@ SequenceAsHashMap::SequenceAsHashMap(const css::uno::Any& aSource) (*this) << aSource; } +//----------------------------------------------- +SequenceAsHashMap::SequenceAsHashMap(const css::uno::Sequence< css::uno::Any >& lSource) +{ + (*this) << lSource; +} + /*----------------------------------------------- 04.11.2003 08:30 -----------------------------------------------*/ @@ -146,6 +152,50 @@ void SequenceAsHashMap::operator<<(const css::uno::Any& aSource) css::uno::Reference< css::uno::XInterface >()); } +//----------------------------------------------- +void SequenceAsHashMap::operator<<(const css::uno::Sequence< css::uno::Any >& lSource) +{ + sal_Int32 c = lSource.getLength(); + sal_Int32 i = 0; + + for (i=0; i<c; ++i) + { + css::beans::PropertyValue lP; + if (lSource[i] >>= lP) + { + if ( + (!lP.Name.getLength()) || + (!lP.Value.hasValue()) + ) + throw css::beans::IllegalTypeException( + ::rtl::OUString::createFromAscii("PropertyValue struct contains no usefull informations."), + css::uno::Reference< css::uno::XInterface >()); + (*this)[lP.Name] = lP.Value; + continue; + } + + css::beans::NamedValue lN; + if (lSource[i] >>= lN) + { + if ( + (!lN.Name.getLength()) || + (!lN.Value.hasValue()) + ) + throw css::beans::IllegalTypeException( + ::rtl::OUString::createFromAscii("NamedValue struct contains no usefull informations."), + css::uno::Reference< css::uno::XInterface >()); + (*this)[lN.Name] = lN.Value; + continue; + } + + // ignore VOID Any ... but reject wrong filled ones! + if (lSource[i].hasValue()) + throw css::beans::IllegalTypeException( + ::rtl::OUString::createFromAscii("Any contains wrong type."), + css::uno::Reference< css::uno::XInterface >()); + } +} + /*----------------------------------------------- 04.11.2003 08:30 -----------------------------------------------*/ |