Permalink
Browse files

use new poi. Also added shortterm fix for issue related to cached ori…

…ginal colours - now resets when loading a new workbook otherwise it tries to update unattached cells
  • Loading branch information...
1 parent 780420c commit 70a72e78a10bb87c934cf6b98836b086ce673aaf @stuzart stuzart committed Nov 6, 2012
View
@@ -109,12 +109,12 @@
<dependency>
<groupId>org.sysmo-db</groupId>
<artifactId>poi-ooxml</artifactId>
- <version>3.9-beta1-20121011</version>
+ <version>3.9-beta1-20121106</version>
</dependency>
<dependency>
<groupId>org.sysmo-db</groupId>
<artifactId>poi-ooxml-schemas</artifactId>
- <version>3.9-beta1-20121011</version>
+ <version>3.9-beta1-20121106</version>
</dependency>
<dependency>
<groupId>dom4j</groupId>
@@ -34,6 +34,11 @@
public OntologyTermValidationWorkbookParser(WorkbookManager workbookManager) {
this.workbookManager = workbookManager;
}
+
+ public static void clearOriginalColours() {
+ logger.debug("Clearing original colours");
+ originalColours.clear();
+ }
public Collection<OntologyTermValidation> readOntologyTermValidations() {
logger.debug("Reading validations from workbook");
@@ -139,7 +144,7 @@ private void highlightCells(Collection<OntologyTermValidation> ontologyTermValid
}
private void restoreCellBackgroundColours() {
- for (Cell cell : originalColours.keySet()) {
+ for (Cell cell : originalColours.keySet()) {
cell.setBackgroundFill(originalColours.get(cell));
}
originalColours.clear();
@@ -164,6 +164,7 @@ public Workbook createNewWorkbook(WorkbookFormat format) {
List<WorkbookChangeListener> existingListeners = workbook.getAllChangeListeners();
workbook.clearChangeListeners();
getOntologyManager().clearOntologyTermValidations();
+ OntologyTermValidationWorkbookParser.clearOriginalColours();
try {
workbook = WorkbookFactory.createWorkbook(format);
for (WorkbookChangeListener l : existingListeners) {
@@ -185,6 +186,7 @@ public Workbook loadWorkbook(URI uri) throws IOException,InvalidWorkbookFormatEx
//need to preserve the listeners on the workbook
List<WorkbookChangeListener> existingListeners = workbook.getAllChangeListeners();
workbook.clearChangeListeners(); //to free it and allow it to be garbage collected
+ OntologyTermValidationWorkbookParser.clearOriginalColours();
workbook = WorkbookFactory.createWorkbook(uri);
logger.debug("Adding Workbook "+existingListeners.size()+" change listeners to new workbook instance");
for (WorkbookChangeListener l : existingListeners) {

0 comments on commit 70a72e7

Please sign in to comment.