fix (WeaselTSF): Use STDMETHODIMP instead of STDAPI for non-static member functions#1835
Open
cqjjjzr wants to merge 1 commit intorime:masterfrom
Open
fix (WeaselTSF): Use STDMETHODIMP instead of STDAPI for non-static member functions#1835cqjjjzr wants to merge 1 commit intorime:masterfrom
cqjjjzr wants to merge 1 commit intorime:masterfrom
Conversation
This was referenced Apr 9, 2026
6b30746 to
a1b5126
Compare
…mber functions. Fixes rime#1834 , also silented clang-format errors due to different interpretation of blocks (commented out `if` keyword) between clang-format versions
Contributor
|
要分开PR,STDAPI改STDMETHODIMP 集中一个PR来,另外的修改另外PR |
Author
|
是分开 PR 的,一个一个 PR 合就会自动 rebase 好 |
Author
|
顺序是 STDAPI改 -> 图标修 -> 新的语言覆盖参数 |
Contributor
|
三个不是强相关的话,应该要独立来,这样绑一起了 |
Author
|
拆开了,幸好这三个可以完全独立应用,不涉及需要来回 rebase 的情况 |
There was a problem hiding this comment.
Pull request overview
This PR addresses #1834 by replacing STDAPI with STDMETHODIMP for COM non-static member function definitions in WeaselTSF, avoiding extern "C" linkage on member implementations and improving compatibility with C++ tooling.
Changes:
- Switched COM member function definitions from
STDAPI/STDAPI_toSTDMETHODIMP/STDMETHODIMP_across WeaselTSF implementation files (with exceptions for true global exports). - Reflowed some function signatures for readability while applying the macro changes.
- Minor comment/brace formatting adjustments in setup and service code paths.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| WeaselTSF/WeaselTSF.cpp | Converts core COM interface method definitions to STDMETHODIMP / STDMETHODIMP_. |
| WeaselTSF/ThreadMgrEventSink.cpp | Converts thread manager event sink method definitions to STDMETHODIMP. |
| WeaselTSF/TextEditSink.cpp | Converts text edit/layout sink method definitions to STDMETHODIMP. |
| WeaselTSF/Server.cpp | Converts class factory COM method definitions to STDMETHODIMP (global DLL exports remain STDAPI). |
| WeaselTSF/LanguageBar.cpp | Converts language bar COM method definitions to STDMETHODIMP. |
| WeaselTSF/KeyEventSink.cpp | Converts key event sink COM method definitions to STDMETHODIMP. |
| WeaselTSF/EnumDisplayAttributeInfo.cpp | Converts enumerator COM method definitions to STDMETHODIMP. |
| WeaselTSF/EditSession.cpp | Converts ITfEditSession method definition to STDMETHODIMP. |
| WeaselTSF/DisplayAttributeProvider.cpp | Converts display attribute provider method definitions to STDMETHODIMP. |
| WeaselTSF/DisplayAttributeInfo.cpp | Converts display attribute info COM method definitions to STDMETHODIMP. |
| WeaselTSF/Composition.cpp | Converts edit-session and composition sink COM method definitions to STDMETHODIMP. |
| WeaselTSF/Compartment.cpp | Converts compartment event sink COM method definitions to STDMETHODIMP. |
| WeaselSetup/imesetup.cpp | Comment/brace formatting around always-silent registration parameters. |
| WeaselServer/WeaselService.cpp | Comment/brace formatting around always-on RegisterApplicationRestart call. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+10
to
+11
| STDMETHODIMP CCompartmentEventSink::QueryInterface(REFIID riid, | ||
| _Outptr_ void** ppvObj) { |
Comment on lines
+18
to
20
| STDMETHODIMP CEnumDisplayAttributeInfo::QueryInterface(REFIID riid, | ||
| _Outptr_ void** ppvObj) { | ||
| if (ppvObj == nullptr) |
| } | ||
|
|
||
| STDAPI CLangBarItemButton::QueryInterface(REFIID riid, void** ppvObject) { | ||
| STDMETHODIMP CLangBarItemButton::QueryInterface(REFIID riid, void** ppvObject) { |
| }; | ||
|
|
||
| STDAPI CClassFactory::QueryInterface(REFIID riid, void** ppvObject) { | ||
| STDMETHODIMP CClassFactory::QueryInterface(REFIID riid, void** ppvObject) { |
| #include "ResponseParser.h" | ||
|
|
||
| STDAPI WeaselTSF::DoEditSession(TfEditCookie ec) { | ||
| STDMETHODIMP WeaselTSF::DoEditSession(TfEditCookie ec) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1834 .
有几个是全局函数,必须是 STDAPI,就没有修改