forms/source/richtext/richtextcontrol.cxx | 7 - i18npool/source/breakiterator/breakiteratorImpl.cxx | 7 - sfx2/source/appl/workwin.cxx | 115 +++++++------------- sfx2/source/view/sfxbasecontroller.cxx | 2 vcl/unx/generic/dtrans/X11_selection.cxx | 6 - 5 files changed, 50 insertions(+), 87 deletions(-)
New commits: commit c67cc960ce344f4cb7a0be785ee69e08e72e6fbb Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 11 13:47:43 2014 +0000 coverity#704236 Logically dead code the nStartPos > 0 check is inside a nStartPos == 0 block so it can't happen so we'll return immediately, and so there's no point changing numberOfChange in that case either there Change-Id: Id6d7fc31033de5c6f3bb0a9ed03234b58c0d509e diff --git a/i18npool/source/breakiterator/breakiteratorImpl.cxx b/i18npool/source/breakiterator/breakiteratorImpl.cxx index e56256b..db36852 100644 --- a/i18npool/source/breakiterator/breakiteratorImpl.cxx +++ b/i18npool/source/breakiterator/breakiteratorImpl.cxx @@ -329,12 +329,7 @@ sal_Int32 SAL_CALL BreakIteratorImpl::previousScript( const OUString& Text, if ((((numberOfChange % 2) == 0) != (ScriptType != getScriptClass(ch)))) numberOfChange--; else if (nStartPos == 0) { - if (numberOfChange > 0) - numberOfChange--; - if (nStartPos > 0) - Text.iterateCodePoints(&nStartPos, -1); - else - return -1; + return -1; } } return numberOfChange == 0 ? iterateCodePoints(Text, nStartPos, 1, ch) : -1; commit 39831d90d9c3d0f714e39ef11799fabe8cc13563 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 11 13:43:05 2014 +0000 coverity#704232 Logically dead code these conditions are already handled in the switch above Change-Id: I1a2bfe4cc536f2d1292fd39b86afc53ac5463308 diff --git a/forms/source/richtext/richtextcontrol.cxx b/forms/source/richtext/richtextcontrol.cxx index bbb5403..44829c6 100644 --- a/forms/source/richtext/richtextcontrol.cxx +++ b/forms/source/richtext/richtextcontrol.cxx @@ -579,13 +579,6 @@ namespace frm { bNeedParametrizedDispatcher = true; } - else if ( ( _nSlotId == SID_ATTR_PARA_HANGPUNCTUATION ) - || ( _nSlotId == SID_ATTR_PARA_FORBIDDEN_RULES ) - || ( _nSlotId == SID_ATTR_PARA_SCRIPTSPACE ) - ) - { - bNeedParametrizedDispatcher = false; - } else { SfxSlotPool& rSlotPool = SfxSlotPool::GetSlotPool( NULL ); commit 25b7ed03d8b0fda45f5e9e2d0190e418ec366016 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 11 13:35:53 2014 +0000 coverity#441225 Dereference null return value Change-Id: I9ff48e869cd03847d5338c5f8fb6acceee522e34 diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx index 0e5a3ce..396f496 100644 --- a/vcl/unx/generic/dtrans/X11_selection.cxx +++ b/vcl/unx/generic/dtrans/X11_selection.cxx @@ -3490,7 +3490,11 @@ void SelectionManager::dragDoDispatch() // cleanup after drag if( m_bWaitingForPrimaryConversion ) - getAdaptor( XA_PRIMARY )->clearTransferable(); + { + SelectionAdaptor* pAdaptor = getAdaptor( XA_PRIMARY ); + if (pAdaptor) + pAdaptor->clearTransferable(); + } m_bDropSent = false; m_bDropSuccess = false; commit 266cbbdfc975ac058ca989b87d372898f49578db Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 11 13:34:17 2014 +0000 coverity#441017 Dereference before null check Change-Id: I3df33251d72266afb43532bee07058e691a6cf66 diff --git a/sfx2/source/view/sfxbasecontroller.cxx b/sfx2/source/view/sfxbasecontroller.cxx index 259250e..4ddb958 100644 --- a/sfx2/source/view/sfxbasecontroller.cxx +++ b/sfx2/source/view/sfxbasecontroller.cxx @@ -358,7 +358,7 @@ void SAL_CALL IMPL_SfxBaseController_CloseListenerHelper::queryClosing( const la { SolarMutexGuard aGuard; SfxViewShell* pShell = m_pController->GetViewShell_Impl(); - if ( m_pController != NULL && pShell ) + if (pShell) { bool bCanClose = pShell->PrepareClose( sal_False ); if ( !bCanClose ) commit 7f8b1b58f48e5593441b29d723eac8dc396c55ed Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 11 13:30:22 2014 +0000 coverity#440865 Logically dead code seeing as we return early if eChild == SFX_CHILDWIN_OBJECTBAR then the reset of the code that depends on that cannot happen Change-Id: I1566ad9d5ef428e3c9e248df08b65d56bb83553e diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index 7af2d81..d9ebe58 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1792,7 +1792,6 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, Rectangle aOuterRect( GetTopRect_Impl() ); aOuterRect.SetPos( pWorkWin->OutputToScreenPixel( aOuterRect.TopLeft() )); Rectangle aInnerRect( aOuterRect ); - sal_Bool bTbx = (eChild == SFX_CHILDWIN_OBJECTBAR); // The current affected window is included in the calculation of // the inner rectangle! @@ -1810,12 +1809,6 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, aInnerRect.Top() += pCli->aSize.Height(); break; - case SFX_ALIGN_TOOLBOXTOP: - // Toolbox has priority, if no higher Position - if ( bTbx && i <= nPos) - aInnerRect.Top() += pCli->aSize.Height(); - break; - case SFX_ALIGN_HIGHESTTOP: // Always performed first aInnerRect.Top() += pCli->aSize.Height(); @@ -1832,12 +1825,6 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, aInnerRect.Bottom() -= pCli->aSize.Height(); break; - case SFX_ALIGN_TOOLBOXBOTTOM: - // Toolbox has priority, if no higher Position - if ( bTbx && i <= nPos) - aInnerRect.Bottom() -= pCli->aSize.Height(); - break; - case SFX_ALIGN_LOWESTBOTTOM: // Always performed first aInnerRect.Bottom() -= pCli->aSize.Height(); @@ -1854,12 +1841,6 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, aInnerRect.Left() += pCli->aSize.Width(); break; - case SFX_ALIGN_TOOLBOXLEFT: - // Toolboxes come always last - if (bTbx && i <= nPos) - aInnerRect.Left() += pCli->aSize.Width(); - break; - case SFX_ALIGN_FIRSTLEFT: // Always performed first aInnerRect.Left() += pCli->aSize.Width(); @@ -1875,12 +1856,6 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, aInnerRect.Right() -= pCli->aSize.Width(); break; - case SFX_ALIGN_TOOLBOXRIGHT: - // Toolboxes come always last - if (bTbx && i <= nPos) - aInnerRect.Right() -= pCli->aSize.Width(); - break; - case SFX_ALIGN_FIRSTRIGHT: // Is only counted if it is the current window if (i == nPos) commit 83490325567d37dc55cd76ada5ec9819d7c51633 Author: Caolán McNamara <caol...@redhat.com> Date: Tue Mar 11 13:28:03 2014 +0000 de-indent, given the early return Change-Id: I7f52cad90ce17813ba7d7c6ce382d58a8fa44916 diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index e50be8e..7af2d81 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -1704,70 +1704,66 @@ void SfxWorkWindow::ConfigChild_Impl(SfxChildIdentifier eChild, SfxChildWin_Impl *pCW = 0; if ( eChild == SFX_CHILDWIN_OBJECTBAR ) - { return; - } - else + + // configure direct childwindow + for (sal_uInt16 n=0; n<aChildWins.size(); n++) { - // configure direct childwindow - for (sal_uInt16 n=0; n<aChildWins.size(); n++) + pCW = aChildWins[n]; + SfxChildWindow *pChild = pCW->pWin; + if ( pChild ) { - pCW = aChildWins[n]; - SfxChildWindow *pChild = pCW->pWin; - if ( pChild ) + if ( pChild->GetType() == nId ) { - if ( pChild->GetType() == nId ) - { - if ( pChild->GetWindow()->GetType() == RSC_DOCKINGWINDOW ) - // it's a DockingWindow - pDockWin = (SfxDockingWindow*) pChild->GetWindow(); - else - // FloatingWindow or ModelessDialog - pWin = pChild->GetWindow(); - break; - } + if ( pChild->GetWindow()->GetType() == RSC_DOCKINGWINDOW ) + // it's a DockingWindow + pDockWin = (SfxDockingWindow*) pChild->GetWindow(); + else + // FloatingWindow or ModelessDialog + pWin = pChild->GetWindow(); + break; } } + } - if ( pDockWin ) + if ( pDockWin ) + { + if ( eChild == SFX_CHILDWIN_DOCKINGWINDOW || pDockWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT ) { - if ( eChild == SFX_CHILDWIN_DOCKINGWINDOW || pDockWin->GetAlignment() == SFX_ALIGN_NOALIGNMENT ) + if ( eChild == SFX_CHILDWIN_SPLITWINDOW && eConfig == SFX_TOGGLEFLOATMODE) { - if ( eChild == SFX_CHILDWIN_SPLITWINDOW && eConfig == SFX_TOGGLEFLOATMODE) - { - // DockingWindow was dragged out of a SplitWindow - pCW->pCli = RegisterChild_Impl(*pDockWin, pDockWin->GetAlignment(), pCW->pWin->CanGetFocus()); - pCW->pCli->nVisible = CHILD_VISIBLE; - } - - pWin = pDockWin; + // DockingWindow was dragged out of a SplitWindow + pCW->pCli = RegisterChild_Impl(*pDockWin, pDockWin->GetAlignment(), pCW->pWin->CanGetFocus()); + pCW->pCli->nVisible = CHILD_VISIBLE; } - else - { - SfxSplitWindow *pSplitWin = GetSplitWindow_Impl(pDockWin->GetAlignment()); - // configure DockingWindow inside a SplitWindow - if ( eConfig == SFX_TOGGLEFLOATMODE) - { - // DockingWindow was dragged into a SplitWindow - pCW->pCli = 0; - ReleaseChild_Impl(*pDockWin); - } + pWin = pDockWin; + } + else + { + SfxSplitWindow *pSplitWin = GetSplitWindow_Impl(pDockWin->GetAlignment()); - pWin = pSplitWin->GetSplitWindow(); - if ( pSplitWin->GetWindowCount() == 1 ) - ((SplitWindow*)pWin)->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); + // configure DockingWindow inside a SplitWindow + if ( eConfig == SFX_TOGGLEFLOATMODE) + { + // DockingWindow was dragged into a SplitWindow + pCW->pCli = 0; + ReleaseChild_Impl(*pDockWin); } - } - DBG_ASSERT( pCW, "Unknown window!" ); - if ( !pCW && pParent ) - { - pParent->ConfigChild_Impl( eChild, eConfig, nId ); - return; + pWin = pSplitWin->GetSplitWindow(); + if ( pSplitWin->GetWindowCount() == 1 ) + ((SplitWindow*)pWin)->Show( true, SHOW_NOFOCUSCHANGE | SHOW_NOACTIVATE ); } } + DBG_ASSERT( pCW, "Unknown window!" ); + if ( !pCW && pParent ) + { + pParent->ConfigChild_Impl( eChild, eConfig, nId ); + return; + } + if ( !bSorted ) // windows may have been registered and released without an update until now Sort_Impl();
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits