Fix MSVC14 warnings about a shadowed variable in the printing sample.

Just to suppress some harmless warnings.
This commit is contained in:
Artur Wieczorek
2016-04-08 18:46:01 +02:00
parent c991c659c4
commit 79b60780fe

View File

@@ -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;
}
}