[Libreoffice-commits] core.git: drawinglayer/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Thu Sep 20 11:58:53 UTC 2018


 drawinglayer/source/tools/emfphelperdata.cxx |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 0185dfc5ece111e2755afed729f2f2c00fe49114
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 20 09:39:26 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 20 13:58:24 2018 +0200

    ofz#10526 check with dynamic_cast its really a EMFPStringFormat
    
    Change-Id: Ifbe81b851b17858a915105c102af6f4d8f2c81fa
    Reviewed-on: https://gerrit.libreoffice.org/60798
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/drawinglayer/source/tools/emfphelperdata.cxx b/drawinglayer/source/tools/emfphelperdata.cxx
index 72674e6c4a1a..c7ccf3a67ba6 100644
--- a/drawinglayer/source/tools/emfphelperdata.cxx
+++ b/drawinglayer/source/tools/emfphelperdata.cxx
@@ -1310,7 +1310,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)
@@ -1341,7 +1341,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)
                                 {


More information about the Libreoffice-commits mailing list