summaryrefslogtreecommitdiff
path: root/comphelper/source/property
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2008-06-24 11:16:20 +0000
committerKurt Zenker <kz@openoffice.org>2008-06-24 11:16:20 +0000
commit80dda83fc06ea0493111d96c89a27ec212923dd7 (patch)
tree58aac0417d201a01de113c622ccaf4c547d33e0f /comphelper/source/property
parent36f6db6fc9ac846d132f2ff9852760398ab67f57 (diff)
INTEGRATION: CWS canvas05 (1.10.20); FILE MERGED
2008/04/21 07:56:10 thb 1.10.20.2: RESYNC: (1.10-1.11); FILE MERGED 2007/10/01 13:50:40 thb 1.10.20.1: #i80285# Merge from CWS picom
Diffstat (limited to 'comphelper/source/property')
-rw-r--r--comphelper/source/property/property.cxx22
1 files changed, 21 insertions, 1 deletions
diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx
index f1dd36516a19..a708a06ea86b 100644
--- a/comphelper/source/property/property.cxx
+++ b/comphelper/source/property/property.cxx
@@ -7,7 +7,7 @@
* OpenOffice.org - a multi-platform office productivity suite
*
* $RCSfile: property.cxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
* This file is part of OpenOffice.org.
*
@@ -53,6 +53,7 @@
#include <com/sun/star/uno/genfunc.h>
#include <algorithm>
+#include <boost/bind.hpp>
//.........................................................................
namespace comphelper
@@ -141,6 +142,25 @@ sal_Bool hasProperty(const rtl::OUString& _rName, const Reference<XPropertySet>&
}
//------------------------------------------------------------------
+bool findProperty(Property& o_rProp,
+ Sequence<Property>& i_seqProps,
+ const ::rtl::OUString& i_rPropName)
+{
+ const Property* pAry(i_seqProps.getConstArray());
+ const sal_Int32 nLen(i_seqProps.getLength());
+ const Property* pRes(
+ std::find_if(pAry,pAry+nLen,
+ boost::bind(PropertyStringEqualFunctor(),
+ _1,
+ boost::cref(i_rPropName))));
+ if( pRes == pAry+nLen )
+ return false;
+
+ o_rProp = *pRes;
+ return true;
+}
+
+//------------------------------------------------------------------
void RemoveProperty(Sequence<Property>& _rProps, const rtl::OUString& _rPropName)
{
sal_Int32 nLen = _rProps.getLength();