diff options
author | Caolán McNamara <caolanm@redhat.com> | 2013-01-15 16:29:47 +0000 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-03-04 16:58:31 +0100 |
commit | 8a9ac1dc14ee5a9a686a68e628fdcfc26e00ac1f (patch) | |
tree | 70a11a8b0be8c9b078a83f50c3b84317aade1f8e /svtools | |
parent | 10e5ede84b02342a1f47dad68ba9a8e857a1b98d (diff) |
Resolves: fdo#37449 apparent access into empty codepage bitset
Change-Id: I2efc3ea10cd4313eaa1894fdfbffd113a125e2ba
(cherry picked from commit 5cd7c8906150b94c224ab9bc9f850684198c7f04)
Reviewed-on: https://gerrit.libreoffice.org/1703
Reviewed-by: Miklos Vajna <vmiklos@suse.cz>
Tested-by: Miklos Vajna <vmiklos@suse.cz>
Diffstat (limited to 'svtools')
-rw-r--r-- | svtools/source/misc/sampletext.cxx | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx index cf07a2a33267..ff74333ba32b 100644 --- a/svtools/source/misc/sampletext.cxx +++ b/svtools/source/misc/sampletext.cxx @@ -630,6 +630,11 @@ namespace #if OSL_DEBUG_LEVEL > 2 void lcl_dump_unicode_coverage(const boost::dynamic_bitset<sal_uInt32> &rIn) { + if (rIn.none()) + { + fprintf(stderr, "<NONE>\n"); + return; + } if (rIn[vcl::UnicodeCoverage::BASIC_LATIN]) fprintf(stderr, "BASIC_LATIN\n"); if (rIn[vcl::UnicodeCoverage::LATIN_1_SUPPLEMENT]) @@ -890,6 +895,11 @@ namespace void lcl_dump_codepage_coverage(const boost::dynamic_bitset<sal_uInt32> &rIn) { + if (rIn.none()) + { + fprintf(stderr, "<NONE>\n"); + return; + } if (rIn[vcl::CodePageCoverage::CP1252]) fprintf(stderr, "CP1252\n"); if (rIn[vcl::CodePageCoverage::CP1250]) @@ -1061,7 +1071,7 @@ namespace aMasked.set(vcl::UnicodeCoverage::PHAGS_PA, false); //So, possibly a CJK font - if (!aMasked.count()) + if (!aMasked.count() && !rFontCapabilities.maCodePageRange.empty()) { boost::dynamic_bitset<sal_uInt32> aCJKCodePageMask(vcl::CodePageCoverage::MAX_CP_ENUM); aCJKCodePageMask.set(vcl::CodePageCoverage::CP932); @@ -1513,8 +1523,7 @@ rtl::OUString makeRepresentativeTextForFont(sal_Int16 nScriptType, const Font &r if (nScriptType != com::sun::star::i18n::ScriptType::ASIAN) { aFontCapabilities.maUnicodeRange &= getCJKMask(); - aFontCapabilities.maCodePageRange = - boost::dynamic_bitset<sal_uInt32>(aFontCapabilities.maCodePageRange.size()); + aFontCapabilities.maCodePageRange.clear(); } if (nScriptType != com::sun::star::i18n::ScriptType::LATIN) aFontCapabilities.maUnicodeRange &= getLatinMask(); |