Kaydet (Commit) 0b75d198 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

Check if the referenced file is loadable, and if not, don't update.

üst 5995c097
......@@ -672,6 +672,12 @@ public:
*/
void notifyAllLinkListeners(sal_uInt16 nFileId, LinkUpdateType eType);
/**
* Check if the file specified by the path is a legitimate file that
* exists & can be loaded.
*/
bool isFileLoadable(const String& rFile) const;
private:
ScExternalRefManager();
ScExternalRefManager(const ScExternalRefManager&);
......@@ -722,7 +728,6 @@ private:
const ScDocument* getInMemorySrcDocument(sal_uInt16 nFileId);
const ScDocument* getSrcDocument(sal_uInt16 nFileId);
SfxObjectShellRef loadSrcDocument(sal_uInt16 nFileId, String& rFilter);
bool isFileLoadable(const String& rFile) const;
void maybeLinkExternalFile(sal_uInt16 nFileId);
......
......@@ -1272,6 +1272,10 @@ void ScExternalRefLink::DataChanged(const String& /*rMimeType*/, const Any& /*rV
String aFile, aFilter;
mpDoc->GetLinkManager()->GetDisplayNames(this, NULL, &aFile, NULL, &aFilter);
ScExternalRefManager* pMgr = mpDoc->GetExternalRefManager();
if (!pMgr->isFileLoadable(aFile))
return;
const String* pCurFile = pMgr->getExternalFileName(mnFileId);
if (!pCurFile)
return;
......
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