java:use System.arrayCopy to copy arrays
instead of a for loop Change-Id: I3fbd92c5f96970543c2da3843e54a733bf811e72
This commit is contained in:
parent
9a54161189
commit
26b4f5be81
@ -1350,8 +1350,7 @@ xLayoutManager.showElement("private:resource/menubar/menubar");
|
|||||||
new com.sun.star.beans.PropertyValue[ nNumArgs + 1 ];
|
new com.sun.star.beans.PropertyValue[ nNumArgs + 1 ];
|
||||||
|
|
||||||
// copy current arguments
|
// copy current arguments
|
||||||
for ( int n = 0; n < nNumArgs; ++n )
|
System.arraycopy(aArguments, 0, aExtendedArguments, 0, nNumArgs);
|
||||||
aExtendedArguments[n] = aArguments[n];
|
|
||||||
|
|
||||||
// add new argument
|
// add new argument
|
||||||
aExtendedArguments[ nNumArgs ] = aArgument;
|
aExtendedArguments[ nNumArgs ] = aArgument;
|
||||||
|
@ -218,9 +218,7 @@ public final class Loader {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
byte[] buf2 = new byte[2 * n];
|
byte[] buf2 = new byte[2 * n];
|
||||||
for (int i = 0; i < n; ++i) {
|
System.arraycopy(buf, 0, buf2, 0, n);
|
||||||
buf2[i] = buf[i];
|
|
||||||
}
|
|
||||||
buf = buf2;
|
buf = buf2;
|
||||||
}
|
}
|
||||||
int k = s.read(buf, n, buf.length - n);
|
int k = s.read(buf, n, buf.length - n);
|
||||||
|
@ -82,11 +82,10 @@ public class _XBindableValue extends MultiMethodTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class MyValueBinding implements XValueBinding {
|
class MyValueBinding implements XValueBinding {
|
||||||
private Type[] TypeArray;
|
|
||||||
private final ArrayList<Type> types = new ArrayList<Type>();
|
private final ArrayList<Type> types = new ArrayList<Type>();
|
||||||
|
|
||||||
public com.sun.star.uno.Type[] getSupportedValueTypes() {
|
public com.sun.star.uno.Type[] getSupportedValueTypes() {
|
||||||
return TypeArray;
|
return types.toArray(new Type[types.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Object getValue(com.sun.star.uno.Type type)
|
public Object getValue(com.sun.star.uno.Type type)
|
||||||
@ -101,12 +100,6 @@ public class _XBindableValue extends MultiMethodTest {
|
|||||||
|
|
||||||
public boolean supportsType(com.sun.star.uno.Type type) {
|
public boolean supportsType(com.sun.star.uno.Type type) {
|
||||||
types.add(type);
|
types.add(type);
|
||||||
TypeArray = new Type[types.size()];
|
|
||||||
|
|
||||||
for (int i = 0; i < types.size(); i++) {
|
|
||||||
TypeArray[i] = (Type) types.toArray()[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user