[Libreoffice-commits] core.git: 2 commits - sw/source vcl/source

Caolán McNamara caolanm at redhat.com
Fri Oct 27 07:57:50 UTC 2017


 sw/source/core/draw/dflyobj.cxx |    6 +++---
 vcl/source/window/builder.cxx   |   11 +++++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

New commits:
commit e027d2956834a716b400a32dfdb4b0adfaeaa2f6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 26 18:27:48 2017 +0100

    coverity#1420315 Unchecked dynamic_cast
    
    Change-Id: Ie522a0691ce269a4cc090057ddb54d8d0b1fa5e6
    Reviewed-on: https://gerrit.libreoffice.org/43918
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx
index 1acaa2bb4605..06319ff4d7f3 100644
--- a/sw/source/core/draw/dflyobj.cxx
+++ b/sw/source/core/draw/dflyobj.cxx
@@ -395,13 +395,13 @@ void SwVirtFlyDrawObj::Rotate(const Point& rRef, long nAngle, double sn, double
             nAngle += 3600;
         }
 
-        if(0 != nAngle)
+        SwWrtShell *pShForAngle = nAngle ? dynamic_cast<SwWrtShell*>(GetFlyFrame()->getRootFrame()->GetCurrShell()) : nullptr;
+        if (pShForAngle)
         {
             // RotGrfFlyFrame: Add transformation to placeholder object
             Size aSize;
             const sal_uInt16 nOldRot(SwVirtFlyDrawObj::getPossibleRotationFromFraphicFrame(aSize));
-            SwWrtShell *pSh = dynamic_cast<SwWrtShell*>( GetFlyFrame()->getRootFrame()->GetCurrShell() );
-            SwFlyFrameAttrMgr aMgr(false, pSh, Frmmgr_Type::NONE);
+            SwFlyFrameAttrMgr aMgr(false, pShForAngle, Frmmgr_Type::NONE);
 
             aMgr.SetRotation(nOldRot, (nOldRot + static_cast<sal_uInt16>(nAngle)) % 3600, aSize);
         }
commit 1b87cdadb88da0ece66c2da1a06c37420e45111c
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Oct 26 14:13:29 2017 +0100

    support stock text in checkboxes and radiobuttons
    
    Change-Id: I03b2e125736b7f8a7127174a7a837760f76f8249
    Reviewed-on: https://gerrit.libreoffice.org/43893
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index e8ab874696c0..9d1fedeebdf5 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1263,6 +1263,11 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
         VclPtr<RadioButton> xButton = VclPtr<RadioButton>::Create(pParent, nBits);
         xButton->SetImageAlign(ImageAlign::Left); //default to left
         xWindow = xButton;
+
+        if (::extractStock(rMap))
+        {
+            xWindow->SetText(getStockText(extractLabel(rMap)));
+        }
     }
     else if (name == "GtkCheckButton")
     {
@@ -1280,7 +1285,13 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
         if (bIsTriState)
             xCheckBox->SetState(TRISTATE_INDET);
         xCheckBox->SetImageAlign(ImageAlign::Left); //default to left
+
         xWindow = xCheckBox;
+
+        if (::extractStock(rMap))
+        {
+            xWindow->SetText(getStockText(extractLabel(rMap)));
+        }
     }
     else if (name == "GtkSpinButton")
     {


More information about the Libreoffice-commits mailing list