summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2013-01-15 16:29:47 +0000
committerNoel Power <noel.power@suse.com>2013-01-16 11:05:28 +0000
commit3d35098b33d08e0105f8093898d833ec367e3949 (patch)
tree7d38b2f9c9f203713f38536b17de11e65624d40f
parent98eff42e9adabc26b128e9ca25b8fd0d909c3f96 (diff)
Resolves: fdo#37449 apparent access into empty codepage bitset
Change-Id: I2efc3ea10cd4313eaa1894fdfbffd113a125e2ba (cherry picked from commit 5cd7c8906150b94c224ab9bc9f850684198c7f04) Reviewed-on: https://gerrit.libreoffice.org/1702 Reviewed-by: Noel Power <noel.power@suse.com> Tested-by: Noel Power <noel.power@suse.com>
-rw-r--r--svtools/source/misc/sampletext.cxx15
1 files changed, 12 insertions, 3 deletions
diff --git a/svtools/source/misc/sampletext.cxx b/svtools/source/misc/sampletext.cxx
index 6b8cc6180968..3c0b173263ba 100644
--- a/svtools/source/misc/sampletext.cxx
+++ b/svtools/source/misc/sampletext.cxx
@@ -634,6 +634,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])
@@ -894,6 +899,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])
@@ -1065,7 +1075,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);
@@ -1517,8 +1527,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();