[Libreoffice-commits] core.git: sd/source
Tomaž Vajngerl (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jun 24 10:52:48 UTC 2020
sd/source/filter/pdf/sdpdffilter.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit c834ea3e4973ca20ae40d0353eb70a47bda9a7a4
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
AuthorDate: Tue Jun 23 14:51:59 2020 +0200
Commit: Tomaž Vajngerl <quikee at gmail.com>
CommitDate: Wed Jun 24 12:52:08 2020 +0200
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 at gmail.com>
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;
}
More information about the Libreoffice-commits
mailing list