diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-04-04 15:03:02 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2003-04-04 15:03:02 +0000 |
commit | 584af2fb172a182fa733da034fdbbb437f139433 (patch) | |
tree | 2993275731a27f911ca43e20a6e2a9ccd8939a09 /framework | |
parent | fa784add83dcbd2f9c48e347585dfd2a12258b97 (diff) |
INTEGRATION: CWS xmlfilter01 (1.4.2.1.34); FILE MERGED
2003/03/06 13:57:17 as 1.4.2.1.34.1: #107711# full read/write access for types, filters, detect service
Diffstat (limited to 'framework')
-rw-r--r-- | framework/source/classes/converter.cxx | 54 |
1 files changed, 52 insertions, 2 deletions
diff --git a/framework/source/classes/converter.cxx b/framework/source/classes/converter.cxx index 225beaa245d7..3c9a44093b95 100644 --- a/framework/source/classes/converter.cxx +++ b/framework/source/classes/converter.cxx @@ -2,9 +2,9 @@ * * $RCSfile: converter.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: hr $ $Date: 2003-03-25 18:21:29 $ + * last change: $Author: hr $ $Date: 2003-04-04 16:03:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -170,6 +170,56 @@ OUStringList Converter::convert_seqOUString2OUStringList( const css::uno::Sequen //----------------------------------------------------------------------------- /** + * converts a vector of unicode strings into a sequence of such items + */ +css::uno::Sequence< ::rtl::OUString > Converter::convert_OUStringList2seqOUString( const OUStringList& lSource ) +{ + css::uno::Sequence< ::rtl::OUString > lDestination(lSource.size()); + sal_uInt32 nItem = 0; + for (OUStringList::const_iterator pIterator=lSource.begin(); pIterator!=lSource.end(); ++pIterator) + { + lDestination[nItem] = *pIterator; + ++nItem; + } + return lDestination; +} + +//----------------------------------------------------------------------------- +/** + * converts an unicode string hash to a sequence<PropertyValue>, where names and values match to key and values. + */ +css::uno::Sequence< css::beans::PropertyValue > Converter::convert_OUStringHash2seqProp( const OUStringHash& lSource ) +{ + css::uno::Sequence< css::beans::PropertyValue > lDestination (lSource.size()); + css::beans::PropertyValue* pDestination = lDestination.getArray(); + sal_Int32 nItem = 0; + for (OUStringHash::const_iterator pItem=lSource.begin(); pItem!=lSource.end(); ++pItem) + { + pDestination[nItem].Name = pItem->first ; + pDestination[nItem].Value <<= pItem->second; + ++nItem; + } + return lDestination; +} + +//----------------------------------------------------------------------------- +/** + * converts a sequence<PropertyValue> to an unicode string hash, where keys and values match to names and values. + */ +OUStringHash Converter::convert_seqProp2OUStringHash( const css::uno::Sequence< css::beans::PropertyValue >& lSource ) +{ + OUStringHash lDestination; + sal_Int32 nCount = lSource.getLength(); + const css::beans::PropertyValue* pSource = lSource.getConstArray(); + for (sal_Int32 nItem=0; nItem<nCount; ++nItem) + { + pSource[nItem].Value >>= lDestination[pSource[nItem].Name]; + } + return lDestination; +} + +//----------------------------------------------------------------------------- +/** @short convert timestamp from String to tools::DateTime notation @descr Format: "<day>.<month>.<year>/<hour>:<min>:<sec>" e.g. : "1.11.2001/13:45:16" |