xref: /aoo41x/main/i18npool/source/paper/paper.cxx (revision cdf0e10c)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_i18npool.hxx"
30 
31 #include <osl/diagnose.h>
32 #include <sal/config.h>
33 #include <rtl/ustring.hxx>
34 #include <rtl/string.hxx>
35 #include <comphelper/processfactory.hxx>
36 #include <com/sun/star/i18n/ScriptType.hpp>
37 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
38 #include <com/sun/star/container/XNameAccess.hpp>
39 
40 #include "i18npool/mslangid.hxx"
41 #include "i18npool/paper.hxx"
42 
43 #include <utility>
44 #include <cstdlib>
45 
46 #ifdef UNX
47 #include <stdio.h>
48 #include <string.h>
49 #include <locale.h>
50 #include <langinfo.h>
51 #endif
52 
53 struct PageDesc
54 {
55     long m_nWidth;
56     long m_nHeight;
57     const char *m_pPSName;
58     const char *m_pAltPSName;
59 };
60 
61 #define PT2MM100( v ) \
62     (long)(((v) * 35.27777778) + 0.5)
63 
64 #define IN2MM100( v ) \
65     ((long)(((v) * 2540) + 0.5))
66 
67 #define MM2MM100( v ) \
68     ((long)((v) * 100))
69 
70 //PostScript Printer Description File Format Specification
71 //http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf
72 //http://www.y-adagio.com/public/committees/docsii/doc_00-49/symp_ulaan/china_ppr.pdf (Kai)
73 //http://www.sls.psi.ch/controls/help/howto/Howto_Print_a_A0_Poster_at_WSLA_012_2.pdf (Dia)
74 static PageDesc aDinTab[] =
75 {
76     { MM2MM100( 841 ),   MM2MM100( 1189 ),   "A0",  NULL },
77     { MM2MM100( 594 ),   MM2MM100( 841 ),    "A1",  NULL },
78     { MM2MM100( 420 ),   MM2MM100( 594 ),    "A2",  NULL },
79     { MM2MM100( 297 ),   MM2MM100( 420 ),    "A3",  NULL },
80     { MM2MM100( 210 ),   MM2MM100( 297 ),    "A4",  NULL },
81     { MM2MM100( 148 ),   MM2MM100( 210 ),    "A5",  NULL },
82     { MM2MM100( 250 ),   MM2MM100( 353 ),    "ISOB4",  NULL },
83     { MM2MM100( 176 ),   MM2MM100( 250 ),    "ISOB5",  NULL },
84     { IN2MM100( 8.5 ),   IN2MM100( 11 ),     "Letter",  "Note" },
85     { IN2MM100( 8.5 ),   IN2MM100( 14 ),     "Legal",  NULL },
86     { IN2MM100( 11 ),    IN2MM100( 17 ),     "Tabloid",  "11x17" },
87     { 0,                 0,                  NULL, NULL }, //User
88     { MM2MM100( 125 ),   MM2MM100( 176 ),    "ISOB6",  NULL },
89     { MM2MM100( 229 ),   MM2MM100( 324 ),    "EnvC4",  "C4" },
90     { MM2MM100( 162 ),   MM2MM100( 229 ),    "EnvC5",  "C5" },
91     { MM2MM100( 114 ),   MM2MM100( 162 ),    "EnvC6",  "C6" },
92     { MM2MM100( 114 ),   MM2MM100( 229 ),    "EnvC65", NULL },
93     { MM2MM100( 110 ),   MM2MM100( 220 ),    "EnvDL",  "DL" },
94     { MM2MM100( 180),    MM2MM100( 270 ),    NULL,  NULL }, //Dia
95     { MM2MM100( 210),    MM2MM100( 280 ),    NULL,  NULL }, //Screen
96     { IN2MM100( 17 ),    IN2MM100( 22 ),     "AnsiC",  "CSheet" },
97     { IN2MM100( 22 ),    IN2MM100( 34 ),     "AnsiD",  "DSheet" },
98     { IN2MM100( 34 ),    IN2MM100( 44 ),     "AnsiE",  "ESheet" },
99     { IN2MM100( 7.25 ),  IN2MM100( 10.5 ),   "Executive",  NULL },
100     //"Folio" is a different size in the PPD documentation than 8.5x11
101     //This "FanFoldGermanLegal" is known in the Philippines as
102     //"Legal" paper or "Long Bond Paper".  The "Legal" name causing untold
103     //misery, given the differently sized US "Legal" paper
104     { IN2MM100( 8.5 ),   IN2MM100( 13 ),     "FanFoldGermanLegal",  NULL },
105     { IN2MM100( 3.875 ), IN2MM100( 7.5 ),    "EnvMonarch", "Monarch" },
106     { IN2MM100( 3.625 ), IN2MM100( 6.5 ),    "EnvPersonal",  "Personal" },
107     { IN2MM100( 3.875 ), IN2MM100( 8.875 ),  "Env9",  NULL },
108     { IN2MM100( 4.125 ), IN2MM100( 9.5 ),    "Env10",  "Comm10" },
109     { IN2MM100( 4.5 ),   IN2MM100( 10.375 ), "Env11",  NULL },
110     { IN2MM100( 4.75 ),  IN2MM100( 11 ),     "Env12",  NULL },
111     { MM2MM100( 184 ),   MM2MM100( 260 ),    NULL,  NULL }, //Kai16
112     { MM2MM100( 130 ),   MM2MM100( 184 ),    NULL,  NULL }, //Kai32
113     { MM2MM100( 140 ),   MM2MM100( 203 ),    NULL,  NULL }, //BigKai32
114     { MM2MM100( 257 ),   MM2MM100( 364 ),    "B4",  NULL }, //JIS
115     { MM2MM100( 182 ),   MM2MM100( 257 ),    "B5",  NULL }, //JIS
116     { MM2MM100( 128 ),   MM2MM100( 182 ),    "B6",  NULL }, //JIS
117     { IN2MM100( 17 ),    IN2MM100( 11 ),     "Ledger",  NULL },
118     { IN2MM100( 5.5 ),   IN2MM100( 8.5 ),    "Statement",  NULL },
119     { PT2MM100( 610 ),   PT2MM100( 780 ),    "Quarto",  NULL },
120     { IN2MM100( 10 ),    IN2MM100( 14 ),     "10x14",  NULL },
121     { IN2MM100( 5.5 ),   IN2MM100( 11.5 ),   "Env14",  NULL },
122     { MM2MM100( 324 ),   MM2MM100( 458 ),    "EnvC3",  "C3" },
123     { MM2MM100( 110 ),   MM2MM100( 230 ),    "EnvItalian",  NULL },
124     { IN2MM100( 14.875 ),IN2MM100( 11 ),     "FanFoldUS",  NULL },
125     { IN2MM100( 8.5 ),   IN2MM100( 13 ),     "FanFoldGerman",  NULL },
126     { MM2MM100( 100 ),   MM2MM100( 148 ),    "Postcard",  NULL },
127     { IN2MM100( 9 ),     IN2MM100( 11 ),     "9x11",  NULL },
128     { IN2MM100( 10 ),    IN2MM100( 11 ),     "10x11",  NULL },
129     { IN2MM100( 15 ),    IN2MM100( 11 ),     "15x11",  NULL },
130     { MM2MM100( 220 ),   MM2MM100( 220 ),    "EnvInvite",  NULL },
131     { MM2MM100( 227 ),   MM2MM100( 356 ),    "SuperA",  NULL },
132     { MM2MM100( 305 ),   MM2MM100( 487 ),    "SuperB",  NULL },
133     { IN2MM100( 8.5 ),   IN2MM100( 12.69 ),  "LetterPlus",  NULL },
134     { MM2MM100( 210 ),   MM2MM100( 330 ),    "A4Plus",  NULL },
135     { MM2MM100( 200 ),   MM2MM100( 148 ),    "DoublePostcard",  NULL },
136     { MM2MM100( 105 ),   MM2MM100( 148 ),    "A6",  NULL },
137     { IN2MM100( 12 ),    IN2MM100( 11 ),     "12x11",  NULL },
138     { MM2MM100( 74 ),    MM2MM100( 105 ),    "A7",  NULL },
139     { MM2MM100( 52 ),    MM2MM100( 74 ),     "A8",  NULL },
140     { MM2MM100( 37 ),    MM2MM100( 52 ),     "A9",  NULL },
141     { MM2MM100( 26 ),    MM2MM100( 37 ),     "A10",  NULL },
142     { MM2MM100( 1000 ),  MM2MM100( 1414 ),   "ISOB0",  NULL },
143     { MM2MM100( 707 ),   MM2MM100( 1000 ),   "ISOB1",  NULL },
144     { MM2MM100( 500 ),   MM2MM100( 707 ),    "ISOB2",  NULL },
145     { MM2MM100( 353 ),   MM2MM100( 500 ),    "ISOB3",  NULL },
146     { MM2MM100( 88 ),    MM2MM100( 125 ),    "ISOB7",  NULL },
147     { MM2MM100( 62 ),    MM2MM100( 88 ),     "ISOB8",  NULL },
148     { MM2MM100( 44 ),    MM2MM100( 62 ),     "ISOB9",  NULL },
149     { MM2MM100( 31 ),    MM2MM100( 44 ),     "ISOB10", NULL },
150     { MM2MM100( 458 ),   MM2MM100( 648 ),    "EnvC2",  "C2" },
151     { MM2MM100( 81 ),    MM2MM100( 114 ),    "EnvC7",  "C7" },
152     { MM2MM100( 57 ),    MM2MM100( 81 ),     "EnvC8",  "C8" },
153     { IN2MM100( 9 ),     IN2MM100( 12 ),     "ARCHA",  NULL },
154     { IN2MM100( 12 ),    IN2MM100( 18 ),     "ARCHB",  NULL },
155     { IN2MM100( 18 ),    IN2MM100( 24 ),     "ARCHC",  NULL },
156     { IN2MM100( 24 ),    IN2MM100( 36 ),     "ARCHD",  NULL },
157     { IN2MM100( 36 ),    IN2MM100( 48 ),     "ARCHE",  NULL }
158 };
159 
160 static const size_t nTabSize = sizeof(aDinTab) / sizeof(aDinTab[0]);
161 
162 #define MAXSLOPPY 21
163 
164 bool PaperInfo::doSloppyFit()
165 {
166     if (m_eType != PAPER_USER)
167         return true;
168 
169     for ( size_t i = 0; i < nTabSize; ++i )
170     {
171         if (i == PAPER_USER) continue;
172 
173         long lDiffW = labs(aDinTab[i].m_nWidth - m_nPaperWidth);
174         long lDiffH = labs(aDinTab[i].m_nHeight - m_nPaperHeight);
175 
176         if ( lDiffW < MAXSLOPPY && lDiffH < MAXSLOPPY )
177         {
178             m_nPaperWidth = aDinTab[i].m_nWidth;
179             m_nPaperHeight = aDinTab[i].m_nHeight;
180             m_eType = (Paper)i;
181             return true;
182         }
183     }
184 
185     return false;
186 }
187 
188 bool PaperInfo::sloppyEqual(const PaperInfo &rOther) const
189 {
190     return
191     (
192       (labs(m_nPaperWidth - rOther.m_nPaperWidth) < MAXSLOPPY) &&
193       (labs(m_nPaperHeight - rOther.m_nPaperHeight) < MAXSLOPPY)
194     );
195 }
196 
197 long PaperInfo::sloppyFitPageDimension(long nDimension)
198 {
199     for ( size_t i = 0; i < nTabSize; ++i )
200     {
201         if (i == PAPER_USER) continue;
202         long lDiff;
203 
204         lDiff = labs(aDinTab[i].m_nWidth - nDimension);
205         if ( lDiff < MAXSLOPPY )
206             return aDinTab[i].m_nWidth;
207 
208         lDiff = labs(aDinTab[i].m_nHeight - nDimension);
209         if ( lDiff < MAXSLOPPY )
210             return aDinTab[i].m_nHeight;
211     }
212     return nDimension;
213 }
214 
215 PaperInfo PaperInfo::getSystemDefaultPaper()
216 {
217     using ::com::sun::star::uno::Reference;
218     using ::com::sun::star::lang::XMultiServiceFactory;
219     using ::com::sun::star::uno::UNO_QUERY_THROW;
220     using ::com::sun::star::uno::Sequence;
221     using ::com::sun::star::uno::Any;
222     using ::com::sun::star::container::XNameAccess;
223     using ::com::sun::star::uno::Exception;
224 #   define CREATE_OUSTRING( ascii ) \
225         rtl::OUString::intern( RTL_CONSTASCII_USTRINGPARAM( ascii ) )
226 
227     rtl::OUString aLocaleStr;
228 
229     Reference< XMultiServiceFactory > xFactory = ::comphelper::getProcessServiceFactory();
230     Reference< XMultiServiceFactory > xConfigProv(
231         xFactory->createInstance( CREATE_OUSTRING( "com.sun.star.configuration.ConfigurationProvider" ) ),
232         UNO_QUERY_THROW );
233 
234     Sequence< Any > aArgs( 1 );
235     aArgs[ 0 ] <<= CREATE_OUSTRING( "org.openoffice.Setup/L10N/" );
236     Reference< XNameAccess > xConfigNA( xConfigProv->createInstanceWithArguments(
237         CREATE_OUSTRING( "com.sun.star.configuration.ConfigurationAccess" ), aArgs ), UNO_QUERY_THROW );
238     try
239     {
240         // try user-defined locale setting
241         xConfigNA->getByName( CREATE_OUSTRING( "ooSetupSystemLocale" ) ) >>= aLocaleStr;
242     }
243     catch( Exception& ) {}
244 
245 #ifdef UNX
246     // if set to "use system", get papersize from system
247     if (aLocaleStr.getLength() == 0)
248     {
249         static bool bInitialized = false;
250         static PaperInfo aInstance(PAPER_A4);
251 
252         if (bInitialized)
253             return aInstance;
254 
255         // try libpaper
256         // #i78617# workaround missing paperconf command
257         FILE* pPipe = popen( "sh -c paperconf 2>/dev/null", "r" );
258         if( pPipe )
259         {
260             Paper ePaper = PAPER_USER;
261 
262             char aBuffer[ 1024 ];
263             aBuffer[0] = 0;
264             char *pBuffer = fgets( aBuffer, sizeof(aBuffer), pPipe );
265             pclose( pPipe );
266 
267             if (pBuffer && *pBuffer != 0)
268             {
269                 rtl::OString aPaper(pBuffer);
270                 aPaper = aPaper.trim();
271                 static struct { const char *pName; Paper ePaper; } aCustoms [] =
272                 {
273                     { "B0",   PAPER_B0_ISO },
274                     { "B1",   PAPER_B1_ISO },
275                     { "B2",   PAPER_B2_ISO },
276                     { "B3",   PAPER_B3_ISO },
277                     { "B4",   PAPER_B4_ISO },
278                     { "B5",   PAPER_B5_ISO },
279                     { "B6",   PAPER_B6_ISO },
280                     { "B7",   PAPER_B7_ISO },
281                     { "B8",   PAPER_B8_ISO },
282                     { "B9",   PAPER_B9_ISO },
283                     { "B10",  PAPER_B10_ISO },
284                     { "folio", PAPER_FANFOLD_LEGAL_DE },
285                     { "flsa",  PAPER_FANFOLD_LEGAL_DE },
286                     { "flse",  PAPER_FANFOLD_LEGAL_DE }
287                 };
288 
289                 bool bHalve = false;
290 
291                 size_t nExtraTabSize = sizeof(aCustoms) / sizeof(aCustoms[0]);
292                 for (size_t i = 0; i < nExtraTabSize; ++i)
293                 {
294                     if (rtl_str_compareIgnoreAsciiCase(aCustoms[i].pName, aPaper.getStr()) == 0)
295                     {
296                         ePaper = aCustoms[i].ePaper;
297                         break;
298                     }
299                 }
300 
301                 if (ePaper == PAPER_USER)
302                 {
303                     bHalve = !rtl_str_shortenedCompareIgnoreAsciiCase_WithLength(
304                         aPaper.getStr(), aPaper.getLength(),  "half", 4, 4);
305                     if (bHalve)
306                         aPaper = aPaper.copy(4);
307                     ePaper = PaperInfo::fromPSName(aPaper);
308                 }
309 
310                 if (ePaper != PAPER_USER)
311                 {
312                     aInstance = PaperInfo(ePaper);
313                     if (bHalve)
314                         aInstance = PaperInfo(aInstance.getHeight()/2, aInstance.getWidth());
315                     bInitialized = true;
316                     return aInstance;
317                 }
318             }
319         }
320 
321 #if defined(LC_PAPER) && defined(_GNU_SOURCE)
322 
323         union paperword { char *string; int word; };
324 
325         // try LC_PAPER
326         paperword w, h;
327         w.string = nl_langinfo(_NL_PAPER_WIDTH);
328         h.string = nl_langinfo(_NL_PAPER_HEIGHT);
329 
330         //glibc stores sizes as integer mm units
331         w.word *= 100;
332         h.word *= 100;
333 
334         for ( size_t i = 0; i < nTabSize; ++i )
335         {
336             if (i == PAPER_USER) continue;
337 
338             //glibc stores sizes as integer mm units, and so is inaccurate. To
339             //find a standard paper size we calculate the standard paper sizes
340             //into equally inaccurate mm and compare
341             long width = (aDinTab[i].m_nWidth + 50) / 100;
342             long height = (aDinTab[i].m_nHeight + 50) / 100;
343 
344             if (width == w.word/100 && height == h.word/100)
345             {
346                 w.word = aDinTab[i].m_nWidth;
347                 h.word = aDinTab[i].m_nHeight;
348                 break;
349             }
350         }
351 
352         aInstance = PaperInfo(w.word, h.word);
353         bInitialized = true;
354         return aInstance;
355 #endif
356     }
357 #endif
358 
359     try
360     {
361         // if set to "use system", try to get locale from system
362         if( aLocaleStr.getLength() == 0 )
363         {
364             aArgs[ 0 ] <<= CREATE_OUSTRING( "org.openoffice.System/L10N/" );
365             xConfigNA.set( xConfigProv->createInstanceWithArguments(
366                 CREATE_OUSTRING( "com.sun.star.configuration.ConfigurationAccess" ), aArgs ),
367                 UNO_QUERY_THROW );
368             xConfigNA->getByName( CREATE_OUSTRING( "Locale" ) ) >>= aLocaleStr;
369         }
370     }
371     catch( Exception& ) {}
372 
373     if (aLocaleStr.getLength() == 0)
374         aLocaleStr = CREATE_OUSTRING("en-US");
375 
376     // convert locale string to locale struct
377     ::com::sun::star::lang::Locale aSysLocale;
378     sal_Int32 nDashPos = aLocaleStr.indexOf( '-' );
379     if( nDashPos < 0 ) nDashPos = aLocaleStr.getLength();
380     aSysLocale.Language = aLocaleStr.copy( 0, nDashPos );
381     if( nDashPos + 1 < aLocaleStr.getLength() )
382         aSysLocale.Country = aLocaleStr.copy( nDashPos + 1 );
383 
384     return PaperInfo::getDefaultPaperForLocale(aSysLocale);
385 }
386 
387 PaperInfo::PaperInfo(Paper eType) : m_eType(eType)
388 {
389     OSL_ENSURE( sizeof(aDinTab) / sizeof(aDinTab[0]) == NUM_PAPER_ENTRIES,
390             "mismatch between array entries and enum values" );
391 
392     m_nPaperWidth = aDinTab[m_eType].m_nWidth;
393     m_nPaperHeight = aDinTab[m_eType].m_nHeight;
394 }
395 
396 PaperInfo::PaperInfo(long nPaperWidth, long nPaperHeight)
397     : m_eType(PAPER_USER),
398       m_nPaperWidth(nPaperWidth),
399       m_nPaperHeight(nPaperHeight)
400 {
401     for ( size_t i = 0; i < nTabSize; ++i )
402     {
403         if (
404              (nPaperWidth == aDinTab[i].m_nWidth) &&
405              (nPaperHeight == aDinTab[i].m_nHeight)
406            )
407         {
408             m_eType = static_cast<Paper>(i);
409             break;
410         }
411     }
412 }
413 
414 rtl::OString PaperInfo::toPSName(Paper ePaper)
415 {
416     return static_cast<size_t>(ePaper) < nTabSize ?
417         rtl::OString(aDinTab[ePaper].m_pPSName) : rtl::OString();
418 }
419 
420 Paper PaperInfo::fromPSName(const rtl::OString &rName)
421 {
422     if (!rName.getLength())
423         return PAPER_USER;
424 
425     for ( size_t i = 0; i < nTabSize; ++i )
426     {
427         if (aDinTab[i].m_pPSName &&
428           !rtl_str_compareIgnoreAsciiCase(aDinTab[i].m_pPSName, rName.getStr()))
429         {
430             return static_cast<Paper>(i);
431         }
432         else if (aDinTab[i].m_pAltPSName &&
433           !rtl_str_compareIgnoreAsciiCase(aDinTab[i].m_pAltPSName, rName.getStr()))
434         {
435             return static_cast<Paper>(i);
436         }
437     }
438 
439     return PAPER_USER;
440 }
441 
442 //http://wiki.services.openoffice.org/wiki/DefaultPaperSize
443 //http://www.unicode.org/cldr/data/charts/supplemental/territory_language_information.html
444 //http://sourceware.org/git/?p=glibc.git;a=tree;f=localedata/locales
445 //http://en.wikipedia.org/wiki/Paper_size
446 //http://msdn.microsoft.com/en-us/library/cc195164.aspx
447 PaperInfo PaperInfo::getDefaultPaperForLocale(
448     const ::com::sun::star::lang::Locale & rLocale)
449 {
450     Paper eType = PAPER_A4;
451 
452     if (
453         //United States, Letter
454         !rLocale.Country.compareToAscii("US") ||
455         //Puerto Rico:
456         //    http://unicode.org/cldr/trac/ticket/1710
457         //    http://sources.redhat.com/ml/libc-hacker/2001-07/msg00046.html
458         !rLocale.Country.compareToAscii("PR") ||
459         //Canada:
460         //    http://sources.redhat.com/ml/libc-hacker/2001-07/msg00053.html
461         !rLocale.Country.compareToAscii("CA") ||
462         //Venuzuela:
463         //    http://unicode.org/cldr/trac/ticket/1710
464         //    https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00019.html
465         !rLocale.Country.compareToAscii("VE") ||
466         //Chile:
467         //    http://unicode.org/cldr/trac/ticket/1710
468         //    https://www.redhat.com/archives/fedora-devel-list/2008-August/msg00240.html
469         !rLocale.Country.compareToAscii("CL") ||
470         //Mexico:
471         //    http://unicode.org/cldr/trac/ticket/1710
472         //    http://qa.openoffice.org/issues/show_bug.cgi?id=49739
473         !rLocale.Country.compareToAscii("MX") ||
474         //Colombia:
475         //    http://unicode.org/cldr/trac/ticket/1710
476         //    http://qa.openoffice.org/issues/show_bug.cgi?id=69703
477         !rLocale.Country.compareToAscii("CO") ||
478         //Philippines:
479         //    http://unicode.org/cldr/trac/ticket/1710
480         //    http://ubuntuliving.blogspot.com/2008/07/default-paper-size-in-evince.html
481         //    http://www.gov.ph/faqs/driverslicense.asp
482         !rLocale.Country.compareToAscii("PH") ||
483         //Belize:
484         //    http://unicode.org/cldr/trac/ticket/2585
485         //    http://www.belize.gov.bz/ct.asp?xItem=1666&ctNode=486&mp=27
486         !rLocale.Country.compareToAscii("BZ") ||
487         //Costa Rica:
488         //    http://unicode.org/cldr/trac/ticket/2585
489         //    http://sources.redhat.com/bugzilla/show_bug.cgi?id=11258
490         !rLocale.Country.compareToAscii("CR") ||
491         //Guatemala:
492         //    http://unicode.org/cldr/trac/ticket/2585
493         //    http://sources.redhat.com/bugzilla/show_bug.cgi?id=10936
494         !rLocale.Country.compareToAscii("GT") ||
495         //Nicaragua:
496         //    http://unicode.org/cldr/trac/ticket/2585
497         !rLocale.Country.compareToAscii("NI") ||
498         //Panama:
499         //    http://unicode.org/cldr/trac/ticket/2585
500         //    http://www.minsa.gob.pa/minsa/tl_files/documents/baner_informativo/INSTRUMENTO%20DE%20INVESTIGACION%20DE%20RAAV%202009.pdf
501         !rLocale.Country.compareToAscii("PA") ||
502         //El Salvador:
503         //    http://unicode.org/cldr/trac/ticket/2585
504         //    http://www.tse.gob.sv
505         !rLocale.Country.compareToAscii("SV")
506        )
507     {
508         eType = PAPER_LETTER;
509     }
510 
511     return eType;
512 }
513 
514 /* vi:set tabstop=4 shiftwidth=4 expandtab: */
515