summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/toolkit/ivctrl.hxx2
-rw-r--r--vcl/source/control/imivctl1.cxx10
-rw-r--r--vcl/source/control/imivctl2.cxx83
-rw-r--r--vcl/source/control/ivctrl.cxx17
4 files changed, 23 insertions, 89 deletions
diff --git a/include/vcl/toolkit/ivctrl.hxx b/include/vcl/toolkit/ivctrl.hxx
index 2973b74f2015..02162627379e 100644
--- a/include/vcl/toolkit/ivctrl.hxx
+++ b/include/vcl/toolkit/ivctrl.hxx
@@ -109,7 +109,6 @@ public:
WB_NOVSCROLL
WB_NOSELECTION
WB_SMART_ARRANGE // Keep Visible-Area at arrange
- WB_ALIGN_TOP // Align line vy line LTR
WB_ALIGN_LEFT // Align columns from top to bottom
WB_NODRAGSELECTION // No selection with tracking rectangle
WB_NOCOLUMNHEADER // No Headerbar in Details view (Headerbar not implemented)
@@ -123,7 +122,6 @@ public:
#define WB_NOHSCROLL WB_SPIN
#define WB_NOVSCROLL WB_DRAG
#define WB_NODRAGSELECTION WB_PATHELLIPSIS
-#define WB_ALIGN_TOP WB_TOP
#define WB_ALIGN_LEFT WB_LEFT
#define WB_NOCOLUMNHEADER WB_CENTER
#define WB_HIGHLIGHTFRAME WB_IGNORETAB
diff --git a/vcl/source/control/imivctl1.cxx b/vcl/source/control/imivctl1.cxx
index b335c532fdf5..a5cfc3914df4 100644
--- a/vcl/source/control/imivctl1.cxx
+++ b/vcl/source/control/imivctl1.cxx
@@ -143,8 +143,7 @@ void SvxIconChoiceCtrl_Impl::SetStyle( WinBits nWinStyle )
nCurTextDrawFlags = DRAWTEXT_FLAGS_ICON;
if( nWinBits & (WB_SMALLICON | WB_DETAILS) )
nCurTextDrawFlags = DRAWTEXT_FLAGS_SMALLICON;
- if( !(nWinStyle & (WB_ALIGN_TOP | WB_ALIGN_LEFT)))
- nWinBits |= WB_ALIGN_LEFT;
+ nWinBits |= WB_ALIGN_LEFT;
}
IMPL_LINK( SvxIconChoiceCtrl_Impl, ScrollUpDownHdl, ScrollBar*, pScrollBar, void )
@@ -301,12 +300,7 @@ void SvxIconChoiceCtrl_Impl::ResetVirtSize()
sal_uLong nGridCount = IcnGridMap_Impl::GetGridCount(
aRealOutputSize, static_cast<sal_uInt16>(nGridDX), static_cast<sal_uInt16>(nGridDY) );
if( nGridCount < nCount )
- {
- if( nWinBits & WB_ALIGN_TOP )
- nMaxVirtWidth = aRealOutputSize.Width() - nVerSBarWidth;
- else // WB_ALIGN_LEFT
- nMaxVirtHeight = aRealOutputSize.Height() - nHorSBarHeight;
- }
+ nMaxVirtHeight = aRealOutputSize.Height() - nHorSBarHeight;
}
}
diff --git a/vcl/source/control/imivctl2.cxx b/vcl/source/control/imivctl2.cxx
index 5b0d2d8adb49..1dba192425d9 100644
--- a/vcl/source/control/imivctl2.cxx
+++ b/vcl/source/control/imivctl2.cxx
@@ -331,7 +331,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoLeftRight( SvxIconChoiceCtrlEntry* pCt
SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pStart, bool bDown)
{
- if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) )
+ if (pView->IsAutoArrange())
{
const tools::Long nPos = static_cast<tools::Long>(pView->GetEntryListPos( pStart ));
tools::Long nEntriesInView = pView->aOutputSize.Height() / pView->nGridDY;
@@ -391,7 +391,7 @@ SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoPageUpDown( SvxIconChoiceCtrlEntry* pS
SvxIconChoiceCtrlEntry* IcnCursor_Impl::GoUpDown( SvxIconChoiceCtrlEntry* pCtrlEntry, bool bDown)
{
- if( pView->IsAutoArrange() && !(pView->nWinBits & WB_ALIGN_TOP) )
+ if( pView->IsAutoArrange())
{
sal_uLong nPos = pView->GetEntryListPos( pCtrlEntry );
if( bDown && nPos < (pView->maEntries.size() - 1) )
@@ -491,10 +491,7 @@ void IcnGridMap_Impl::Expand()
{
sal_uInt16 nNewGridRows = _nGridRows;
sal_uInt16 nNewGridCols = _nGridCols;
- if( _pView->nWinBits & WB_ALIGN_TOP )
- nNewGridRows += 50;
- else
- nNewGridCols += 50;
+ nNewGridCols += 50;
size_t nNewCellCount = static_cast<size_t>(nNewGridRows) * nNewGridCols;
bool* pNewGridMap = new bool[nNewCellCount];
@@ -513,10 +510,7 @@ void IcnGridMap_Impl::Create_Impl()
if( _pGridMap )
return;
GetMinMapSize( _nGridCols, _nGridRows );
- if( _pView->nWinBits & WB_ALIGN_TOP )
- _nGridRows += 50; // avoid resize of gridmap too often
- else
- _nGridCols += 50;
+ _nGridCols += 50;
size_t nCellCount = static_cast<size_t>(_nGridRows) * _nGridCols;
_pGridMap.reset( new bool[nCellCount] );
@@ -529,28 +523,14 @@ void IcnGridMap_Impl::Create_Impl()
void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const
{
- tools::Long nX, nY;
- if( _pView->nWinBits & WB_ALIGN_TOP )
- {
- // The view grows in vertical direction. Its max. width is _pView->nMaxVirtWidth
- nX = _pView->nMaxVirtWidth;
- if( !nX )
- nX = _pView->pView->GetOutputSizePixel().Width();
- if( !(_pView->nFlags & IconChoiceFlags::Arranging) )
- nX -= _pView->nVerSBarWidth;
-
- nY = _pView->aVirtOutputSize.Height();
- }
- else
- {
- // The view grows in horizontal direction. Its max. height is _pView->nMaxVirtHeight
- nY = _pView->nMaxVirtHeight;
- if( !nY )
- nY = _pView->pView->GetOutputSizePixel().Height();
- if( !(_pView->nFlags & IconChoiceFlags::Arranging) )
- nY -= _pView->nHorSBarHeight;
- nX = _pView->aVirtOutputSize.Width();
- }
+ // The view grows in horizontal direction. Its max. height is _pView->nMaxVirtHeight
+ tools::Long nY = _pView->nMaxVirtHeight;
+ if( !nY )
+ nY = _pView->pView->GetOutputSizePixel().Height();
+ if( !(_pView->nFlags & IconChoiceFlags::Arranging) )
+ nY -= _pView->nHorSBarHeight;
+
+ tools::Long nX = _pView->aVirtOutputSize.Width();
if( !nX )
nX = DEFAULT_MAX_VIRT_WIDTH;
@@ -572,10 +552,7 @@ void IcnGridMap_Impl::GetMinMapSize( sal_uInt16& rDX, sal_uInt16& rDY ) const
GridId IcnGridMap_Impl::GetGrid( sal_uInt16 nGridX, sal_uInt16 nGridY )
{
Create();
- if( _pView->nWinBits & WB_ALIGN_TOP )
- return nGridX + ( static_cast<GridId>(nGridY) * _nGridCols );
- else
- return nGridY + ( static_cast<GridId>(nGridX) * _nGridRows );
+ return nGridY + ( static_cast<GridId>(nGridX) * _nGridRows );
}
GridId IcnGridMap_Impl::GetGrid( const Point& rDocPos )
@@ -677,38 +654,18 @@ void IcnGridMap_Impl::OutputSizeChanged()
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( nRows != _nGridRows )
+ Clear();
+ else if( nCols >= _nGridCols )
+ Expand();
}
-// Independently of the view's alignment (TOP or LEFT), the gridmap
-// should contain the data in a continuous region, to make it possible
+// the gridmap should contain the data in a continuous region, to make it possible
// to copy the whole block if the gridmap needs to be expanded.
void IcnGridMap_Impl::GetGridCoord( GridId nId, sal_uInt16& rGridX, sal_uInt16& rGridY )
{
- Create();
- if( _pView->nWinBits & WB_ALIGN_TOP )
- {
- rGridX = static_cast<sal_uInt16>(nId % _nGridCols);
- rGridY = static_cast<sal_uInt16>(nId / _nGridCols);
- }
- else
- {
- rGridX = static_cast<sal_uInt16>(nId / _nGridRows);
- rGridY = static_cast<sal_uInt16>(nId % _nGridRows);
- }
+ rGridX = static_cast<sal_uInt16>(nId / _nGridRows);
+ rGridY = static_cast<sal_uInt16>(nId % _nGridRows);
}
diff --git a/vcl/source/control/ivctrl.cxx b/vcl/source/control/ivctrl.cxx
index 1cab3e097c77..24df3832bef9 100644
--- a/vcl/source/control/ivctrl.cxx
+++ b/vcl/source/control/ivctrl.cxx
@@ -136,22 +136,7 @@ void SvtIconChoiceCtrl::MouseMove( const MouseEvent& rMEvt )
}
void SvtIconChoiceCtrl::ArrangeIcons()
{
- if ( GetStyle() & WB_ALIGN_TOP )
- {
- Size aFullSize;
- tools::Rectangle aEntryRect;
-
- for ( sal_Int32 i = 0; i < GetEntryCount(); i++ )
- {
- SvxIconChoiceCtrlEntry* pEntry = GetEntry ( i );
- aEntryRect = _pImpl->GetEntryBoundRect ( pEntry );
-
- aFullSize.setWidth ( aFullSize.getWidth()+aEntryRect.GetWidth() );
- }
-
- _pImpl->Arrange(aFullSize.getWidth(), 0);
- }
- else if ( GetStyle() & WB_ALIGN_LEFT )
+ if (GetStyle() & WB_ALIGN_LEFT)
{
Size aFullSize;
tools::Rectangle aEntryRect;