summaryrefslogtreecommitdiff
path: root/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
diff options
context:
space:
mode:
Diffstat (limited to 'odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java')
-rw-r--r--odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java12
1 files changed, 5 insertions, 7 deletions
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
index 388e4890bbd2..47cc018ac2e4 100644
--- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
+++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java
@@ -38,7 +38,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
{
private String aName;
private int nValue;
- private java.util.Vector<XResultListener> aListeners = new java.util.Vector<XResultListener>();
+ private java.util.ArrayList<XResultListener> aListeners = new java.util.ArrayList<XResultListener>();
public ExampleAddInResult( String aNewName )
{
@@ -56,7 +56,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
public void addResultListener(com.sun.star.sheet.XResultListener aListener)
{
- aListeners.addElement( aListener );
+ aListeners.add( aListener );
// immediately notify of initial value
aListener.modified( getResult() );
@@ -64,7 +64,7 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
public void removeResultListener(com.sun.star.sheet.XResultListener aListener)
{
- aListeners.removeElement( aListener );
+ aListeners.remove( aListener );
}
public void incrementValue()
@@ -72,10 +72,8 @@ class ExampleAddInResult implements com.sun.star.sheet.XVolatileResult
++nValue;
com.sun.star.sheet.ResultEvent aEvent = getResult();
- java.util.Enumeration<XResultListener> aEnum = aListeners.elements();
- while (aEnum.hasMoreElements())
- aEnum.nextElement().modified(
- aEvent);
+ for( XResultListener l : aListeners)
+ l.modified(aEvent);
}
}