compilerplugins/clang/flatten.cxx | 247 +++++++- compilerplugins/clang/test/flatten.cxx | 49 + svtools/source/brwbox/brwbox1.cxx | 603 +++++++++----------- svtools/source/brwbox/brwbox2.cxx | 86 +- svtools/source/brwbox/brwbox3.cxx | 30 svtools/source/brwbox/brwhead.cxx | 52 - svtools/source/brwbox/editbrowsebox.cxx | 183 +++--- svtools/source/brwbox/editbrowsebox2.cxx | 94 +-- svtools/source/config/apearcfg.cxx | 46 - svtools/source/config/colorcfg.cxx | 28 svtools/source/config/helpopt.cxx | 98 +-- svtools/source/config/htmlcfg.cxx | 120 +-- svtools/source/contnr/fileview.cxx | 24 svtools/source/contnr/foldertree.cxx | 86 +- svtools/source/contnr/iconviewimpl.cxx | 52 - svtools/source/contnr/imivctl1.cxx | 194 +++--- svtools/source/contnr/imivctl2.cxx | 34 - svtools/source/contnr/ivctrl.cxx | 80 +- svtools/source/contnr/simptabl.cxx | 46 - svtools/source/contnr/svimpbox.cxx | 288 ++++----- svtools/source/contnr/svlbitm.cxx | 46 - svtools/source/contnr/svtabbx.cxx | 82 +- svtools/source/contnr/treelist.cxx | 56 - svtools/source/contnr/treelistbox.cxx | 316 +++++----- svtools/source/control/accessibleruler.cxx | 48 - svtools/source/control/autocmpledit.cxx | 20 svtools/source/control/calendar.cxx | 158 ++--- svtools/source/control/ctrlbox.cxx | 198 +++--- svtools/source/control/headbar.cxx | 320 +++++----- svtools/source/control/inettbc.cxx | 82 +- svtools/source/control/roadmap.cxx | 52 - svtools/source/control/ruler.cxx | 508 ++++++++-------- svtools/source/control/tabbar.cxx | 516 ++++++++--------- svtools/source/control/toolbarmenu.cxx | 102 +-- svtools/source/control/toolbarmenuacc.cxx | 60 - svtools/source/control/valueacc.cxx | 112 +-- svtools/source/control/valueset.cxx | 526 ++++++++--------- svtools/source/dialogs/PlaceEditDialog.cxx | 40 - svtools/source/dialogs/addresstemplate.cxx | 24 svtools/source/dialogs/wizdlg.cxx | 80 +- svtools/source/edit/editsyntaxhighlighter.cxx | 50 - svtools/source/filter/DocumentToGraphicRenderer.cxx | 36 - svtools/source/filter/SvFilterOptionsDialog.cxx | 46 - svtools/source/filter/exportdialog.cxx | 77 +- svtools/source/graphic/descriptor.cxx | 86 +- svtools/source/graphic/grfcache.cxx | 52 - svtools/source/graphic/grfmgr.cxx | 102 +-- svtools/source/graphic/grfmgr2.cxx | 160 ++--- svtools/source/graphic/provider.cxx | 266 ++++---- svtools/source/hatchwindow/documentcloser.cxx | 68 +- svtools/source/hatchwindow/hatchwindow.cxx | 22 svtools/source/hatchwindow/ipwin.cxx | 75 +- svtools/source/misc/embedhlp.cxx | 30 svtools/source/misc/imap.cxx | 20 svtools/source/misc/imap2.cxx | 122 ++-- svtools/source/misc/imap3.cxx | 56 - svtools/source/misc/templatefoldercache.cxx | 38 - svtools/source/misc/transfer.cxx | 180 ++--- svtools/source/misc/transfer2.cxx | 32 - svtools/source/svhtml/htmlsupp.cxx | 46 - svtools/source/svrtf/svparser.cxx | 84 +- svtools/source/uno/framestatuslistener.cxx | 20 svtools/source/uno/generictoolboxcontroller.cxx | 88 +- svtools/source/uno/popupmenucontrollerbase.cxx | 72 +- svtools/source/uno/statusbarcontroller.cxx | 76 +- svtools/source/uno/svtxgridcontrol.cxx | 32 - svtools/source/uno/toolboxcontroller.cxx | 250 ++++---- svtools/source/uno/treecontrolpeer.cxx | 282 ++++----- svtools/source/uno/unoevent.cxx | 24 svtools/source/uno/unoiface.cxx | 380 ++++++------ 70 files changed, 4456 insertions(+), 4202 deletions(-)
New commits: commit 1ae61b0ac4187b2938647f3ca0289a070a5dc7d2 Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 22 11:26:08 2017 +0200 loplugin:flatten in svtools almost completely automatically rewritten, only had to tweak the indentation on a couple of lines. Change-Id: Ieec92e5b602d180d7ec556e3421ce3c835c1f646 Reviewed-on: https://gerrit.libreoffice.org/45072 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index fe7d5a8d58e2..275e8c9e5fa7 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -372,107 +372,107 @@ void BrowseBox::SetColumnPos( sal_uInt16 nColumnId, sal_uInt16 nPos ) return; // does the state change? - if (nOldPos != nPos) - { - // remark the column selection - sal_uInt16 nSelectedColId = ToggleSelectedColumn(); - - // determine old column area - Size aDataWinSize( pDataWin->GetSizePixel() ); - if ( pDataWin->pHeaderBar ) - aDataWinSize.Height() += pDataWin->pHeaderBar->GetSizePixel().Height(); + if (nOldPos == nPos) + return; - tools::Rectangle aFromRect( GetFieldRect( nColumnId) ); - aFromRect.Right() += 2*MIN_COLUMNWIDTH; + // remark the column selection + sal_uInt16 nSelectedColId = ToggleSelectedColumn(); - sal_uInt16 nNextPos = nOldPos + 1; - if ( nOldPos > nPos ) - nNextPos = nOldPos - 1; + // determine old column area + Size aDataWinSize( pDataWin->GetSizePixel() ); + if ( pDataWin->pHeaderBar ) + aDataWinSize.Height() += pDataWin->pHeaderBar->GetSizePixel().Height(); - BrowserColumn *pNextCol = pCols[ nNextPos ]; - tools::Rectangle aNextRect(GetFieldRect( pNextCol->GetId() )); + tools::Rectangle aFromRect( GetFieldRect( nColumnId) ); + aFromRect.Right() += 2*MIN_COLUMNWIDTH; - // move column internally - { - BrowserColumns::iterator it = pCols.begin(); - ::std::advance( it, nOldPos ); - BrowserColumn* pTemp = *it; - pCols.erase( it ); - it = pCols.begin(); - ::std::advance( it, nPos ); - pCols.insert( it, pTemp ); - } + sal_uInt16 nNextPos = nOldPos + 1; + if ( nOldPos > nPos ) + nNextPos = nOldPos - 1; - // determine new column area - tools::Rectangle aToRect( GetFieldRect( nColumnId ) ); - aToRect.Right() += 2*MIN_COLUMNWIDTH; + BrowserColumn *pNextCol = pCols[ nNextPos ]; + tools::Rectangle aNextRect(GetFieldRect( pNextCol->GetId() )); - // do scroll, let redraw - if( pDataWin->GetBackground().IsScrollable() ) - { - long nScroll = -aFromRect.GetWidth(); - tools::Rectangle aScrollArea; - if ( nOldPos > nPos ) - { - long nFrozenWidth = GetFrozenWidth(); - if ( aToRect.Left() < nFrozenWidth ) - aToRect.Left() = nFrozenWidth; - aScrollArea = tools::Rectangle(Point(aToRect.Left(),0), - Point(aNextRect.Right(),aDataWinSize.Height())); - nScroll *= -1; // reverse direction - } - else - aScrollArea = tools::Rectangle(Point(aNextRect.Left(),0), - Point(aToRect.Right(),aDataWinSize.Height())); + // move column internally + { + BrowserColumns::iterator it = pCols.begin(); + ::std::advance( it, nOldPos ); + BrowserColumn* pTemp = *it; + pCols.erase( it ); + it = pCols.begin(); + ::std::advance( it, nPos ); + pCols.insert( it, pTemp ); + } - pDataWin->Scroll( nScroll, 0, aScrollArea ); - aToRect.Top() = 0; - aToRect.Bottom() = aScrollArea.Bottom(); - Invalidate( aToRect ); - } - else - pDataWin->Window::Invalidate( InvalidateFlags::NoChildren ); + // determine new column area + tools::Rectangle aToRect( GetFieldRect( nColumnId ) ); + aToRect.Right() += 2*MIN_COLUMNWIDTH; - // adjust header bar positions - if ( pDataWin->pHeaderBar ) + // do scroll, let redraw + if( pDataWin->GetBackground().IsScrollable() ) + { + long nScroll = -aFromRect.GetWidth(); + tools::Rectangle aScrollArea; + if ( nOldPos > nPos ) { - sal_uInt16 nNewPos = nPos; - if ( GetColumnId(0) == HandleColumnId ) - --nNewPos; - pDataWin->pHeaderBar->MoveItem(nColumnId,nNewPos); + long nFrozenWidth = GetFrozenWidth(); + if ( aToRect.Left() < nFrozenWidth ) + aToRect.Left() = nFrozenWidth; + aScrollArea = tools::Rectangle(Point(aToRect.Left(),0), + Point(aNextRect.Right(),aDataWinSize.Height())); + nScroll *= -1; // reverse direction } - // remember the column selection - SetToggledSelectedColumn(nSelectedColId); + else + aScrollArea = tools::Rectangle(Point(aNextRect.Left(),0), + Point(aToRect.Right(),aDataWinSize.Height())); - if ( isAccessibleAlive() ) - { - commitTableEvent( - TABLE_MODEL_CHANGED, - makeAny( AccessibleTableModelChange( - DELETE, - 0, - GetRowCount(), - nOldPos, - nOldPos - ) - ), - Any() - ); + pDataWin->Scroll( nScroll, 0, aScrollArea ); + aToRect.Top() = 0; + aToRect.Bottom() = aScrollArea.Bottom(); + Invalidate( aToRect ); + } + else + pDataWin->Window::Invalidate( InvalidateFlags::NoChildren ); - commitTableEvent( - TABLE_MODEL_CHANGED, - makeAny( AccessibleTableModelChange( - INSERT, - 0, - GetRowCount(), - nPos, - nPos - ) - ), - Any() - ); - } + // adjust header bar positions + if ( pDataWin->pHeaderBar ) + { + sal_uInt16 nNewPos = nPos; + if ( GetColumnId(0) == HandleColumnId ) + --nNewPos; + pDataWin->pHeaderBar->MoveItem(nColumnId,nNewPos); } + // remember the column selection + SetToggledSelectedColumn(nSelectedColId); + + if ( !isAccessibleAlive() ) + return; + + commitTableEvent( + TABLE_MODEL_CHANGED, + makeAny( AccessibleTableModelChange( + DELETE, + 0, + GetRowCount(), + nOldPos, + nOldPos + ) + ), + Any() + ); + + commitTableEvent( + TABLE_MODEL_CHANGED, + makeAny( AccessibleTableModelChange( + INSERT, + 0, + GetRowCount(), + nPos, + nPos + ) + ), + Any() + ); } @@ -492,30 +492,30 @@ void BrowseBox::SetColumnTitle( sal_uInt16 nItemId, const OUString& rTitle ) // does the state change? BrowserColumn *pCol = pCols[ nItemPos ]; - if ( pCol->Title() != rTitle ) - { - OUString sOld(pCol->Title()); + if ( pCol->Title() == rTitle ) + return; - pCol->Title() = rTitle; + OUString sOld(pCol->Title()); - // adjust headerbar column - if ( pDataWin->pHeaderBar ) - pDataWin->pHeaderBar->SetItemText( nItemId, rTitle ); - else - { - // redraw visible columns - if ( GetUpdateMode() && ( pCol->IsFrozen() || nItemPos > nFirstCol ) ) - Invalidate( tools::Rectangle( Point(0,0), - Size( GetOutputSizePixel().Width(), GetTitleHeight() ) ) ); - } + pCol->Title() = rTitle; - if ( isAccessibleAlive() ) - { - commitTableEvent( TABLE_COLUMN_DESCRIPTION_CHANGED, - makeAny( rTitle ), - makeAny( sOld ) - ); - } + // adjust headerbar column + if ( pDataWin->pHeaderBar ) + pDataWin->pHeaderBar->SetItemText( nItemId, rTitle ); + else + { + // redraw visible columns + if ( GetUpdateMode() && ( pCol->IsFrozen() || nItemPos > nFirstCol ) ) + Invalidate( tools::Rectangle( Point(0,0), + Size( GetOutputSizePixel().Width(), GetTitleHeight() ) ) ); + } + + if ( isAccessibleAlive() ) + { + commitTableEvent( TABLE_COLUMN_DESCRIPTION_CHANGED, + makeAny( rTitle ), + makeAny( sOld ) + ); } } @@ -529,99 +529,98 @@ void BrowseBox::SetColumnWidth( sal_uInt16 nItemId, sal_uLong nWidth ) return; // does the state change? - if ( nWidth >= LONG_MAX || pCols[ nItemPos ]->Width() != nWidth ) - { - long nOldWidth = pCols[ nItemPos ]->Width(); + if ( !(nWidth >= LONG_MAX || pCols[ nItemPos ]->Width() != nWidth) ) + return; - // adjust last column, if necessary - if ( IsVisible() && nItemPos == pCols.size() - 1 ) + long nOldWidth = pCols[ nItemPos ]->Width(); + + // adjust last column, if necessary + if ( IsVisible() && nItemPos == pCols.size() - 1 ) + { + long nMaxWidth = pDataWin->GetSizePixel().Width(); + nMaxWidth -= pDataWin->bAutoSizeLastCol + ? GetFieldRect(nItemId).Left() + : GetFrozenWidth(); + if ( pDataWin->bAutoSizeLastCol || nWidth > (sal_uLong)nMaxWidth ) { - long nMaxWidth = pDataWin->GetSizePixel().Width(); - nMaxWidth -= pDataWin->bAutoSizeLastCol - ? GetFieldRect(nItemId).Left() - : GetFrozenWidth(); - if ( pDataWin->bAutoSizeLastCol || nWidth > (sal_uLong)nMaxWidth ) - { - nWidth = nMaxWidth > 16 ? nMaxWidth : nOldWidth; - } + nWidth = nMaxWidth > 16 ? nMaxWidth : nOldWidth; } + } - // OV - // In AutoSizeLastColumn(), we call SetColumnWidth with nWidth==0xffff. - // Thus, check here, if the width has actually changed. - if( (sal_uLong)nOldWidth == nWidth ) - return; + // OV + // In AutoSizeLastColumn(), we call SetColumnWidth with nWidth==0xffff. + // Thus, check here, if the width has actually changed. + if( (sal_uLong)nOldWidth == nWidth ) + return; - // do we want to display the change immediately? - bool bUpdate = GetUpdateMode() && - ( pCols[ nItemPos ]->IsFrozen() || nItemPos >= nFirstCol ); + // do we want to display the change immediately? + bool bUpdate = GetUpdateMode() && + ( pCols[ nItemPos ]->IsFrozen() || nItemPos >= nFirstCol ); - if ( bUpdate ) - { - // Selection hidden - DoHideCursor( "SetColumnWidth" ); - ToggleSelection(); - //!pDataWin->Update(); - //!Control::Update(); - } + if ( bUpdate ) + { + // Selection hidden + DoHideCursor( "SetColumnWidth" ); + ToggleSelection(); + //!pDataWin->Update(); + //!Control::Update(); + } - // set width - pCols[ nItemPos ]->SetWidth(nWidth, GetZoom()); + // set width + pCols[ nItemPos ]->SetWidth(nWidth, GetZoom()); - // scroll and invalidate - if ( bUpdate ) + // scroll and invalidate + if ( bUpdate ) + { + // get X-Pos of the column changed + long nX = 0; + for ( size_t nCol = 0; nCol < nItemPos; ++nCol ) { - // get X-Pos of the column changed - long nX = 0; - for ( size_t nCol = 0; nCol < nItemPos; ++nCol ) - { - BrowserColumn *pCol = pCols[ nCol ]; - if ( pCol->IsFrozen() || nCol >= nFirstCol ) - nX += pCol->Width(); - } - - // actually scroll+invalidate - pDataWin->SetClipRegion(); - bool bSelVis = bSelectionIsVisible; - bSelectionIsVisible = false; - if( GetBackground().IsScrollable() ) - { - - tools::Rectangle aScrRect( nX + std::min( (sal_uLong)nOldWidth, nWidth ), 0, - GetSizePixel().Width() , // the header is longer than the datawin - pDataWin->GetPosPixel().Y() - 1 ); - Control::Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); - aScrRect.Bottom() = pDataWin->GetSizePixel().Height(); - pDataWin->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); - tools::Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (sal_uLong)nOldWidth ), USHRT_MAX ); - Control::Invalidate( aInvRect, InvalidateFlags::NoChildren ); - pDataWin->Invalidate( aInvRect ); - } - else - { - Control::Invalidate( InvalidateFlags::NoChildren ); - pDataWin->Window::Invalidate( InvalidateFlags::NoChildren ); - } + BrowserColumn *pCol = pCols[ nCol ]; + if ( pCol->IsFrozen() || nCol >= nFirstCol ) + nX += pCol->Width(); + } + // actually scroll+invalidate + pDataWin->SetClipRegion(); + bool bSelVis = bSelectionIsVisible; + bSelectionIsVisible = false; + if( GetBackground().IsScrollable() ) + { - //!pDataWin->Update(); - //!Control::Update(); - bSelectionIsVisible = bSelVis; - ToggleSelection(); - DoShowCursor( "SetColumnWidth" ); + tools::Rectangle aScrRect( nX + std::min( (sal_uLong)nOldWidth, nWidth ), 0, + GetSizePixel().Width() , // the header is longer than the datawin + pDataWin->GetPosPixel().Y() - 1 ); + Control::Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); + aScrRect.Bottom() = pDataWin->GetSizePixel().Height(); + pDataWin->Scroll( nWidth-nOldWidth, 0, aScrRect, SCROLL_FLAGS ); + tools::Rectangle aInvRect( nX, 0, nX + std::max( nWidth, (sal_uLong)nOldWidth ), USHRT_MAX ); + Control::Invalidate( aInvRect, InvalidateFlags::NoChildren ); + pDataWin->Invalidate( aInvRect ); + } + else + { + Control::Invalidate( InvalidateFlags::NoChildren ); + pDataWin->Window::Invalidate( InvalidateFlags::NoChildren ); } - UpdateScrollbars(); - - // adjust headerbar column - if ( pDataWin->pHeaderBar ) - pDataWin->pHeaderBar->SetItemSize( - nItemId ? nItemId : USHRT_MAX - 1, nWidth ); - // adjust last column - if ( nItemPos != pCols.size() - 1 ) - AutoSizeLastColumn(); + //!pDataWin->Update(); + //!Control::Update(); + bSelectionIsVisible = bSelVis; + ToggleSelection(); + DoShowCursor( "SetColumnWidth" ); } + UpdateScrollbars(); + + // adjust headerbar column + if ( pDataWin->pHeaderBar ) + pDataWin->pHeaderBar->SetItemSize( + nItemId ? nItemId : USHRT_MAX - 1, nWidth ); + + // adjust last column + if ( nItemPos != pCols.size() - 1 ) + AutoSizeLastColumn(); } @@ -695,27 +694,27 @@ void BrowseBox::RemoveColumn( sal_uInt16 nItemId ) SetColumnWidth( GetColumnId( nPos - 1 ), LONG_MAX ); } - if ( isAccessibleAlive() ) - { - commitTableEvent( - TABLE_MODEL_CHANGED, - makeAny( AccessibleTableModelChange( DELETE, - 0, - GetRowCount(), - nPos, - nPos - ) - ), - Any() - ); + if ( !isAccessibleAlive() ) + return; - commitHeaderBarEvent( - CHILD, - Any(), - makeAny( CreateAccessibleColumnHeader( nPos ) ), - true - ); - } + commitTableEvent( + TABLE_MODEL_CHANGED, + makeAny( AccessibleTableModelChange( DELETE, + 0, + GetRowCount(), + nPos, + nPos + ) + ), + Any() + ); + + commitHeaderBarEvent( + CHILD, + Any(), + makeAny( CreateAccessibleColumnHeader( nPos ) ), + true + ); } @@ -752,39 +751,39 @@ void BrowseBox::RemoveColumns() Control::Invalidate(); } - if ( isAccessibleAlive() ) - { - if ( pCols.size() != nOldCount ) - { - // all columns should be removed, so we remove the column header bar and append it again - // to avoid to notify every column remove - commitBrowseBoxEvent( - CHILD, - Any(), - makeAny(m_pImpl->getAccessibleHeaderBar(BBTYPE_COLUMNHEADERBAR)) - ); + if ( !isAccessibleAlive() ) + return; - // and now append it again - commitBrowseBoxEvent( - CHILD, - makeAny(m_pImpl->getAccessibleHeaderBar(BBTYPE_COLUMNHEADERBAR)), - Any() - ); + if ( pCols.size() == nOldCount ) + return; - // notify a table model change - commitTableEvent( - TABLE_MODEL_CHANGED, - makeAny ( AccessibleTableModelChange( DELETE, - 0, - GetRowCount(), - 0, - nOldCount - ) - ), - Any() - ); - } - } + // all columns should be removed, so we remove the column header bar and append it again + // to avoid to notify every column remove + commitBrowseBoxEvent( + CHILD, + Any(), + makeAny(m_pImpl->getAccessibleHeaderBar(BBTYPE_COLUMNHEADERBAR)) + ); + + // and now append it again + commitBrowseBoxEvent( + CHILD, + makeAny(m_pImpl->getAccessibleHeaderBar(BBTYPE_COLUMNHEADERBAR)), + Any() + ); + + // notify a table model change + commitTableEvent( + TABLE_MODEL_CHANGED, + makeAny ( AccessibleTableModelChange( DELETE, + 0, + GetRowCount(), + 0, + nOldCount + ) + ), + Any() + ); } @@ -1086,38 +1085,38 @@ void BrowseBox::Clear() DoShowCursor( "Clear" ); CursorMoved(); - if ( isAccessibleAlive() ) - { - // all rows should be removed, so we remove the row header bar and append it again - // to avoid to notify every row remove - if ( nOldRowCount != nRowCount ) - { - commitBrowseBoxEvent( - CHILD, - Any(), - makeAny( m_pImpl->getAccessibleHeaderBar( BBTYPE_ROWHEADERBAR ) ) - ); + if ( !isAccessibleAlive() ) + return; - // and now append it again - commitBrowseBoxEvent( - CHILD, - makeAny( m_pImpl->getAccessibleHeaderBar( BBTYPE_ROWHEADERBAR ) ), - Any() - ); + // all rows should be removed, so we remove the row header bar and append it again + // to avoid to notify every row remove + if ( nOldRowCount == nRowCount ) + return; - // notify a table model change - commitTableEvent( - TABLE_MODEL_CHANGED, - makeAny( AccessibleTableModelChange( DELETE, - 0, - nOldRowCount, - 0, - GetColumnCount()) - ), - Any() - ); - } - } + commitBrowseBoxEvent( + CHILD, + Any(), + makeAny( m_pImpl->getAccessibleHeaderBar( BBTYPE_ROWHEADERBAR ) ) + ); + + // and now append it again + commitBrowseBoxEvent( + CHILD, + makeAny( m_pImpl->getAccessibleHeaderBar( BBTYPE_ROWHEADERBAR ) ), + Any() + ); + + // notify a table model change + commitTableEvent( + TABLE_MODEL_CHANGED, + makeAny( AccessibleTableModelChange( DELETE, + 0, + nOldRowCount, + 0, + GetColumnCount()) + ), + Any() + ); } void BrowseBox::RowInserted( long nRow, long nNumRows, bool bDoPaint, bool bKeepSelection ) @@ -1662,27 +1661,27 @@ void BrowseBox::SelectAll() // restore screen SAL_INFO("svtools", "BrowseBox::ShowCursor " << this ); - if ( isAccessibleAlive() ) - { - commitTableEvent( - SELECTION_CHANGED, - Any(), - Any() - ); - commitHeaderBarEvent( - SELECTION_CHANGED, - Any(), - Any(), - true - ); // column header event + if ( !isAccessibleAlive() ) + return; - commitHeaderBarEvent( - SELECTION_CHANGED, - Any(), - Any(), - false - ); // row header event - } + commitTableEvent( + SELECTION_CHANGED, + Any(), + Any() + ); + commitHeaderBarEvent( + SELECTION_CHANGED, + Any(), + Any(), + true + ); // column header event + + commitHeaderBarEvent( + SELECTION_CHANGED, + Any(), + Any(), + false + ); // row header event } @@ -1741,20 +1740,20 @@ void BrowseBox::SelectRow( long nRow, bool _bSelect, bool bExpand ) // restore screen SAL_INFO("svtools", "BrowseBox::ShowCursor " << this ); - if ( isAccessibleAlive() ) - { - commitTableEvent( - SELECTION_CHANGED, - Any(), - Any() - ); - commitHeaderBarEvent( - SELECTION_CHANGED, - Any(), - Any(), - false - ); // row header event - } + if ( !isAccessibleAlive() ) + return; + + commitTableEvent( + SELECTION_CHANGED, + Any(), + Any() + ); + commitHeaderBarEvent( + SELECTION_CHANGED, + Any(), + Any(), + false + ); // row header event } diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 4e341b72dbf4..f1030cd9ec31 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -576,57 +576,57 @@ void BrowseBox::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle // Title Bar // If there is a handle column and if the header bar is available, only // take the HandleColumn into account - if (nTitleLines && (!bHeaderBar || bHandleCol)) + if (!(nTitleLines && (!bHeaderBar || bHandleCol))) + return; + + // iterate through columns to redraw + long nX = 0; + size_t nCol; + for (nCol = 0; nCol < pCols.size() && nX < rRect.Right(); ++nCol) { - // iterate through columns to redraw - long nX = 0; - size_t nCol; - for (nCol = 0; nCol < pCols.size() && nX < rRect.Right(); ++nCol) - { - // skip invisible columns between frozen and scrollable area - if (nCol < nFirstCol && !pCols[nCol]->IsFrozen()) - nCol = nFirstCol; + // skip invisible columns between frozen and scrollable area + if (nCol < nFirstCol && !pCols[nCol]->IsFrozen()) + nCol = nFirstCol; - // only the handle column? - if (bHeaderBar && bHandleCol && nCol > 0) - break; + // only the handle column? + if (bHeaderBar && bHandleCol && nCol > 0) + break; - BrowserColumn* pCol = pCols[nCol]; + BrowserColumn* pCol = pCols[nCol]; - // draw the column and increment position - if ( pCol->Width() > 4 ) - { - ButtonFrame aButtonFrame( Point( nX, 0 ), - Size( pCol->Width()-1, GetTitleHeight()-1 ), - pCol->Title(), !IsEnabled()); - aButtonFrame.Draw(rRenderContext); - rRenderContext.DrawLine(Point(nX + pCol->Width() - 1, 0), - Point(nX + pCol->Width() - 1, GetTitleHeight() - 1)); - } - else - { - rRenderContext.Push(PushFlags::FILLCOLOR); - rRenderContext.SetFillColor(Color(COL_BLACK)); - rRenderContext.DrawRect(tools::Rectangle(Point(nX, 0), Size(pCol->Width(), GetTitleHeight() - 1))); - rRenderContext.Pop(); - } - - // skip column - nX += pCol->Width(); + // draw the column and increment position + if ( pCol->Width() > 4 ) + { + ButtonFrame aButtonFrame( Point( nX, 0 ), + Size( pCol->Width()-1, GetTitleHeight()-1 ), + pCol->Title(), !IsEnabled()); + aButtonFrame.Draw(rRenderContext); + rRenderContext.DrawLine(Point(nX + pCol->Width() - 1, 0), + Point(nX + pCol->Width() - 1, GetTitleHeight() - 1)); } - - // retouching - if ( !bHeaderBar && nCol == pCols.size() ) + else { - const StyleSettings &rSettings = rRenderContext.GetSettings().GetStyleSettings(); - Color aColFace(rSettings.GetFaceColor()); - rRenderContext.Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR); - rRenderContext.SetFillColor(aColFace); - rRenderContext.SetLineColor(aColFace); - rRenderContext.DrawRect(tools::Rectangle(Point(nX, 0), - Point(rRect.Right(), GetTitleHeight() - 2 ))); + rRenderContext.Push(PushFlags::FILLCOLOR); + rRenderContext.SetFillColor(Color(COL_BLACK)); + rRenderContext.DrawRect(tools::Rectangle(Point(nX, 0), Size(pCol->Width(), GetTitleHeight() - 1))); rRenderContext.Pop(); } + + // skip column + nX += pCol->Width(); + } + + // retouching + if ( !bHeaderBar && nCol == pCols.size() ) + { + const StyleSettings &rSettings = rRenderContext.GetSettings().GetStyleSettings(); + Color aColFace(rSettings.GetFaceColor()); + rRenderContext.Push(PushFlags::FILLCOLOR | PushFlags::LINECOLOR); + rRenderContext.SetFillColor(aColFace); + rRenderContext.SetLineColor(aColFace); + rRenderContext.DrawRect(tools::Rectangle(Point(nX, 0), + Point(rRect.Right(), GetTitleHeight() - 2 ))); + rRenderContext.Pop(); } } diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx index 8eff53f03fe0..073277734c89 100644 --- a/svtools/source/brwbox/brwbox3.cxx +++ b/svtools/source/brwbox/brwbox3.cxx @@ -497,23 +497,23 @@ void BrowseBox::GetAllSelectedColumns( css::uno::Sequence< sal_Int32 >& _rColumn { const MultiSelection* pColumnSel = GetColumnSelection(); sal_Int32 nCount = GetSelectedColumnCount(); - if( pColumnSel && nCount ) - { - _rColumns.realloc( nCount ); + if( !(pColumnSel && nCount) ) + return; + + _rColumns.realloc( nCount ); - sal_Int32 nIndex = 0; - const size_t nRangeCount = pColumnSel->GetRangeCount(); - for( size_t nRange = 0; nRange < nRangeCount; ++nRange ) + sal_Int32 nIndex = 0; + const size_t nRangeCount = pColumnSel->GetRangeCount(); + for( size_t nRange = 0; nRange < nRangeCount; ++nRange ) + { + const Range& rRange = pColumnSel->GetRange( nRange ); + // loop has to include aRange.Max() + for( sal_Int32 nCol = rRange.Min(); nCol <= (sal_Int32)rRange.Max(); ++nCol ) { - const Range& rRange = pColumnSel->GetRange( nRange ); - // loop has to include aRange.Max() - for( sal_Int32 nCol = rRange.Min(); nCol <= (sal_Int32)rRange.Max(); ++nCol ) - { - DBG_ASSERT( nIndex < nCount, - "GetAllSelectedColumns - range overflow" ); - _rColumns[ nIndex ] = nCol; - ++nIndex; - } + DBG_ASSERT( nIndex < nCount, + "GetAllSelectedColumns - range overflow" ); + _rColumns[ nIndex ] = nCol; + ++nIndex; } } } diff --git a/svtools/source/brwbox/brwhead.cxx b/svtools/source/brwbox/brwhead.cxx index 9db299802b1d..f8ffa0e834e3 100644 --- a/svtools/source/brwbox/brwhead.cxx +++ b/svtools/source/brwbox/brwhead.cxx @@ -69,35 +69,35 @@ void BrowserHeader::EndDrag() // not aborted? sal_uInt16 nId = GetCurItemId(); - if ( nId ) + if ( !nId ) + return; + + // handle column? + if ( nId == USHRT_MAX-1 ) + nId = 0; + + if ( !IsItemMode() ) + { + // column resize + _pBrowseBox->SetColumnWidth( nId, GetItemSize( nId ) ); + _pBrowseBox->ColumnResized( nId ); + SetItemSize( nId, _pBrowseBox->GetColumnWidth( nId ) ); + } + else { - // handle column? - if ( nId == USHRT_MAX-1 ) - nId = 0; + // column drag + // did the position actually change? + // take the handle column into account + sal_uInt16 nOldPos = _pBrowseBox->GetColumnPos(nId), + nNewPos = GetItemPos( nId ); - if ( !IsItemMode() ) - { - // column resize - _pBrowseBox->SetColumnWidth( nId, GetItemSize( nId ) ); - _pBrowseBox->ColumnResized( nId ); - SetItemSize( nId, _pBrowseBox->GetColumnWidth( nId ) ); - } - else + if (_pBrowseBox->GetColumnId(0) == BrowseBox::HandleColumnId) + nNewPos++; + + if (nOldPos != nNewPos) { - // column drag - // did the position actually change? - // take the handle column into account - sal_uInt16 nOldPos = _pBrowseBox->GetColumnPos(nId), - nNewPos = GetItemPos( nId ); - - if (_pBrowseBox->GetColumnId(0) == BrowseBox::HandleColumnId) - nNewPos++; - - if (nOldPos != nNewPos) - { - _pBrowseBox->SetColumnPos( nId, nNewPos ); - _pBrowseBox->ColumnMoved( nId ); - } + _pBrowseBox->SetColumnPos( nId, nNewPos ); + _pBrowseBox->ColumnMoved( nId ); } } } diff --git a/svtools/source/brwbox/editbrowsebox.cxx b/svtools/source/brwbox/editbrowsebox.cxx index 2df958fd2ef5..eb092d16c51f 100644 --- a/svtools/source/brwbox/editbrowsebox.cxx +++ b/svtools/source/brwbox/editbrowsebox.cxx @@ -489,44 +489,45 @@ namespace svt else if (IsEditing() && !aController->GetWindow().HasChildPathFocus()) AsynchGetFocus(); - if (IsEditing() && aController->GetWindow().IsEnabled() && aController->WantMouseEvent()) - { // forwards the event to the control + if (!(IsEditing() && aController->GetWindow().IsEnabled() && aController->WantMouseEvent())) +return; - // If the field has been moved previously, we have to adjust the position +// forwards the event to the control - aController->GetWindow().GrabFocus(); + // If the field has been moved previously, we have to adjust the position - // the position of the event relative to the controller's window - Point aPos = _rEvt.GetPosPixel() - _rEvt.GetRect().TopLeft(); - // the (child) window which should really get the event - vcl::Window* pRealHandler = aController->GetWindow().FindWindow(aPos); - if (pRealHandler) - // the coords relative to this real handler - aPos -= pRealHandler->GetPosPixel(); - else - pRealHandler = &aController->GetWindow(); + aController->GetWindow().GrabFocus(); + + // the position of the event relative to the controller's window + Point aPos = _rEvt.GetPosPixel() - _rEvt.GetRect().TopLeft(); + // the (child) window which should really get the event + vcl::Window* pRealHandler = aController->GetWindow().FindWindow(aPos); + if (pRealHandler) + // the coords relative to this real handler + aPos -= pRealHandler->GetPosPixel(); + else + pRealHandler = &aController->GetWindow(); - // the faked event - MouseEvent aEvent(aPos, _rEvt.GetClicks(), _rEvt.GetMode(), - _rEvt.GetButtons(), - _rEvt.GetModifier()); + // the faked event + MouseEvent aEvent(aPos, _rEvt.GetClicks(), _rEvt.GetMode(), + _rEvt.GetButtons(), + _rEvt.GetModifier()); - pRealHandler->MouseButtonDown(aEvent); - if (_bUp) - pRealHandler->MouseButtonUp(aEvent); + pRealHandler->MouseButtonDown(aEvent); + if (_bUp) + pRealHandler->MouseButtonUp(aEvent); - vcl::Window *pWin = &aController->GetWindow(); - if (!pWin->IsTracking()) + vcl::Window *pWin = &aController->GetWindow(); + if (!pWin->IsTracking()) + { + for (pWin = pWin->GetWindow(GetWindowType::FirstChild); + pWin && !pWin->IsTracking(); + pWin = pWin->GetWindow(GetWindowType::Next)) { - for (pWin = pWin->GetWindow(GetWindowType::FirstChild); - pWin && !pWin->IsTracking(); - pWin = pWin->GetWindow(GetWindowType::Next)) - { - } } - if (pWin && pWin->IsTracking()) - pWin->EndTracking(); } + if (pWin && pWin->IsTracking()) + pWin->EndTracking(); } @@ -770,20 +771,20 @@ namespace svt GetDataWindow().ApplyControlForeground(GetDataWindow(), rStyleSettings.GetFieldTextColor()); } - if (bBackground) // FIXME: Outside of Paint Hierarchy + if (!bBackground) // FIXME: Outside of Paint Hierarchy + return; + + if (GetDataWindow().IsControlBackground()) { - if (GetDataWindow().IsControlBackground()) - { - GetDataWindow().SetControlBackground(GetControlBackground()); - GetDataWindow().SetBackground(GetDataWindow().GetControlBackground()); - GetDataWindow().SetFillColor(GetDataWindow().GetControlBackground()); - } - else - { - GetDataWindow().SetControlBackground(); - GetDataWindow().SetBackground(rStyleSettings.GetFieldColor()); - GetDataWindow().SetFillColor(rStyleSettings.GetFieldColor()); - } + GetDataWindow().SetControlBackground(GetControlBackground()); + GetDataWindow().SetBackground(GetDataWindow().GetControlBackground()); + GetDataWindow().SetFillColor(GetDataWindow().GetControlBackground()); + } + else + { + GetDataWindow().SetControlBackground(); + GetDataWindow().SetBackground(rStyleSettings.GetFieldColor()); + GetDataWindow().SetFillColor(rStyleSettings.GetFieldColor()); } } @@ -940,38 +941,38 @@ namespace svt return; } - if (nEditRow >= 0 && nEditCol > HandleColumnId) + if (!(nEditRow >= 0 && nEditCol > HandleColumnId)) + return; + + aController = GetController(nRow, nCol); + if (aController.is()) { - aController = GetController(nRow, nCol); - if (aController.is()) - { - tools::Rectangle aRect( GetCellRect(nEditRow, nEditCol, false)); - ResizeController(aController, aRect); + tools::Rectangle aRect( GetCellRect(nEditRow, nEditCol, false)); + ResizeController(aController, aRect); - InitController(aController, nEditRow, nEditCol); + InitController(aController, nEditRow, nEditCol); - aController->ClearModified(); - aController->SetModifyHdl(LINK(this,EditBrowseBox,ModifyHdl)); - EnableAndShow(); + aController->ClearModified(); + aController->SetModifyHdl(LINK(this,EditBrowseBox,ModifyHdl)); + EnableAndShow(); - if ( isAccessibleAlive() ) - implCreateActiveAccessible(); + if ( isAccessibleAlive() ) + implCreateActiveAccessible(); - // activate the cell only of the browser has the focus - if ( bHasFocus && bCellFocus ) - AsynchGetFocus(); - } - else + // activate the cell only of the browser has the focus + if ( bHasFocus && bCellFocus ) + AsynchGetFocus(); + } + else + { + // no controller -> we have a new "active descendant" + if ( isAccessibleAlive() && HasFocus() ) { - // no controller -> we have a new "active descendant" - if ( isAccessibleAlive() && HasFocus() ) - { - commitTableEvent( - ACTIVE_DESCENDANT_CHANGED, - makeAny( CreateAccessibleCell( nRow, GetColumnPos( nCol -1) ) ), - Any() - ); - } + commitTableEvent( + ACTIVE_DESCENDANT_CHANGED, + makeAny( CreateAccessibleCell( nRow, GetColumnPos( nCol -1) ) ), + Any() + ); } } } @@ -979,37 +980,37 @@ namespace svt void EditBrowseBox::DeactivateCell(bool bUpdate) { - if (IsEditing()) + if (!IsEditing()) + return; + + if ( isAccessibleAlive() ) { - if ( isAccessibleAlive() ) - { - commitBrowseBoxEvent( CHILD, Any(), makeAny( m_aImpl->m_xActiveCell ) ); - m_aImpl->clearActiveCell(); - } + commitBrowseBoxEvent( CHILD, Any(), makeAny( m_aImpl->m_xActiveCell ) ); + m_aImpl->clearActiveCell(); + } - aOldController = aController; - aController.clear(); + aOldController = aController; + aController.clear(); - // reset the modify handler - aOldController->SetModifyHdl(Link<LinkParamNone*,void>()); + // reset the modify handler + aOldController->SetModifyHdl(Link<LinkParamNone*,void>()); - if (bHasFocus) - GrabFocus(); // ensure that we have (and keep) the focus + if (bHasFocus) + GrabFocus(); // ensure that we have (and keep) the focus - aOldController->suspend(); + aOldController->suspend(); - // update if requested - if (bUpdate) - Update(); + // update if requested + if (bUpdate) + Update(); - nOldEditCol = nEditCol; - nOldEditRow = nEditRow; + nOldEditCol = nEditCol; + nOldEditRow = nEditRow; - // release the controller (asynchronously) - if (nEndEvent) - Application::RemoveUserEvent(nEndEvent); - nEndEvent = Application::PostUserEvent(LINK(this,EditBrowseBox,EndEditHdl), nullptr, true); - } + // release the controller (asynchronously) + if (nEndEvent) + Application::RemoveUserEvent(nEndEvent); + nEndEvent = Application::PostUserEvent(LINK(this,EditBrowseBox,EndEditHdl), nullptr, true); } diff --git a/svtools/source/brwbox/editbrowsebox2.cxx b/svtools/source/brwbox/editbrowsebox2.cxx index d705b99d063a..3d962b425501 100644 --- a/svtools/source/brwbox/editbrowsebox2.cxx +++ b/svtools/source/brwbox/editbrowsebox2.cxx @@ -65,24 +65,24 @@ void EditBrowseBox::implCreateActiveAccessible( ) DBG_ASSERT( IsEditing(), "EditBrowseBox::implCreateActiveAccessible: not to be called if we're not editing currently!" ); DBG_ASSERT( !m_aImpl->m_xActiveCell.is(), "EditBrowseBox::implCreateActiveAccessible: not to be called if the old one is still alive!" ); - if ( !m_aImpl->m_xActiveCell.is() && IsEditing() ) - { - Reference< XAccessible > xCont = aController->GetWindow().GetAccessible(); - Reference< XAccessible > xMy = GetAccessible(); - if ( xMy.is() && xCont.is() ) - { - m_aImpl->m_xActiveCell = getAccessibleFactory().createEditBrowseBoxTableCellAccess( - xMy, // parent accessible - xCont, // control accessible - VCLUnoHelper::GetInterface( &aController->GetWindow() ), // focus window (for notifications) - *this, // the browse box - GetCurRow(), - GetColumnPos( GetCurColumnId() ) - ); - - commitBrowseBoxEvent( CHILD, makeAny( m_aImpl->m_xActiveCell ), Any() ); - } - } + if ( !(!m_aImpl->m_xActiveCell.is() && IsEditing()) ) + return; + + Reference< XAccessible > xCont = aController->GetWindow().GetAccessible(); + Reference< XAccessible > xMy = GetAccessible(); + if ( !(xMy.is() && xCont.is()) ) + return; + + m_aImpl->m_xActiveCell = getAccessibleFactory().createEditBrowseBoxTableCellAccess( + xMy, // parent accessible + xCont, // control accessible + VCLUnoHelper::GetInterface( &aController->GetWindow() ), // focus window (for notifications) + *this, // the browse box + GetCurRow(), + GetColumnPos( GetCurColumnId() ) + ); + + commitBrowseBoxEvent( CHILD, makeAny( m_aImpl->m_xActiveCell ), Any() ); } @@ -127,40 +127,40 @@ void EditBrowseBox::DetermineFocus( const GetFocusFlags _nGetFocusFlags ) pWindow = pWindow->GetParent()) bFocus = pWindow == this; - if (bFocus != bHasFocus) - { - bHasFocus = bFocus; + if (bFocus == bHasFocus) + return; + + bHasFocus = bFocus; + + if ( !(GetBrowserFlags( ) & EditBrowseBoxFlags::SMART_TAB_TRAVEL) ) + return; + + if ( !(bHasFocus // we got the focus + && ( _nGetFocusFlags & GetFocusFlags::Tab )) // using the TAB key + ) + return; - if ( GetBrowserFlags( ) & EditBrowseBoxFlags::SMART_TAB_TRAVEL ) + long nRows = GetRowCount(); + sal_uInt16 nCols = ColCount(); + + if ( ( nRows > 0 ) && ( nCols > 0 ) ) + { + if ( _nGetFocusFlags & GetFocusFlags::Forward ) { - if ( bHasFocus // we got the focus - && ( _nGetFocusFlags & GetFocusFlags::Tab ) // using the TAB key - ) + if ( GetColumnId( 0 ) != HandleColumnId ) { - long nRows = GetRowCount(); - sal_uInt16 nCols = ColCount(); - - if ( ( nRows > 0 ) && ( nCols > 0 ) ) - { - if ( _nGetFocusFlags & GetFocusFlags::Forward ) - { - if ( GetColumnId( 0 ) != HandleColumnId ) - { - GoToRowColumnId( 0, GetColumnId( 0 ) ); - } - else - { // the first column is the handle column -> not focussable - if ( nCols > 1 ) - GoToRowColumnId( 0, GetColumnId( 1 ) ); - } - } - else if ( _nGetFocusFlags & GetFocusFlags::Backward ) - { - GoToRowColumnId( nRows - 1, GetColumnId( nCols -1 ) ); - } - } + GoToRowColumnId( 0, GetColumnId( 0 ) ); + } + else + { // the first column is the handle column -> not focussable + if ( nCols > 1 ) + GoToRowColumnId( 0, GetColumnId( 1 ) ); } } + else if ( _nGetFocusFlags & GetFocusFlags::Backward ) + { + GoToRowColumnId( nRows - 1, GetColumnId( nCols -1 ) ); + } } } diff --git a/svtools/source/config/apearcfg.cxx b/svtools/source/config/apearcfg.cxx index 7ccfa0f142a9..e74cbe33ae84 100644 --- a/svtools/source/config/apearcfg.cxx +++ b/svtools/source/config/apearcfg.cxx @@ -54,35 +54,35 @@ SvtTabAppearanceCfg::SvtTabAppearanceCfg() const Any* pValues = aValues.getConstArray(); DBG_ASSERT(aValues.getLength() == rNames.getLength(), "GetProperties failed"); - if(aValues.getLength() == rNames.getLength()) + if(aValues.getLength() != rNames.getLength()) + return; + + for(int nProp = 0; nProp < rNames.getLength(); ++nProp, ++pValues) { - for(int nProp = 0; nProp < rNames.getLength(); ++nProp, ++pValues) + if(pValues->hasValue()) { - if(pValues->hasValue()) + switch(nProp) { - switch(nProp) + case 0: //"Window/Drag" + { + short nTmp; + if (*pValues >>= nTmp) + nDragMode = (DragMode)nTmp; + break; + } + case 1: bMenuMouseFollow = *o3tl::doAccess<bool>(*pValues); break; //"Menu/FollowMouse", + case 2: { - case 0: //"Window/Drag" - { - short nTmp; - if (*pValues >>= nTmp) - nDragMode = (DragMode)nTmp; - break; - } - case 1: bMenuMouseFollow = *o3tl::doAccess<bool>(*pValues); break; //"Menu/FollowMouse", - case 2: - { - short nTmp; - if (*pValues >>= nTmp) - nSnapMode = (SnapType)nTmp; //"Dialog/MousePositioning", - break; - } - case 3: { short nTmp = 0; *pValues >>= nTmp; nMiddleMouse = static_cast<MouseMiddleButtonAction>(nTmp); break; } //"Dialog/MiddleMouseButton", + short nTmp; + if (*pValues >>= nTmp) + nSnapMode = (SnapType)nTmp; //"Dialog/MousePositioning", + break; + } + case 3: { short nTmp = 0; *pValues >>= nTmp; nMiddleMouse = static_cast<MouseMiddleButtonAction>(nTmp); break; } //"Dialog/MiddleMouseButton", #if defined( UNX ) - case 4: bFontAntialiasing = *o3tl::doAccess<bool>(*pValues); break; // "FontAntialising/Enabled", - case 5: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight", + case 4: bFontAntialiasing = *o3tl::doAccess<bool>(*pValues); break; // "FontAntialising/Enabled", + case 5: *pValues >>= nAAMinPixelHeight; break; // "FontAntialising/MinPixelHeight", #endif - } } } } diff --git a/svtools/source/config/colorcfg.cxx b/svtools/source/config/colorcfg.cxx index 9acf01a6326c..c7be767896a3 100644 --- a/svtools/source/config/colorcfg.cxx +++ b/svtools/source/config/colorcfg.cxx @@ -346,24 +346,24 @@ IMPL_LINK( ColorConfig_Impl, DataChangedEventListener, VclSimpleEvent&, rEvent, void ColorConfig_Impl::ImplUpdateApplicationSettings() { Application* pApp = GetpApp(); - if( pApp ) - { - AllSettings aSettings = Application::GetSettings(); - StyleSettings aStyleSettings( aSettings.GetStyleSettings() ); + if( !pApp ) + return; - ColorConfigValue aRet = GetColorConfigValue(svtools::FONTCOLOR); - if(COL_AUTO == sal::static_int_cast<ColorData>(aRet.nColor)) - aRet.nColor = ColorConfig::GetDefaultColor(svtools::FONTCOLOR).GetColor(); + AllSettings aSettings = Application::GetSettings(); + StyleSettings aStyleSettings( aSettings.GetStyleSettings() ); - Color aFontColor(aRet.nColor); + ColorConfigValue aRet = GetColorConfigValue(svtools::FONTCOLOR); + if(COL_AUTO == sal::static_int_cast<ColorData>(aRet.nColor)) + aRet.nColor = ColorConfig::GetDefaultColor(svtools::FONTCOLOR).GetColor(); - if( aStyleSettings.GetFontColor() != aFontColor ) - { - aStyleSettings.SetFontColor( aFontColor ); + Color aFontColor(aRet.nColor); - aSettings.SetStyleSettings( aStyleSettings ); - Application::SetSettings( aSettings ); - } + if( aStyleSettings.GetFontColor() != aFontColor ) + { + aStyleSettings.SetFontColor( aFontColor ); + + aSettings.SetStyleSettings( aStyleSettings ); + Application::SetSettings( aSettings ); } } diff --git a/svtools/source/config/helpopt.cxx b/svtools/source/config/helpopt.cxx index bc1ac4d014c1..3a2ec50d60da 100644 --- a/svtools/source/config/helpopt.cxx +++ b/svtools/source/config/helpopt.cxx @@ -136,66 +136,66 @@ void SvtHelpOptions_Impl::Load(const uno::Sequence< OUString>& rPropertyNames) Sequence< Any > aValues = GetProperties( rPropertyNames ); const Any* pValues = aValues.getConstArray(); DBG_ASSERT( aValues.getLength() == rPropertyNames.getLength(), "GetProperties failed" ); - if ( aValues.getLength() == rPropertyNames.getLength() ) + if ( aValues.getLength() != rPropertyNames.getLength() ) + return; + + for ( int nProp = 0; nProp < rPropertyNames.getLength(); nProp++ ) { - for ( int nProp = 0; nProp < rPropertyNames.getLength(); nProp++ ) + assert(pValues[nProp].hasValue() && "property value missing"); + if ( pValues[nProp].hasValue() ) { - assert(pValues[nProp].hasValue() && "property value missing"); - if ( pValues[nProp].hasValue() ) + bool bTmp; + OUString aTmpStr; + sal_Int32 nTmpInt = 0; + if ( pValues[nProp] >>= bTmp ) { - bool bTmp; - OUString aTmpStr; - sal_Int32 nTmpInt = 0; - if ( pValues[nProp] >>= bTmp ) - { - switch ( static_cast< HelpProperty >( - lcl_MapPropertyName(rPropertyNames[nProp], aInternalPropertyNames) ) ) - { - case HelpProperty::ExtendedHelp: - bExtendedHelp = bTmp; - break; - case HelpProperty::HelpTips: - bHelpTips = bTmp; - break; - default: - SAL_WARN( "svtools.config", "Wrong Member!" ); - break; - } - } - else if ( pValues[nProp] >>= aTmpStr ) + switch ( static_cast< HelpProperty >( + lcl_MapPropertyName(rPropertyNames[nProp], aInternalPropertyNames) ) ) { - switch ( static_cast< HelpProperty >(nProp) ) - { - case HelpProperty::Locale: - aLocale = aTmpStr; - break; - - case HelpProperty::System: - aSystem = aTmpStr; - break; - case HelpProperty::StyleSheet: - sHelpStyleSheet = aTmpStr; + case HelpProperty::ExtendedHelp: + bExtendedHelp = bTmp; + break; + case HelpProperty::HelpTips: + bHelpTips = bTmp; + break; + default: + SAL_WARN( "svtools.config", "Wrong Member!" ); break; - default: - SAL_WARN( "svtools.config", "Wrong Member!" ); - break; - } - } - else if ( pValues[nProp] >>= nTmpInt ) - { - SAL_WARN( "svtools.config", "Wrong Member!" ); } - else + } + else if ( pValues[nProp] >>= aTmpStr ) + { + switch ( static_cast< HelpProperty >(nProp) ) { - SAL_WARN( "svtools.config", "Wrong Type!" ); + case HelpProperty::Locale: + aLocale = aTmpStr; + break; + + case HelpProperty::System: + aSystem = aTmpStr; + break; + case HelpProperty::StyleSheet: + sHelpStyleSheet = aTmpStr; + break; + default: + SAL_WARN( "svtools.config", "Wrong Member!" ); + break; } } + else if ( pValues[nProp] >>= nTmpInt ) + { + SAL_WARN( "svtools.config", "Wrong Member!" ); + } + else + { + SAL_WARN( "svtools.config", "Wrong Type!" ); + } } - if ( IsHelpTips() != Help::IsQuickHelpEnabled() ) - IsHelpTips() ? Help::EnableQuickHelp() : Help::DisableQuickHelp(); - if ( IsExtendedHelp() != Help::IsBalloonHelpEnabled() ) - IsExtendedHelp() ? Help::EnableBalloonHelp() : Help::DisableBalloonHelp(); } + if ( IsHelpTips() != Help::IsQuickHelpEnabled() ) + IsHelpTips() ? Help::EnableQuickHelp() : Help::DisableQuickHelp(); + if ( IsExtendedHelp() != Help::IsBalloonHelpEnabled() ) + IsExtendedHelp() ? Help::EnableBalloonHelp() : Help::DisableBalloonHelp(); } void SvtHelpOptions_Impl::ImplCommit() diff --git a/svtools/source/config/htmlcfg.cxx b/svtools/source/config/htmlcfg.cxx index f20d725f8e28..cbf6cff6282e 100644 --- a/svtools/source/config/htmlcfg.cxx +++ b/svtools/source/config/htmlcfg.cxx @@ -123,71 +123,71 @@ void SvxHtmlOptions::Load( const Sequence< OUString >& aNames ) Sequence<Any> aValues = GetProperties(aNames); const Any* pValues = aValues.getConstArray(); DBG_ASSERT(aValues.getLength() == aNames.getLength(), "GetProperties failed"); - if(aValues.getLength() == aNames.getLength()) + if(aValues.getLength() != aNames.getLength()) + return; + + pImpl->nFlags = HtmlCfgFlags::NONE; + for(int nProp = 0; nProp < aNames.getLength(); nProp++) { - pImpl->nFlags = HtmlCfgFlags::NONE; - for(int nProp = 0; nProp < aNames.getLength(); nProp++) + if(pValues[nProp].hasValue()) { - if(pValues[nProp].hasValue()) + switch(nProp) { - switch(nProp) - { - case 0: - if(*o3tl::doAccess<bool>(pValues[nProp])) - pImpl->nFlags |= HtmlCfgFlags::UnknownTags; - break;//"Import/UnknownTag", - case 1: - if(*o3tl::doAccess<bool>(pValues[nProp])) - pImpl->nFlags |= HtmlCfgFlags::IgnoreFontFamily; - break;//"Import/FontSetting", - case 2: pValues[nProp] >>= pImpl->aFontSizeArr[0]; break;//"Import/FontSize/Size_1", - case 3: pValues[nProp] >>= pImpl->aFontSizeArr[1]; break;//"Import/FontSize/Size_2", - case 4: pValues[nProp] >>= pImpl->aFontSizeArr[2]; break;//"Import/FontSize/Size_3", - case 5: pValues[nProp] >>= pImpl->aFontSizeArr[3]; break;//"Import/FontSize/Size_4", - case 6: pValues[nProp] >>= pImpl->aFontSizeArr[4]; break;//"Import/FontSize/Size_5", - case 7: pValues[nProp] >>= pImpl->aFontSizeArr[5]; break;//"Import/FontSize/Size_6", - case 8: pValues[nProp] >>= pImpl->aFontSizeArr[6]; break;//"Import/FontSize/Size_7", - case 9://"Export/Browser", + case 0: + if(*o3tl::doAccess<bool>(pValues[nProp])) + pImpl->nFlags |= HtmlCfgFlags::UnknownTags; + break;//"Import/UnknownTag", + case 1: + if(*o3tl::doAccess<bool>(pValues[nProp])) + pImpl->nFlags |= HtmlCfgFlags::IgnoreFontFamily; + break;//"Import/FontSetting", + case 2: pValues[nProp] >>= pImpl->aFontSizeArr[0]; break;//"Import/FontSize/Size_1", + case 3: pValues[nProp] >>= pImpl->aFontSizeArr[1]; break;//"Import/FontSize/Size_2", + case 4: pValues[nProp] >>= pImpl->aFontSizeArr[2]; break;//"Import/FontSize/Size_3", + case 5: pValues[nProp] >>= pImpl->aFontSizeArr[3]; break;//"Import/FontSize/Size_4", + case 6: pValues[nProp] >>= pImpl->aFontSizeArr[4]; break;//"Import/FontSize/Size_5", + case 7: pValues[nProp] >>= pImpl->aFontSizeArr[5]; break;//"Import/FontSize/Size_6", + case 8: pValues[nProp] >>= pImpl->aFontSizeArr[6]; break;//"Import/FontSize/Size_7", + case 9://"Export/Browser", + { + sal_Int32 nExpMode = 0; + pValues[nProp] >>= nExpMode; + switch( nExpMode ) { - sal_Int32 nExpMode = 0; - pValues[nProp] >>= nExpMode; - switch( nExpMode ) - { - case 1: nExpMode = HTML_CFG_MSIE; break; - case 3: nExpMode = HTML_CFG_WRITER; break; - case 4: nExpMode = HTML_CFG_NS40; break; - default: nExpMode = HTML_CFG_NS40; break; - } - - pImpl->nExportMode = nExpMode; + case 1: nExpMode = HTML_CFG_MSIE; break; + case 3: nExpMode = HTML_CFG_WRITER; break; + case 4: nExpMode = HTML_CFG_NS40; break; + default: nExpMode = HTML_CFG_NS40; break; } - break; - case 10: - if(*o3tl::doAccess<bool>(pValues[nProp])) - pImpl->nFlags |= HtmlCfgFlags::StarBasic; - break;//"Export/Basic", - case 11: - if(*o3tl::doAccess<bool>(pValues[nProp])) - pImpl->nFlags |= HtmlCfgFlags::PrintLayoutExtension; - break;//"Export/PrintLayout", - case 12: - if(*o3tl::doAccess<bool>(pValues[nProp])) - pImpl->nFlags |= HtmlCfgFlags::LocalGrf; - break;//"Export/LocalGraphic", - case 13: - if(*o3tl::doAccess<bool>(pValues[nProp])) - pImpl->nFlags |= HtmlCfgFlags::IsBasicWarning; - break;//"Export/Warning" - - case 14: pValues[nProp] >>= pImpl->eEncoding; - pImpl->bIsEncodingDefault = false; - break;//"Export/Encoding" - - case 15: - if(*o3tl::doAccess<bool>(pValues[nProp])) - pImpl->nFlags |= HtmlCfgFlags::NumbersEnglishUS; - break;//"Import/NumbersEnglishUS" - } + + pImpl->nExportMode = nExpMode; + } + break; + case 10: + if(*o3tl::doAccess<bool>(pValues[nProp])) + pImpl->nFlags |= HtmlCfgFlags::StarBasic; + break;//"Export/Basic", + case 11: + if(*o3tl::doAccess<bool>(pValues[nProp])) + pImpl->nFlags |= HtmlCfgFlags::PrintLayoutExtension; + break;//"Export/PrintLayout", + case 12: + if(*o3tl::doAccess<bool>(pValues[nProp])) + pImpl->nFlags |= HtmlCfgFlags::LocalGrf; + break;//"Export/LocalGraphic", + case 13: + if(*o3tl::doAccess<bool>(pValues[nProp])) + pImpl->nFlags |= HtmlCfgFlags::IsBasicWarning; + break;//"Export/Warning" + + case 14: pValues[nProp] >>= pImpl->eEncoding; + pImpl->bIsEncodingDefault = false; + break;//"Export/Encoding" + + case 15: + if(*o3tl::doAccess<bool>(pValues[nProp])) + pImpl->nFlags |= HtmlCfgFlags::NumbersEnglishUS; + break;//"Import/NumbersEnglishUS" } } } diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 7d6eeecd440e..d0f628798eba 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -1289,19 +1289,19 @@ IMPL_LINK( SvtFileView, HeaderSelect_Impl, HeaderBar*, pBar, void ) IMPL_LINK( SvtFileView, HeaderEndDrag_Impl, HeaderBar*, pBar, void ) { - if ( !pBar->IsItemMode() ) - { - Size aSize; - sal_uInt16 nTabs = pBar->GetItemCount(); - long nTmpSize = 0; + if ( pBar->IsItemMode() ) + return; - for ( sal_uInt16 i = 1; i <= nTabs; ++i ) - { - long nWidth = pBar->GetItemSize(i); - aSize.Width() = nWidth + nTmpSize; - nTmpSize += nWidth; - mpImpl->mpView->SetTab( i, aSize.Width(), MapUnit::MapPixel ); - } + Size aSize; + sal_uInt16 nTabs = pBar->GetItemCount(); + long nTmpSize = 0; + + for ( sal_uInt16 i = 1; i <= nTabs; ++i ) + { + long nWidth = pBar->GetItemSize(i); + aSize.Width() = nWidth + nTmpSize; + nTmpSize += nWidth; + mpImpl->mpView->SetTab( i, aSize.Width(), MapUnit::MapPixel ); } } diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx index 2f2aae754a48..cc62de2a363a 100644 --- a/svtools/source/contnr/foldertree.cxx +++ b/svtools/source/contnr/foldertree.cxx @@ -41,48 +41,48 @@ void FolderTree::RequestingChildren( SvTreeListEntry* pEntry ) void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry ) { - if( pEntry ) - { - OUString* pURL = static_cast< OUString* >( pEntry->GetUserData() ); + if( !pEntry ) + return; + + OUString* pURL = static_cast< OUString* >( pEntry->GetUserData() ); - if( pURL && m_sLastUpdatedDir != *pURL ) + if( pURL && m_sLastUpdatedDir != *pURL ) + { + while (SvTreeListEntry* pChild = FirstChild(pEntry)) { - while (SvTreeListEntry* pChild = FirstChild(pEntry)) - { - GetModel()->Remove(pChild); - } + GetModel()->Remove(pChild); + } - ::std::vector< SortingData_Impl* > aContent; + ::std::vector< SortingData_Impl* > aContent; - ::rtl::Reference< ::svt::FileViewContentEnumerator > - xContentEnumerator(new FileViewContentEnumerator( - m_xEnv, aContent, m_aMutex, nullptr)); + ::rtl::Reference< ::svt::FileViewContentEnumerator > + xContentEnumerator(new FileViewContentEnumerator( + m_xEnv, aContent, m_aMutex, nullptr)); - FolderDescriptor aFolder( *pURL ); + FolderDescriptor aFolder( *pURL ); - EnumerationResult eResult = - xContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList ); + EnumerationResult eResult = + xContentEnumerator->enumerateFolderContentSync( aFolder, m_aBlackList ); - if ( EnumerationResult::SUCCESS == eResult ) + if ( EnumerationResult::SUCCESS == eResult ) + { + for(SortingData_Impl* i : aContent) { - for(SortingData_Impl* i : aContent) + if( i->mbIsFolder ) { - if( i->mbIsFolder ) - { - SvTreeListEntry* pNewEntry = InsertEntry( i->GetTitle(), pEntry, true ); + SvTreeListEntry* pNewEntry = InsertEntry( i->GetTitle(), pEntry, true ); - OUString* sData = new OUString( i->maTargetURL ); - pNewEntry->SetUserData( static_cast< void* >( sData ) ); - } + OUString* sData = new OUString( i->maTargetURL ); + pNewEntry->SetUserData( static_cast< void* >( sData ) ); } } } - else - { - // this dir was updated recently - // next time read this remote folder - m_sLastUpdatedDir.clear(); - } + } + else + { + // this dir was updated recently + // next time read this remote folder + m_sLastUpdatedDir.clear(); } } @@ -92,24 +92,24 @@ void FolderTree::FillTreeEntry( const OUString & rUrl, const ::std::vector< std: SvTreeListEntry* pParent = GetCurEntry(); - if( pParent && !IsExpanded( pParent ) ) - { - while (SvTreeListEntry* pChild = FirstChild(pParent)) - { - GetModel()->Remove(pChild); - } + if( !(pParent && !IsExpanded( pParent )) ) + return; + while (SvTreeListEntry* pChild = FirstChild(pParent)) + { + GetModel()->Remove(pChild); + } - for(::std::vector< std::pair< OUString, OUString > >::const_iterator it = rFolders.begin(); it != rFolders.end() ; ++it) - { - SvTreeListEntry* pNewEntry = InsertEntry( it->first, pParent, true ); - OUString* sData = new OUString( it->second ); - pNewEntry->SetUserData( static_cast< void* >( sData ) ); - } - m_sLastUpdatedDir = rUrl; - Expand( pParent ); + for(::std::vector< std::pair< OUString, OUString > >::const_iterator it = rFolders.begin(); it != rFolders.end() ; ++it) + { + SvTreeListEntry* pNewEntry = InsertEntry( it->first, pParent, true ); + OUString* sData = new OUString( it->second ); + pNewEntry->SetUserData( static_cast< void* >( sData ) ); } + + m_sLastUpdatedDir = rUrl; + Expand( pParent ); } void FolderTree::SetTreePath( OUString const & sUrl ) diff --git a/svtools/source/contnr/iconviewimpl.cxx b/svtools/source/contnr/iconviewimpl.cxx index d1221169afb4..4f36e04ae4a6 100644 --- a/svtools/source/contnr/iconviewimpl.cxx +++ b/svtools/source/contnr/iconviewimpl.cxx @@ -36,20 +36,20 @@ void IconViewImpl::CursorUp() for(short i = 0; i < pView->GetColumnsCount() && pPrevFirstToDraw; i++) pPrevFirstToDraw = pView->PrevVisible(pPrevFirstToDraw); - if( pPrevFirstToDraw ) - { - nFlags &= (~LBoxFlags::Filling); - long nEntryHeight = pView->GetEntryHeight(); - ShowCursor( false ); - pView->Update(); - pStartEntry = pPrevFirstToDraw; - tools::Rectangle aArea( GetVisibleArea() ); - aArea.Bottom() -= nEntryHeight; - pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren ); - pView->Update(); - ShowCursor( true ); - pView->NotifyScrolled(); - } + if( !pPrevFirstToDraw ) + return; + + nFlags &= (~LBoxFlags::Filling); + long nEntryHeight = pView->GetEntryHeight(); + ShowCursor( false ); + pView->Update(); + pStartEntry = pPrevFirstToDraw; + tools::Rectangle aArea( GetVisibleArea() ); + aArea.Bottom() -= nEntryHeight; + pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren ); + pView->Update(); + ShowCursor( true ); + pView->NotifyScrolled(); } void IconViewImpl::CursorDown() @@ -440,19 +440,19 @@ void IconViewImpl::Paint(vcl::RenderContext& rRenderContext, const tools::Rectan void IconViewImpl::InvalidateEntry( long nId ) const { - if( !(nFlags & LBoxFlags::InPaint )) - { - tools::Rectangle aRect( GetVisibleArea() ); - long nMaxBottom = aRect.Bottom(); - aRect.Top() = nId / pView->GetColumnsCount() * pView->GetEntryHeight(); - aRect.Bottom() = aRect.Top(); aRect.Bottom() += pView->GetEntryHeight(); + if( (nFlags & LBoxFlags::InPaint )) + return; - if( aRect.Top() > nMaxBottom ) - return; - if( aRect.Bottom() > nMaxBottom ) - aRect.Bottom() = nMaxBottom; - pView->Invalidate( aRect ); - } + tools::Rectangle aRect( GetVisibleArea() ); + long nMaxBottom = aRect.Bottom(); + aRect.Top() = nId / pView->GetColumnsCount() * pView->GetEntryHeight(); + aRect.Bottom() = aRect.Top(); aRect.Bottom() += pView->GetEntryHeight(); + + if( aRect.Top() > nMaxBottom ) + return; + if( aRect.Bottom() > nMaxBottom ) + aRect.Bottom() = nMaxBottom; + pView->Invalidate( aRect ); } bool IconViewImpl::KeyInput( const KeyEvent& rKEvt ) diff --git a/svtools/source/contnr/imivctl1.cxx b/svtools/source/contnr/imivctl1.cxx index 8366a8c497e1..e789d1524a7d 100644 --- a/svtools/source/contnr/imivctl1.cxx +++ b/svtools/source/contnr/imivctl1.cxx @@ -371,26 +371,26 @@ void SvxIconChoiceCtrl_Impl::SelectEntry( SvxIconChoiceCtrlEntry* pEntry, bool b nFlags &= ~IconChoiceFlags::ClearingSelection; } } - if( pEntry->IsSelected() != bSelect ) + if( pEntry->IsSelected() == bSelect ) + return; + + pHdlEntry = pEntry; + SvxIconViewFlags nEntryFlags = pEntry->GetFlags(); + if( bSelect ) { - pHdlEntry = pEntry; - SvxIconViewFlags nEntryFlags = pEntry->GetFlags(); - if( bSelect ) - { - nEntryFlags |= SvxIconViewFlags::SELECTED; - pEntry->AssignFlags( nEntryFlags ); - nSelectionCount++; - CallSelectHandler(); - } - else - { - nEntryFlags &= ~SvxIconViewFlags::SELECTED; - pEntry->AssignFlags( nEntryFlags ); - nSelectionCount--; - CallSelectHandler(); - } - EntrySelected( pEntry, bSelect ); + nEntryFlags |= SvxIconViewFlags::SELECTED; + pEntry->AssignFlags( nEntryFlags ); + nSelectionCount++; + CallSelectHandler(); } + else + { + nEntryFlags &= ~SvxIconViewFlags::SELECTED; + pEntry->AssignFlags( nEntryFlags ); + nSelectionCount--; + CallSelectHandler(); + } + EntrySelected( pEntry, bSelect ); } void SvxIconChoiceCtrl_Impl::EntrySelected(SvxIconChoiceCtrlEntry* pEntry, bool bSelect) @@ -480,22 +480,22 @@ void SvxIconChoiceCtrl_Impl::AdjustVirtSize( const tools::Rectangle& rRect ) if( aVirtOutputSize.Height() < (rRect.Bottom()+TBOFFS_WINBORDER) ) nHeightOffs = (rRect.Bottom()+TBOFFS_WINBORDER) - aVirtOutputSize.Height(); - if( nWidthOffs || nHeightOffs ) - { - Range aRange; - aVirtOutputSize.Width() += nWidthOffs; - aRange.Max() = aVirtOutputSize.Width(); - aHorSBar->SetRange( aRange ); + if( !(nWidthOffs || nHeightOffs) ) + return; - aVirtOutputSize.Height() += nHeightOffs; - aRange.Max() = aVirtOutputSize.Height(); - aVerSBar->SetRange( aRange ); + Range aRange; + aVirtOutputSize.Width() += nWidthOffs; + aRange.Max() = aVirtOutputSize.Width(); + aHorSBar->SetRange( aRange ); - pImpCursor->Clear(); - pGridMap->OutputSizeChanged(); - AdjustScrollBars(); - DocRectChanged(); - } + aVirtOutputSize.Height() += nHeightOffs; + aRange.Max() = aVirtOutputSize.Height(); + aVerSBar->SetRange( aRange ); + + pImpCursor->Clear(); + pGridMap->OutputSizeChanged(); + AdjustScrollBars(); + DocRectChanged(); } void SvxIconChoiceCtrl_Impl::InitPredecessors() @@ -940,48 +940,48 @@ bool SvxIconChoiceCtrl_Impl::MouseMove( const MouseEvent& rMEvt ) void SvxIconChoiceCtrl_Impl::SetCursor_Impl( SvxIconChoiceCtrlEntry* pOldCursor, SvxIconChoiceCtrlEntry* pNewCursor, bool bMod1, bool bShift ) { - if( pNewCursor ) + if( !pNewCursor ) + return; + + SvxIconChoiceCtrlEntry* pFilterEntry = nullptr; + bool bDeselectAll = false; + if( eSelectionMode != SelectionMode::Single ) { - SvxIconChoiceCtrlEntry* pFilterEntry = nullptr; - bool bDeselectAll = false; - if( eSelectionMode != SelectionMode::Single ) + if( !bMod1 && !bShift ) + bDeselectAll = true; + else if( bShift && !bMod1 && !pAnchor ) { - if( !bMod1 && !bShift ) - bDeselectAll = true; - else if( bShift && !bMod1 && !pAnchor ) - { - bDeselectAll = true; - pFilterEntry = pOldCursor; - } + bDeselectAll = true; + pFilterEntry = pOldCursor; } - if( bDeselectAll ) - DeselectAllBut( pFilterEntry ); - ShowCursor( false ); - MakeEntryVisible( pNewCursor ); - SetCursor( pNewCursor ); - if( bMod1 && !bShift ) - { - if( pAnchor ) - { - AddSelectedRect( pAnchor, pOldCursor ); - pAnchor = nullptr; - } - } - else if( bShift ) + } + if( bDeselectAll ) + DeselectAllBut( pFilterEntry ); + ShowCursor( false ); + MakeEntryVisible( pNewCursor ); + SetCursor( pNewCursor ); + if( bMod1 && !bShift ) + { + if( pAnchor ) { - if( !pAnchor ) - pAnchor = pOldCursor; - if ( nWinBits & WB_ALIGN_LEFT ) - SelectRange( pAnchor, pNewCursor, bool(nFlags & IconChoiceFlags::AddMode) ); - else - SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList); + AddSelectedRect( pAnchor, pOldCursor ); + pAnchor = nullptr; } + } + else if( bShift ) + { + if( !pAnchor ) + pAnchor = pOldCursor; + if ( nWinBits & WB_ALIGN_LEFT ) + SelectRange( pAnchor, pNewCursor, bool(nFlags & IconChoiceFlags::AddMode) ); else - { - SelectEntry( pCursor, true, false ); - aCurSelectionRect = GetEntryBoundRect( pCursor ); - CallEventListeners( VclEventId::ListboxSelect, pCursor ); - } + SelectRect(pAnchor,pNewCursor, bool(nFlags & IconChoiceFlags::AddMode), &aSelectedRectList); + } + else + { + SelectEntry( pCursor, true, false ); + aCurSelectionRect = GetEntryBoundRect( pCursor ); + CallEventListeners( VclEventId::ListboxSelect, pCursor ); } } @@ -2123,20 +2123,20 @@ void SvxIconChoiceCtrl_Impl::Command( const CommandEvent& rCEvt ) void SvxIconChoiceCtrl_Impl::ToTop( SvxIconChoiceCtrlEntry* pEntry ) { - if( !pZOrderList->empty() - && pEntry != pZOrderList->back() + if( !(!pZOrderList->empty() + && pEntry != pZOrderList->back()) + ) return; + + for( + SvxIconChoiceCtrlEntryList_impl::iterator it = pZOrderList->begin(); + it != pZOrderList->end(); + ++it ) { - for( - SvxIconChoiceCtrlEntryList_impl::iterator it = pZOrderList->begin(); - it != pZOrderList->end(); - ++it - ) { - if ( *it == pEntry ) - { - pZOrderList->erase( it ); - pZOrderList->push_back( pEntry ); - break; - } + if ( *it == pEntry ) + { + pZOrderList->erase( it ); + pZOrderList->push_back( pEntry ); + break; } } } @@ -3070,24 +3070,24 @@ void SvxIconChoiceCtrl_Impl::InitSettings() pView->SetBackground( rStyleSettings.GetFieldColor()); long nScrBarSize = rStyleSettings.GetScrollBarSize(); - if( nScrBarSize != nHorSBarHeight || nScrBarSize != nVerSBarWidth ) - { - nHorSBarHeight = nScrBarSize; - Size aSize( aHorSBar->GetSizePixel() ); - aSize.Height() = nScrBarSize; - aHorSBar->Hide(); - aHorSBar->SetSizePixel( aSize ); + if( !(nScrBarSize != nHorSBarHeight || nScrBarSize != nVerSBarWidth) ) + return; - nVerSBarWidth = nScrBarSize; - aSize = aVerSBar->GetSizePixel(); - aSize.Width() = nScrBarSize; - aVerSBar->Hide(); - aVerSBar->SetSizePixel( aSize ); + nHorSBarHeight = nScrBarSize; + Size aSize( aHorSBar->GetSizePixel() ); + aSize.Height() = nScrBarSize; + aHorSBar->Hide(); + aHorSBar->SetSizePixel( aSize ); - Size aOSize( pView->Control::GetOutputSizePixel() ); - PositionScrollBars( aOSize.Width(), aOSize.Height() ); - AdjustScrollBars(); - } + nVerSBarWidth = nScrBarSize; + aSize = aVerSBar->GetSizePixel(); + aSize.Width() = nScrBarSize; + aVerSBar->Hide(); + aVerSBar->SetSizePixel( aSize ); + + Size aOSize( pView->Control::GetOutputSizePixel() ); + PositionScrollBars( aOSize.Width(), aOSize.Height() ); + AdjustScrollBars(); } EntryList_Impl::EntryList_Impl( SvxIconChoiceCtrl_Impl* pOwner ) : diff --git a/svtools/source/contnr/imivctl2.cxx b/svtools/source/contnr/imivctl2.cxx index ae2532edd7dd..6521751e5a86 100644 --- a/svtools/source/contnr/imivctl2.cxx +++ b/svtools/source/contnr/imivctl2.cxx @@ -674,24 +674,24 @@ sal_uLong IcnGridMap_Impl::GetGridCount( const Size& rSizePixel, sal_uInt16 nDX, void IcnGridMap_Impl::OutputSizeChanged() { - if( _pGridMap ) + if( !_pGridMap ) + return; + + sal_uInt16 nCols, nRows; + GetMinMapSize( nCols, nRows ); + if( _pView->nWinBits & WB_ALIGN_TOP ) { - sal_uInt16 nCols, nRows; - GetMinMapSize( nCols, nRows ); - if( _pView->nWinBits & WB_ALIGN_TOP ) - { - if( nCols != _nGridCols ) - Clear(); - else if( nRows >= _nGridRows ) - Expand(); - } - else - { - if( nRows != _nGridRows ) - Clear(); - else if( nCols >= _nGridCols ) - Expand(); - } + if( nCols != _nGridCols ) + Clear(); + else if( nRows >= _nGridRows ) + Expand(); + } + else + { + if( nRows != _nGridRows ) + Clear(); + else if( nCols >= _nGridCols ) + Expand(); } } diff --git a/svtools/source/contnr/ivctrl.cxx b/svtools/source/contnr/ivctrl.cxx index 31310df0313b..247442ce9165 100644 --- a/svtools/source/contnr/ivctrl.cxx +++ b/svtools/source/contnr/ivctrl.cxx @@ -330,54 +330,54 @@ void SvtIconChoiceCtrl::DataChanged( const DataChangedEvent& rDCEvt ) void SvtIconChoiceCtrl::SetBackground( const Wallpaper& rPaper ) { - if( rPaper != GetBackground() ) + if( rPaper == GetBackground() ) + return; + + const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); + // if it is the default (empty) wallpaper + if( rPaper.GetStyle() == WallpaperStyle::NONE && rPaper.GetColor() == COL_TRANSPARENT && + !rPaper.IsBitmap() && !rPaper.IsGradient() && !rPaper.IsRect()) { - const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); - // if it is the default (empty) wallpaper - if( rPaper.GetStyle() == WallpaperStyle::NONE && rPaper.GetColor() == COL_TRANSPARENT && - !rPaper.IsBitmap() && !rPaper.IsGradient() && !rPaper.IsRect()) + Control::SetBackground( rStyleSettings.GetFieldColor() ); + } + else + { + Wallpaper aBackground( rPaper ); + // HACK, as background might be transparent! + if( !aBackground.IsBitmap() ) + aBackground.SetStyle( WallpaperStyle::Tile ); + + WallpaperStyle eStyle = aBackground.GetStyle(); + Color aBack( aBackground.GetColor()); + Color aTrans( COL_TRANSPARENT ); + if( aBack == aTrans && + (!aBackground.IsBitmap() || + aBackground.GetBitmap().IsTransparent() || + (eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale)) ) { - Control::SetBackground( rStyleSettings.GetFieldColor() ); + aBackground.SetColor( rStyleSettings.GetFieldColor() ); + } + if( aBackground.IsScrollable() ) + { + tools::Rectangle aRect; + aRect.SetSize( Size(32765, 32765) ); + aBackground.SetRect( aRect ); } else { - Wallpaper aBackground( rPaper ); - // HACK, as background might be transparent! - if( !aBackground.IsBitmap() ) - aBackground.SetStyle( WallpaperStyle::Tile ); - - WallpaperStyle eStyle = aBackground.GetStyle(); - Color aBack( aBackground.GetColor()); - Color aTrans( COL_TRANSPARENT ); - if( aBack == aTrans && - (!aBackground.IsBitmap() || - aBackground.GetBitmap().IsTransparent() || - (eStyle != WallpaperStyle::Tile && eStyle != WallpaperStyle::Scale)) ) - { - aBackground.SetColor( rStyleSettings.GetFieldColor() ); - } - if( aBackground.IsScrollable() ) - { - tools::Rectangle aRect; - aRect.SetSize( Size(32765, 32765) ); - aBackground.SetRect( aRect ); - } - else - { - tools::Rectangle aRect( _pImpl->GetOutputRect() ); - aBackground.SetRect( aRect ); - } - Control::SetBackground( aBackground ); + tools::Rectangle aRect( _pImpl->GetOutputRect() ); + aBackground.SetRect( aRect ); } + Control::SetBackground( aBackground ); + } - // If text colors are attributed "hard," don't use automatism to select - // a readable text color. - vcl::Font aFont( GetFont() ); - aFont.SetColor( rStyleSettings.GetFieldTextColor() ); - SetFont( aFont ); + // If text colors are attributed "hard," don't use automatism to select + // a readable text color. + vcl::Font aFont( GetFont() ); + aFont.SetColor( rStyleSettings.GetFieldTextColor() ); + SetFont( aFont ); - Invalidate(InvalidateFlags::NoChildren); - } + Invalidate(InvalidateFlags::NoChildren); } void SvtIconChoiceCtrl::RequestHelp( const HelpEvent& rHEvt ) diff --git a/svtools/source/contnr/simptabl.cxx b/svtools/source/contnr/simptabl.cxx index 0b59579b4598..2e4e989054e5 100644 --- a/svtools/source/contnr/simptabl.cxx +++ b/svtools/source/contnr/simptabl.cxx @@ -175,21 +175,21 @@ void SvSimpleTable::SetTabs() SvHeaderTabListBox::SetTabs(); sal_uInt16 nPrivTabCount = TabCount(); - if ( nPrivTabCount ) - { - if ( nPrivTabCount > aHeaderBar->GetItemCount() ) - nPrivTabCount = aHeaderBar->GetItemCount(); + if ( !nPrivTabCount ) + return; - sal_uInt16 i, nPos = 0; - for ( i = 1; i < nPrivTabCount; ++i ) - { - sal_uInt16 nNewSize = static_cast< sal_uInt16 >( GetTab(i) ) - nPos; - aHeaderBar->SetItemSize( i, nNewSize ); - nPos = (sal_uInt16)GetTab(i); - } + if ( nPrivTabCount > aHeaderBar->GetItemCount() ) + nPrivTabCount = aHeaderBar->GetItemCount(); - aHeaderBar->SetItemSize( i, HEADERBAR_FULLSIZE ); // because no tab for last entry + sal_uInt16 i, nPos = 0; + for ( i = 1; i < nPrivTabCount; ++i ) + { + sal_uInt16 nNewSize = static_cast< sal_uInt16 >( GetTab(i) ) - nPos; + aHeaderBar->SetItemSize( i, nNewSize ); + nPos = (sal_uInt16)GetTab(i); } + + aHeaderBar->SetItemSize( i, HEADERBAR_FULLSIZE ); // because no tab for last entry } void SvSimpleTable::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) @@ -324,19 +324,19 @@ void SvSimpleTable::HBarClick() { sal_uInt16 nId=aHeaderBar->GetCurItemId(); - if (aHeaderBar->GetItemBits(nId) & HeaderBarItemBits::CLICKABLE) - { - if(nId==nSortCol+1) - { - SortByCol(nId-1,!bSortDirection); - } - else - { - SortByCol(nId-1,bSortDirection); - } + if (!(aHeaderBar->GetItemBits(nId) & HeaderBarItemBits::CLICKABLE)) + return; - aHeaderBarClickLink.Call(this); + if(nId==nSortCol+1) + { + SortByCol(nId-1,!bSortDirection); } + else + { + SortByCol(nId-1,bSortDirection); + } + + aHeaderBarClickLink.Call(this); } void SvSimpleTable::HBarDrag() diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx index c9f598dde923..6153f987efd3 100644 --- a/svtools/source/contnr/svimpbox.cxx +++ b/svtools/source/contnr/svimpbox.cxx @@ -221,20 +221,20 @@ void SvImpLBox::UpdateContextBmpWidthMax( SvTreeListEntry const * pEntry ) void SvImpLBox::CalcCellFocusRect( SvTreeListEntry const * pEntry, tools::Rectangle& rRect ) { - if ( pEntry && bIsCellFocusEnabled ) + if ( !(pEntry && bIsCellFocusEnabled) ) + return; + + if ( nCurTabPos > FIRST_ENTRY_TAB ) { - if ( nCurTabPos > FIRST_ENTRY_TAB ) - { - SvLBoxItem& rItem = pCursor->GetItem( nCurTabPos ); - rRect.Left() = pView->GetTab( pCursor, &rItem )->GetPos(); - } - if (pCursor->ItemCount() > static_cast<size_t>(nCurTabPos+1)) - { - SvLBoxItem& rNextItem = pCursor->GetItem( nCurTabPos + 1 ); - long nRight = pView->GetTab( pCursor, &rNextItem )->GetPos() - 1; - if ( nRight < rRect.Right() ) - rRect.Right() = nRight; - } + SvLBoxItem& rItem = pCursor->GetItem( nCurTabPos ); + rRect.Left() = pView->GetTab( pCursor, &rItem )->GetPos(); + } + if (pCursor->ItemCount() > static_cast<size_t>(nCurTabPos+1)) + { + SvLBoxItem& rNextItem = pCursor->GetItem( nCurTabPos + 1 ); + long nRight = pView->GetTab( pCursor, &rNextItem )->GetPos() - 1; + if ( nRight < rRect.Right() ) + rRect.Right() = nRight; } } @@ -374,20 +374,20 @@ void SvImpLBox::CursorUp() return; SvTreeListEntry* pPrevFirstToDraw = pView->PrevVisible(pStartEntry); - if( pPrevFirstToDraw ) - { - nFlags &= (~LBoxFlags::Filling); - long nEntryHeight = pView->GetEntryHeight(); - ShowCursor( false ); - pView->Update(); - pStartEntry = pPrevFirstToDraw; - tools::Rectangle aArea( GetVisibleArea() ); - aArea.Bottom() -= nEntryHeight; - pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren ); - pView->Update(); - ShowCursor( true ); - pView->NotifyScrolled(); - } + if( !pPrevFirstToDraw ) + return; + + nFlags &= (~LBoxFlags::Filling); + long nEntryHeight = pView->GetEntryHeight(); + ShowCursor( false ); + pView->Update(); + pStartEntry = pPrevFirstToDraw; + tools::Rectangle aArea( GetVisibleArea() ); + aArea.Bottom() -= nEntryHeight; + pView->Scroll( 0, nEntryHeight, aArea, ScrollFlags::NoChildren ); + pView->Update(); + ShowCursor( true ); + pView->NotifyScrolled(); } void SvImpLBox::PageDown( sal_uInt16 nDelta ) @@ -1323,36 +1323,36 @@ void SvImpLBox::FillView() nTempThumb = nVisibleViewCount - 1; pStartEntry = pView->GetEntryAtVisPos(nTempThumb); } - if( pStartEntry ) + if( !pStartEntry ) + return; + + sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos(pView->LastVisible())); + sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); + sal_uLong nCurDispEntries = nLast-nThumb+1; + if( nCurDispEntries >= nVisibleCount ) + return; + + ShowCursor( false ); + // fill window by moving the thumb up incrementally + bool bFound = false; + SvTreeListEntry* pTemp = pStartEntry; + while( nCurDispEntries < nVisibleCount && pTemp ) { - sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos(pView->LastVisible())); - sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); - sal_uLong nCurDispEntries = nLast-nThumb+1; - if( nCurDispEntries < nVisibleCount ) + pTemp = pView->PrevVisible(pStartEntry); + if( pTemp ) { - ShowCursor( false ); - // fill window by moving the thumb up incrementally - bool bFound = false; - SvTreeListEntry* pTemp = pStartEntry; - while( nCurDispEntries < nVisibleCount && pTemp ) - { - pTemp = pView->PrevVisible(pStartEntry); - if( pTemp ) - { - nThumb--; - pStartEntry = pTemp; - nCurDispEntries++; - bFound = true; - } - } - if( bFound ) - { - aVerSBar->SetThumbPos( nThumb ); - ShowCursor( true ); // recalculate focus rectangle - pView->Invalidate(); - } + nThumb--; + pStartEntry = pTemp; + nCurDispEntries++; + bFound = true; } } + if( bFound ) + { + aVerSBar->SetThumbPos( nThumb ); + ShowCursor( true ); // recalculate focus rectangle + pView->Invalidate(); + } } @@ -1481,22 +1481,22 @@ void SvImpLBox::SetEntryHeight() void SvImpLBox::EntryExpanded( SvTreeListEntry* pEntry ) { // SelAllDestrAnch( false, true ); //DeselectAll(); - if( GetUpdateMode() ) + if( !GetUpdateMode() ) + return; + + ShowCursor( false ); + long nY = GetEntryLine( pEntry ); + if( IsLineVisible(nY) ) { - ShowCursor( false ); - long nY = GetEntryLine( pEntry ); - if( IsLineVisible(nY) ) - { - InvalidateEntriesFrom( nY ); - FindMostRight( pEntry, nullptr ); - } - aVerSBar->SetRange( Range(0, pView->GetVisibleCount()-1 ) ); - // if we expanded before the thumb, the thumb's position has to be - // corrected - SyncVerThumb(); - ShowVerSBar(); - ShowCursor( true ); + InvalidateEntriesFrom( nY ); + FindMostRight( pEntry, nullptr ); } + aVerSBar->SetRange( Range(0, pView->GetVisibleCount()-1 ) ); + // if we expanded before the thumb, the thumb's position has to be + // corrected + SyncVerThumb(); + ShowVerSBar(); + ShowCursor( true ); } void SvImpLBox::EntryCollapsed( SvTreeListEntry* pEntry ) @@ -1743,23 +1743,23 @@ void SvImpLBox::MovingEntry( SvTreeListEntry* pEntry ) ShowCursor( false ); if( IsEntryInView( pEntry ) ) pView->Invalidate(); - if( pEntry == pStartEntry ) + if( pEntry != pStartEntry ) + return; + + SvTreeListEntry* pNew = nullptr; + if( !pEntry->HasChildren() ) { - SvTreeListEntry* pNew = nullptr; - if( !pEntry->HasChildren() ) - { - pNew = pView->NextVisible(pStartEntry); - if( !pNew ) - pNew = pView->PrevVisible(pStartEntry); - } - else - { - pNew = SvTreeList::NextSibling( pEntry ); - if( !pNew ) - pNew = SvTreeList::PrevSibling( pEntry ); - } - pStartEntry = pNew; + pNew = pView->NextVisible(pStartEntry); + if( !pNew ) + pNew = pView->PrevVisible(pStartEntry); + } + else + { + pNew = SvTreeList::NextSibling( pEntry ); + if( !pNew ) + pNew = SvTreeList::PrevSibling( pEntry ); } + pStartEntry = pNew; } void SvImpLBox::EntryMoved( SvTreeListEntry* pEntry ) @@ -1799,56 +1799,56 @@ void SvImpLBox::EntryMoved( SvTreeListEntry* pEntry ) void SvImpLBox::EntryInserted( SvTreeListEntry* pEntry ) { - if( GetUpdateMode() ) - { - SvTreeListEntry* pParent = pTree->GetParent(pEntry); - if (pParent && pTree->GetChildList(pParent).size() == 1) - // draw plus sign - pTree->InvalidateEntry( pParent ); + if( !GetUpdateMode() ) + return; - if( !pView->IsEntryVisible( pEntry ) ) - return; - bool bDeselAll(nFlags & LBoxFlags::DeselectAll); - if( bDeselAll ) - SelAllDestrAnch( false ); - else - DestroyAnchor(); - // nFlags &= (~LBoxFlags::DeselectAll); + SvTreeListEntry* pParent = pTree->GetParent(pEntry); + if (pParent && pTree->GetChildList(pParent).size() == 1) + // draw plus sign + pTree->InvalidateEntry( pParent ); + + if( !pView->IsEntryVisible( pEntry ) ) + return; + bool bDeselAll(nFlags & LBoxFlags::DeselectAll); + if( bDeselAll ) + SelAllDestrAnch( false ); + else + DestroyAnchor(); + // nFlags &= (~LBoxFlags::DeselectAll); // ShowCursor( false ); // if cursor is moved lower - long nY = GetEntryLine( pEntry ); - bool bEntryVisible = IsLineVisible( nY ); - if( bEntryVisible ) - { - ShowCursor( false ); // if cursor is moved lower - nY -= pView->GetEntryHeight(); // because of lines - InvalidateEntriesFrom( nY ); - } - else if( pStartEntry && nY < GetEntryLine(pStartEntry) ) + long nY = GetEntryLine( pEntry ); + bool bEntryVisible = IsLineVisible( nY ); + if( bEntryVisible ) + { + ShowCursor( false ); // if cursor is moved lower + nY -= pView->GetEntryHeight(); // because of lines + InvalidateEntriesFrom( nY ); + } + else if( pStartEntry && nY < GetEntryLine(pStartEntry) ) + { + // Check if the view is filled completely. If not, then adjust + // pStartEntry and the Cursor (automatic scrolling). + sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos(pView->LastVisible())); + sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); + sal_uInt16 nCurDispEntries = nLast-nThumb+1; + if( nCurDispEntries < nVisibleCount ) { - // Check if the view is filled completely. If not, then adjust - // pStartEntry and the Cursor (automatic scrolling). - sal_uInt16 nLast = (sal_uInt16)(pView->GetVisiblePos(pView->LastVisible())); - sal_uInt16 nThumb = (sal_uInt16)(pView->GetVisiblePos( pStartEntry )); - sal_uInt16 nCurDispEntries = nLast-nThumb+1; - if( nCurDispEntries < nVisibleCount ) - { - // set at the next paint event - pStartEntry = nullptr; - SetCursor( nullptr ); - pView->Invalidate(); - } - } - else if( !pStartEntry ) + // set at the next paint event + pStartEntry = nullptr; + SetCursor( nullptr ); pView->Invalidate(); - - SetMostRight( pEntry ); - aVerSBar->SetRange( Range(0, pView->GetVisibleCount()-1)); - SyncVerThumb(); // if something was inserted before the thumb - ShowVerSBar(); - ShowCursor( true ); - if( pStartEntry != pView->First() && (nFlags & LBoxFlags::Filling) ) - pView->Update(); + } } + else if( !pStartEntry ) + pView->Invalidate(); + + SetMostRight( pEntry ); + aVerSBar->SetRange( Range(0, pView->GetVisibleCount()-1)); + SyncVerThumb(); // if something was inserted before the thumb + ShowVerSBar(); + ShowCursor( true ); + if( pStartEntry != pView->First() && (nFlags & LBoxFlags::Filling) ) + pView->Update(); } @@ -3073,27 +3073,27 @@ void SvImpLBox::SetCurEntry( SvTreeListEntry* pEntry ) IMPL_LINK_NOARG(SvImpLBox, EditTimerCall, Timer *, void) { - if( pView->IsInplaceEditingEnabled() ) + if( !pView->IsInplaceEditingEnabled() ) + return; + + bool bIsMouseTriggered = aEditClickPos.X() >= 0; + if ( bIsMouseTriggered ) { - bool bIsMouseTriggered = aEditClickPos.X() >= 0; - if ( bIsMouseTriggered ) + Point aCurrentMousePos = pView->GetPointerPosPixel(); + if ( ( std::abs( aCurrentMousePos.X() - aEditClickPos.X() ) > 5 ) + || ( std::abs( aCurrentMousePos.Y() - aEditClickPos.Y() ) > 5 ) + ) { - Point aCurrentMousePos = pView->GetPointerPosPixel(); - if ( ( std::abs( aCurrentMousePos.X() - aEditClickPos.X() ) > 5 ) - || ( std::abs( aCurrentMousePos.Y() - aEditClickPos.Y() ) > 5 ) - ) - { - return; - } + return; } + } - SvTreeListEntry* pEntry = GetCurEntry(); - if( pEntry ) - { - ShowCursor( false ); - pView->ImplEditEntry( pEntry ); - ShowCursor( true ); - } + SvTreeListEntry* pEntry = GetCurEntry(); + if( pEntry ) + { + ShowCursor( false ); + pView->ImplEditEntry( pEntry ); + ShowCursor( true ); } } diff --git a/svtools/source/contnr/svlbitm.cxx b/svtools/source/contnr/svlbitm.cxx index 78a74272eb1e..968dc5402ac4 100644 --- a/svtools/source/contnr/svlbitm.cxx +++ b/svtools/source/contnr/svlbitm.cxx @@ -317,30 +317,30 @@ void SvLBoxButton::Clone( SvLBoxItem* pSource ) void SvLBoxButton::ImplAdjustBoxSize(Size& io_rSize, ControlType i_eType, vcl::RenderContext const & rRenderContext) { - if (rRenderContext.IsNativeControlSupported( i_eType, ControlPart::Entire) ) ... etc. - the rest is truncated _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits