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

Caolán McNamara caolanm at redhat.com
Sun Mar 2 13:20:30 PST 2014


 svtools/source/contnr/treelistbox.cxx |    7 +++--
 sw/source/filter/ww8/ww8par.cxx       |   42 +++++++++++++++++-----------------
 2 files changed, 26 insertions(+), 23 deletions(-)

New commits:
commit bd1014e245676335c7830f7bcc56afd5adf90fa6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Mar 2 21:04:53 2014 +0000

    coverity#705000 Unchecked dynamic_cast
    
    Change-Id: Iae20a0ab45779483fc501e5ab982e38f38ba21b7
    Reviewed-on: https://gerrit.libreoffice.org/8425
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index dc20084..053134e 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -952,27 +952,29 @@ SdrObject* SwMSDffManager::ProcessObj(SvStream& rSt,
                 if ( ( ( rObjData.nSpFlags & SP_FFLIPV ) || mnFix16Angle || nTextRotationAngle ) && dynamic_cast< SdrObjCustomShape* >( pObj ) )
                 {
                     SdrObjCustomShape* pCustomShape = dynamic_cast< SdrObjCustomShape* >( pObj );
-
-                    double fExtraTextRotation = 0.0;
-                    if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) )
-                    {   // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false
-                        fExtraTextRotation = -mnFix16Angle;
-                    }
-                    if ( rObjData.nSpFlags & SP_FFLIPV )    // sj: in ppt the text is flipped, whereas in word the text
-                    {                                       // remains unchanged, so we have to take back the flipping here
-                        fExtraTextRotation += 18000.0;      // because our core will flip text if the shape is flipped.
-                    }
-                    fExtraTextRotation += nTextRotationAngle;
-                    if ( !::basegfx::fTools::equalZero( fExtraTextRotation ) )
+                    if (pCustomShape)
                     {
-                        fExtraTextRotation /= 100.0;
-                        SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
-                        const OUString sTextRotateAngle( "TextRotateAngle" );
-                        com::sun::star::beans::PropertyValue aPropVal;
-                        aPropVal.Name = sTextRotateAngle;
-                        aPropVal.Value <<= fExtraTextRotation;
-                        aGeometryItem.SetPropertyValue( aPropVal );
-                        pCustomShape->SetMergedItem( aGeometryItem );
+                        double fExtraTextRotation = 0.0;
+                        if ( mnFix16Angle && !( GetPropertyValue( DFF_Prop_FitTextToShape ) & 4 ) )
+                        {   // text is already rotated, we have to take back the object rotation if DFF_Prop_RotateText is false
+                            fExtraTextRotation = -mnFix16Angle;
+                        }
+                        if ( rObjData.nSpFlags & SP_FFLIPV )    // sj: in ppt the text is flipped, whereas in word the text
+                        {                                       // remains unchanged, so we have to take back the flipping here
+                            fExtraTextRotation += 18000.0;      // because our core will flip text if the shape is flipped.
+                        }
+                        fExtraTextRotation += nTextRotationAngle;
+                        if ( !::basegfx::fTools::equalZero( fExtraTextRotation ) )
+                        {
+                            fExtraTextRotation /= 100.0;
+                            SdrCustomShapeGeometryItem aGeometryItem( (SdrCustomShapeGeometryItem&)pCustomShape->GetMergedItem( SDRATTR_CUSTOMSHAPE_GEOMETRY ) );
+                            const OUString sTextRotateAngle( "TextRotateAngle" );
+                            com::sun::star::beans::PropertyValue aPropVal;
+                            aPropVal.Name = sTextRotateAngle;
+                            aPropVal.Value <<= fExtraTextRotation;
+                            aGeometryItem.SetPropertyValue( aPropVal );
+                            pCustomShape->SetMergedItem( aGeometryItem );
+                        }
                     }
                 }
                 else if ( mnFix16Angle )
commit 2aa4b7e1f06d85ffcaecf58b77c0fde0d15845ab
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Sun Mar 2 21:17:26 2014 +0000

    coverity#984421 Unused pointer value
    
    Change-Id: Id44c9c3da6624db63e1f0f95dcaeddcc8b5402d5
    Reviewed-on: https://gerrit.libreoffice.org/8426
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svtools/source/contnr/treelistbox.cxx b/svtools/source/contnr/treelistbox.cxx
index f829cd7..7a13b01 100644
--- a/svtools/source/contnr/treelistbox.cxx
+++ b/svtools/source/contnr/treelistbox.cxx
@@ -3390,13 +3390,14 @@ Rectangle SvTreeListBox::GetFocusRect( SvTreeListEntry* pEntry, long nLine )
         // if SelTab != 0, we have to calculate also
         if( nFocusWidth == -1 || nFirstSelTab )
         {
+            SvLBoxTab* pLastTab = NULL; // default to select whole width
+
             sal_uInt16 nLastTab;
-            SvLBoxTab* pLastTab = GetLastTab(SV_LBOXTAB_SHOW_SELECTION,nLastTab);
+            GetLastTab(SV_LBOXTAB_SHOW_SELECTION,nLastTab);
             nLastTab++;
             if( nLastTab < aTabs.size() ) // is there another one?
                 pLastTab = aTabs[ nLastTab ];
-            else
-                pLastTab = 0;  // select whole width
+
             aSize.Width() = pLastTab ? pLastTab->GetPos() : 0x0fffffff;
             nFocusWidth = (short)aSize.Width();
             if( pTab )


More information about the Libreoffice-commits mailing list