Skip to content

Commit 386620c

Browse files
committed
add TODO
1 parent 1541074 commit 386620c

2 files changed

Lines changed: 12 additions & 4 deletions

File tree

src/tabbookmark.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ bool HandleCloseButton(const MOUSEHOOKSTRUCT* pmouse) {
221221
// Get the tab under mouse and check if close button is clicked within it.
222222
// This prevents false positives from other PUSHBUTTON elements like
223223
// New Tab Button.
224-
if (!tab || !IsOnCloseButton(pt)) {
224+
if (!tab || !IsOnCloseButton(pt)) { // TODO: it seems buggy here
225225
return false;
226226
}
227227
if (!IsNeedKeep(tab_count, KeepTabTrigger::kCloseButton)) {

src/uia.cc

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ bool EnsureAutomation() {
6464
}
6565
return true;
6666
}
67+
68+
// TODO: get rid of *out parameters
6769
bool TryGetFocusedElement(const ComPtr<IUIAutomation>& automation,
6870
ComPtr<IUIAutomationElement>* focused) {
6971
if (!automation || !focused) {
@@ -74,6 +76,7 @@ bool TryGetFocusedElement(const ComPtr<IUIAutomation>& automation,
7476
focused->Get() != nullptr;
7577
}
7678

79+
// TODO: get rid of *out parameters
7780
bool TryGetElementFromHandle(const ComPtr<IUIAutomation>& automation,
7881
HWND hwnd,
7982
ComPtr<IUIAutomationElement>* element) {
@@ -85,6 +88,7 @@ bool TryGetElementFromHandle(const ComPtr<IUIAutomation>& automation,
8588
element->Get() != nullptr;
8689
}
8790

91+
// TODO: get rid of *out parameters
8892
bool TryGetElementFromPoint(const ComPtr<IUIAutomation>& automation,
8993
POINT pt,
9094
ComPtr<IUIAutomationElement>* element) {
@@ -96,6 +100,7 @@ bool TryGetElementFromPoint(const ComPtr<IUIAutomation>& automation,
96100
element->Get() != nullptr;
97101
}
98102

103+
// TODO: get rid of *out parameters
99104
bool TryGetCurrentStringProperty(const ComPtr<IUIAutomationElement>& element,
100105
PROPERTYID property_id,
101106
std::wstring* value) {
@@ -116,6 +121,10 @@ bool TryGetCurrentStringProperty(const ComPtr<IUIAutomationElement>& element,
116121
ComPtr<IUIAutomationCondition> MakeClassCondition(
117122
const ComPtr<IUIAutomation>& automation,
118123
std::wstring_view class_name) {
124+
if (!automation || class_name.empty()) {
125+
return nullptr;
126+
}
127+
119128
ScopedVariant val;
120129
val.value.vt = VT_BSTR;
121130
val.value.bstrVal = SysAllocStringLen(class_name.data(),
@@ -128,9 +137,7 @@ ComPtr<IUIAutomationCondition> MakeClassCondition(
128137
if (FAILED(automation->CreatePropertyCondition(
129138
UIA_ClassNamePropertyId, val.value,
130139
condition.ReleaseAndGetAddressOf()))) {
131-
{
132-
return nullptr;
133-
}
140+
return nullptr;
134141
}
135142
return condition;
136143
}
@@ -168,6 +175,7 @@ ComPtr<IUIAutomationElement> FindFirstInSubtree(
168175
return hit;
169176
}
170177

178+
// TODO: get rid of *out parameters
171179
bool FindSiblingByClass(const ComPtr<IUIAutomation>& automation,
172180
const ComPtr<IUIAutomationElement>& element,
173181
std::wstring_view class_name,

0 commit comments

Comments
 (0)