From 79b60780fe1e388365b328e72a8564995a40764d Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Fri, 8 Apr 2016 18:46:01 +0200 Subject: [PATCH] Fix MSVC14 warnings about a shadowed variable in the printing sample. Just to suppress some harmless warnings. --- samples/printing/printing.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/samples/printing/printing.cpp b/samples/printing/printing.cpp index f8644625a3..6d68ace02a 100644 --- a/samples/printing/printing.cpp +++ b/samples/printing/printing.cpp @@ -700,20 +700,20 @@ void MyPrintout::DrawPageTwo() { // GetTextExtent demo: wxString words[7] = { wxT("This "), wxT("is "), wxT("GetTextExtent "), wxT("testing "), wxT("string. "), wxT("Enjoy "), wxT("it!") }; - wxCoord w, h; long x = 200, y= 250; dc->SetFont(wxFontInfo(15).Family(wxFONTFAMILY_SWISS)); for (int i = 0; i < 7; i++) { + wxCoord wordWidth, wordHeight; wxString word = words[i]; word.Remove( word.Len()-1, 1 ); - dc->GetTextExtent(word, &w, &h); - dc->DrawRectangle(x, y, w, h); - dc->GetTextExtent(words[i], &w, &h); + dc->GetTextExtent(word, &wordWidth, &wordHeight); + dc->DrawRectangle(x, y, wordWidth, wordHeight); + dc->GetTextExtent(words[i], &wordWidth, &wordHeight); dc->DrawText(words[i], x, y); - x += w; + x += wordWidth; } }