diff options
Diffstat (limited to 'svtools/source/brwbox')
-rw-r--r-- | svtools/source/brwbox/brwbox1.cxx | 78 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox2.cxx | 5 | ||||
-rw-r--r-- | svtools/source/brwbox/brwbox3.cxx | 4 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.cxx | 5 | ||||
-rw-r--r-- | svtools/source/brwbox/datwin.hxx | 2 |
5 files changed, 30 insertions, 64 deletions
diff --git a/svtools/source/brwbox/brwbox1.cxx b/svtools/source/brwbox/brwbox1.cxx index 870185098d0a..385eb089303f 100644 --- a/svtools/source/brwbox/brwbox1.cxx +++ b/svtools/source/brwbox/brwbox1.cxx @@ -322,13 +322,8 @@ void BrowseBox::SetToggledSelectedColumn(sal_uInt16 _nSelectedColumnId) } } -void BrowseBox::FreezeColumn( sal_uInt16 nItemId, bool bFreeze ) +void BrowseBox::FreezeColumn( sal_uInt16 nItemId ) { - - // never unfreeze the handle-column - if ( nItemId == HandleColumnId && !bFreeze ) - return; - // get the position in the current array size_t nItemPos = GetColumnPos( nItemId ); if ( nItemPos >= pCols->size() ) @@ -336,57 +331,33 @@ void BrowseBox::FreezeColumn( sal_uInt16 nItemId, bool bFreeze ) return; // doesn't the state change? - if ( (*pCols)[ nItemPos ]->IsFrozen() == bFreeze ) + if ( (*pCols)[ nItemPos ]->IsFrozen() ) return; // remark the column selection sal_uInt16 nSelectedColId = ToggleSelectedColumn(); - // freeze or unfreeze? - if ( bFreeze ) + // to be moved? + if ( nItemPos != 0 && !(*pCols)[ nItemPos-1 ]->IsFrozen() ) { - // to be moved? - if ( nItemPos != 0 && !(*pCols)[ nItemPos-1 ]->IsFrozen() ) - { - // move to the right of the last frozen column - sal_uInt16 nFirstScrollable = FrozenColCount(); - BrowserColumn *pColumn = (*pCols)[ nItemPos ]; - BrowserColumns::iterator it = pCols->begin(); - ::std::advance( it, nItemPos ); - pCols->erase( it ); - nItemPos = nFirstScrollable; - it = pCols->begin(); - ::std::advance( it, nItemPos ); - pCols->insert( it, pColumn ); - } - - // adjust the number of the first scrollable and visible column - if ( nFirstCol <= nItemPos ) - nFirstCol = nItemPos + 1; + // move to the right of the last frozen column + sal_uInt16 nFirstScrollable = FrozenColCount(); + BrowserColumn *pColumn = (*pCols)[ nItemPos ]; + BrowserColumns::iterator it = pCols->begin(); + ::std::advance( it, nItemPos ); + pCols->erase( it ); + nItemPos = nFirstScrollable; + it = pCols->begin(); + ::std::advance( it, nItemPos ); + pCols->insert( it, pColumn ); } - else - { - // to be moved? - if ( (sal_Int32)nItemPos != FrozenColCount()-1 ) - { - // move to the leftmost scrollable column - sal_uInt16 nFirstScrollable = FrozenColCount(); - BrowserColumn *pColumn = (*pCols)[ nItemPos ]; - BrowserColumns::iterator it = pCols->begin(); - ::std::advance( it, nItemPos ); - pCols->erase( it ); - nItemPos = nFirstScrollable; - it = pCols->begin(); - ::std::advance( it, nItemPos ); - pCols->insert( it, pColumn ); - } - // adjust the number of the first scrollable and visible column - nFirstCol = nItemPos; - } + // adjust the number of the first scrollable and visible column + if ( nFirstCol <= nItemPos ) + nFirstCol = nItemPos + 1; // toggle the freeze-state of the column - (*pCols)[ nItemPos ]->Freeze( bFreeze ); + (*pCols)[ nItemPos ]->Freeze(); // align the scrollbar-range UpdateScrollbars(); @@ -1889,10 +1860,10 @@ long BrowseBox::FirstSelectedColumn( ) const } -long BrowseBox::FirstSelectedRow( bool bInverse ) +long BrowseBox::FirstSelectedRow() { - return bMultiSelection ? uRow.pSel->FirstSelected(bInverse) : uRow.nSel; + return bMultiSelection ? uRow.pSel->FirstSelected() : uRow.nSel; } @@ -2039,7 +2010,7 @@ Rectangle BrowseBox::GetFieldRectPixel( long nRow, sal_uInt16 nColumnId, } -Rectangle BrowseBox::GetRowRectPixel( long nRow, bool bRelToBrowser ) const +Rectangle BrowseBox::GetRowRectPixel( long nRow ) const { // get the rectangle relative to DataWin @@ -2056,11 +2027,8 @@ Rectangle BrowseBox::GetRowRectPixel( long nRow, bool bRelToBrowser ) const // adjust relative to BrowseBox's output area Point aTopLeft( aRect.TopLeft() ); - if ( bRelToBrowser ) - { - aTopLeft = pDataWin->OutputToScreenPixel( aTopLeft ); - aTopLeft = ScreenToOutputPixel( aTopLeft ); - } + aTopLeft = pDataWin->OutputToScreenPixel( aTopLeft ); + aTopLeft = ScreenToOutputPixel( aTopLeft ); return Rectangle( aTopLeft, aRect.GetSize() ); } diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index 1a3cfad27e11..e178fb02918f 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -236,14 +236,13 @@ void BrowseBox::EndScroll() } -void BrowseBox::ToggleSelection( bool bForce ) +void BrowseBox::ToggleSelection() { // selection highlight-toggling allowed? if ( bHideSelect ) return; - if ( !bForce && - ( bNotToggleSel || !IsUpdateMode() || !bSelectionIsVisible ) ) + if ( bNotToggleSel || !IsUpdateMode() || !bSelectionIsVisible ) return; // only highlight painted areas! diff --git a/svtools/source/brwbox/brwbox3.cxx b/svtools/source/brwbox/brwbox3.cxx index 7e2af122454e..c98cc999b270 100644 --- a/svtools/source/brwbox/brwbox3.cxx +++ b/svtools/source/brwbox/brwbox3.cxx @@ -544,9 +544,9 @@ void BrowseBox::GrabFocus() Control::GrabFocus(); } -Reference< XAccessible > BrowseBox::GetAccessible( bool bCreate ) +Reference< XAccessible > BrowseBox::GetAccessible() { - return Control::GetAccessible( bCreate ); + return Control::GetAccessible(); } vcl::Window* BrowseBox::GetAccessibleParentWindow() const diff --git a/svtools/source/brwbox/datwin.cxx b/svtools/source/brwbox/datwin.cxx index 7df9e0ed5a66..d1fee6b3b100 100644 --- a/svtools/source/brwbox/datwin.cxx +++ b/svtools/source/brwbox/datwin.cxx @@ -254,7 +254,7 @@ void BrowserDataWin::LeaveUpdateLock() } } -void InitSettings_Impl(vcl::Window* pWin, bool bFont, bool bForeground, bool bBackground) +void InitSettings_Impl(vcl::Window* pWin, bool bFont, bool bForeground) { const StyleSettings& rStyleSettings = pWin->GetSettings().GetStyleSettings(); @@ -264,8 +264,7 @@ void InitSettings_Impl(vcl::Window* pWin, bool bFont, bool bForeground, bool bBa if (bFont || bForeground) pWin->ApplyControlForeground(*pWin, rStyleSettings.GetWindowTextColor()); - if (bBackground) - pWin->ApplyControlBackground(*pWin, rStyleSettings.GetWindowColor()); + pWin->ApplyControlBackground(*pWin, rStyleSettings.GetWindowColor()); } diff --git a/svtools/source/brwbox/datwin.hxx b/svtools/source/brwbox/datwin.hxx index 7a218617902a..d4d1495076a8 100644 --- a/svtools/source/brwbox/datwin.hxx +++ b/svtools/source/brwbox/datwin.hxx @@ -198,7 +198,7 @@ public: void InitSettings_Impl( vcl::Window *pWin, - bool bFont = true, bool bForeground = true, bool bBackground = true ); + bool bFont = true, bool bForeground = true ); #endif |