Kaydet (Commit) 02ea9bc3 authored tarafından Tamás Zolnai's avatar Tamás Zolnai

tdf#114613: Repair function does not work after opening PPTX file

We need to disable undo handling during file import.
Same is done for other file formats (e.g. PPT, XLSX).

Change-Id: I1969c17b4a25b59b0d216ee847b3664e9c2207ca
Reviewed-on: https://gerrit.libreoffice.org/46882Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
Tested-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 0678d8e3
......@@ -21,6 +21,8 @@
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/document/XUndoManager.hpp>
#include <com/sun/star/document/XUndoManagerSupplier.hpp>
#include <comphelper/propertysequence.hxx>
#include <osl/diagnose.h>
#include <vcl/msgbox.hxx>
......@@ -125,6 +127,19 @@ bool PowerPointImport::importDocument()
file:///<path-to-oox-module>/source/dump/pptxdumper.ini. */
OOX_DUMP_FILE( ::oox::dump::pptx::Dumper );
uno::Reference< document::XUndoManagerSupplier > xUndoManagerSupplier (getModel(), UNO_QUERY );
uno::Reference< util::XLockable > xUndoManager;
bool bWasUnLocked = true;
if(xUndoManagerSupplier.is())
{
xUndoManager = xUndoManagerSupplier->getUndoManager();
if(xUndoManager.is())
{
bWasUnLocked = !xUndoManager->isLocked();
xUndoManager->lock();
}
}
importDocumentProperties();
OUString aFragmentPath = getFragmentPathFromFirstTypeFromOfficeDoc( "officeDocument" );
......@@ -158,6 +173,9 @@ bool PowerPointImport::importDocument()
pBox->Execute();
}
if(xUndoManager.is() && bWasUnLocked)
xUndoManager->unlock();
return bRet;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment