diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 09:39:26 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-09-20 13:01:09 +0200 |
commit | f133621aeb78a37dc4d9db7a0eb7d0bde4637fb2 (patch) | |
tree | b3bdb50b5e68e9dfe0ad2895125b3c122a8cae3f /drawinglayer | |
parent | 2755bf801ee7105fdaee8221714909f839e2ca78 (diff) |
ofz#10526 check with dynamic_cast its really a EMFPStringFormat
Change-Id: Ifbe81b851b17858a915105c102af6f4d8f2c81fa
Reviewed-on: https://gerrit.libreoffice.org/60799
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Tested-by: Jenkins
Diffstat (limited to 'drawinglayer')
-rw-r--r-- | drawinglayer/source/tools/emfphelperdata.cxx | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx index a5b31b1b4ebe..df96667e0cbf 100644 --- a/drawinglayer/source/tools/emfphelperdata.cxx +++ b/drawinglayer/source/tools/emfphelperdata.cxx @@ -1309,7 +1309,7 @@ namespace emfplushelper const OUString text = read_uInt16s_ToOUString(rMS, stringLength); SAL_INFO("drawinglayer", "EMF+ DrawString string: " << text); // get the stringFormat from the Object table ( this is OPTIONAL and may be nullptr ) - const EMFPStringFormat *stringFormat = static_cast< EMFPStringFormat* >(maEMFPObjects[formatId & 0xff].get()); + const EMFPStringFormat *stringFormat = dynamic_cast<EMFPStringFormat*>(maEMFPObjects[formatId & 0xff].get()); // get the font from the flags const EMFPFont *font = static_cast< EMFPFont* >( maEMFPObjects[flags & 0xff].get() ); if (!font) @@ -1340,7 +1340,7 @@ namespace emfplushelper double stringAlignmentHorizontalOffset = 0.0; if (stringFormat) { - SAL_WARN_IF(stringFormat && stringFormat->DirectionRightToLeft(), "drawinglayer", "EMF+ DrawString Alignment TODO For a right-to-left layout rectangle, the origin should be at the upper right."); + SAL_WARN_IF(stringFormat->DirectionRightToLeft(), "drawinglayer", "EMF+ DrawString Alignment TODO For a right-to-left layout rectangle, the origin should be at the upper right."); if (stringFormat->stringAlignment == StringAlignmentNear) // Alignment is to the left side of the layout rectangle (lx, ly, lw, lh) { |