summaryrefslogtreecommitdiff
path: root/vcl/source/control
diff options
context:
space:
mode:
Diffstat (limited to 'vcl/source/control')
-rw-r--r--vcl/source/control/combobox.cxx46
-rw-r--r--vcl/source/control/ilstbox.cxx12
-rw-r--r--vcl/source/control/lstbox.cxx60
3 files changed, 59 insertions, 59 deletions
diff --git a/vcl/source/control/combobox.cxx b/vcl/source/control/combobox.cxx
index ecaca6598f0c..a5d619fc0af5 100644
--- a/vcl/source/control/combobox.cxx
+++ b/vcl/source/control/combobox.cxx
@@ -188,7 +188,7 @@ void ComboBox::ImplInit( Window* pParent, WinBits nStyle )
if ( mpFloatWin )
mpFloatWin->SetImplListBox( mpImplLB );
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( true );
+ mpImplLB->GetMainWindow().AllowGrabFocus( true );
ImplCalcEditHeight();
@@ -249,7 +249,7 @@ IMPL_LINK_NOARG(ComboBox, ImplClickBtnHdl)
ImplClearLayoutData();
if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
return 0;
}
@@ -270,7 +270,7 @@ IMPL_LINK_NOARG(ComboBox, ImplPopupModeEndHdl)
ImplClearLayoutData();
if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
mpBtn->SetPressed( false );
ImplCallEventListeners( VCLEVENT_DROPDOWN_CLOSE );
@@ -578,20 +578,20 @@ void ComboBox::FillLayoutData() const
mpControlData->mpLayoutData = new vcl::ControlLayoutData();
AppendLayoutData( *mpSubEdit );
mpSubEdit->SetLayoutDataParent( this );
- Control* pMainWindow = mpImplLB->GetMainWindow();
+ Control& rMainWindow = mpImplLB->GetMainWindow();
if( mpFloatWin )
{
// dropdown mode
if( mpFloatWin->IsReallyVisible() )
{
- AppendLayoutData( *pMainWindow );
- pMainWindow->SetLayoutDataParent( this );
+ AppendLayoutData( rMainWindow );
+ rMainWindow.SetLayoutDataParent( this );
}
}
else
{
- AppendLayoutData( *pMainWindow );
- pMainWindow->SetLayoutDataParent( this );
+ AppendLayoutData( rMainWindow );
+ rMainWindow.SetLayoutDataParent( this );
}
}
@@ -644,7 +644,7 @@ void ComboBox::StateChanged( StateChangedType nType )
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
+ mpImplLB->GetMainWindow().EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
}
else if( nType == STATE_CHANGE_MIRRORING )
{
@@ -762,7 +762,7 @@ bool ComboBox::Notify( NotifyEvent& rNEvt )
nDone = false; // don't eat this event, let the default handling happen (i.e. scroll the context)
}
}
- else if( ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) && ( rNEvt.GetWindow() == mpImplLB->GetMainWindow() ) )
+ else if( ( rNEvt.GetType() == EVENT_MOUSEBUTTONDOWN ) && ( rNEvt.GetWindow() == &mpImplLB->GetMainWindow() ) )
{
mpSubEdit->GrabFocus();
}
@@ -1107,7 +1107,7 @@ void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
long nCharWidth = GetTextWidth(OUString(static_cast<sal_Unicode>('x')));
if ( !IsDropDownBox() )
{
- Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
+ Size aOutSz = mpImplLB->GetMainWindow().GetOutputSizePixel();
rnCols = (sal_uInt16)(aOutSz.Width()/nCharWidth);
rnLines = (sal_uInt16)(aOutSz.Height()/mpImplLB->GetEntryHeight());
}
@@ -1121,11 +1121,11 @@ void ComboBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
void ComboBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( true, true, true );
+ mpImplLB->GetMainWindow().ImplInitSettings( true, true, true );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
- Font aFont = mpImplLB->GetMainWindow()->GetDrawPixelFont( pDev );
+ Font aFont = mpImplLB->GetMainWindow().GetDrawPixelFont( pDev );
OutDevType eOutDevType = pDev->GetOutDevType();
pDev->Push();
@@ -1235,18 +1235,18 @@ void ComboBox::UserDraw( const UserDrawEvent& )
void ComboBox::SetUserItemSize( const Size& rSz )
{
- mpImplLB->GetMainWindow()->SetUserItemSize( rSz );
+ mpImplLB->GetMainWindow().SetUserItemSize( rSz );
}
void ComboBox::EnableUserDraw( bool bUserDraw )
{
- mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
+ mpImplLB->GetMainWindow().EnableUserDraw( bUserDraw );
}
void ComboBox::DrawEntry( const UserDrawEvent& rEvt, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos )
{
- DBG_ASSERT( rEvt.GetDevice() == mpImplLB->GetMainWindow(), "DrawEntry?!" );
- mpImplLB->GetMainWindow()->DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
+ DBG_ASSERT( rEvt.GetDevice() == &mpImplLB->GetMainWindow(), "DrawEntry?!" );
+ mpImplLB->GetMainWindow().DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
}
void ComboBox::SetSeparatorPos( sal_Int32 n )
@@ -1357,8 +1357,8 @@ void ComboBox::SetNoSelection()
Rectangle ComboBox::GetBoundingRectangle( sal_Int32 nItem ) const
{
- Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
- Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
+ Rectangle aRect = mpImplLB->GetMainWindow().GetBoundingRectangle( nItem );
+ Rectangle aOffset = mpImplLB->GetMainWindow().GetWindowExtentsRelative( (Window*)this );
aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() );
return aRect;
}
@@ -1384,16 +1384,16 @@ long ComboBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const
{
// point must be either in main list window
// or in impl window (dropdown case)
- ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
+ ImplListBoxWindow& rMain = mpImplLB->GetMainWindow();
// convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
- aConvPoint = pMain->AbsoluteScreenToOutputPixel( aConvPoint );
- aConvPoint = pMain->PixelToLogic( aConvPoint );
+ aConvPoint = rMain.AbsoluteScreenToOutputPixel( aConvPoint );
+ aConvPoint = rMain.PixelToLogic( aConvPoint );
// try to find entry
- sal_Int32 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ sal_Int32 nEntry = rMain.GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
nIndex = -1;
else
diff --git a/vcl/source/control/ilstbox.cxx b/vcl/source/control/ilstbox.cxx
index 2769e905423b..194c7c3556ce 100644
--- a/vcl/source/control/ilstbox.cxx
+++ b/vcl/source/control/ilstbox.cxx
@@ -2952,13 +2952,13 @@ void ImplListBoxFloatingWindow::setPosSizePixel( long nX, long nY, long nWidth,
// this the presence of the vertical Scrollbar has to be known.
mpImplLB->SetSizePixel( GetOutputSizePixel() );
((Window*)mpImplLB)->Resize();
- ((Window*)mpImplLB->GetMainWindow())->Resize();
+ ((Window&)mpImplLB->GetMainWindow()).Resize();
}
}
void ImplListBoxFloatingWindow::Resize()
{
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
FloatingWindow::Resize();
}
@@ -3077,12 +3077,12 @@ void ImplListBoxFloatingWindow::StartFloat( bool bStartTracking )
mpImplLB->ShowProminentEntry( nPos );
if( bStartTracking )
- mpImplLB->GetMainWindow()->EnableMouseMoveSelect( true );
+ mpImplLB->GetMainWindow().EnableMouseMoveSelect( true );
- if ( mpImplLB->GetMainWindow()->IsGrabFocusAllowed() )
- mpImplLB->GetMainWindow()->GrabFocus();
+ if ( mpImplLB->GetMainWindow().IsGrabFocusAllowed() )
+ mpImplLB->GetMainWindow().GrabFocus();
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
}
}
diff --git a/vcl/source/control/lstbox.cxx b/vcl/source/control/lstbox.cxx
index 27e5d5e00feb..cdb711917a53 100644
--- a/vcl/source/control/lstbox.cxx
+++ b/vcl/source/control/lstbox.cxx
@@ -39,7 +39,7 @@
void ListBox::EnableQuickSelection( const bool& b )
{
- mpImplLB->GetMainWindow()->EnableQuickSelection(b);
+ mpImplLB->GetMainWindow().EnableQuickSelection(b);
}
ListBox::ListBox(WindowType nType)
@@ -173,7 +173,7 @@ void ListBox::ImplInit( Window* pParent, WinBits nStyle )
mpImplLB->SetSelectionChangedHdl( LINK( this, ListBox, ImplSelectionChangedHdl ) );
}
else
- mpImplLB->GetMainWindow()->AllowGrabFocus( true );
+ mpImplLB->GetMainWindow().AllowGrabFocus( true );
SetCompoundControl( true );
}
@@ -311,7 +311,7 @@ IMPL_LINK_NOARG(ListBox, ImplClickBtnHdl)
ImplClearLayoutData();
if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
if( mpImplWin )
mpImplWin->ImplClearLayoutData();
}
@@ -343,7 +343,7 @@ IMPL_LINK_NOARG(ListBox, ImplPopupModeEndHdl)
ImplClearLayoutData();
if( mpImplLB )
- mpImplLB->GetMainWindow()->ImplClearLayoutData();
+ mpImplLB->GetMainWindow().ImplClearLayoutData();
if( mpImplWin )
mpImplWin->ImplClearLayoutData();
@@ -371,11 +371,11 @@ void ListBox::ToggleDropDown()
void ListBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_uLong nFlags )
{
- mpImplLB->GetMainWindow()->ImplInitSettings( true, true, true );
+ mpImplLB->GetMainWindow().ImplInitSettings( true, true, true );
Point aPos = pDev->LogicToPixel( rPos );
Size aSize = pDev->LogicToPixel( rSize );
- Font aFont = mpImplLB->GetMainWindow()->GetDrawPixelFont( pDev );
+ Font aFont = mpImplLB->GetMainWindow().GetDrawPixelFont( pDev );
OutDevType eOutDevType = pDev->GetOutDevType();
pDev->Push();
@@ -693,7 +693,7 @@ void ListBox::Resize()
void ListBox::FillLayoutData() const
{
mpControlData->mpLayoutData = new vcl::ControlLayoutData();
- const Control* pMainWin = mpImplLB->GetMainWindow();
+ const Control& rMainWin = mpImplLB->GetMainWindow();
if( mpFloatWin )
{
// Dropdown mode
@@ -701,14 +701,14 @@ void ListBox::FillLayoutData() const
mpImplWin->SetLayoutDataParent( this );
if( mpFloatWin->IsReallyVisible() )
{
- AppendLayoutData( *pMainWin );
- pMainWin->SetLayoutDataParent( this );
+ AppendLayoutData( rMainWin );
+ rMainWin.SetLayoutDataParent( this );
}
}
else
{
- AppendLayoutData( *pMainWin );
- pMainWin->SetLayoutDataParent( this );
+ AppendLayoutData( rMainWin );
+ rMainWin.SetLayoutDataParent( this );
}
}
@@ -723,16 +723,16 @@ long ListBox::GetIndexForPoint( const Point& rPoint, sal_Int32& rPos ) const
{
// Point must be either in main list window
// or in impl window (dropdown case)
- ImplListBoxWindow* pMain = mpImplLB->GetMainWindow();
+ ImplListBoxWindow& rMain = mpImplLB->GetMainWindow();
// Convert coordinates to ImplListBoxWindow pixel coordinate space
Point aConvPoint = LogicToPixel( rPoint );
aConvPoint = OutputToAbsoluteScreenPixel( aConvPoint );
- aConvPoint = pMain->AbsoluteScreenToOutputPixel( aConvPoint );
- aConvPoint = pMain->PixelToLogic( aConvPoint );
+ aConvPoint = rMain.AbsoluteScreenToOutputPixel( aConvPoint );
+ aConvPoint = rMain.PixelToLogic( aConvPoint );
// Try to find entry
- sal_Int32 nEntry = pMain->GetEntryPosForPoint( aConvPoint );
+ sal_Int32 nEntry = rMain.GetEntryPosForPoint( aConvPoint );
if( nEntry == LISTBOX_ENTRY_NOTFOUND )
{
// Not found, maybe dropdown case
@@ -805,7 +805,7 @@ void ListBox::StateChanged( StateChangedType nType )
if ( mpImplWin )
{
mpImplWin->SetZoom( GetZoom() );
- mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
+ mpImplWin->SetFont( mpImplLB->GetMainWindow().GetFont() );
mpImplWin->Invalidate();
}
Resize();
@@ -816,7 +816,7 @@ void ListBox::StateChanged( StateChangedType nType )
if ( mpImplWin )
{
mpImplWin->SetControlFont( GetControlFont() );
- mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
+ mpImplWin->SetFont( mpImplLB->GetMainWindow().GetFont() );
mpImplWin->Invalidate();
}
Resize();
@@ -828,7 +828,7 @@ void ListBox::StateChanged( StateChangedType nType )
{
mpImplWin->SetControlForeground( GetControlForeground() );
mpImplWin->SetTextColor( GetControlForeground() );
- mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
+ mpImplWin->SetFont( mpImplLB->GetMainWindow().GetFont() );
mpImplWin->Invalidate();
}
}
@@ -845,17 +845,17 @@ void ListBox::StateChanged( StateChangedType nType )
}
else
{
- mpImplWin->SetBackground( mpImplLB->GetMainWindow()->GetControlBackground() );
- mpImplWin->SetControlBackground( mpImplLB->GetMainWindow()->GetControlBackground() );
+ mpImplWin->SetBackground( mpImplLB->GetMainWindow().GetControlBackground() );
+ mpImplWin->SetControlBackground( mpImplLB->GetMainWindow().GetControlBackground() );
}
- mpImplWin->SetFont( mpImplLB->GetMainWindow()->GetFont() );
+ mpImplWin->SetFont( mpImplLB->GetMainWindow().GetFont() );
mpImplWin->Invalidate();
}
}
else if ( nType == STATE_CHANGE_STYLE )
{
SetStyle( ImplInitStyle( GetStyle() ) );
- mpImplLB->GetMainWindow()->EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
+ mpImplLB->GetMainWindow().EnableSort( ( GetStyle() & WB_SORT ) ? true : false );
bool bSimpleMode = ( GetStyle() & WB_SIMPLEMODE ) ? true : false;
mpImplLB->SetMultiSelectionSimpleMode( bSimpleMode );
}
@@ -1159,8 +1159,8 @@ bool ListBox::IsInDropDown() const
Rectangle ListBox::GetBoundingRectangle( sal_Int32 nItem ) const
{
- Rectangle aRect = mpImplLB->GetMainWindow()->GetBoundingRectangle( nItem );
- Rectangle aOffset = mpImplLB->GetMainWindow()->GetWindowExtentsRelative( (Window*)this );
+ Rectangle aRect = mpImplLB->GetMainWindow().GetBoundingRectangle( nItem );
+ Rectangle aOffset = mpImplLB->GetMainWindow().GetWindowExtentsRelative( (Window*)this );
aRect.Move( aOffset.TopLeft().X(), aOffset.TopLeft().Y() );
return aRect;
}
@@ -1182,7 +1182,7 @@ void ListBox::EnableMultiSelection( bool bMulti, bool bStackSelection )
// In a MultiSelection, we can't see us travelling without focus
if ( mpFloatWin )
- mpImplLB->GetMainWindow()->AllowGrabFocus( bMulti );
+ mpImplLB->GetMainWindow().AllowGrabFocus( bMulti );
}
bool ListBox::IsMultiSelectionEnabled() const
@@ -1350,7 +1350,7 @@ void ListBox::GetMaxVisColumnsAndLines( sal_uInt16& rnCols, sal_uInt16& rnLines
float nCharWidth = approximate_char_width();
if ( !IsDropDownBox() )
{
- Size aOutSz = mpImplLB->GetMainWindow()->GetOutputSizePixel();
+ Size aOutSz = mpImplLB->GetMainWindow().GetOutputSizePixel();
rnCols = (sal_uInt16) (aOutSz.Width()/nCharWidth);
rnLines = (sal_uInt16) (aOutSz.Height()/mpImplLB->GetEntryHeight());
}
@@ -1374,22 +1374,22 @@ void ListBox::UserDraw( const UserDrawEvent& )
void ListBox::DrawEntry( const UserDrawEvent& rEvt, bool bDrawImage, bool bDrawText, bool bDrawTextAtImagePos )
{
- if ( rEvt.GetDevice() == mpImplLB->GetMainWindow() )
- mpImplLB->GetMainWindow()->DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
+ if ( rEvt.GetDevice() == &mpImplLB->GetMainWindow() )
+ mpImplLB->GetMainWindow().DrawEntry( rEvt.GetItemId(), bDrawImage, bDrawText, bDrawTextAtImagePos );
else if ( rEvt.GetDevice() == mpImplWin )
mpImplWin->DrawEntry( bDrawImage, bDrawText, bDrawTextAtImagePos );
}
void ListBox::SetUserItemSize( const Size& rSz )
{
- mpImplLB->GetMainWindow()->SetUserItemSize( rSz );
+ mpImplLB->GetMainWindow().SetUserItemSize( rSz );
if ( mpImplWin )
mpImplWin->SetUserItemSize( rSz );
}
void ListBox::EnableUserDraw( bool bUserDraw )
{
- mpImplLB->GetMainWindow()->EnableUserDraw( bUserDraw );
+ mpImplLB->GetMainWindow().EnableUserDraw( bUserDraw );
if ( mpImplWin )
mpImplWin->EnableUserDraw( bUserDraw );
}