From 3869e10a30a22a8cf47986d4216d9edd8e501c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Wed, 23 Nov 2011 17:22:57 +0000 Subject: [PATCH] for mixed script mode use sample latin text --- svtools/source/misc/sampletext.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx index 7c2be7b226f6..8ea02956d90c 100644 --- a/svtools/source/misc/sampletext.cxx +++ b/svtools/source/misc/sampletext.cxx @@ -425,6 +425,9 @@ rtl::OUString makeShortRepresentativeTextForScript(UScriptCode eScript) sSampleText = rtl::OUString(aTale, SAL_N_ELEMENTS(aTale)); break; } + case USCRIPT_LATIN: + sSampleText = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Lorem ipsum")); + break; default: break; } @@ -1010,17 +1013,11 @@ namespace return aMask; } - boost::dynamic_bitset getGenericMask() - { - static boost::dynamic_bitset aMask(getWeakMask() & getCommonLatnSubsetMask()); - return aMask; - } - UScriptCode getScript(const vcl::FontCapabilities &rFontCapabilities) { using vcl::UnicodeCoverage::UnicodeCoverageEnum; - boost::dynamic_bitset aMasked = rFontCapabilities.maUnicodeRange & getGenericMask(); + boost::dynamic_bitset aMasked = rFontCapabilities.maUnicodeRange & getWeakMask(); if (aMasked.count() == 1) return otCoverageToScript(static_cast(aMasked.find_first())); @@ -1160,7 +1157,7 @@ rtl::OUString makeShortRepresentativeTextForSelectedFont(OutputDevice &rDevice) lcl_dump_codepage_coverage(aFontCapabilities.maCodePageRange); #endif - aFontCapabilities.maUnicodeRange &= getGenericMask(); + aFontCapabilities.maUnicodeRange &= getCommonLatnSubsetMask(); //If this font is probably tuned to display a single non-Latin //script and the font name is itself in Latin, then show a small @@ -1551,6 +1548,8 @@ rtl::OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const Font &r sRet = makeRepresentativeTextForScript(USCRIPT_ARABIC); } } + else if (nScriptType == com::sun::star::i18n::ScriptType::LATIN) + sRet = makeRepresentativeTextForScript(USCRIPT_LATIN); } }