summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2020-06-23 14:51:59 +0200
committerTomaž Vajngerl <quikee@gmail.com>2020-06-24 12:52:08 +0200
commitc834ea3e4973ca20ae40d0353eb70a47bda9a7a4 (patch)
tree6ef34fd07d4fb83c7f0dd058493c7049f6000fd2 /sd
parent3fc4898473752eaac44f3bc1e0df9eb548974425 (diff)
sd: ignore UNDO when importing a PDF with SdPdfFilter
Change-Id: I6c695ca4edb284d70726b6f30148a508d0e70911 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96944 Tested-by: Jenkins Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/filter/pdf/sdpdffilter.cxx8
1 files changed, 7 insertions, 1 deletions
diff --git a/sd/source/filter/pdf/sdpdffilter.cxx b/sd/source/filter/pdf/sdpdffilter.cxx
index 9a53dde90cdf..7072100eb0cd 100644
--- a/sd/source/filter/pdf/sdpdffilter.cxx
+++ b/sd/source/filter/pdf/sdpdffilter.cxx
@@ -50,6 +50,11 @@ bool SdPdfFilter::Import()
if (vcl::ImportPDFUnloaded(aFileName, aGraphics) == 0)
return false;
+ bool bWasLocked = mrDocument.isLocked();
+ mrDocument.setLock(true);
+ const bool bSavedUndoEnabled = mrDocument.IsUndoEnabled();
+ mrDocument.EnableUndo(false);
+
// Add as many pages as we need up-front.
mrDocument.CreateFirstPages();
for (size_t i = 0; i < aGraphics.size() - 1; ++i)
@@ -94,7 +99,8 @@ bool SdPdfFilter::Import()
xAnnotation->setDateTime(rPDFAnnotation.maDateTime);
}
}
-
+ mrDocument.setLock(bWasLocked);
+ mrDocument.EnableUndo(bSavedUndoEnabled);
return true;
}