Kaydet (Commit) 246aba2a authored tarafından Caolán McNamara's avatar Caolán McNamara

coverity#735802 Unchecked dynamic_cast

Change-Id: I798d5a5f1e28e88b23f478d241a8fcd7519f905f
üst 11e17447
...@@ -1096,15 +1096,14 @@ IMPL_LINK_NOARG(ScInputBarGroup, ClickHdl) ...@@ -1096,15 +1096,14 @@ IMPL_LINK_NOARG(ScInputBarGroup, ClickHdl)
void ScInputBarGroup::TriggerToolboxLayout() void ScInputBarGroup::TriggerToolboxLayout()
{ {
Window *w=GetParent(); Window *w=GetParent();
ScInputWindow *pParent; ScInputWindow &rParent = dynamic_cast<ScInputWindow&>(*w);
pParent=dynamic_cast<ScInputWindow*>(w);
SfxViewFrame* pViewFrm = SfxViewFrame::Current(); SfxViewFrame* pViewFrm = SfxViewFrame::Current();
// Capture the vertical position of this window in the toolbar, when we increase // Capture the vertical position of this window in the toolbar, when we increase
// the size of the toolbar to accomadate expanded line input we need to take this // the size of the toolbar to accomadate expanded line input we need to take this
// into account // into account
if ( !nVertOffset ) if ( !nVertOffset )
nVertOffset = pParent->GetItemPosRect( pParent->GetItemCount() - 1 ).Top(); nVertOffset = rParent.GetItemPosRect( rParent.GetItemCount() - 1 ).Top();
if ( pViewFrm ) if ( pViewFrm )
{ {
...@@ -1120,9 +1119,9 @@ void ScInputBarGroup::TriggerToolboxLayout() ...@@ -1120,9 +1119,9 @@ void ScInputBarGroup::TriggerToolboxLayout()
if ( xLayoutManager.is() ) if ( xLayoutManager.is() )
{ {
if ( aMultiTextWnd.GetNumLines() > 1) if ( aMultiTextWnd.GetNumLines() > 1)
pParent->SetToolbarLayoutMode( TBX_LAYOUT_LOCKVERT ); rParent.SetToolbarLayoutMode( TBX_LAYOUT_LOCKVERT );
else else
pParent->SetToolbarLayoutMode( TBX_LAYOUT_NORMAL ); rParent.SetToolbarLayoutMode( TBX_LAYOUT_NORMAL );
xLayoutManager->lock(); xLayoutManager->lock();
DataChangedEvent aFakeUpdate( DATACHANGED_SETTINGS, NULL, SETTINGS_STYLE ); DataChangedEvent aFakeUpdate( DATACHANGED_SETTINGS, NULL, SETTINGS_STYLE );
// this basically will trigger the reposititioning of the // this basically will trigger the reposititioning of the
...@@ -1131,11 +1130,11 @@ void ScInputBarGroup::TriggerToolboxLayout() ...@@ -1131,11 +1130,11 @@ void ScInputBarGroup::TriggerToolboxLayout()
// controlled by mbCalc. Additionally the ImplFormat above is // controlled by mbCalc. Additionally the ImplFormat above is
// controlled via mbFormat. It seems the easiest way to get these // controlled via mbFormat. It seems the easiest way to get these
// booleans set is to send in the fake event below. // booleans set is to send in the fake event below.
pParent->DataChanged( aFakeUpdate); rParent.DataChanged( aFakeUpdate);
// highest item in toolbar will have been calculated via the // highest item in toolbar will have been calculated via the
// event above. Call resize on InputBar to pick up the height // event above. Call resize on InputBar to pick up the height
// change // change
pParent->Resize(); rParent.Resize();
// unlock relayouts the toolbars in the 4 quadrants // unlock relayouts the toolbars in the 4 quadrants
xLayoutManager->unlock(); xLayoutManager->unlock();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment