mirror of
https://gitlab.freedesktop.org/cairo/cairo.git
synced 2026-02-08 08:00:29 +01:00
DWrite/GeometryRecorder: Complete implementation of QueryInterface
...by checking for IUnknown. This makes GeometryRecorder::QueryInterface compliant with the rules of COM. QueryInterface for IUnknown has a special meaning in COM: it's used to check whether two interface pointers refer to the same object.
This commit is contained in:
parent
59197e7791
commit
46153a0408
1 changed files with 9 additions and 6 deletions
|
|
@ -845,15 +845,18 @@ public:
|
|||
: mCairoPath(aCairoPath)
|
||||
, mMatrix(matrix) {}
|
||||
|
||||
// IUnknown interface
|
||||
IFACEMETHOD (QueryInterface)(IID const& iid, OUT void** ppObject) noexcept override
|
||||
{
|
||||
if (iid != __uuidof(IDWriteGeometrySink))
|
||||
return E_NOINTERFACE;
|
||||
if (iid == __uuidof (IUnknown) ||
|
||||
iid == __uuidof (IDWriteGeometrySink))
|
||||
{
|
||||
AddRef();
|
||||
*ppObject = this;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*ppObject = static_cast<IDWriteGeometrySink*>(this);
|
||||
|
||||
return S_OK;
|
||||
*ppObject = nullptr;
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
IFACEMETHOD_(ULONG, AddRef)() noexcept override
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue