summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2004-10-04 18:47:45 +0000
committerKurt Zenker <kz@openoffice.org>2004-10-04 18:47:45 +0000
commit961e1368284d48d8000f46a802b7fd2c41defa02 (patch)
tree6baed59aff4577767de6fdaf4ae823797e8cd4e2 /svtools
parentda4a71232019d7361bc82054568d403eca914da1 (diff)
INTEGRATION: CWS mav09 (1.1.1.1.514); FILE MERGED
2004/06/18 14:06:01 mba 1.1.1.1.514.1: #i27773#: interface to Property Sequence
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/misc/ownlist.cxx42
1 files changed, 39 insertions, 3 deletions
diff --git a/svtools/source/misc/ownlist.cxx b/svtools/source/misc/ownlist.cxx
index b97614503928..4ab037864d0b 100644
--- a/svtools/source/misc/ownlist.cxx
+++ b/svtools/source/misc/ownlist.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ownlist.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:59:02 $
+ * last change: $Author: kz $ $Date: 2004-10-04 19:47:45 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -61,7 +61,13 @@
#include <ctype.h>
#include <stdio.h>
-#include <ownlist.hxx>
+#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUES_HPP_
+#include <com/sun/star/beans/PropertyValues.hpp>
+#endif
+
+#include "ownlist.hxx"
+
+using namespace com::sun::star;
//=========================================================================
//============== SvCommandList ============================================
@@ -322,4 +328,34 @@ SvStream & operator <<
return rStm;
}
+BOOL SvCommandList::FillFromSequence( const com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence )
+{
+ const sal_Int32 nCount = aCommandSequence.getLength();
+ String aCommand, aArg;
+ ::rtl::OUString aApiArg;
+ for( sal_Int32 nIndex=0; nIndex<nCount; nIndex++ )
+ {
+ aCommand = aCommandSequence[nIndex].Name;
+ if( !( aCommandSequence[nIndex].Value >>= aApiArg ) )
+ return sal_False;
+ aArg = aApiArg;
+ Append( aCommand, aArg );
+ }
+
+ return TRUE;
+}
+
+void SvCommandList::FillSequence( com::sun::star::uno::Sequence < com::sun::star::beans::PropertyValue >& aCommandSequence )
+{
+ const sal_Int32 nCount = Count();
+ aCommandSequence.realloc( nCount );
+ for( sal_Int32 nIndex = 0; nIndex < nCount; nIndex++ )
+ {
+ const SvCommand& rCommand = (*this)[ nIndex ];
+ aCommandSequence[nIndex].Name = rCommand.GetCommand();
+ aCommandSequence[nIndex].Handle = -1;
+ aCommandSequence[nIndex].Value = uno::makeAny( ::rtl::OUString( rCommand.GetArgument() ) );
+ aCommandSequence[nIndex].State = beans::PropertyState_DIRECT_VALUE;
+ }
+}