[Libreoffice-commits] core.git: include/svx svx/source

Caolán McNamara caolanm at redhat.com
Thu Sep 10 09:47:24 PDT 2015


 include/svx/sidebar/LinePropertyPanelBase.hxx     |   16 ++++++------
 svx/source/sidebar/line/LinePropertyPanel.cxx     |   28 +++++++---------------
 svx/source/sidebar/line/LinePropertyPanelBase.cxx |   24 +++++++++---------
 3 files changed, 30 insertions(+), 38 deletions(-)

New commits:
commit afe53855a221a3c767e8eb06adfc3d1090d13bfb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 10 16:50:28 2015 +0100

    fix crash on rightclicking image in tdf#93675 and pressing esc
    
    SfxBindings::UpdateControllers_Impl in
    sfx2/source/control/bindings.cxx has an awesome
    reinterpret_cast<SfxPoolItem *>(-1)
    so the unconditional dynamic_casts introduced during the rework of
    
    commit fee180f13d48c1fa97a3ecde4b2067e5b0f13fc2
    Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Date:   Tue Jul 28 18:52:30 2015 +0200
    
        split the line width panel into two pieces
    
    explode and die
    
    Change-Id: Ic99b5e515bb530b74461155b7e71b7e8814666b2

diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
index a5f4a99..8db5b44 100644
--- a/include/svx/sidebar/LinePropertyPanelBase.hxx
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -101,14 +101,14 @@ protected:
     virtual void setLineCap(const XLineCapItem* pItem) = 0;
 
 
-    void updateLineStyle(bool bDisabled, bool bSetOrDefault, const XLineStyleItem* pItem);
-    void updateLineDash(bool bDisabled, bool bSetOrDefault, const XLineDashItem* pItem);
-    void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const XLineTransparenceItem* pItem);
-    void updateLineWidth(bool bDisabled, bool bSetOrDefault, const XLineWidthItem* pItem);
-    void updateLineStart(bool bDisabled, bool bSetOrDefault, const XLineStartItem* pItem);
-    void updateLineEnd(bool bDisabled, bool bSetOrDefault, const XLineEndItem* pItem);
-    void updateLineJoint(bool bDisabled, bool bSetOrDefault, const XLineJointItem* pItem);
-    void updateLineCap(bool bDisabled, bool bSetOrDefault, const XLineCapItem* pItem);
+    void updateLineStyle(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+    void updateLineDash(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+    void updateLineTransparence(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+    void updateLineWidth(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+    void updateLineStart(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+    void updateLineEnd(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+    void updateLineJoint(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
+    void updateLineCap(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem);
 
     void FillLineEndList();
     void FillLineStyleList();
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 616cf5a..2a5e134 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -131,38 +131,32 @@ void LinePropertyPanel::NotifyItemUpdate(
     {
         case SID_ATTR_LINE_DASH:
         {
-            const XLineDashItem* pItem = dynamic_cast<const XLineDashItem*>(pState);
-            updateLineDash(bDisabled, bSetOrDefault, pItem);
+            updateLineDash(bDisabled, bSetOrDefault, pState);
+            break;
         }
-        break;
         case SID_ATTR_LINE_STYLE:
         {
-            const XLineStyleItem* pItem = dynamic_cast<const XLineStyleItem*>(pState);
-            updateLineStyle(bDisabled, bSetOrDefault, pItem);
+            updateLineStyle(bDisabled, bSetOrDefault, pState);
+            break;
         }
-        break;
         case SID_ATTR_LINE_TRANSPARENCE:
         {
-            const XLineTransparenceItem* pItem = dynamic_cast<const XLineTransparenceItem*>(pState);
-            updateLineTransparence(bDisabled, bSetOrDefault, pItem);
+            updateLineTransparence(bDisabled, bSetOrDefault, pState);
             break;
         }
         case SID_ATTR_LINE_WIDTH:
         {
-            const XLineWidthItem* pItem = dynamic_cast<const XLineWidthItem*>(pState);
-            updateLineWidth(bDisabled, bSetOrDefault, pItem);
+            updateLineWidth(bDisabled, bSetOrDefault, pState);
             break;
         }
         case SID_ATTR_LINE_START:
         {
-            const XLineStartItem* pItem = dynamic_cast<const XLineStartItem*>(pState);
-            updateLineStart(bDisabled, bSetOrDefault, pItem);
+            updateLineStart(bDisabled, bSetOrDefault, pState);
             break;
         }
         case SID_ATTR_LINE_END:
         {
-            const XLineEndItem* pItem = dynamic_cast<const XLineEndItem*>(pState);
-            updateLineEnd(bDisabled, bSetOrDefault, pItem);
+            updateLineEnd(bDisabled, bSetOrDefault, pState);
             break;
         }
         case SID_LINEEND_LIST:
@@ -180,14 +174,12 @@ void LinePropertyPanel::NotifyItemUpdate(
         }
         case SID_ATTR_LINE_JOINT:
         {
-            const XLineJointItem* pItem = dynamic_cast<const XLineJointItem*>(pState);
-            updateLineJoint(bDisabled, bSetOrDefault, pItem);
+            updateLineJoint(bDisabled, bSetOrDefault, pState);
             break;
         }
         case SID_ATTR_LINE_CAP:
         {
-            const XLineCapItem* pItem = dynamic_cast<const XLineCapItem*>(pState);
-            updateLineCap(bDisabled, bSetOrDefault, pItem);
+            updateLineCap(bDisabled, bSetOrDefault, pState);
             break;
         }
     }
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index b875cce..59098a9 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -271,7 +271,7 @@ void LinePropertyPanelBase::DataChanged(const DataChangedEvent& /*rEvent*/)
 {
 }
 
-void LinePropertyPanelBase::updateLineStyle(bool bDisabled, bool bSetOrDefault, const XLineStyleItem* pItem)
+void LinePropertyPanelBase::updateLineStyle(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem)
 {
     if(bDisabled)
     {
@@ -299,7 +299,7 @@ void LinePropertyPanelBase::updateLineStyle(bool bDisabled, bool bSetOrDefault,
     SelectLineStyle();
 }
 
-void LinePropertyPanelBase::updateLineDash(bool bDisabled, bool bSetOrDefault, const XLineDashItem* pItem)
+void LinePropertyPanelBase::updateLineDash(bool bDisabled, bool bSetOrDefault, const SfxPoolItem* pItem)
 {
     if(bDisabled)
     {
@@ -328,7 +328,7 @@ void LinePropertyPanelBase::updateLineDash(bool bDisabled, bool bSetOrDefault, c
 }
 
 void LinePropertyPanelBase::updateLineTransparence(bool bDisabled, bool bSetOrDefault,
-        const XLineTransparenceItem* pItem)
+        const SfxPoolItem* pState)
 {
     if(bDisabled)
     {
@@ -343,7 +343,7 @@ void LinePropertyPanelBase::updateLineTransparence(bool bDisabled, bool bSetOrDe
 
     if(bSetOrDefault)
     {
-        if(pItem)
+        if (const XLineTransparenceItem* pItem = dynamic_cast<const XLineTransparenceItem*>(pState))
         {
             mnTrans = pItem->GetValue();
             mpMFTransparent->SetValue(mnTrans);
@@ -356,7 +356,7 @@ void LinePropertyPanelBase::updateLineTransparence(bool bDisabled, bool bSetOrDe
 }
 
 void LinePropertyPanelBase::updateLineWidth(bool bDisabled, bool bSetOrDefault,
-        const XLineWidthItem* pItem)
+        const SfxPoolItem* pState)
 {
     if(bDisabled)
     {
@@ -371,7 +371,7 @@ void LinePropertyPanelBase::updateLineWidth(bool bDisabled, bool bSetOrDefault,
 
     if(bSetOrDefault)
     {
-        if(pItem)
+        if (const XLineWidthItem* pItem = dynamic_cast<const XLineWidthItem*>(pState))
         {
             mnWidthCoreValue = pItem->GetValue();
             mbWidthValuable = true;
@@ -385,7 +385,7 @@ void LinePropertyPanelBase::updateLineWidth(bool bDisabled, bool bSetOrDefault,
 }
 
 void LinePropertyPanelBase::updateLineStart(bool bDisabled, bool bSetOrDefault,
-        const XLineStartItem* pItem)
+        const SfxPoolItem* pItem)
 {
     if(bDisabled)
     {
@@ -413,7 +413,7 @@ void LinePropertyPanelBase::updateLineStart(bool bDisabled, bool bSetOrDefault,
 }
 
 void LinePropertyPanelBase::updateLineEnd(bool bDisabled, bool bSetOrDefault,
-        const XLineEndItem* pItem)
+        const SfxPoolItem* pItem)
 {
     if(bDisabled)
     {
@@ -441,7 +441,7 @@ void LinePropertyPanelBase::updateLineEnd(bool bDisabled, bool bSetOrDefault,
 }
 
 void LinePropertyPanelBase::updateLineJoint(bool bDisabled, bool bSetOrDefault,
-        const XLineJointItem* pItem)
+        const SfxPoolItem* pState)
 {
     if(bDisabled)
     {
@@ -456,7 +456,7 @@ void LinePropertyPanelBase::updateLineJoint(bool bDisabled, bool bSetOrDefault,
 
     if(bSetOrDefault)
     {
-        if(pItem)
+        if (const XLineJointItem* pItem = dynamic_cast<const XLineJointItem*>(pState))
         {
             sal_Int32 nEntryPos(0);
 
@@ -500,7 +500,7 @@ void LinePropertyPanelBase::updateLineJoint(bool bDisabled, bool bSetOrDefault,
 }
 
 void LinePropertyPanelBase::updateLineCap(bool bDisabled, bool bSetOrDefault,
-        const XLineCapItem* pItem)
+        const SfxPoolItem* pState)
 {
     if(bDisabled)
     {
@@ -515,7 +515,7 @@ void LinePropertyPanelBase::updateLineCap(bool bDisabled, bool bSetOrDefault,
 
     if(bSetOrDefault)
     {
-        if(pItem)
+        if (const XLineCapItem* pItem = dynamic_cast<const XLineCapItem*>(pState))
         {
             sal_Int32 nEntryPos(0);
 


More information about the Libreoffice-commits mailing list