[Libreoffice-commits] core.git: 2 commits - cppcanvas/source
Caolán McNamara
caolanm at redhat.com
Thu Apr 27 15:59:05 UTC 2017
cppcanvas/source/mtfrenderer/emfplus.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit 36977f7404c8c3255792dc9995d213510a2cdb11
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Apr 27 16:58:05 2017 +0100
crashtesting: more crashing on exporting fdo31814-3.emf to odg
Change-Id: I4cb359b426daed6c5d83c4ed4b85fe87de9d739a
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index a4411c22bcfe..cdead7a030ff 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1280,9 +1280,12 @@ namespace cppcanvas
EMFPStringFormat *stringFormat = static_cast< EMFPStringFormat* >( aObjects[ formatId & 0xff ] );
css::rendering::FontRequest aFontRequest;
- LanguageTag aLanguageTag( static_cast< LanguageType >( stringFormat->language ) );
- aFontRequest.Locale = aLanguageTag.getLocale( false );
- SAL_INFO("cppcanvas.emf", "EMF+\t\t Font locale, Country:" << aLanguageTag.getCountry() <<" Language:" << aLanguageTag.getLanguage() );
+ if (stringFormat)
+ {
+ LanguageTag aLanguageTag( static_cast< LanguageType >( stringFormat->language ) );
+ aFontRequest.Locale = aLanguageTag.getLocale( false );
+ SAL_INFO("cppcanvas.emf", "EMF+\t\t Font locale, Country:" << aLanguageTag.getCountry() <<" Language:" << aLanguageTag.getLanguage() );
+ }
SAL_INFO("cppcanvas.emf", "EMF+\t\t TODO Use all string formatting attributes during drawing");
double cellSize = setFont (aFontRequest, flags & 0xff, rFactoryParms, rState);
commit c63a90453b59352950bbccce93a210964ccb7c14
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Apr 27 16:55:05 2017 +0100
crashtesting: crash on exporting fdo31814-3.emf to odg
since
commit f9af0abce2c266a53f536a207a62bc691213f6a0
Date: Sat Apr 15 01:44:46 2017 +0200
EMF+ Add initial support for EmfPlusStringFormat Object
The EmfPlusStringFormat object specifies text layout, display manipulations,
and language identification. With this commit the support for font language
and country was added. Also Bold style is applied,
for strings which needs that.
elsewhere the pattern is to mask with 0xff to restrict to the hardcoded
256 size, so do that here too
Change-Id: Iba5bcc3fabe836c963b3eef47a864e87425675c7
diff --git a/cppcanvas/source/mtfrenderer/emfplus.cxx b/cppcanvas/source/mtfrenderer/emfplus.cxx
index bd13102eb6a6..a4411c22bcfe 100644
--- a/cppcanvas/source/mtfrenderer/emfplus.cxx
+++ b/cppcanvas/source/mtfrenderer/emfplus.cxx
@@ -1278,7 +1278,7 @@ namespace cppcanvas
OUString text = read_uInt16s_ToOUString(rMF, stringLength);
- EMFPStringFormat *stringFormat = static_cast< EMFPStringFormat* >( aObjects[ formatId ] );
+ EMFPStringFormat *stringFormat = static_cast< EMFPStringFormat* >( aObjects[ formatId & 0xff ] );
css::rendering::FontRequest aFontRequest;
LanguageTag aLanguageTag( static_cast< LanguageType >( stringFormat->language ) );
aFontRequest.Locale = aLanguageTag.getLocale( false );
More information about the Libreoffice-commits
mailing list