diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-02-26 13:11:12 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-02-27 11:05:00 +0100 |
commit | ed40d477b2412d4f23540052ca0748028c6103e6 (patch) | |
tree | d6a0013c1441e3c7d1a136479756aed7f396d786 /vcl/win/dtrans | |
parent | f3fab0832b57677d8dfe1297ae7aba631b44cc30 (diff) |
Drop ComPtr and use sal::systools::COMReference
Change-Id: I9eb6d99d883b44943ad69c2c28d4e55716dc34f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111673
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'vcl/win/dtrans')
-rw-r--r-- | vcl/win/dtrans/FmtFilter.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/vcl/win/dtrans/FmtFilter.cxx b/vcl/win/dtrans/FmtFilter.cxx index e9c4b42f8b68..535f6c122712 100644 --- a/vcl/win/dtrans/FmtFilter.cxx +++ b/vcl/win/dtrans/FmtFilter.cxx @@ -308,15 +308,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; |