diff options
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/source/gdi/CommonSalLayout.cxx | 5 | ||||
-rw-r--r-- | vcl/source/outdev/font.cxx | 3 | ||||
-rw-r--r-- | vcl/source/text/ImplLayoutArgs.cxx | 3 |
3 files changed, 3 insertions, 8 deletions
diff --git a/vcl/source/gdi/CommonSalLayout.cxx b/vcl/source/gdi/CommonSalLayout.cxx index e2b9e79bfba4..0007e3f355d1 100644 --- a/vcl/source/gdi/CommonSalLayout.cxx +++ b/vcl/source/gdi/CommonSalLayout.cxx @@ -165,11 +165,6 @@ void GenericSalLayout::SetNeedFallback(vcl::text::ImplLayoutArgs& rArgs, sal_Int if (nCharPos < 0 || mbFuzzing) return; - // Do not try to find fallback for null character, as that is pointless and it would break - // searching for it (the broken ofz34898-1.doc document triggers this). - if (rArgs.mrStr[nCharPos] == '\0') - return; - using namespace ::com::sun::star; if (!mxBreak.is()) diff --git a/vcl/source/outdev/font.cxx b/vcl/source/outdev/font.cxx index de3a0726c72c..ba487b0198c3 100644 --- a/vcl/source/outdev/font.cxx +++ b/vcl/source/outdev/font.cxx @@ -1208,10 +1208,7 @@ std::unique_ptr<SalLayout> OutputDevice::ImplGlyphFallbackLayout( std::unique_pt bool bRTL = false; OUStringBuffer aMissingCodeBuf(512); while (rLayoutArgs.GetNextPos( &nCharPos, &bRTL)) - { - assert(rLayoutArgs.mrStr[nCharPos] != '\0'); aMissingCodeBuf.append(rLayoutArgs.mrStr[nCharPos]); - } rLayoutArgs.ResetPos(); OUString aMissingCodes = aMissingCodeBuf.makeStringAndClear(); diff --git a/vcl/source/text/ImplLayoutArgs.cxx b/vcl/source/text/ImplLayoutArgs.cxx index 55e01d2737b8..0638473f4168 100644 --- a/vcl/source/text/ImplLayoutArgs.cxx +++ b/vcl/source/text/ImplLayoutArgs.cxx @@ -141,6 +141,9 @@ static bool IsControlChar(sal_UCS4 cChar) // byte order markers and invalid unicode if ((cChar == 0xFEFF) || (cChar == 0xFFFE) || (cChar == 0xFFFF)) return true; + // drop null character too, broken documents may contain it (ofz34898-1.doc) + if (cChar == 0) + return true; return false; } |