[Libreoffice-commits] core.git: 23 commits - dbaccess/source sc/source slideshow/source starmath/source svtools/source svx/source sw/source
Caolán McNamara
caolanm at redhat.com
Sat Mar 15 13:56:18 PDT 2014
dbaccess/source/core/api/RowSetBase.cxx | 1
sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx | 10 +
sc/source/ui/drawfunc/fusel.cxx | 2
slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx | 4
starmath/source/mathtype.hxx | 56 +++++++-
svtools/source/contnr/fileview.cxx | 4
svx/source/svdraw/svdograf.cxx | 2
svx/source/svdraw/svdoole2.cxx | 2
svx/source/table/tablecontroller.cxx | 2
sw/source/core/crsr/pam.cxx | 2
sw/source/core/doc/docfly.cxx | 3
sw/source/core/layout/flycnt.cxx | 10 -
sw/source/core/layout/pagechg.cxx | 66 +++++-----
sw/source/core/layout/sectfrm.cxx | 8 -
sw/source/core/layout/tabfrm.cxx | 6
sw/source/core/layout/wsfrm.cxx | 4
sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx | 9 -
sw/source/core/uibase/uiview/viewport.cxx | 9 +
sw/source/core/uibase/uno/unotxdoc.cxx | 3
19 files changed, 134 insertions(+), 69 deletions(-)
New commits:
commit edc8ee009943e7fc9a68730b0efb303b019a62d4
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 14:53:41 2014 +0000
coverity#708518 Uninitialized scalar field
Change-Id: I09780a6d3de9ab38fc88b0aa5df8e85b1336df7e
diff --git a/sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx
index 49ae7ba..7efabbc 100644
--- a/sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx
+++ b/sw/source/core/uibase/dialog/SwSpellDialogChildWindow.cxx
@@ -149,10 +149,11 @@ SwSpellDialogChildWindow::SwSpellDialogChildWindow (
Window* _pParent,
sal_uInt16 nId,
SfxBindings* pBindings,
- SfxChildWinInfo* pInfo) :
- svx::SpellDialogChildWindow (
- _pParent, nId, pBindings, pInfo),
- m_pSpellState(new SpellState)
+ SfxChildWinInfo* pInfo)
+ : svx::SpellDialogChildWindow (
+ _pParent, nId, pBindings, pInfo)
+ , m_bIsGrammarCheckingOn(false)
+ , m_pSpellState(new SpellState)
{
OUString aPropName(UPN_IS_GRAMMAR_INTERACTIVE);
SvtLinguConfig().GetProperty( aPropName ) >>= m_bIsGrammarCheckingOn;
commit 9078c7cf7e7969d761ed619ed2ed98dbca6bd1fd
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 14:49:36 2014 +0000
coverity#738913 Uninitialized pointer field
Change-Id: I8832345411d2783c783c3430e55dc1a0c1977204
diff --git a/sw/source/core/uibase/uno/unotxdoc.cxx b/sw/source/core/uibase/uno/unotxdoc.cxx
index 6a6ce86..10fdac8 100644
--- a/sw/source/core/uibase/uno/unotxdoc.cxx
+++ b/sw/source/core/uibase/uno/unotxdoc.cxx
@@ -361,7 +361,7 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell)
pDrawPage(0),
pxXDrawPage(0),
-
+ pBodyText(0),
pxXNumberingRules(0),
pxXFootnotes(0),
pxXFootnoteSettings(0),
@@ -385,6 +385,7 @@ SwXTextDocument::SwXTextDocument(SwDocShell* pShell)
pxLinkTargetSupplier(0),
pxXRedlines(0),
m_pHiddenViewFrame(0),
+ pPropertyHelper(0),
m_pPrintUIOptions( NULL ),
m_pRenderData( NULL ),
// #i117783#
commit f7c818b40fc57736028a3da0d0e62c5bce40c907
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 14:44:00 2014 +0000
coverity#1079297 Uninitialized pointer field
Change-Id: Id65d309ac085f2b3e5fe8fcaf5f48ab254242bfe
diff --git a/starmath/source/mathtype.hxx b/starmath/source/mathtype.hxx
index d4eb71a..20bed43 100644
--- a/starmath/source/mathtype.hxx
+++ b/starmath/source/mathtype.hxx
@@ -81,10 +81,30 @@ public:
Init();
}
- MathType(OUString &rIn,SmNode *pIn) :
- rRet(rIn), pTree(pIn), nHAlign(2), nVAlign(0), nInsertion(0), nDefaultSize(12),
- nLSize(0), nDSize(0), nCurSize(0), nLastSize(0), nSpec(0), bIsSilent(sal_False),
- nTypeFace(0)
+ MathType(OUString &rIn,SmNode *pIn)
+ : nVersion(0)
+ , nPlatform(0)
+ , nProduct(0)
+ , nProdVersion(0)
+ , nProdSubVersion(0)
+ , pS(NULL)
+ , rRet(rIn)
+ , pTree(pIn)
+ , nHAlign(2)
+ , nVAlign(0)
+ , nPendingAttributes(0)
+ , nInsertion(0)
+ , nDefaultSize(12)
+ , nLSize(0)
+ , nDSize(0)
+ , nCurSize(0)
+ , nLastSize(0)
+ , nSpec(0)
+ , bIsSilent(sal_False)
+ , bIsReInterpBrace(sal_False)
+ , nPostSup(0)
+ , nPostlSup(0)
+ , nTypeFace(0)
{
Init();
}
commit a43a0e004c328ba6bb40c03a1f9917f4b4fc7d89
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 14:38:35 2014 +0000
coverity#1079296 Uninitialized pointer field
Change-Id: I56ba87b453e8111a5c54f40eeb52d2998d140ce9
diff --git a/starmath/source/mathtype.hxx b/starmath/source/mathtype.hxx
index 332cd27..d4eb71a 100644
--- a/starmath/source/mathtype.hxx
+++ b/starmath/source/mathtype.hxx
@@ -53,10 +53,30 @@ typedef ::std::set< MathTypeFont, LessMathTypeFont > MathTypeFontSet;
class MathType
{
public:
- MathType(OUString &rIn) :
- rRet(rIn), nHAlign(0), nVAlign(0), nDefaultSize(12),
- nLSize(0), nDSize(0), nCurSize(0), nLastSize(0), bIsSilent(sal_False),
- nTypeFace(0)
+ MathType(OUString &rIn)
+ : nVersion(0)
+ , nPlatform(0)
+ , nProduct(0)
+ , nProdVersion(0)
+ , nProdSubVersion(0)
+ , pS(NULL)
+ , rRet(rIn)
+ , pTree(NULL)
+ , nHAlign(0)
+ , nVAlign(0)
+ , nPendingAttributes(0)
+ , nInsertion(0)
+ , nDefaultSize(12)
+ , nLSize(0)
+ , nDSize(0)
+ , nCurSize(0)
+ , nLastSize(0)
+ , nSpec(0)
+ , bIsSilent(sal_False)
+ , bIsReInterpBrace(sal_False)
+ , nPostSup(0)
+ , nPostlSup(0)
+ , nTypeFace(0)
{
Init();
}
commit 8967b65be87dc3ee19726284394a996128b46cfb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 14:34:19 2014 +0000
coverity#1000861 Uninitialized pointer field
Change-Id: I343ae6fde04e2ad937499909f5b5da221d1d12d5
diff --git a/dbaccess/source/core/api/RowSetBase.cxx b/dbaccess/source/core/api/RowSetBase.cxx
index bef066f..ee45318 100644
--- a/dbaccess/source/core/api/RowSetBase.cxx
+++ b/dbaccess/source/core/api/RowSetBase.cxx
@@ -77,6 +77,7 @@ connectivity::sdbcx::ObjectType OEmptyCollection::createObject(const OUString& /
ORowSetBase::ORowSetBase( const Reference<XComponentContext>& _rContext, ::cppu::OBroadcastHelper& _rBHelper, ::osl::Mutex* _pMutex )
:OPropertyStateContainer(_rBHelper)
,m_pMutex(_pMutex)
+ ,m_pMySelf(NULL)
,m_pCache(NULL)
,m_pColumns(NULL)
,m_rBHelper(_rBHelper)
commit 52e8018846e1ddda94cfc8681b5d86c1d8815056
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 14:29:17 2014 +0000
coverity#704903 Unchecked dynamic_cast
Change-Id: Ifd67414600bb3a91d2b33c82d836ace3a187d6f5
diff --git a/sw/source/core/layout/flycnt.cxx b/sw/source/core/layout/flycnt.cxx
index 1271991..862837c 100644
--- a/sw/source/core/layout/flycnt.cxx
+++ b/sw/source/core/layout/flycnt.cxx
@@ -382,22 +382,20 @@ void SwFlyAtCntFrm::MakeAll()
// wrapping style influence is considered on object positioning
if ( bFormatAnchor )
{
- SwTxtFrm* pAnchPosAnchorFrm =
- dynamic_cast<SwTxtFrm*>(GetAnchorFrmContainingAnchPos());
- OSL_ENSURE( pAnchPosAnchorFrm,
- "<SwFlyAtCntFrm::MakeAll()> - anchor frame of wrong type -> crash" );
+ SwTxtFrm& rAnchPosAnchorFrm =
+ dynamic_cast<SwTxtFrm&>(*GetAnchorFrmContainingAnchPos());
// #i58182# - For the usage of new method
// <SwObjectFormatterTxtFrm::CheckMovedFwdCondition(..)>
// to check move forward of anchor frame due to the object
// positioning it's needed to know, if the object is anchored
// at the master frame before the anchor frame is formatted.
- const bool bAnchoredAtMaster( !pAnchPosAnchorFrm->IsFollow() );
+ const bool bAnchoredAtMaster(!rAnchPosAnchorFrm.IsFollow());
// #i56300#
// perform complete format of anchor text frame and its
// previous frames, which have become invalid due to the
// fly frame format.
- SwObjectFormatterTxtFrm::FormatAnchorFrmAndItsPrevs( *pAnchPosAnchorFrm );
+ SwObjectFormatterTxtFrm::FormatAnchorFrmAndItsPrevs( rAnchPosAnchorFrm );
// #i35911#
// #i40444#
// #i58182# - usage of new method
commit cf4ad5f6c5a561f5197e561b456b024ea4d619c6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 14:12:06 2014 +0000
coverity#705829 Dereference before null check
Change-Id: Ic624b6bab3215148ff0b9a73fd24577623b398f9
diff --git a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
index b613788..384dc44 100644
--- a/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
+++ b/sc/source/filter/xml/XMLChangeTrackingImportHelper.cxx
@@ -410,15 +410,23 @@ void ScXMLChangeTrackingImportHelper::AddGenerated(ScMyCellInfo* pCellInfo, cons
void ScXMLChangeTrackingImportHelper::EndChangeAction()
{
+ if (!pCurrentAction)
+ {
+ OSL_FAIL("no current action");
+ return;
+ }
+
if ((pCurrentAction->nActionType == SC_CAT_DELETE_COLS) ||
(pCurrentAction->nActionType == SC_CAT_DELETE_ROWS))
GetMultiSpannedRange();
- if (pCurrentAction && pCurrentAction->nActionNumber > 0)
+
+ if (pCurrentAction->nActionNumber > 0)
aActions.push_back(pCurrentAction);
else
{
OSL_FAIL("no current action");
}
+
pCurrentAction = NULL;
}
commit 267c37038bfa8c845bc7d68843ead28e3696ca4c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 14:07:35 2014 +0000
coverity#705838 Dereference before null check
Change-Id: I9a18699554bb0831478e5ca177e87ae11a6206cf
diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx
index b8b5e66..feedc55 100644
--- a/sc/source/ui/drawfunc/fusel.cxx
+++ b/sc/source/ui/drawfunc/fusel.cxx
@@ -379,7 +379,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
SetMouseButtonCode(rMEvt.GetButtons());
bool bReturn = FuDraw::MouseButtonUp(rMEvt);
- bool bOle = pViewShell->GetViewFrame()->GetFrame().IsInPlace();
+ bool bOle = pViewShell ? pViewShell->GetViewFrame()->GetFrame().IsInPlace() : false;
SdrObject* pObj = NULL;
SdrPageView* pPV = NULL;
commit 1c45064b1ea5cdb9ba9d80e7814ae1125c8eb8be
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:51:11 2014 +0000
coverity#1019336 Dereference after null check
Change-Id: I7bdd58f1411279d64b61baf25792cc6d1dff19ad
diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx
index b237dfc..e918196 100644
--- a/svx/source/svdraw/svdoole2.cxx
+++ b/svx/source/svdraw/svdoole2.cxx
@@ -1458,7 +1458,7 @@ void SdrOle2Obj::SetPage(SdrPage* pNewPage)
if (bRemove && mpImpl->mbConnected )
Disconnect();
- if(!pModel && !GetStyleSheet() && pNewPage->GetModel())
+ if(!pModel && !GetStyleSheet() && pNewPage && pNewPage->GetModel())
{
// #i119287# Set default StyleSheet for SdrGrafObj here, it is different from 'Default'. This
// needs to be done before the style 'Default' is set from the :SetModel() call which is triggered
commit d77cc9d2cdc702f2b2016498df107f4120d27690
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:49:20 2014 +0000
coverity#1019335 Dereference after null check
Change-Id: I309e0c3f8a0630991e2aad64f995567e0920be3b
diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx
index 89f7002..a158dcd 100644
--- a/svx/source/svdraw/svdograf.cxx
+++ b/svx/source/svdraw/svdograf.cxx
@@ -974,7 +974,7 @@ void SdrGrafObj::SetPage( SdrPage* pNewPage )
ImpLinkAbmeldung();
}
- if(!pModel && !GetStyleSheet() && pNewPage->GetModel())
+ if(!pModel && !GetStyleSheet() && pNewPage && pNewPage->GetModel())
{
// #i119287# Set default StyleSheet for SdrGrafObj here, it is different from 'Default'. This
// needs to be done before the style 'Default' is set from the :SetModel() call which is triggered
commit 53d879aaff1be962e54ee7bcfacc220344504a2c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:47:19 2014 +0000
coverity#1000605 Dereference after null check
Change-Id: I1b7404e04fd2a6c7100d663054a91da63edd0652
diff --git a/sw/source/core/uibase/uiview/viewport.cxx b/sw/source/core/uibase/uiview/viewport.cxx
index 30fa410..d13a073 100644
--- a/sw/source/core/uibase/uiview/viewport.cxx
+++ b/sw/source/core/uibase/uiview/viewport.cxx
@@ -62,8 +62,13 @@ static sal_uInt16 nPgNum = 0;
bool SwView::IsDocumentBorder()
{
- return GetDocShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED ||
- m_pWrtShell->GetViewOptions()->getBrowseMode() ||
+ if (GetDocShell()->GetCreateMode() == SFX_CREATE_MODE_EMBEDDED)
+ return true;
+
+ if (!m_pWrtShell)
+ return false;
+
+ return m_pWrtShell->GetViewOptions()->getBrowseMode() ||
SVX_ZOOM_PAGEWIDTH_NOBORDER == (SvxZoomType)m_pWrtShell->GetViewOptions()->GetZoomType();
}
commit 1fca856a9afd5a9909ef430c82c097e50a8b896e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:24:09 2014 +0000
coverity#982477 Dereference after null check
Change-Id: I0fd7ffa2a7961f3d733daf2d74f5beac53bd0291
diff --git a/sw/source/core/doc/docfly.cxx b/sw/source/core/doc/docfly.cxx
index 624b668..46fa511 100644
--- a/sw/source/core/doc/docfly.cxx
+++ b/sw/source/core/doc/docfly.cxx
@@ -658,8 +658,7 @@ bool SwDoc::ChgAnchor( const SdrMarkList& _rMrkList,
case FLY_AT_PARA:
case FLY_AT_CHAR:
{
- const Point aNewPoint = pOldAnchorFrm &&
- ( pOldAnchorFrm->IsVertical() ||
+ const Point aNewPoint = ( pOldAnchorFrm->IsVertical() ||
pOldAnchorFrm->IsRightToLeft() )
? aObjRect.TopRight()
: aPt;
commit a81ace639f00c58ef773c06f612c6a890f28ea59
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:18:43 2014 +0000
coverity#982475 Dereference after null check
Change-Id: I146d253ad2b49e71cec56bbd0e1b687a0e0de245
diff --git a/sw/source/core/crsr/pam.cxx b/sw/source/core/crsr/pam.cxx
index 09e8ea7..0ce1518 100644
--- a/sw/source/core/crsr/pam.cxx
+++ b/sw/source/core/crsr/pam.cxx
@@ -708,7 +708,7 @@ bool SwPaM::HasReadonlySel( bool bFormView, bool bAnnotationMode ) const
bool bAtStartA = pA != NULL && pA->GetMarkStart() == *GetPoint();
bool bAtStartB = pB != NULL && pB->GetMarkStart() == *GetMark();
bRet = ( pA != pB ) || bAtStartA || bAtStartB;
- bool bProtectForm = pDoc->get( IDocumentSettingAccess::PROTECT_FORM );
+ bool bProtectForm = pDoc ? pDoc->get( IDocumentSettingAccess::PROTECT_FORM ) : false;
if ( bProtectForm )
bRet |= ( pA == NULL || pB == NULL );
}
commit ffe291088beae0b4823f110dda0f6fe314bbfaa9
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:17:39 2014 +0000
coverity#982473 Dereference after null check
Change-Id: I394a65ace05c94ae18f4cf0f5bfca6e10e7bedf5
diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx
index e3671ac..8d6c0e8 100644
--- a/svx/source/table/tablecontroller.cxx
+++ b/svx/source/table/tablecontroller.cxx
@@ -372,7 +372,7 @@ void SvxTableController::onSelectionHasChanged()
if( rMarkList.GetMarkCount() == 1 )
bSelected = mxTableObj.get() == rMarkList.GetMark(0)->GetMarkedSdrObj();
/* fdo#46186 Selecting the table means selecting the entire cells */
- if(!hasSelectedCells())
+ if (!hasSelectedCells() && pTableObj)
{
maCursorFirstPos = pTableObj->getFirstCell();
maCursorLastPos = pTableObj->getLastCell();
commit 19efab6828d79b96adfba8cbea6d057c4f3ac2f6
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:13:40 2014 +0000
coverity#982471 Dereference after null check
Change-Id: I00c47ffa1f03e1c6e921efbc41ef01252c1c64b7
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index cb0f321..be9c77e 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1011,7 +1011,9 @@ sal_Bool ViewTabListBox_Impl::EditedEntry( SvTreeListEntry* pEntry,
aContent.setPropertyValue( aPropName, aValue );
mpParent->EntryRenamed( aURL, rNewText );
- pData->maURL = aURL;
+ if (pData)
+ pData->maURL = aURL;
+
pEntry->SetUserData( pData );
bRet = sal_True;
commit 7c2e5331a7707bafc9bc2f3b7acd207cc385489d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:11:43 2014 +0000
coverity#982470 Dereference after null check
Change-Id: Ifa6a78eae364bd5f4adc717543dde508d7b1f445
diff --git a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
index e44c0e6..4b98cd4 100644
--- a/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
+++ b/slideshow/source/engine/OGLTrans/generic/OGLTrans_TransitionerImpl.cxx
@@ -613,7 +613,9 @@ bool OGLTransitionerImpl::createWindow( Window* pPWindow )
pWindow->GetSystemData();
#endif
- if( pWindow )
+#if defined( UNX )
+ if (pWindow && pChildSysData)
+#endif
{
pWindow->SetMouseTransparent( true );
pWindow->SetParentClipMode( PARENTCLIPMODE_NOCLIP );
commit 95c2bb3498fd76e73190f29089555ee363c0c998
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:02:21 2014 +0000
coverity#704923 Dereference after null check
Change-Id: Ifae6d3e9699ff201fda12dfda26c7e86996dd954
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index ef48670..8a93e74 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -2029,7 +2029,7 @@ void SwCntntFrm::_UpdateAttr( const SfxPoolItem* pOld, const SfxPoolItem* pNew,
SwPageFrm *pPage = FindPageFrm();
if ( !GetPrev() )
CheckPageDescs( pPage );
- if ( pPage && GetAttrSet()->GetPageDesc().GetNumOffset() )
+ if ( GetAttrSet()->GetPageDesc().GetNumOffset() )
((SwRootFrm*)pPage->GetUpper())->SetVirtPageNum( sal_True );
SwDocPosUpdate aMsgHnt( pPage->Frm().Top() );
pPage->GetFmt()->GetDoc()->UpdatePageFlds( &aMsgHnt );
commit 3a95cbd896c2a9abf89f73d11a829fbefda1da6e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 13:00:06 2014 +0000
coverity#704921 Dereference after null check
Change-Id: I8b8186935f37981512554d06cd52a47fdc7209e0
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 10d5b4d..82eeb6e 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -4939,7 +4939,7 @@ void SwCellFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
if( bAttrSetChg )
((SwAttrSetChg*)pNew)->GetChgSet()->GetItemState( RES_VERT_ORIENT, false, &pItem);
- else if ( RES_VERT_ORIENT == pNew->Which() )
+ else if (pNew && RES_VERT_ORIENT == pNew->Which())
pItem = pNew;
if ( pItem )
commit 4a679c92bd43bbd166d31a62c6ee7c04dd3c588f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 12:59:10 2014 +0000
coverity#704920 Dereference after null check
Change-Id: I20f1f3183555a813f0e1c3b73d973333774b6b63
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 7427b74..10d5b4d 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3222,7 +3222,7 @@ SwCntntFrm *SwTabFrm::FindLastCntnt()
const SwFrm* pRow = pRet->GetUpper();
while ( pRow && !pRow->GetUpper()->IsTabFrm() )
pRow = pRow->GetUpper();
- SwCntntFrm* pCntntFrm = ((SwLayoutFrm*)pRow)->ContainsCntnt();
+ SwCntntFrm* pCntntFrm = pRow ? ((SwLayoutFrm*)pRow)->ContainsCntnt() : NULL;
pRet = 0;
while ( pCntntFrm && ((SwLayoutFrm*)pRow)->IsAnLower( pCntntFrm ) )
commit 3d00ff2bcd08023d15a7f3d610a77a2b98933006
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 12:57:38 2014 +0000
coverity#704919 Dereference after null check
Change-Id: Idabe692f900ba9a6e1cae35afa3fb8fd33044be0
diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx
index c400114..ef48670 100644
--- a/sw/source/core/layout/wsfrm.cxx
+++ b/sw/source/core/layout/wsfrm.cxx
@@ -235,7 +235,7 @@ void SwFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
{
sal_uInt8 nInvFlags = 0;
- if( pNew && RES_ATTRSET_CHG == pNew->Which() )
+ if( pOld && pNew && RES_ATTRSET_CHG == pNew->Which() )
{
SfxItemIter aNIter( *((SwAttrSetChg*)pNew)->GetChgSet() );
SfxItemIter aOIter( *((SwAttrSetChg*)pOld)->GetChgSet() );
commit 3c9375d4aa066dfcbb856aec60d49844b26e46fe
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 12:56:07 2014 +0000
coverity#704918 Dereference after null check
Change-Id: I748b9a5e9fafa7d09a70a15195e929a048e33ed7
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index 385a98d..7427b74 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -3555,7 +3555,7 @@ void SwRowFrm::Modify( const SfxPoolItem* pOld, const SfxPoolItem * pNew )
if ( !pItem )
pChgSet->GetItemState( RES_ROW_SPLIT, false, &pItem);
}
- else if ( RES_FRM_SIZE == pNew->Which() || RES_ROW_SPLIT == pNew->Which() )
+ else if (pNew && (RES_FRM_SIZE == pNew->Which() || RES_ROW_SPLIT == pNew->Which()))
pItem = pNew;
if ( pItem )
commit 1b924d5b420d9c32898c2999d1c55c5d1670df88
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 12:53:48 2014 +0000
coverity#704914 Dereference after null check
Change-Id: Ib52b2d6cd7339320b7ec00d874f8c7c1de87e59d
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index bcc5d10..f6a9055 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -2357,8 +2357,12 @@ void SwSectionFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew
case RES_COL:
if( !IsInFtn() )
{
- ChgColumns( *(const SwFmtCol*)pOld, *(const SwFmtCol*)pNew );
- rInvFlags |= 0x11;
+ assert(pOld && pNew);
+ if (pOld && pNew)
+ {
+ ChgColumns( *(const SwFmtCol*)pOld, *(const SwFmtCol*)pNew );
+ rInvFlags |= 0x11;
+ }
}
break;
commit 64f41f1ae17e47e78175083bad3a3165fbf2053f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Mar 15 12:49:57 2014 +0000
coverity#704908 Dereference after null check
Change-Id: I74addce71d6044da27d9021dc3aef0c73dd55d27
diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx
index b809700..1a976615 100644
--- a/sw/source/core/layout/pagechg.cxx
+++ b/sw/source/core/layout/pagechg.cxx
@@ -549,34 +549,36 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
{
// If the frame format is changed, several things might also change:
// 1. columns:
- OSL_ENSURE( pOld && pNew, "FMT_CHG Missing Format." );
- const SwFmt* pOldFmt = ((SwFmtChg*)pOld)->pChangedFmt;
- const SwFmt* pNewFmt = ((SwFmtChg*)pNew)->pChangedFmt;
- OSL_ENSURE( pOldFmt && pNewFmt, "FMT_CHG Missing Format." );
-
- const SwFmtCol &rOldCol = pOldFmt->GetCol();
- const SwFmtCol &rNewCol = pNewFmt->GetCol();
- if( rOldCol != rNewCol )
+ assert(pOld && pNew); //FMT_CHG Missing Format
+ const SwFmt* pOldFmt = pOld ? ((SwFmtChg*)pOld)->pChangedFmt : NULL;
+ const SwFmt* pNewFmt = pNew ? ((SwFmtChg*)pNew)->pChangedFmt : NULL;
+ assert(pOldFmt && pNewFmt); //FMT_CHG Missing Format
+ if (pOldFmt && pNewFmt)
{
- SwLayoutFrm *pB = FindBodyCont();
- OSL_ENSURE( pB, "Seite ohne Body." );
- pB->ChgColumns( rOldCol, rNewCol );
- rInvFlags |= 0x20;
- }
-
- // 2. header and footer:
- const SwFmtHeader &rOldH = pOldFmt->GetHeader();
- const SwFmtHeader &rNewH = pNewFmt->GetHeader();
- if( rOldH != rNewH )
- rInvFlags |= 0x08;
+ const SwFmtCol &rOldCol = pOldFmt->GetCol();
+ const SwFmtCol &rNewCol = pNewFmt->GetCol();
+ if( rOldCol != rNewCol )
+ {
+ SwLayoutFrm *pB = FindBodyCont();
+ OSL_ENSURE( pB, "Seite ohne Body." );
+ pB->ChgColumns( rOldCol, rNewCol );
+ rInvFlags |= 0x20;
+ }
- const SwFmtFooter &rOldF = pOldFmt->GetFooter();
- const SwFmtFooter &rNewF = pNewFmt->GetFooter();
- if( rOldF != rNewF )
- rInvFlags |= 0x10;
- CheckDirChange();
+ // 2. header and footer:
+ const SwFmtHeader &rOldH = pOldFmt->GetHeader();
+ const SwFmtHeader &rNewH = pNewFmt->GetHeader();
+ if( rOldH != rNewH )
+ rInvFlags |= 0x08;
+
+ const SwFmtFooter &rOldF = pOldFmt->GetFooter();
+ const SwFmtFooter &rNewF = pNewFmt->GetFooter();
+ if( rOldF != rNewF )
+ rInvFlags |= 0x10;
+ CheckDirChange();
+ }
}
- // no break
+ // no break
case RES_FRM_SIZE:
{
const SwRect aOldPageFrmRect( Frm() );
@@ -625,12 +627,14 @@ void SwPageFrm::_UpdateAttr( const SfxPoolItem *pOld, const SfxPoolItem *pNew,
break;
case RES_COL:
- {
- SwLayoutFrm *pB = FindBodyCont();
- OSL_ENSURE( pB, "page without body." );
- pB->ChgColumns( *(const SwFmtCol*)pOld, *(const SwFmtCol*)pNew );
- rInvFlags |= 0x22;
- }
+ assert(pOld && pNew); //COL Missing Format
+ if (pOld && pNew)
+ {
+ SwLayoutFrm *pB = FindBodyCont();
+ assert(pB); //page without body
+ pB->ChgColumns( *(const SwFmtCol*)pOld, *(const SwFmtCol*)pNew );
+ rInvFlags |= 0x22;
+ }
break;
case RES_HEADER:
More information about the Libreoffice-commits
mailing list