[Libreoffice-commits] .: 2 commits - rsc/inc rsc/source svtools/inc svtools/source vcl/inc vcl/source
Ivan Timofeev
ivantimofeev at kemper.freedesktop.org
Thu Jul 26 09:31:40 PDT 2012
rsc/inc/vclrsc.hxx | 2 -
rsc/source/parser/rscicpx.cxx | 2 -
svtools/inc/svtools/svtreebx.hxx | 1
svtools/source/contnr/svimpbox.cxx | 55 +++++-----------------------------
svtools/source/inc/svimpbox.hxx | 2 -
vcl/inc/vcl/window.hxx | 2 -
vcl/source/window/brdwin.cxx | 59 ++++++++++++++-----------------------
7 files changed, 31 insertions(+), 92 deletions(-)
New commits:
commit 09cc3a1b65dbf40717c4b41f24e86450f6fb4a99
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Thu Jul 26 20:20:38 2012 +0400
pTabBar is always NULL
Change-Id: I0f40a54c02c0231f75fcfcae7676f529984ee0f2
diff --git a/svtools/inc/svtools/svtreebx.hxx b/svtools/inc/svtools/svtreebx.hxx
index b656bdb..02c223e 100644
--- a/svtools/inc/svtools/svtreebx.hxx
+++ b/svtools/inc/svtools/svtreebx.hxx
@@ -36,7 +36,6 @@
// forward and defines ---------------------------------------------------
class SvImpLBox;
-class TabBar;
#define SV_TAB_BORDER 8
diff --git a/svtools/source/contnr/svimpbox.cxx b/svtools/source/contnr/svimpbox.cxx
index 21a0e4a..d828661 100644
--- a/svtools/source/contnr/svimpbox.cxx
+++ b/svtools/source/contnr/svimpbox.cxx
@@ -29,7 +29,6 @@
#include <vcl/svapp.hxx>
#include <vcl/salnativewidgets.hxx>
#include <vcl/help.hxx>
-#include <svtools/tabbar.hxx>
#include <stack>
@@ -54,7 +53,6 @@ sal_Int32 SvImpLBox::s_nImageRefCount = 0;
SvImpLBox::SvImpLBox( SvTreeListBox* pLBView, SvLBoxTreeList* pLBTree, WinBits nWinStyle) :
- pTabBar( NULL ),
aVerSBar( pLBView, WB_DRAG | WB_VSCROLL ),
aHorSBar( pLBView, WB_DRAG | WB_HSCROLL ),
aScrBarBox( pLBView ),
@@ -281,13 +279,7 @@ void SvImpLBox::Clear()
aVerSBar.SetRange( aRange );
aOutputSize = pView->Control::GetOutputSizePixel();
nFlags &= ~(F_VER_SBARSIZE_WITH_HBAR | F_HOR_SBARSIZE_WITH_VBAR );
- if( pTabBar )
- {
- aOutputSize.Height() -= nHorSBarHeight;
- nFlags |= F_VER_SBARSIZE_WITH_HBAR;
- }
- if( !pTabBar )
- aHorSBar.Hide();
+ aHorSBar.Hide();
aHorSBar.SetThumbPos( 0 );
MapMode aMapMode( pView->GetMapMode());
aMapMode.SetOrigin( Point(0,0) );
@@ -1154,39 +1146,13 @@ void SvImpLBox::DrawNet()
pView->SetLineColor( aOldLineColor );
}
-
-static long GetOptSize( TabBar* pTabBar )
-{
- return pTabBar->CalcWindowSizePixel().Width();
-}
-
void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask )
{
long nOverlap = 0;
Size aVerSize( nVerSBarWidth, rSize.Height() );
Size aHorSize( rSize.Width(), nHorSBarHeight );
- long nTabBarWidth = 0;
- if( pTabBar )
- {
- nTabBarWidth = GetOptSize( pTabBar );
- long nMaxWidth = (rSize.Width() * 700) / 1000;
- if( nTabBarWidth > nMaxWidth )
- {
- nTabBarWidth = nMaxWidth;
- pTabBar->SetStyle( pTabBar->GetStyle() | WB_MINSCROLL );
- }
- else
- {
- WinBits nStyle = pTabBar->GetStyle();
- nStyle &= ~(WB_MINSCROLL);
- pTabBar->SetStyle( nStyle );
- }
- aHorSize.Width() -= nTabBarWidth;
- Size aTabSize( pTabBar->GetSizePixel() );
- aTabSize.Width() = nTabBarWidth;
- pTabBar->SetSizePixel( aTabSize );
- }
+
if( nMask & 0x0001 )
aHorSize.Width() -= nVerSBarWidth;
if( nMask & 0x0002 )
@@ -1198,23 +1164,18 @@ void SvImpLBox::PositionScrollBars( Size& rSize, sal_uInt16 nMask )
aHorSize.Width() += 2 * nOverlap;
Point aHorPos( -nOverlap, rSize.Height() - aHorSize.Height() + nOverlap );
- if( pTabBar )
- pTabBar->SetPosPixel( aHorPos );
- aHorPos.X() += nTabBarWidth;
+
aHorSBar.SetPosSizePixel( aHorPos, aHorSize );
if( nMask & 0x0001 )
rSize.Width() = aVerPos.X();
if( nMask & 0x0002 )
rSize.Height() = aHorPos.Y();
- if( pTabBar )
- pTabBar->Show();
if( (nMask & (0x0001|0x0002)) == (0x0001|0x0002) )
aScrBarBox.Show();
else
aScrBarBox.Hide();
-
}
// nResult: Bit0 == VerSBar Bit1 == HorSBar
@@ -1236,10 +1197,11 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize )
aOrigin.X() *= -1;
nMaxRight += aOrigin.X() - 1;
long nVis = nMostRight - aOrigin.X();
- if( pTabBar || (
- (nWindowStyle & WB_HSCROLL) &&
- (nVis < nMostRight || nMaxRight < nMostRight) ))
+ if( (nWindowStyle & WB_HSCROLL) &&
+ (nVis < nMostRight || nMaxRight < nMostRight) )
+ {
bHorBar = sal_True;
+ }
// number of entries that are not collapsed
sal_uLong nTotalCount = pView->GetVisibleCount();
@@ -1335,8 +1297,7 @@ sal_uInt16 SvImpLBox::AdjustScrollBars( Size& rSize )
aHorSBar.Show();
else
{
- if( !pTabBar )
- aHorSBar.Hide();
+ aHorSBar.Hide();
}
rSize = aOSize;
return nResult;
diff --git a/svtools/source/inc/svimpbox.hxx b/svtools/source/inc/svimpbox.hxx
index b12e3b9..e8c6a59 100644
--- a/svtools/source/inc/svimpbox.hxx
+++ b/svtools/source/inc/svimpbox.hxx
@@ -44,7 +44,6 @@ class SvLBoxTreeList;
class SvImpLBox;
class SvLBoxEntry;
class SvLBoxTab;
-class TabBar;
namespace comphelper
{
namespace string
@@ -105,7 +104,6 @@ private:
SvLBoxButton* pActiveButton;
SvLBoxEntry* pActiveEntry;
SvLBoxTab* pActiveTab;
- TabBar* pTabBar;
ScrollBar aVerSBar;
ScrollBar aHorSBar;
commit 9b5a4f37912620a707ad2c8390381dd9f43d5f17
Author: Ivan Timofeev <timofeev.i.s at gmail.com>
Date: Thu Jul 26 19:30:47 2012 +0400
remove unused border styles
Change-Id: I4b01bdaf4fc20a55f2b4e9ebd039220031c03f11
diff --git a/rsc/inc/vclrsc.hxx b/rsc/inc/vclrsc.hxx
index 914f8f4..d1be1f1 100644
--- a/rsc/inc/vclrsc.hxx
+++ b/rsc/inc/vclrsc.hxx
@@ -96,8 +96,6 @@ typedef sal_uInt16 WindowBorderStyle;
#define WINDOW_BORDER_NORMAL ((WindowBorderStyle)0x0001)
#define WINDOW_BORDER_MONO ((WindowBorderStyle)0x0002)
-#define WINDOW_BORDER_ACTIVE ((WindowBorderStyle)0x0004)
-#define WINDOW_BORDER_DOUBLEOUT ((WindowBorderStyle)0x0008)
#define WINDOW_BORDER_MENU ((WindowBorderStyle)0x0010)
#define WINDOW_BORDER_NOBORDER ((WindowBorderStyle)0x1000)
diff --git a/rsc/source/parser/rscicpx.cxx b/rsc/source/parser/rscicpx.cxx
index 5a69920..bb1fa3b 100644
--- a/rsc/source/parser/rscicpx.cxx
+++ b/rsc/source/parser/rscicpx.cxx
@@ -314,8 +314,6 @@ RscTop * RscTypCont::InitClassWindow( RscTop * pSuper, RscEnum * pMapUnit,
// Konstanten in Tabelle stellen
SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_NORMAL" ), WINDOW_BORDER_NORMAL );
SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_MONO" ), WINDOW_BORDER_MONO );
- SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_ACTIVE" ), WINDOW_BORDER_ACTIVE );
- SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_DOUBLEOUT" ), WINDOW_BORDER_DOUBLEOUT );
SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_MENU" ), WINDOW_BORDER_MENU );
SETCONST( pBorderStyleEnum, pHS->getID( "WINDOW_BORDER_NOBORDER" ), WINDOW_BORDER_NOBORDER );
diff --git a/vcl/inc/vcl/window.hxx b/vcl/inc/vcl/window.hxx
index 0d64a3c..aaf7f3a 100644
--- a/vcl/inc/vcl/window.hxx
+++ b/vcl/inc/vcl/window.hxx
@@ -289,8 +289,6 @@ typedef sal_uInt16 StateChangedType;
// Border-Styles fuer SetBorder()
#define WINDOW_BORDER_NORMAL ((sal_uInt16)0x0001)
#define WINDOW_BORDER_MONO ((sal_uInt16)0x0002)
-#define WINDOW_BORDER_ACTIVE ((sal_uInt16)0x0004)
-#define WINDOW_BORDER_DOUBLEOUT ((sal_uInt16)0x0008)
#define WINDOW_BORDER_MENU ((sal_uInt16)0x0010)
#define WINDOW_BORDER_TOPBOTTOM ((sal_uInt16)0x0020)
#define WINDOW_BORDER_NWF ((sal_uInt16)0x0040)
diff --git a/vcl/source/window/brdwin.cxx b/vcl/source/window/brdwin.cxx
index 5d9ac3e..94a21e9 100644
--- a/vcl/source/window/brdwin.cxx
+++ b/vcl/source/window/brdwin.cxx
@@ -1198,7 +1198,7 @@ void ImplSmallBorderWindowView::Init( OutputDevice* pDev, long nWidth, long nHei
sal_uInt16 nStyle = FRAME_DRAW_NODRAW;
// Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster
// ist, dann Border nach aussen
- if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder )
+ if ( mpBorderWindow->mbSmallOutBorder )
nStyle |= FRAME_DRAW_DOUBLEOUT;
else if ( nBorderStyle & WINDOW_BORDER_TOPBOTTOM )
nStyle |= FRAME_DRAW_TOPBOTTOM;
@@ -1377,42 +1377,29 @@ void ImplSmallBorderWindowView::DrawWindow( sal_uInt16 nDrawFlags, OutputDevice*
if ( nDrawFlags & BORDERWINDOW_DRAW_FRAME )
{
- if ( nBorderStyle & WINDOW_BORDER_ACTIVE )
- {
- Color aColor = mpOutDev->GetSettings().GetStyleSettings().GetHighlightColor();
- mpOutDev->SetLineColor();
- mpOutDev->SetFillColor( aColor );
- mpOutDev->DrawRect( Rectangle( 0, 0, mnWidth-1, mnTopBorder ) );
- mpOutDev->DrawRect( Rectangle( 0, mnHeight-mnBottomBorder, mnWidth-1, mnHeight-1 ) );
- mpOutDev->DrawRect( Rectangle( 0, 0, mnLeftBorder, mnHeight-1 ) );
- mpOutDev->DrawRect( Rectangle( mnWidth-mnRightBorder, 0, mnWidth-1, mnHeight-1 ) );
- }
+ sal_uInt16 nStyle = 0;
+ // Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster
+ // ist, dann Border nach aussen
+ if ( mpBorderWindow->mbSmallOutBorder )
+ nStyle |= FRAME_DRAW_DOUBLEOUT;
+ else if ( nBorderStyle & WINDOW_BORDER_TOPBOTTOM )
+ nStyle |= FRAME_DRAW_TOPBOTTOM;
+ else if ( nBorderStyle & WINDOW_BORDER_NWF )
+ nStyle |= FRAME_DRAW_NWF;
else
- {
- sal_uInt16 nStyle = 0;
- // Wenn Border umgesetzt wurde oder BorderWindow ein Frame-Fenster
- // ist, dann Border nach aussen
- if ( (nBorderStyle & WINDOW_BORDER_DOUBLEOUT) || mpBorderWindow->mbSmallOutBorder )
- nStyle |= FRAME_DRAW_DOUBLEOUT;
- else if ( nBorderStyle & WINDOW_BORDER_TOPBOTTOM )
- nStyle |= FRAME_DRAW_TOPBOTTOM;
- else if ( nBorderStyle & WINDOW_BORDER_NWF )
- nStyle |= FRAME_DRAW_NWF;
- else
- nStyle |= FRAME_DRAW_DOUBLEIN;
- if ( nBorderStyle & WINDOW_BORDER_MONO )
- nStyle |= FRAME_DRAW_MONO;
- if ( nBorderStyle & WINDOW_BORDER_MENU )
- nStyle |= FRAME_DRAW_MENU;
- // tell DrawFrame that we're drawing a window border of a frame window to avoid round corners
- if( pWin && pWin == pWin->ImplGetFrameWindow() )
- nStyle |= FRAME_DRAW_WINDOWBORDER;
-
- DecorationView aDecoView( mpOutDev );
- Point aTmpPoint;
- Rectangle aInRect( aTmpPoint, Size( mnWidth, mnHeight ) );
- aDecoView.DrawFrame( aInRect, nStyle );
- }
+ nStyle |= FRAME_DRAW_DOUBLEIN;
+ if ( nBorderStyle & WINDOW_BORDER_MONO )
+ nStyle |= FRAME_DRAW_MONO;
+ if ( nBorderStyle & WINDOW_BORDER_MENU )
+ nStyle |= FRAME_DRAW_MENU;
+ // tell DrawFrame that we're drawing a window border of a frame window to avoid round corners
+ if( pWin && pWin == pWin->ImplGetFrameWindow() )
+ nStyle |= FRAME_DRAW_WINDOWBORDER;
+
+ DecorationView aDecoView( mpOutDev );
+ Point aTmpPoint;
+ Rectangle aInRect( aTmpPoint, Size( mnWidth, mnHeight ) );
+ aDecoView.DrawFrame( aInRect, nStyle );
}
}
More information about the Libreoffice-commits
mailing list