Patch level : 10.0
Files correlati : stampe Ricompilazione Demo : [ ] Commento : Migliorata gestione nomi di stampante lunghi (> 30 caratteri) git-svn-id: svn://10.65.10.50/trunk@18672 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
ab2395fe1b
commit
393b89f3fa
@ -4,24 +4,13 @@
|
||||
// Author: Julian Smart
|
||||
// Modified by:
|
||||
// Created: 2001-08-21
|
||||
// RCS-ID: $Id: email.cpp,v 1.5 2009-03-23 10:37:33 alex Exp $
|
||||
// RCS-ID: $Id: email.cpp,v 1.6 2009-04-07 09:19:08 guy Exp $
|
||||
// Copyright: (c) Julian Smart
|
||||
// Licence: wxWindows licence
|
||||
/////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "wxinc.h"
|
||||
|
||||
// For compilers that support precompilation, includes "wx/wx.h".
|
||||
#include "wx/wxprec.h"
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
#pragma hdrstop
|
||||
#endif
|
||||
|
||||
#ifndef WX_PRECOMP
|
||||
#include "wx/wx.h"
|
||||
#endif
|
||||
|
||||
#include "wx/string.h"
|
||||
#include "email.h"
|
||||
|
||||
#ifdef __WXMSW__
|
||||
|
@ -3604,7 +3604,7 @@ double xvt_str_fuzzy_compare (const char* s1, const char* s2)
|
||||
double xvt_str_fuzzy_compare_ignoring_case (const char* s1, const char* s2)
|
||||
{
|
||||
wxString str1(s1); str1.MakeUpper();
|
||||
wxString str2(s2); str1.MakeUpper();
|
||||
wxString str2(s2); str2.MakeUpper();
|
||||
return fstrcmp(str1, str2);
|
||||
}
|
||||
|
||||
|
@ -236,6 +236,7 @@ WC_HSLIDER, /* horizontal slider control */
|
||||
WC_VSLIDER, /* vertical slider control */
|
||||
WC_POPUP, /* list of listedit control or popup menu */
|
||||
WC_PROPGRID, /* property grid */
|
||||
WC_MVC, /* model view controller */
|
||||
} WIN_TYPE;
|
||||
|
||||
typedef enum {
|
||||
|
@ -708,19 +708,19 @@ int xvt_print_get_name(const PRINT_RCD* precp, char* name, int sz_s)
|
||||
wxString n = ((const char*)precp) + 4;
|
||||
if (n.Length() >= 30)
|
||||
{
|
||||
double dBest = 1.0;
|
||||
double dBest = 0.0;
|
||||
wxString strBest = n;
|
||||
SLIST plist = xvt_print_list_devices();
|
||||
for (SLIST_ELT pitem = xvt_slist_get_first(plist);
|
||||
pitem != NULL; pitem = xvt_slist_get_next(plist, pitem))
|
||||
{
|
||||
const wxString pname = xvt_slist_get(plist, pitem, NULL);
|
||||
const char* pname = xvt_slist_get(plist, pitem, NULL);
|
||||
const double dScore = xvt_str_fuzzy_compare_ignoring_case(n, pname);
|
||||
if (dScore < dBest)
|
||||
if (dScore > dBest)
|
||||
{
|
||||
dBest = dScore;
|
||||
strBest = pname;
|
||||
if (dScore == 0.0)
|
||||
if (dScore >= 1.0)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user