Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CEditView::Create において SystemParametersInfo 呼び出しが失敗した場合の対策を追加 #527

Merged
merged 3 commits into from
Oct 7, 2018
Merged

CEditView::Create において SystemParametersInfo 呼び出しが失敗した場合の対策を追加 #527

merged 3 commits into from
Oct 7, 2018

Conversation

beru
Copy link
Contributor

@beru beru commented Oct 7, 2018

#523 で頂いた レビュー指摘コメント に対応しました。

@beru
Copy link
Contributor Author

beru commented Oct 7, 2018

失敗した場合の値は上限の 31 にしました。マジックナンバーではなくて constexpr で定数宣言した方が良いかも知れませんが…。

@@ -385,7 +385,12 @@ BOOL CEditView::Create(

/* キーボードの現在のリピート間隔を取得 */
DWORD dwKeyBoardSpeed;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • dwKeyBoardSpeed のデフォルトは const の変数として定義した方がいいと思います。
  • 392行目では直値を使わず、その定義した const の変数を使った方がいいと思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

8927c9b で、直値を何度も使わずに定数宣言して使うように修正しました。

}
else{
dwKeyBoardSpeed = 31;
dwKeyBoardSpeed = keyboardRepeatSpeedMax;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

細かいですが、

393行目は意味的には最大値ではなくデフォルト値という意味なので
390行目と396行目は役割が異なります。

別の定数を用意してそれを393行目で使って、その上でその定義値として、keyboardRepeatSpeedMax を使えばいいと思います。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

83458a2 で対応しました。

Copy link
Member

@m-tmatma m-tmatma left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます

@beru
Copy link
Contributor Author

beru commented Oct 7, 2018

Merge します。もし問題が見つかったら別の PR で対処する事にしましょう。

@beru beru merged commit 933c809 into sakura-editor:master Oct 7, 2018
@beru beru deleted the SetTimer_interval_BugFix_episode_2 branch October 7, 2018 12:21
@m-tmatma m-tmatma added this to the next release milestone Oct 21, 2018
HoppingTappy pushed a commit to HoppingTappy/sakura that referenced this pull request Jun 11, 2019
…ix_episode_2

CEditView::Create において SystemParametersInfo 呼び出しが失敗した場合の対策を追加
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants