aboutsummaryrefslogtreecommitdiffhomepage
path: root/win32/PlatWin.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'win32/PlatWin.cxx')
-rw-r--r--win32/PlatWin.cxx14
1 files changed, 7 insertions, 7 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx
index a927372c2..c1d1f7cd1 100644
--- a/win32/PlatWin.cxx
+++ b/win32/PlatWin.cxx
@@ -353,9 +353,6 @@ FontCached::FontCached(const FontParameters &fp) :
if (SUCCEEDED(hr)) {
pTextFormat->SetWordWrapping(DWRITE_WORD_WRAPPING_NO_WRAP);
- const int maxLines = 2;
- DWRITE_LINE_METRICS lineMetrics[maxLines];
- UINT32 lineCount = 0;
FLOAT yAscent = 1.0f;
FLOAT yDescent = 1.0f;
FLOAT yInternalLeading = 0.0f;
@@ -363,6 +360,9 @@ FontCached::FontCached(const FontParameters &fp) :
hr = pIDWriteFactory->CreateTextLayout(L"X", 1, pTextFormat,
100.0f, 100.0f, &pTextLayout);
if (SUCCEEDED(hr)) {
+ const int maxLines = 2;
+ DWRITE_LINE_METRICS lineMetrics[maxLines]{};
+ UINT32 lineCount = 0;
hr = pTextLayout->GetLineMetrics(lineMetrics, maxLines, &lineCount);
if (SUCCEEDED(hr)) {
yAscent = lineMetrics[0].baseline;
@@ -2040,7 +2040,7 @@ class ListBoxX : public ListBox {
IListBoxDelegate *delegate;
const char *widestItem;
unsigned int maxCharWidth;
- int resizeHit;
+ WPARAM resizeHit;
PRectangle rcPreSize;
Point dragOffset;
Point location; // Caret location at which the list is opened
@@ -2449,7 +2449,7 @@ POINT ListBoxX::MaxTrackSize() const {
}
void ListBoxX::SetRedraw(bool on) {
- ::SendMessage(lb, WM_SETREDRAW, static_cast<BOOL>(on), 0);
+ ::SendMessage(lb, WM_SETREDRAW, on, 0);
if (on)
::InvalidateRect(lb, NULL, TRUE);
}
@@ -2540,7 +2540,7 @@ void ListBoxX::StartResize(WPARAM hitCode) {
}
::SetCapture(GetHWND());
- resizeHit = static_cast<int>(hitCode);
+ resizeHit = hitCode;
}
LRESULT ListBoxX::NcHitTest(WPARAM wParam, LPARAM lParam) const {
@@ -2753,7 +2753,7 @@ LRESULT ListBoxX::WndProc(HWND hWnd, UINT iMessage, WPARAM wParam, LPARAM lParam
case WM_MEASUREITEM: {
MEASUREITEMSTRUCT *pMeasureItem = reinterpret_cast<MEASUREITEMSTRUCT *>(lParam);
- pMeasureItem->itemHeight = static_cast<unsigned int>(ItemHeight());
+ pMeasureItem->itemHeight = ItemHeight();
}
break;