summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-03-08 18:23:40 +0900
committerTomaž Vajngerl <tomaz.vajngerl@collabora.co.uk>2015-03-10 14:04:33 +0900
commit422fdeccd88a89461271bd6d87774a4c5015ba60 (patch)
tree8a4455353091db1adc5d8b94d88319fd34b87628
parente8c2bb2e7cbb476b4b73758fb9a053b5380b29f6 (diff)
tabbar: remove useless whitespace, rearrange constructor
Change-Id: Iee31413c1ded4fbda8227e88d09a1f917f18ca5d
-rw-r--r--svtools/source/control/tabbar.cxx176
1 files changed, 12 insertions, 164 deletions
diff --git a/svtools/source/control/tabbar.cxx b/svtools/source/control/tabbar.cxx
index e69f05e6ca3a..2e071de0b707 100644
--- a/svtools/source/control/tabbar.cxx
+++ b/svtools/source/control/tabbar.cxx
@@ -86,12 +86,6 @@ struct ImplTabBarItem
}
};
-
-
-
-// - ImplTabButton -
-
-
class ImplTabButton : public PushButton
{
bool mbModKey : 1;
@@ -228,14 +222,7 @@ void ImplTabSizer::Paint( const Rectangle& )
aDecoView.DrawHandle(aOutputRect, true);
}
-
-
// Is not named Impl. as it may be both instantiated and derived from
-
-
-// - TabBarEdit -
-
-
class TabBarEdit : public Edit
{
private:
@@ -257,16 +244,12 @@ public:
virtual void LoseFocus() SAL_OVERRIDE;
};
-
-
TabBarEdit::TabBarEdit( TabBar* pParent, WinBits nWinStyle ) :
Edit( pParent, nWinStyle )
{
mbPostEvt = false;
}
-
-
bool TabBarEdit::PreNotify( NotifyEvent& rNEvt )
{
if ( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
@@ -298,8 +281,6 @@ bool TabBarEdit::PreNotify( NotifyEvent& rNEvt )
return Edit::PreNotify( rNEvt );
}
-
-
void TabBarEdit::LoseFocus()
{
if ( !mbPostEvt )
@@ -311,8 +292,6 @@ void TabBarEdit::LoseFocus()
Edit::LoseFocus();
}
-
-
IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel )
{
ResetPostEvent();
@@ -332,8 +311,6 @@ IMPL_LINK( TabBarEdit, ImplEndEditHdl, void*, pCancel )
return 0;
}
-
-
IMPL_LINK_NOARG(TabBarEdit, ImplEndTimerHdl)
{
if ( HasFocus() )
@@ -349,7 +326,6 @@ IMPL_LINK_NOARG(TabBarEdit, ImplEndTimerHdl)
return 0;
}
-
struct TabBar_Impl
{
std::unique_ptr<ImplTabSizer> mpSizer;
@@ -387,7 +363,17 @@ struct TabBar_Impl
}
};
+TabBar::TabBar( vcl::Window* pParent, WinBits nWinStyle ) :
+ Window( pParent, (nWinStyle & WB_3DLOOK) | WB_CLIPCHILDREN )
+{
+ ImplInit( nWinStyle );
+ maCurrentItemList = 0;
+}
+TabBar::~TabBar()
+{
+ EndEditMode( true );
+}
const sal_uInt16 TabBar::APPEND = ::std::numeric_limits<sal_uInt16>::max();
const sal_uInt16 TabBar::PAGE_NOT_FOUND = ::std::numeric_limits<sal_uInt16>::max();
@@ -442,23 +428,6 @@ void TabBar::ImplInit( WinBits nWinStyle )
ImplInitSettings( true, true );
}
-
-
-TabBar::TabBar( vcl::Window* pParent, WinBits nWinStyle ) :
- Window( pParent, (nWinStyle & WB_3DLOOK) | WB_CLIPCHILDREN )
-{
- ImplInit( nWinStyle );
- maCurrentItemList = 0;
-}
-
-
-
-TabBar::~TabBar()
-{
- EndEditMode( true );
-}
-
-
ImplTabBarItem* TabBar::seek( size_t i )
{
if ( i < mpImpl->mpItemList.size() )
@@ -487,8 +456,6 @@ ImplTabBarItem* TabBar::next()
return NULL;
}
-
-
void TabBar::ImplInitSettings( bool bFont, bool bBackground )
{
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
@@ -524,8 +491,6 @@ void TabBar::ImplInitSettings( bool bFont, bool bBackground )
}
}
-
-
void TabBar::ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
Color& rSelectColor, Color& rSelectTextColor )
{
@@ -558,8 +523,6 @@ void TabBar::ImplGetColors( Color& rFaceColor, Color& rFaceTextColor,
}
}
-
-
bool TabBar::ImplCalcWidth()
{
// Sizes should only be retrieved if the text or the font was changed
@@ -616,8 +579,6 @@ bool TabBar::ImplCalcWidth()
return bChanged;
}
-
-
void TabBar::ImplFormat()
{
ImplCalcWidth();
@@ -664,8 +625,6 @@ void TabBar::ImplFormat()
ImplEnableControls();
}
-
-
sal_uInt16 TabBar::ImplGetLastFirstPos()
{
sal_uInt16 nCount = mpImpl->getItemSize();
@@ -685,8 +644,6 @@ sal_uInt16 TabBar::ImplGetLastFirstPos()
return nLastFirstPos;
}
-
-
void TabBar::ImplInitControls()
{
if ( mnWinStyle & WB_SIZEABLE )
@@ -755,8 +712,6 @@ void TabBar::ImplInitControls()
mbHasInsertTab = (mnWinStyle & WB_INSERTTAB);
}
-
-
void TabBar::ImplEnableControls()
{
if ( mbSizeFormat || mbFormat )
@@ -844,8 +799,6 @@ IMPL_LINK( TabBar, ImplClickHdl, ImplTabButton*, pBtn )
return 0;
}
-
-
void TabBar::MouseMove( const MouseEvent& rMEvt )
{
if ( rMEvt.IsLeaveWindow() )
@@ -854,8 +807,6 @@ void TabBar::MouseMove( const MouseEvent& rMEvt )
Window::MouseMove( rMEvt );
}
-
-
void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
{
// Only terminate EditModus and do not execute click
@@ -1059,8 +1010,6 @@ void TabBar::MouseButtonDown( const MouseEvent& rMEvt )
Window::MouseButtonDown( rMEvt );
}
-
-
void TabBar::MouseButtonUp( const MouseEvent& rMEvt )
{
mbInSelect = false;
@@ -1391,7 +1340,6 @@ void TabBar::Paint( const Rectangle& rect )
}
}
-
void TabBar::Resize()
{
Size aNewSize = GetOutputSizePixel();
@@ -1581,8 +1529,6 @@ void TabBar::RequestHelp( const HelpEvent& rHEvt )
Window::RequestHelp( rHEvt );
}
-
-
void TabBar::StateChanged( StateChangedType nType )
{
Window::StateChanged( nType );
@@ -1623,8 +1569,6 @@ void TabBar::StateChanged( StateChangedType nType )
}
}
-
-
void TabBar::DataChanged( const DataChangedEvent& rDCEvt )
{
Window::DataChanged( rDCEvt );
@@ -1639,8 +1583,6 @@ void TabBar::DataChanged( const DataChangedEvent& rDCEvt )
}
}
-
-
void TabBar::ImplSelect()
{
Select();
@@ -1648,28 +1590,20 @@ void TabBar::ImplSelect()
CallEventListeners( VCLEVENT_TABBAR_PAGESELECTED, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(mnCurPageId)) );
}
-
-
void TabBar::Select()
{
maSelectHdl.Call( this );
}
-
-
void TabBar::DoubleClick()
{
}
-
-
void TabBar::Split()
{
maSplitHdl.Call( this );
}
-
-
void TabBar::ImplActivatePage()
{
ActivatePage();
@@ -1677,13 +1611,8 @@ void TabBar::ImplActivatePage()
CallEventListeners( VCLEVENT_TABBAR_PAGEACTIVATED, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(mnCurPageId)) );
}
-
-
void TabBar::ActivatePage()
-{
-}
-
-
+{}
bool TabBar::ImplDeactivatePage()
{
@@ -1769,42 +1698,30 @@ Rectangle TabBar::ImplGetInsertTabRect(ImplTabBarItem* pItem) const
return Rectangle();
}
-
-
bool TabBar::DeactivatePage()
{
return true;
}
-
-
bool TabBar::StartRenaming()
{
return true;
}
-
-
TabBarAllowRenamingReturnCode TabBar::AllowRenaming()
{
return TABBAR_RENAMING_YES;
}
-
-
void TabBar::EndRenaming()
{
}
-
-
void TabBar::Mirror()
{
}
-
-
void TabBar::InsertPage( sal_uInt16 nPageId, const OUString& rText,
TabBarPageBits nBits, sal_uInt16 nPos )
{
@@ -1838,8 +1755,6 @@ void TabBar::InsertPage( sal_uInt16 nPageId, const OUString& rText,
CallEventListeners( VCLEVENT_TABBAR_PAGEINSERTED, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(nPageId)) );
}
-
-
Color TabBar::GetTabBgColor( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -1872,8 +1787,6 @@ void TabBar::SetTabBgColor( sal_uInt16 nPageId, const Color& aTabBgColor )
}
}
-
-
void TabBar::RemovePage( sal_uInt16 nPageId )
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -1902,8 +1815,6 @@ void TabBar::RemovePage( sal_uInt16 nPageId )
}
}
-
-
void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos )
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -1940,8 +1851,6 @@ void TabBar::MovePage( sal_uInt16 nPageId, sal_uInt16 nNewPos )
}
}
-
-
void TabBar::Clear()
{
// delete all items
@@ -1964,8 +1873,6 @@ void TabBar::Clear()
CallEventListeners( VCLEVENT_TABBAR_PAGEREMOVED, reinterpret_cast<void*>(sal::static_int_cast<sal_IntPtr>(PAGE_NOT_FOUND)) );
}
-
-
bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -1976,8 +1883,6 @@ bool TabBar::IsPageEnabled( sal_uInt16 nPageId ) const
return false;
}
-
-
void TabBar::SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits )
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -1997,8 +1902,6 @@ void TabBar::SetPageBits( sal_uInt16 nPageId, TabBarPageBits nBits )
}
}
-
-
TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2009,22 +1912,16 @@ TabBarPageBits TabBar::GetPageBits( sal_uInt16 nPageId ) const
return sal_False;
}
-
-
sal_uInt16 TabBar::GetPageCount() const
{
return mpImpl->getItemSize();
}
-
-
sal_uInt16 TabBar::GetPageId( sal_uInt16 nPos ) const
{
return nPos < mpImpl->mpItemList.size() ? mpImpl->mpItemList[nPos]->mnId : 0;
}
-
-
sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const
{
for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
@@ -2036,8 +1933,6 @@ sal_uInt16 TabBar::GetPagePos( sal_uInt16 nPageId ) const
return PAGE_NOT_FOUND;
}
-
-
sal_uInt16 TabBar::GetPageId( const Point& rPos, bool bCheckInsTab ) const
{
for (size_t i = 0; i < mpImpl->mpItemList.size(); ++i)
@@ -2057,8 +1952,6 @@ sal_uInt16 TabBar::GetPageId( const Point& rPos, bool bCheckInsTab ) const
return 0;
}
-
-
Rectangle TabBar::GetPageRect( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2069,8 +1962,6 @@ Rectangle TabBar::GetPageRect( sal_uInt16 nPageId ) const
return Rectangle();
}
-
-
void TabBar::SetCurPageId( sal_uInt16 nPageId )
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2153,8 +2044,6 @@ void TabBar::SetCurPageId( sal_uInt16 nPageId )
}
}
-
-
void TabBar::MakeVisible( sal_uInt16 nPageId )
{
if ( !IsReallyVisible() )
@@ -2201,8 +2090,6 @@ void TabBar::MakeVisible( sal_uInt16 nPageId )
}
}
-
-
void TabBar::SetFirstPageId( sal_uInt16 nPageId )
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2235,8 +2122,6 @@ void TabBar::SetFirstPageId( sal_uInt16 nPageId )
}
}
-
-
void TabBar::SelectPage( sal_uInt16 nPageId, bool bSelect )
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2256,8 +2141,6 @@ void TabBar::SelectPage( sal_uInt16 nPageId, bool bSelect )
}
}
-
-
sal_uInt16 TabBar::GetSelectPageCount() const
{
sal_uInt16 nSelected = 0;
@@ -2271,8 +2154,6 @@ sal_uInt16 TabBar::GetSelectPageCount() const
return nSelected;
}
-
-
bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2282,8 +2163,6 @@ bool TabBar::IsPageSelected( sal_uInt16 nPageId ) const
return false;
}
-
-
bool TabBar::StartEditMode( sal_uInt16 nPageId )
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2394,8 +2273,6 @@ void TabBar::EndEditMode( bool bCancel )
}
}
-
-
void TabBar::SetMirrored(bool bMirrored)
{
if( mbMirrored != bMirrored )
@@ -2418,8 +2295,6 @@ bool TabBar::IsEffectiveRTL() const
return IsMirrored() != Application::GetSettings().GetLayoutRTL();
}
-
-
void TabBar::SetMaxPageWidth( long nMaxWidth )
{
if ( mnMaxPageWidth != nMaxWidth )
@@ -2433,8 +2308,6 @@ void TabBar::SetMaxPageWidth( long nMaxWidth )
}
}
-
-
void TabBar::SetPageText( sal_uInt16 nPageId, const OUString& rText )
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2451,8 +2324,6 @@ void TabBar::SetPageText( sal_uInt16 nPageId, const OUString& rText )
}
}
-
-
OUString TabBar::GetPageText( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2461,8 +2332,6 @@ OUString TabBar::GetPageText( sal_uInt16 nPageId ) const
return OUString();
}
-
-
OUString TabBar::GetHelpText( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2481,8 +2350,6 @@ OUString TabBar::GetHelpText( sal_uInt16 nPageId ) const
return OUString();
}
-
-
OString TabBar::GetHelpId( sal_uInt16 nPageId ) const
{
sal_uInt16 nPos = GetPagePos( nPageId );
@@ -2492,8 +2359,6 @@ OString TabBar::GetHelpId( sal_uInt16 nPageId ) const
return aRet;
}
-
-
bool TabBar::StartDrag( const CommandEvent& rCEvt, vcl::Region& rRegion )
{
if ( !(mnWinStyle & WB_DRAG) || (rCEvt.GetCommand() != COMMAND_STARTDRAG) )
@@ -2537,8 +2402,6 @@ bool TabBar::StartDrag( const CommandEvent& rCEvt, vcl::Region& rRegion )
return true;
}
-
-
sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
{
ImplTabBarItem* pItem;
@@ -2660,8 +2523,6 @@ sal_uInt16 TabBar::ShowDropPos( const Point& rPos )
return mnDropPos;
}
-
-
void TabBar::HideDropPos()
{
if ( mbDropPos )
@@ -2700,8 +2561,6 @@ void TabBar::HideDropPos()
}
}
-
-
bool TabBar::SwitchPage( const Point& rPos )
{
bool bSwitch = false;
@@ -2740,16 +2599,12 @@ bool TabBar::SwitchPage( const Point& rPos )
return bSwitch;
}
-
-
void TabBar::EndSwitchPage()
{
mnSwitchTime = 0;
mnSwitchId = 0;
}
-
-
void TabBar::SetStyle( WinBits nStyle )
{
mnWinStyle = nStyle;
@@ -2759,8 +2614,6 @@ void TabBar::SetStyle( WinBits nStyle )
Resize();
}
-
-
Size TabBar::CalcWindowSizePixel() const
{
long nWidth = 0;
@@ -2778,19 +2631,14 @@ Size TabBar::CalcWindowSizePixel() const
return Size( nWidth, GetSettings().GetStyleSettings().GetScrollBarSize() );
}
-
Rectangle TabBar::GetPageArea() const
{
return Rectangle( Point( mnOffX, mnOffY ), Size( mnLastOffX-mnOffX+1, GetSizePixel().Height()-mnOffY ) );
}
-
-
-::com::sun::star::uno::Reference< ::com::sun::star::accessibility::XAccessible > TabBar::CreateAccessible()
+css::uno::Reference<css::accessibility::XAccessible> TabBar::CreateAccessible()
{
return mpImpl->maAccessibleFactory.getFactory().createAccessibleTabBar( *this );
}
-
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */