Kaydet (Commit) e8559f07 authored tarafından Marcel Metz's avatar Marcel Metz Kaydeden (comit) Luboš Luňák

Remove unused code

Hello lo-devs,

There is never an instance of mpDateTable allocated and a lot of
code is never executed because of that. This patch removes the
unused code.

regards Marcel
üst 9d54084d
......@@ -45,8 +45,6 @@ class HelpEvent;
class DataChangedEvent;
class FloatingWindow;
class PushButton;
struct ImplDateInfo;
class ImplDateTable;
class ImplCFieldFloatWin;
/*************************************************************************
......@@ -173,7 +171,6 @@ oder durch Beendigung einer Selektion ausgeloest.
class SVT_DLLPUBLIC Calendar : public Control
{
private:
ImplDateTable* mpDateTable;
Table* mpSelectTable;
Table* mpOldSelectTable;
Table* mpRestoreSelectTable;
......
......@@ -77,23 +77,6 @@ using namespace ::com::sun::star;
// =======================================================================
struct ImplDateInfo
{
XubString maText;
Color* mpTextColor;
Color* mpFrameColor;
sal_uInt16 mnFlags;
ImplDateInfo( const XubString& rText ) :
maText( rText )
{ mpTextColor = mpFrameColor = NULL; mnFlags = 0; }
~ImplDateInfo() { delete mpTextColor; delete mpFrameColor; }
};
DECLARE_TABLE( ImplDateTable, ImplDateInfo* )
// =======================================================================
static void ImplCalendarSelectDate( Table* pTable, const Date& rDate, sal_Bool bSelect )
{
if ( bSelect )
......@@ -196,7 +179,6 @@ inline void ImplCalendarClearSelectDate( Table* pTable )
void Calendar::ImplInit( WinBits nWinStyle )
{
mpDateTable = NULL;
mpSelectTable = new Table;
mpOldSelectTable = NULL;
mpRestoreSelectTable = NULL;
......@@ -307,18 +289,6 @@ Calendar::~Calendar()
delete mpSaturdayColor;
delete mpSundayColor;
if ( mpDateTable )
{
ImplDateInfo* pDateInfo = mpDateTable->First();
while ( pDateInfo )
{
delete pDateInfo;
pDateInfo = mpDateTable->Next();
}
delete mpDateTable;
}
delete mpSelectTable;
if ( mpOldSelectTable )
delete mpOldSelectTable;
......@@ -770,7 +740,6 @@ void Calendar::ImplDrawDate( long nX, long nY,
DayOfWeek eDayOfWeek,
sal_Bool bBack, sal_Bool bOther, sal_uLong nToday )
{
ImplDateInfo* pDateInfo;
Color* pTextColor = NULL;
const String& rDay = *(mpDayText[nDay-1]);
Rectangle aDateRect( nX, nY, nX+mnDayWidth-1, nY+mnDayHeight-1 );
......@@ -788,26 +757,12 @@ void Calendar::ImplDrawDate( long nX, long nY,
bSel = sal_True;
}
// Dateinfo ermitteln
if ( mpDateTable )
{
pDateInfo = mpDateTable->Get( Date( nDay, nMonth, nYear ).GetDate() );
if ( !pDateInfo )
pDateInfo = mpDateTable->Get( Date( nDay, nMonth, 0 ).GetDate() );
}
else
pDateInfo = NULL;
// Textfarbe ermitteln
if ( bSel )
pTextColor = &maSelColor;
else if ( bOther )
pTextColor = &maOtherColor;
else
{
if ( pDateInfo && pDateInfo->mpTextColor )
pTextColor = pDateInfo->mpTextColor;
else
{
if ( eDayOfWeek == SATURDAY )
pTextColor = mpSaturdayColor;
......@@ -816,7 +771,6 @@ void Calendar::ImplDrawDate( long nX, long nY,
if ( !pTextColor )
pTextColor = mpStandardColor;
}
}
if ( bFocus )
HideFocus();
......@@ -824,17 +778,6 @@ void Calendar::ImplDrawDate( long nX, long nY,
// Font ermitteln
Font aOldFont = GetFont();
sal_Bool bBoldFont = sal_False;
if ( (mnWinStyle & WB_BOLDTEXT) &&
pDateInfo && (pDateInfo->mnFlags & DIB_BOLD) )
{
bBoldFont = sal_True;
Font aFont = aOldFont;
if ( aFont.GetWeight() < WEIGHT_BOLD )
aFont.SetWeight( WEIGHT_BOLD );
else
aFont.SetWeight( WEIGHT_NORMAL );
SetFont( aFont );
}
// Hintergrund ausgeben
const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
......@@ -878,34 +821,6 @@ void Calendar::ImplDrawDate( long nX, long nY,
DrawRect( aDateRect );
}
// Evt. DateInfo ausgeben
if ( (mnWinStyle & WB_FRAMEINFO) && pDateInfo && pDateInfo->mpFrameColor )
{
SetLineColor( *(pDateInfo->mpFrameColor) );
SetFillColor();
Rectangle aFrameRect( aDateRect );
aFrameRect.Left()++;
aFrameRect.Top()++;
long nFrameWidth = aFrameRect.GetWidth();
long nFrameHeight = aFrameRect.GetHeight();
long nFrameOff;
if ( nFrameWidth < nFrameHeight )
{
nFrameOff = nFrameHeight-nFrameWidth;
aFrameRect.Top() += nFrameOff/2;
nFrameOff %= 2;
aFrameRect.Bottom() -= nFrameOff;
}
else if ( nFrameWidth > nFrameHeight )
{
nFrameOff = nFrameWidth-nFrameHeight;
aFrameRect.Left() += nFrameOff/2;
nFrameOff %= 2;
aFrameRect.Right() -= nFrameOff;
}
DrawEllipse( aFrameRect );
}
// Evt. noch FocusRect
if ( bFocus && HasFocus() )
ShowFocus( aDateRect );
......@@ -1809,28 +1724,6 @@ void Calendar::RequestHelp( const HelpEvent& rHEvt )
aDateRect.Right() = aPt.X();
aDateRect.Bottom() = aPt.Y();
if ( (rHEvt.GetMode() & HELPMODE_BALLOON) || (mnWinStyle & WB_QUICKHELPSHOWSDATEINFO) )
{
ImplDateInfo* pInfo;
if ( mpDateTable )
{
pInfo = mpDateTable->Get( aDate.GetDate() );
if ( !pInfo )
pInfo = mpDateTable->Get( Date( aDate.GetDay(), aDate.GetMonth(), 0 ).GetDate() );
}
else
pInfo = NULL;
if ( pInfo )
{
XubString aStr = pInfo->maText;
if ( aStr.Len() )
{
Help::ShowBalloon( this, rHEvt.GetMousePosPixel(), aDateRect, aStr );
return;
}
}
}
if ( rHEvt.GetMode() & HELPMODE_QUICK )
{
maCalendarWrapper.setGregorianDateTime( aDate);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment