diff options
author | Eike Rathke <erack@redhat.com> | 2015-01-09 13:53:27 +0100 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2015-01-09 16:10:04 +0100 |
commit | 97a8b3ed5e5bd42e213d3230fa764b0f5d10f0f2 (patch) | |
tree | a9a6d6b8952c0112adefd0b55aa9dcb3a3d66dd8 /sc | |
parent | b6339617b1cc3136f9e527acd0746d712cd21643 (diff) |
Resolves: fdo#85617 always store fully encoded external document name
Also OOXML calls these API functions, this is the central place to handle it.
Diffstat (limited to 'sc')
-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; |