diff options
-rw-r--r-- | sc/source/ui/unoobj/linkuno.cxx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx index ce3619708cfd..bec0c4d25302 100644 --- a/sc/source/ui/unoobj/linkuno.cxx +++ b/sc/source/ui/unoobj/linkuno.cxx @@ -1709,7 +1709,8 @@ Reference< sheet::XExternalDocLink > SAL_CALL ScExternalDocLinksObj::addDocLink( throw (RuntimeException, std::exception) { SolarMutexGuard aGuard; - sal_uInt16 nFileId = mpRefMgr->getExternalFileId(aDocName); + OUString aDocUrl( ScGlobal::GetAbsDocName( aDocName, mpDocShell)); + sal_uInt16 nFileId = mpRefMgr->getExternalFileId(aDocUrl); Reference< sheet::XExternalDocLink > aDocLink(new ScExternalDocLinkObj(mpDocShell, mpRefMgr, nFileId)); return aDocLink; } @@ -1718,10 +1719,11 @@ Any SAL_CALL ScExternalDocLinksObj::getByName(const OUString &aName) throw (container::NoSuchElementException, lang::WrappedTargetException, RuntimeException, std::exception) { SolarMutexGuard aGuard; - if (!mpRefMgr->hasExternalFile(aName)) + OUString aDocUrl( ScGlobal::GetAbsDocName( aName, mpDocShell)); + if (!mpRefMgr->hasExternalFile(aDocUrl)) throw container::NoSuchElementException(); - sal_uInt16 nFileId = mpRefMgr->getExternalFileId(aName); + sal_uInt16 nFileId = mpRefMgr->getExternalFileId(aDocUrl); Reference< sheet::XExternalDocLink > aDocLink(new ScExternalDocLinkObj(mpDocShell, mpRefMgr, nFileId)); Any aAny; |