Skip to content
Snippets Groups Projects
Commit 9a6fbf56 authored by Hallvard Trætteberg's avatar Hallvard Trætteberg
Browse files

Fixed bug, document location wasn't set when opening document.

parent 4099b8b5
No related branches found
No related tags found
No related merge requests found
......@@ -31,6 +31,7 @@ public abstract class DocumentStorageImpl<D, L> implements IDocumentStorage<L> {
@Override
public void openDocument(L storage) throws IOException {
setDocument(loadDocument(storage));
setDocumentLocation(storage);
}
@Override
......@@ -39,8 +40,14 @@ public abstract class DocumentStorageImpl<D, L> implements IDocumentStorage<L> {
}
public void saveDocumentAs(L documentLocation) throws IOException {
L oldDocumentLocation = getDocumentLocation();
setDocumentLocation(documentLocation);
try {
saveDocument();
} catch (IOException e) {
setDocumentLocation(oldDocumentLocation);
throw e;
}
}
public void saveCopyAs(L documentLocation) throws IOException {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment