Update ooo320-m1
[ooovba.git] / qadevOOo / runner / helper / PropertyHelper.java
blob170762a1355df9889d1b795af3c2f6e284d690e9
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: PropertyHelper.java,v $
10 * $Revision: 1.4.8.1 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 package helper;
33 import java.util.ArrayList;
35 import com.sun.star.beans.PropertyValue;
37 public class PropertyHelper
39 /**
40 Create a PropertyValue[] from a ArrayList
41 @param _aArrayList
42 @return a PropertyValue[]
44 public static PropertyValue[] createPropertyValueArrayFormArrayList(ArrayList _aPropertyList)
46 // copy the whole PropertyValue List to an PropertyValue Array
47 PropertyValue[] aSaveProperties = null;
49 if (_aPropertyList == null)
51 aSaveProperties = new PropertyValue[0];
53 else
55 aSaveProperties = (PropertyValue[])_aPropertyList.toArray(new PropertyValue[_aPropertyList.size()]);
56 // old java 1.4
57 // if (_aPropertyList.size() > 0)
58 // {
59 // aSaveProperties = new PropertyValue[_aPropertyList.size()];
60 // for (int i = 0;i<_aPropertyList.size(); i++)
61 // {
62 // aSaveProperties[i] = (PropertyValue) _aPropertyList.get(i);
63 // }
64 // }
65 // else
66 // {
67 // aSaveProperties = new PropertyValue[0];
68 // }
70 return aSaveProperties;