diff options
Diffstat (limited to 'sd/source/ui/toolpanel/ScrollPanel.cxx')
-rwxr-xr-x | sd/source/ui/toolpanel/ScrollPanel.cxx | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/sd/source/ui/toolpanel/ScrollPanel.cxx b/sd/source/ui/toolpanel/ScrollPanel.cxx index 6b10ed889424..1d827874a1ee 100755 --- a/sd/source/ui/toolpanel/ScrollPanel.cxx +++ b/sd/source/ui/toolpanel/ScrollPanel.cxx @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -135,7 +135,7 @@ ScrollPanel::~ScrollPanel (void) TitledControl* ScrollPanel::AddControl ( - ::std::auto_ptr<TreeNode> pControl, + ::std::auto_ptr<TreeNode> pControl, const String& rTitle, ULONG nHelpId) { @@ -143,14 +143,14 @@ TitledControl* ScrollPanel::AddControl ( // managed by the content object. TitledControl* pTitledControl = new TitledControl( this, - pControl, + pControl, rTitle, TitledControlStandardClickHandler(GetControlContainer(), ControlContainer::ES_TOGGLE), TitleBar::TBT_SUB_CONTROL_HEADLINE); pTitledControl->GetTitleBar()->SetHelpId(nHelpId); AddControl(::std::auto_ptr<TreeNode>(pTitledControl)); - + return pTitledControl; } @@ -169,7 +169,7 @@ void ScrollPanel::AddControl (::std::auto_ptr<TreeNode> pControl) const Link aWindowListener(LINK(this,ScrollPanel,WindowEventListener)); OSL_ASSERT(pControl->GetWindow()!=NULL); pControl->GetWindow()->AddEventListener(aWindowListener); - + TitledControl* pTitledControl = dynamic_cast<TitledControl*>(pControl.get()); if (pTitledControl != NULL) { @@ -192,8 +192,8 @@ void ScrollPanel::AddControl (::std::auto_ptr<TreeNode> pControl) rFocusManager.RegisterLink(pFirst,pControl->GetWindow(), KEY_UP); rFocusManager.RegisterLink(pControl->GetWindow(),pFirst, KEY_DOWN); } - - + + // Add a down link only for the first control so that when entering // the sub tool panel the focus is set to the first control. if (nControlCount == 0) @@ -230,7 +230,7 @@ void ScrollPanel::Paint (const Rectangle& rRect) Size aSize (maScrollWindow.GetOutputSizePixel()); // Paint left and right vertical border. Rectangle aVerticalArea ( - Point(0,0), + Point(0,0), Size(mnHorizontalBorder,aSize.Height())); maScrollWindow.DrawRect (aVerticalArea); aVerticalArea.Right() += mnHorizontalBorder + mnChildrenWidth - 1; @@ -252,7 +252,7 @@ void ScrollPanel::Paint (const Rectangle& rRect) break; maScrollWindow.DrawRect (aStripeArea); } - + maScrollWindow.SetLineColor (aOriginalLineColor); maScrollWindow.SetFillColor (aOriginalFillColor); } @@ -397,7 +397,7 @@ void ScrollPanel::Rearrange (void) mnChildrenWidth += aRequiredSize.Width(); else mnChildrenWidth += aAvailableSize.Width(); - + sal_Int32 nChildrenHeight (LayoutChildren()); maVerticalScrollBar.SetRangeMax ( nChildrenHeight + mnVerticalBorder); @@ -413,7 +413,7 @@ Size ScrollPanel::GetRequiredSize (void) { // First determine the width of the children. This is the maximum of // the current window width and the individual minimum widths of the - // children. + // children. int nChildrenWidth (GetSizePixel().Width()); unsigned int nCount = mpControlContainer->GetControlCount(); unsigned int nIndex; @@ -428,7 +428,7 @@ Size ScrollPanel::GetRequiredSize (void) // Determine the accumulated width of all children when scaled to the // minimum width. nChildrenWidth -= 2*mnHorizontalBorder; - Size aTotalSize (nChildrenWidth, + Size aTotalSize (nChildrenWidth, 2*mnVerticalBorder + (nCount-1) * mnVerticalGap); for (nIndex=0; nIndex<nCount; nIndex++) { @@ -528,7 +528,7 @@ Size ScrollPanel::SetupScrollBars (const Size& rRequiredSize) if (GetMinimumWidth() + aScrollBarSize.Width() > aWindowSize.Width()) bShowHorizontal = true; } - + // Setup the scroll bars. aRemainingSize.Width() = SetupVerticalScrollBar (bShowVertical, rRequiredSize.Height()); @@ -585,7 +585,7 @@ sal_Int32 ScrollPanel::SetupVerticalScrollBar (bool bShow, sal_Int32 nRange) long nMinPos = maVerticalScrollBar.GetRangeMin(); if (maVerticalScrollBar.GetThumbPos() < nMinPos) maVerticalScrollBar.SetThumbPos(nMinPos); - long nMaxPos = maVerticalScrollBar.GetRangeMax() + long nMaxPos = maVerticalScrollBar.GetRangeMax() - maVerticalScrollBar.GetVisibleSize(); if (maVerticalScrollBar.GetThumbPos() >= nMaxPos) maVerticalScrollBar.SetThumbPos(nMaxPos); @@ -638,7 +638,7 @@ sal_Int32 ScrollPanel::SetupHorizontalScrollBar (bool bShow, sal_Int32 nRange) long nMinPos = maHorizontalScrollBar.GetRangeMin(); if (maHorizontalScrollBar.GetThumbPos() < nMinPos) maHorizontalScrollBar.SetThumbPos(nMinPos); - long nMaxPos = maHorizontalScrollBar.GetRangeMax() + long nMaxPos = maHorizontalScrollBar.GetRangeMax() - maHorizontalScrollBar.GetVisibleSize(); if (maHorizontalScrollBar.GetThumbPos() >= nMaxPos) maHorizontalScrollBar.SetThumbPos(nMaxPos); @@ -731,7 +731,7 @@ void ScrollPanel::MakeRectangleVisible ( aRectangle.Move( -maScrollOffset.X() + aRelativeBox.Left(), -maScrollOffset.Y() + aRelativeBox.Top()); - + const int nVisibleHeight (maVerticalScrollBar.GetVisibleSize()); const int nVisibleTop (maVerticalScrollBar.GetThumbPos()); if (aRectangle.Bottom() >= nVisibleTop+nVisibleHeight) @@ -764,12 +764,12 @@ IMPL_LINK(ScrollPanel,WindowEventListener,VclSimpleEvent*,pEvent) Rectangle aBox (pControl->GetItemRect(pControl->GetSelectItemId())); aBox.Top()-=4; aBox.Bottom()+=4; - + MakeRectangleVisible(aBox, pControl); } } break; - + case VCLEVENT_WINDOW_MOUSEBUTTONDOWN: { // Make the item under the mouse visible. We need this case @@ -790,13 +790,13 @@ IMPL_LINK(ScrollPanel,WindowEventListener,VclSimpleEvent*,pEvent) Rectangle aBox (pControl->GetItemRect(pControl->GetItemId(aPosition))); aBox.Top()-=4; aBox.Bottom()+=4; - + MakeRectangleVisible(aBox, pControl); } } } break; - + case VCLEVENT_WINDOW_GETFOCUS: { @@ -814,7 +814,7 @@ IMPL_LINK(ScrollPanel,WindowEventListener,VclSimpleEvent*,pEvent) } } break; - + case VCLEVENT_WINDOW_SHOW: case VCLEVENT_WINDOW_HIDE: case VCLEVENT_WINDOW_ACTIVATE: |