diff options
Diffstat (limited to 'odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java')
-rw-r--r-- | odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java index 513bfa1517d4..109335f3cbea 100644 --- a/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java +++ b/odk/examples/DevelopersGuide/Spreadsheet/ExampleAddIn.java @@ -163,9 +163,30 @@ public class ExampleAddIn // XExampleAddIn + public int getIncremented( int nValue ) + { + return nValue + 1; + } + public com.sun.star.sheet.XVolatileResult getCounter(String aName) + { + if ( aResults == null ) + { + // create the table of results, and start a thread to increment + // all counters + aResults = new java.util.HashMap<String, ExampleAddInResult>(); + ExampleAddInThread aThread = new ExampleAddInThread( aResults ); + aThread.start(); + } - + ExampleAddInResult aResult = aResults.get(aName); + if ( aResult == null ) + { + aResult = new ExampleAddInResult(aName); + aResults.put( aName, aResult ); + } + return aResult; + } // XAddIn |