summaryrefslogtreecommitdiffstats
path: root/dtrans/source/win32/dtobj/FmtFilter.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dtrans/source/win32/dtobj/FmtFilter.cxx')
-rw-r--r--dtrans/source/win32/dtobj/FmtFilter.cxx11
1 files changed, 4 insertions, 7 deletions
diff --git a/dtrans/source/win32/dtobj/FmtFilter.cxx b/dtrans/source/win32/dtobj/FmtFilter.cxx
index 0b60cb51c109..c65512e8a4e9 100644
--- a/dtrans/source/win32/dtobj/FmtFilter.cxx
+++ b/dtrans/source/win32/dtobj/FmtFilter.cxx
@@ -302,15 +302,12 @@ static std::wstring getShellLinkTarget(const std::wstring& aLnkFile)
try
{
sal::systools::COMReference<IShellLinkW> pIShellLink;
- HRESULT hr = CoCreateInstance(
- CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER, IID_IShellLinkW, reinterpret_cast<LPVOID*>(&pIShellLink));
- if (FAILED(hr))
- return target;
+ pIShellLink.CoCreateInstance(CLSID_ShellLink, nullptr, CLSCTX_INPROC_SERVER);
- sal::systools::COMReference<IPersistFile> pIPersistFile =
- pIShellLink.QueryInterface<IPersistFile>(IID_IPersistFile);
+ sal::systools::COMReference<IPersistFile> pIPersistFile(pIShellLink,
+ sal::systools::COM_QUERY_THROW);
- hr = pIPersistFile->Load(aLnkFile.c_str(), STGM_READ);
+ HRESULT hr = pIPersistFile->Load(aLnkFile.c_str(), STGM_READ);
if (FAILED(hr))
return target;