[Libreoffice-commits] core.git: 4 commits - writerfilter/source

Miklos Vajna vmiklos at collabora.co.uk
Sat Mar 29 13:26:39 PDT 2014


 writerfilter/source/dmapper/DomainMapper_Impl.cxx      |    2 ++
 writerfilter/source/dmapper/StyleSheetTable.cxx        |    9 ++++++---
 writerfilter/source/dmapper/TablePropertiesHandler.cxx |    2 +-
 3 files changed, 9 insertions(+), 4 deletions(-)

New commits:
commit 8736c5222a8e83a1310713a92492e63198749467
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Mar 29 21:13:21 2014 +0100

    coverity#1194911 Unchecked dynamic_cast
    
    Change-Id: I1e7f4bcd8f54219d86ad7a003469d5a486090f47

diff --git a/writerfilter/source/dmapper/TablePropertiesHandler.cxx b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
index 7777ed9..e5e4172 100644
--- a/writerfilter/source/dmapper/TablePropertiesHandler.cxx
+++ b/writerfilter/source/dmapper/TablePropertiesHandler.cxx
@@ -98,7 +98,7 @@ namespace dmapper {
 
                     DomainMapperTableManager* pManager = dynamic_cast<DomainMapperTableManager*>(m_pTableManager);
                     // In case any of the cells has the btLr cell direction, then an explicit minimal size will just hide the whole row, don't do that.
-                    if (pMeasureHandler->GetRowHeightSizeType() != text::SizeType::MIN || !pManager->HasBtlrCell())
+                    if (pMeasureHandler->GetRowHeightSizeType() != text::SizeType::MIN || !pManager || !pManager->HasBtlrCell())
                     {
                         // In case a cell already wanted fixed size, we should not overwrite it here.
                         if (!pManager || !pManager->IsRowSizeTypeInserted())
commit f19318697c9b15a464285d5dec2a8f923e955f24
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Mar 29 21:09:09 2014 +0100

    coverity#705071 Unchecked dynamic_cast
    
    Change-Id: Ic7b120daf4d5456ed882ffa3724c53d1246e7b4d

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index ef56822..955fc3e 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -675,7 +675,8 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
                 uno::makeAny( ConversionHelper::convertTableJustification( nIntValue )));
         break;
         case NS_ooxml::LN_CT_TrPrBase_jc:     //table alignment - row properties!
-                dynamic_cast< StyleSheetPropertyMap* >( m_pImpl->m_pCurrentEntry->pProperties.get() )->SetCT_TrPrBase_jc(nIntValue);
+            if (StyleSheetPropertyMap* pMap = dynamic_cast< StyleSheetPropertyMap* >( m_pImpl->m_pCurrentEntry->pProperties.get() ))
+                pMap->SetCT_TrPrBase_jc(nIntValue);
         break;
         case NS_ooxml::LN_CT_TblPrBase_tblBorders: //table borders, might be defined in table style
         {
commit e50a0b6b1fd84694db1768a768570cdb8c614513
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Mar 29 21:06:38 2014 +0100

    coverity#705070 Unchecked dynamic_cast
    
    Change-Id: Ibb4cf1e8bd002d4c36030f5567e1a16f86ea1668

diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 42dd33e..ef56822 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -465,10 +465,12 @@ void StyleSheetTable::lcl_attribute(Id Name, Value & val)
             }
         break;
         case NS_ooxml::LN_CT_TblWidth_w:
-            dynamic_cast< StyleSheetPropertyMap* >( m_pImpl->m_pCurrentEntry->pProperties.get() )->SetCT_TblWidth_w( nIntValue );
+            if (StyleSheetPropertyMap* pMap = dynamic_cast< StyleSheetPropertyMap* >( m_pImpl->m_pCurrentEntry->pProperties.get() ))
+                pMap->SetCT_TblWidth_w( nIntValue );
         break;
         case NS_ooxml::LN_CT_TblWidth_type:
-            dynamic_cast< StyleSheetPropertyMap* >( m_pImpl->m_pCurrentEntry->pProperties.get() )->SetCT_TblWidth_type( nIntValue );
+            if (StyleSheetPropertyMap* pMap = dynamic_cast< StyleSheetPropertyMap* >( m_pImpl->m_pCurrentEntry->pProperties.get() ))
+                pMap->SetCT_TblWidth_type( nIntValue );
         break;
         case NS_ooxml::LN_CT_LatentStyles_defQFormat:
             m_pImpl->AppendLatentStyleProperty("defQFormat", val);
commit e9509e54b45fc429a93975917dca2ec343e5f48d
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Mar 29 21:04:27 2014 +0100

    coverity#736004 Unchecked dynamic_cast
    
    Change-Id: Icca4946543409adb0ac6f7bf78915f8ef5b0fa40

diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 0df4a54..2177596 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -746,6 +746,8 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( )
                 pFrameProperties[15].Name = rPropNameSupplier.GetName(PROP_BACK_COLOR_TRANSPARENCY);
 
                 const ParagraphProperties* pStyleProperties = dynamic_cast<const ParagraphProperties*>( pParaStyle->pProperties.get() );
+                if (!pStyleProperties)
+                    return;
                 sal_Int32 nWidth =
                     rAppendContext.pLastParagraphProperties->Getw() > 0 ?
                         rAppendContext.pLastParagraphProperties->Getw() :


More information about the Libreoffice-commits mailing list