[Libreoffice-commits] core.git: sc/source
Caolán McNamara
caolanm at redhat.com
Wed Jan 31 16:16:04 UTC 2018
sc/source/core/data/global2.cxx | 9 +++++++--
sc/source/filter/excel/excel.cxx | 5 +++++
sc/source/ui/docshell/docsh.cxx | 1 +
sc/source/ui/docshell/externalrefmgr.cxx | 3 +++
4 files changed, 16 insertions(+), 2 deletions(-)
New commits:
commit daa761664c6db169a47d60664203f2283a6dc2e3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Jan 31 16:14:02 2018 +0000
ofz#3032 Timeout
Change-Id: Ibd370623f89341560d5d3a6c3bd073cc7365fab9
diff --git a/sc/source/core/data/global2.cxx b/sc/source/core/data/global2.cxx
index 531c6d357e8d..4187d5b5de72 100644
--- a/sc/source/core/data/global2.cxx
+++ b/sc/source/core/data/global2.cxx
@@ -313,8 +313,13 @@ OUString ScGlobal::GetAbsDocName( const OUString& rFileName,
if (!pShell || !pShell->HasName())
{ // maybe relative to document path working directory
INetURLObject aObj;
- aObj.SetSmartURL(!utl::ConfigManager::IsFuzzing() ? SvtPathOptions().GetWorkPath() : OUString("file:///tmp"));
- aObj.setFinalSlash(); // it IS a path
+ if (!utl::ConfigManager::IsFuzzing())
+ {
+ aObj.SetSmartURL(SvtPathOptions().GetWorkPath());
+ aObj.setFinalSlash(); // it IS a path
+ }
+ else
+ aObj.SetSmartURL("file:///tmp/document");
bool bWasAbs = true;
aAbsName = aObj.smartRel2Abs( rFileName, bWasAbs ).GetMainURL(INetURLObject::DecodeMechanism::NONE);
// returned string must be encoded because it's used directly to create SfxMedium
diff --git a/sc/source/filter/excel/excel.cxx b/sc/source/filter/excel/excel.cxx
index d03f59b323ca..f39766edd83a 100644
--- a/sc/source/filter/excel/excel.cxx
+++ b/sc/source/filter/excel/excel.cxx
@@ -231,6 +231,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportQPW(SvStream &rStream)
aDocument.SetDocOptions(aDocOpt);
aDocument.MakeTable(0);
aDocument.EnableExecuteLink(false);
+ aDocument.SetInsertingFromOtherDoc(true);
return ScFormatFilter::Get().ScImportQuattroPro(&rStream, &aDocument) == ERRCODE_NONE;
}
@@ -243,6 +244,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportCalcRTF(SvStream &rStream)
aDocument.SetDocOptions(aDocOpt);
aDocument.MakeTable(0);
aDocument.EnableExecuteLink(false);
+ aDocument.SetInsertingFromOtherDoc(true);
ScRange aRange;
return ScFormatFilter::Get().ScImportRTF(rStream, OUString(), &aDocument, aRange) == ERRCODE_NONE;
}
@@ -267,6 +269,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportXLS(SvStream& rStream)
rDoc.SetDocOptions(aDocOpt);
rDoc.MakeTable(0);
rDoc.EnableExecuteLink(false);
+ rDoc.SetInsertingFromOtherDoc(true);
rDoc.InitDrawLayer(xDocShell.get());
bool bRet(false);
try
@@ -293,6 +296,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportWKS(SvStream& rStream)
aDocument.SetDocOptions(aDocOpt);
aDocument.MakeTable(0);
aDocument.EnableExecuteLink(false);
+ aDocument.SetInsertingFromOtherDoc(true);
return ScFormatFilter::Get().ScImportLotus123(aMedium, &aDocument, RTL_TEXTENCODING_ASCII_US) == ERRCODE_NONE;
}
@@ -305,6 +309,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDIF(SvStream &rStream)
aDocument.SetDocOptions(aDocOpt);
aDocument.MakeTable(0);
aDocument.EnableExecuteLink(false);
+ aDocument.SetInsertingFromOtherDoc(true);
return ScFormatFilter::Get().ScImportDif(rStream, &aDocument, ScAddress(0, 0, 0), RTL_TEXTENCODING_IBM_850) == ERRCODE_NONE;
}
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index c4f2b2a00168..358bc1a248ae 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -3259,6 +3259,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportSLK(SvStream &rStream)
aDocument.SetDocOptions(aDocOpt);
aDocument.MakeTable(0);
aDocument.EnableExecuteLink(false);
+ aDocument.SetInsertingFromOtherDoc(true);
ScImportExport aImpEx(&aDocument);
return aImpEx.ImportStream(rStream, OUString(), SotClipboardFormatId::SYLK);
}
diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx
index 9af84ece7e3d..c148855d9bb9 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2681,6 +2681,9 @@ void ScExternalRefManager::maybeCreateRealFileName(sal_uInt16 nFileId)
OUString ScExternalRefManager::getOwnDocumentName() const
{
+ if (utl::ConfigManager::IsFuzzing())
+ return ("file:///tmp/document");
+
SfxObjectShell* pShell = mpDoc->GetDocumentShell();
if (!pShell)
// This should not happen!
More information about the Libreoffice-commits
mailing list