From 7eb0233e22f4891cef8a1fd0d8ea6a9a3f3d5faa Mon Sep 17 00:00:00 2001 From: cris Date: Thu, 26 Jun 2003 11:02:57 +0000 Subject: [PATCH] Patch level : 2.0 512 Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : corretto errore AO20064: su Win98 se provo a stampare con una stampante Genrica/Solo Testo non stampa nulla e il programma si blocca, mentre su Win2000 funziona. git-svn-id: svn://10.65.10.50/trunk@11290 c028cbd2-c16b-5b4b-a496-9718f37d4682 --- xvaga/xvaga.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/xvaga/xvaga.cpp b/xvaga/xvaga.cpp index 814bc5991..deb7f350c 100755 --- a/xvaga/xvaga.cpp +++ b/xvaga/xvaga.cpp @@ -1845,6 +1845,7 @@ wxFont& TFontId::Font(wxDC* dc) const { const wxSize ppi = dc->GetPPI(); dPrintScale = ppi.x / 96.0; // First guess for scaling factor + int nLastTextWidth = 0; int nBestSize = 0; double nMin = dPrintScale-0.1; @@ -1858,9 +1859,19 @@ wxFont& TFontId::Font(wxDC* dc) const wxFont courier(nFontSize, wxMODERN, wxNORMAL, wxNORMAL); dc->SetFont(courier); int tw; dc->GetTextExtent("0123456789", &tw, NULL); + if (tw != nLastTextWidth) + nLastTextWidth = tw; // Happens with Generic/Text Only + else + { + if (nBestSize == 0) + nBestSize = nFontSize; + break; + } if (tw > ppi.x) + { nMax = nScale; + } else { nMin = nScale;