[Libreoffice-commits] core.git: 2 commits - include/svtools svtools/source

Noel Grandin noel.grandin at collabora.co.uk
Fri Aug 18 14:09:21 UTC 2017


 include/svtools/calendar.hxx        |   32 ---
 svtools/source/control/calendar.cxx |  326 ++----------------------------------
 2 files changed, 20 insertions(+), 338 deletions(-)

New commits:
commit e64a54acfea031d45b06b4c9d606fc03bfcbf40b
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Aug 18 14:24:48 2017 +0200

    WB_RANGESELECT,WB_MULTISELECT in Calendar is dead
    
    since
    
        commit 6c759da0442f5123a4a4355e8dc9c926a49d25d7
        delete workben
    
    Change-Id: Ib9db62ea3fb064b70912318eda2528590c307295
    Reviewed-on: https://gerrit.libreoffice.org/41287
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svtools/calendar.hxx b/include/svtools/calendar.hxx
index 345f3552ff1b..8992d3ef4cb4 100644
--- a/include/svtools/calendar.hxx
+++ b/include/svtools/calendar.hxx
@@ -58,9 +58,6 @@ WinBits
 WB_BORDER                   We draw a border around the window.
 WB_TABSTOP                  Keyboard control is possible. We get the focus, when
                             the user clicks in the Control.
-WB_RANGESELECT              The user can select multiple days, which need to be
-                            consecutive
-WB_MULTISELECT              The user can select multiple days
 
 --------------------------------------------------------------------------
 
@@ -97,9 +94,6 @@ If a ContextMenu is displayed, the baseclass' handler must not be called.
 
 --------------------------------------------------------------------------
 
-For multiple selection (WB_RANGESELECT or WB_MULTISELECT) SelectDate(),
-SelectDateRange() can select date ranges. SelectDateRange() selects
-including the end date.
 SetNoSelection() deselects everything.
 SetCurDate() does not select the current date, but only defines the focus
 rectangle.
@@ -125,17 +119,6 @@ calls or by ending a selection.
 
 *************************************************************************/
 
-// Needs to be in agreement with the WinBits in the TabBar or
-// we move it to \vcl\inc\wintypes.hxx
-#ifndef WB_RANGESELECT
-#define WB_RANGESELECT              ((WinBits)0x00200000)
-#endif
-#ifndef WB_MULTISELECT
-#define WB_MULTISELECT              ((WinBits)0x00400000)
-#endif
-
-#define DIB_BOLD                    ((sal_uInt16)0x0001)
-
 typedef std::set<sal_Int32> IntDateSet;
 
 
@@ -183,7 +166,6 @@ private:
                     mbFormat:1,
                     mbDrag:1,
                     mbSelection:1,
-                    mbMultiSelection:1,
                     mbUnSel:1,
                     mbMenuDown:1,
                     mbSpinDown:1,
@@ -217,7 +199,7 @@ private:
     SVT_DLLPRIVATE void         ImplUpdateDate( const Date& rDate );
     SVT_DLLPRIVATE void         ImplUpdateSelection( IntDateSet* pOld );
     SVT_DLLPRIVATE void         ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
-                                                 bool bMove, bool bExpand, bool bExtended );
+                                                 bool bMove );
     SVT_DLLPRIVATE void         ImplUpdate( bool bCalcNew = false );
     using Window::ImplScroll;
     SVT_DLLPRIVATE void         ImplScroll( bool bPrev );
@@ -303,9 +285,6 @@ With EnableToday()/EnableNone() we can enable a TodayButton and a NoneButton.
 
 --------------------------------------------------------------------------
 
-If we set WB_RANGESELECT with SetCalendarStyle(), we can select multiple days
-in the Calendar.
-
 Because we only take over the start date into the field, we should query
 with GetCalendar() in the SelectHandler and with GetSelectDateCount()/GetSelectDate()
 the selected range. We then can e.g. take over that value to another field.
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index ec424b404be7..828e3af37c0d 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -67,79 +67,7 @@ static void ImplCalendarSelectDate( IntDateSet* pTable, const Date& rDate, bool
         pTable->erase( rDate.GetDate() );
 }
 
-static void ImplCalendarSelectDateRange( IntDateSet* pTable,
-                                         const Date& rStartDate,
-                                         const Date& rEndDate,
-                                         bool bSelect )
-{
-    Date aStartDate = rStartDate;
-    Date aEndDate = rEndDate;
-    if ( aStartDate > aEndDate )
-    {
-        Date aTempDate = aStartDate;
-        aStartDate = aEndDate;
-        aEndDate = aTempDate;
-    }
-
-    if ( bSelect )
-    {
-        while ( aStartDate <= aEndDate )
-        {
-            pTable->insert( aStartDate.GetDate() );
-            ++aStartDate;
-        }
-    }
-    else
-    {
-        for ( IntDateSet::const_iterator it = pTable->begin(); it != pTable->end(); )
-        {
-            Date aDate( *it );
-            if ( aDate > aEndDate )
-                break;
-
-            if ( aDate >= aStartDate )
-                it = pTable->erase(it);
-            else
-                ++it;
-        }
-    }
-}
-
-static void ImplCalendarUnSelectDateRange( IntDateSet* pTable,
-                                           IntDateSet* pOldTable,
-                                           const Date& rStartDate,
-                                           const Date& rEndDate )
-{
-    Date aStartDate = rStartDate;
-    Date aEndDate = rEndDate;
-    if ( aStartDate > aEndDate )
-    {
-        Date aTempDate = aStartDate;
-        aStartDate = aEndDate;
-        aEndDate = aTempDate;
-    }
-
-    for ( IntDateSet::const_iterator it = pTable->begin(); it != pTable->end(); )
-    {
-        Date aDate( *it );
-        if ( aDate > aEndDate )
-            break;
-
-        if ( aDate >= aStartDate )
-            it = pTable->erase(it);
-        else
-            ++it;
-    }
 
-    for ( IntDateSet::const_iterator it = pOldTable->begin(); it != pOldTable->end(); ++it )
-    {
-        Date aDate( *it );
-        if ( aDate > aEndDate )
-            break;
-        if ( aDate >= aStartDate )
-            pTable->insert( aDate.GetDate() );
-    }
-}
 
 inline void ImplCalendarClearSelectDate( IntDateSet* pTable )
 {
@@ -162,7 +90,6 @@ void Calendar::ImplInit( WinBits nWinStyle )
     mbFormat                = true;
     mbDrag                  = false;
     mbSelection             = false;
-    mbMultiSelection        = false;
     mbUnSel                 = false;
     mbMenuDown              = false;
     mbSpinDown              = false;
@@ -226,7 +153,7 @@ void Calendar::ImplInitSettings()
 }
 
 Calendar::Calendar( vcl::Window* pParent, WinBits nWinStyle ) :
-    Control( pParent, nWinStyle & (WB_TABSTOP | WB_GROUP | WB_BORDER | WB_3DLOOK | WB_RANGESELECT | WB_MULTISELECT) ),
+    Control( pParent, nWinStyle & (WB_TABSTOP | WB_GROUP | WB_BORDER | WB_3DLOOK) ),
     maCalendarWrapper( Application::GetAppLocaleDataWrapper().getComponentContext() ),
     maOldFormatFirstDate( 0, 0, 1900 ),
     maOldFormatLastDate( 0, 0, 1900 ),
@@ -940,7 +867,7 @@ void Calendar::ImplUpdateSelection( IntDateSet* pOld )
 }
 
 void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
-                                bool bMove, bool bExpand, bool bExtended )
+                                bool bMove )
 {
     std::unique_ptr<IntDateSet> pOldSel(new IntDateSet( *mpSelectTable ));
     Date    aOldDate = maCurDate;
@@ -949,83 +876,19 @@ void Calendar::ImplMouseSelect( const Date& rDate, sal_uInt16 nHitTest,
     if ( !(nHitTest & CALENDAR_HITTEST_DAY) )
         --aTempDate;
 
-    if ( mbMultiSelection )
-    {
-        maCurDate = aTempDate;
-        mbSelLeft = aTempDate < maAnchorDate;
-
-        if ( bMove )
-        {
-            if ( mbSelLeft )
-            {
-                ImplCalendarUnSelectDateRange( mpSelectTable, mpRestoreSelectTable, Date( 1, 1, 0 ), aTempDate );
-                ImplCalendarUnSelectDateRange( mpSelectTable, mpRestoreSelectTable, maAnchorDate, Date( 31, 12, 9999 ) );
-            }
-            else
-            {
-                ImplCalendarUnSelectDateRange( mpSelectTable, mpRestoreSelectTable, Date( 1, 1, 0 ), maAnchorDate );
-                ImplCalendarUnSelectDateRange( mpSelectTable, mpRestoreSelectTable, aTempDate, Date( 31, 12, 9999 ) );
-            }
-            ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, !mbUnSel );
-        }
-        else
-        {
-            if ( bExpand )
-            {
-                if ( !bExtended )
-                {
-                    if ( mbSelLeft )
-                    {
-                        ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aTempDate, false );
-                        ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), false );
-                    }
-                    else
-                    {
-                        ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, false );
-                        ImplCalendarSelectDateRange( mpSelectTable, aTempDate, Date( 31, 12, 9999 ), false );
-                    }
-                }
-                ImplCalendarSelectDateRange( mpSelectTable, aTempDate, maAnchorDate, true );
-            }
-            else if ( bExtended && !(mnWinStyle & WB_RANGESELECT) )
-            {
-                maAnchorDate = aTempDate;
-                if ( IsDateSelected( aTempDate ) )
-                {
-                    mbUnSel = true;
-                    ImplCalendarSelectDate( mpSelectTable, aTempDate, false );
-                }
-                else
-                {
-                    ImplCalendarSelectDate( mpSelectTable, aTempDate, true );
-                }
-            }
-            else
-            {
-                maAnchorDate = aTempDate;
-                ImplCalendarClearSelectDate( mpSelectTable );
-                ImplCalendarSelectDate( mpSelectTable, aTempDate, true );
-            }
-
-            mpRestoreSelectTable = new IntDateSet( *mpSelectTable );
-        }
-    }
+    if ( aTempDate < maCurDate )
+        mbSelLeft = true;
     else
+        mbSelLeft = false;
+    if ( !(nHitTest & CALENDAR_HITTEST_DAY) )
+        aTempDate = maOldCurDate;
+    if ( !bMove )
+        maAnchorDate = aTempDate;
+    if ( aTempDate != maCurDate )
     {
-        if ( aTempDate < maCurDate )
-            mbSelLeft = true;
-        else
-            mbSelLeft = false;
-        if ( !(nHitTest & CALENDAR_HITTEST_DAY) )
-            aTempDate = maOldCurDate;
-        if ( !bMove )
-            maAnchorDate = aTempDate;
-        if ( aTempDate != maCurDate )
-        {
-            maCurDate = aTempDate;
-            ImplCalendarSelectDate( mpSelectTable, aOldDate, false );
-            ImplCalendarSelectDate( mpSelectTable, maCurDate, true );
-        }
+        maCurDate = aTempDate;
+        ImplCalendarSelectDate( mpSelectTable, aOldDate, false );
+        ImplCalendarSelectDate( mpSelectTable, maCurDate, true );
     }
 
     bool bNewSel = *pOldSel != *mpSelectTable;
@@ -1153,7 +1016,7 @@ void Calendar::ImplTracking( const Point& rPos, bool bRepeat )
         }
     }
     else
-        ImplMouseSelect( aTempDate, nHitTest, true, false, false );
+        ImplMouseSelect( aTempDate, nHitTest, true );
 }
 
 void Calendar::ImplEndTracking( bool bCancel )
@@ -1163,7 +1026,6 @@ void Calendar::ImplEndTracking( bool bCancel )
 
     mbDrag              = false;
     mbSelection         = false;
-    mbMultiSelection    = false;
     mbUnSel             = false;
     mbSpinDown          = false;
     mbPrevIn            = false;
@@ -1269,8 +1131,7 @@ void Calendar::MouseButtonDown( const MouseEvent& rMEvt )
                             StartTracking();
                         }
 
-                        mbMultiSelection = (mnWinStyle & (WB_MULTISELECT | WB_RANGESELECT)) != 0;
-                        ImplMouseSelect( aTempDate, nHitTest, false, rMEvt.IsShift(), rMEvt.IsMod1() );
+                        ImplMouseSelect( aTempDate, nHitTest, false );
                     }
                 }
             }
@@ -1311,9 +1172,6 @@ void Calendar::Tracking( const TrackingEvent& rTEvt )
 void Calendar::KeyInput( const KeyEvent& rKEvt )
 {
     Date    aNewDate = maCurDate;
-    bool    bMultiSel = (mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) != 0;
-    bool    bExpand = rKEvt.GetKeyCode().IsShift();
-    bool    bExtended = rKEvt.GetKeyCode().IsMod1();
 
     switch ( rKEvt.GetKeyCode().GetCode() )
     {
@@ -1353,23 +1211,6 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
             aNewDate.AddDays( aNewDate.GetDaysInMonth() );
             break;
 
-        case KEY_SPACE:
-            if ( bMultiSel && !(mnWinStyle & WB_RANGESELECT) )
-            {
-                if ( !bExpand )
-                {
-                    bool bDateSel = IsDateSelected( maCurDate );
-                    SelectDate( maCurDate, !bDateSel );
-                    mbSelLeft = false;
-                    mbTravelSelect = true;
-                    Select();
-                    mbTravelSelect = false;
-                }
-            }
-            else
-                Control::KeyInput( rKEvt );
-            break;
-
         default:
             Control::KeyInput( rKEvt );
             break;
@@ -1377,38 +1218,7 @@ void Calendar::KeyInput( const KeyEvent& rKEvt )
 
     if ( aNewDate != maCurDate )
     {
-        if ( bMultiSel && bExpand )
-        {
-            std::unique_ptr<IntDateSet> pOldSel(new IntDateSet( *mpSelectTable ));
-            Date aOldAnchorDate = maAnchorDate;
-            mbSelLeft = aNewDate < maAnchorDate;
-            if ( !bExtended )
-            {
-                if ( mbSelLeft )
-                {
-                    ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), aNewDate, false );
-                    ImplCalendarSelectDateRange( mpSelectTable, maAnchorDate, Date( 31, 12, 9999 ), false );
-                }
-                else
-                {
-                    ImplCalendarSelectDateRange( mpSelectTable, Date( 1, 1, 0 ), maAnchorDate, false );
-                    ImplCalendarSelectDateRange( mpSelectTable, aNewDate, Date( 31, 12, 9999 ), false );
-                }
-            }
-            ImplCalendarSelectDateRange( mpSelectTable, aNewDate, maAnchorDate, true );
-            SetCurDate( aNewDate );
-            maAnchorDate = aOldAnchorDate;
-            ImplUpdateSelection( pOldSel.get() );
-        }
-        else
-        {
-            if ( mnWinStyle & WB_RANGESELECT )
-            {
-                SetNoSelection();
-                SelectDate( aNewDate );
-            }
-            SetCurDate( aNewDate );
-        }
+        SetCurDate( aNewDate );
         mbTravelSelect = true;
         Select();
         mbTravelSelect = false;
@@ -1610,13 +1420,8 @@ void Calendar::SetCurDate( const Date& rNewDate )
         maCurDate       = rNewDate;
         maAnchorDate    = maCurDate;
 
-        if ( !(mnWinStyle & (WB_RANGESELECT | WB_MULTISELECT)) )
-        {
-            ImplCalendarSelectDate( mpSelectTable, aOldDate, false );
-            ImplCalendarSelectDate( mpSelectTable, maCurDate, true );
-        }
-        else if ( !HasFocus() )
-            bUpdate = false;
+        ImplCalendarSelectDate( mpSelectTable, aOldDate, false );
+        ImplCalendarSelectDate( mpSelectTable, maCurDate, true );
 
         // shift actual date in the visible area
         if ( mbFormat || (maCurDate < GetFirstMonth()) )
@@ -1826,7 +1631,6 @@ void Calendar::EndSelection()
 
         mbDrag              = false;
         mbSelection         = false;
-        mbMultiSelection    = false;
         mbSpinDown          = false;
         mbPrevIn            = false;
         mbNextIn            = false;
@@ -2122,11 +1926,6 @@ bool CalendarField::ShowDropDown( bool bShow )
             else
                 aDate = Date( Date::SYSTEM );
         }
-        if ( pCalendar->GetStyle() & (WB_RANGESELECT | WB_MULTISELECT) )
-        {
-            pCalendar->SetNoSelection();
-            pCalendar->SelectDate( aDate );
-        }
         pCalendar->SetCurDate( aDate );
         Point       aPos( GetParent()->OutputToScreenPixel( GetPosPixel() ) );
         tools::Rectangle   aRect( aPos, GetSizePixel() );
commit adf38e23f32b0b0e0b45a45f4abf2758e74c1a59
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Aug 18 13:56:31 2017 +0200

    WB_BOLDTEXT,WB_FRAMEINFO,WB_WEEKNUMBER are dead
    
    since commit 6c759da0442f5123a4a4355e8dc9c926a49d25d7
    "delete workben"
    
    Change-Id: Ie1f399a7a8179c7727491f4ab7b4b2772fd130b8
    Reviewed-on: https://gerrit.libreoffice.org/41286
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/svtools/calendar.hxx b/include/svtools/calendar.hxx
index a70644256e79..345f3552ff1b 100644
--- a/include/svtools/calendar.hxx
+++ b/include/svtools/calendar.hxx
@@ -58,14 +58,9 @@ WinBits
 WB_BORDER                   We draw a border around the window.
 WB_TABSTOP                  Keyboard control is possible. We get the focus, when
                             the user clicks in the Control.
-WB_BOLDTEXT                 We format by bold texts and DIB_BOLD is evaluated by
-                            AddDateInfo()
-WB_FRAMEINFO                We format in a way, so that FrameInfo can be displayed
-                            and the FrameColor is evaluated by AddDateInfo()
 WB_RANGESELECT              The user can select multiple days, which need to be
                             consecutive
 WB_MULTISELECT              The user can select multiple days
-WB_WEEKNUMBER               We also display the weekdays
 
 --------------------------------------------------------------------------
 
@@ -130,9 +125,6 @@ calls or by ending a selection.
 
 *************************************************************************/
 
-#define WB_BOLDTEXT                 ((WinBits)0x00008000)
-#define WB_FRAMEINFO                ((WinBits)0x00010000)
-#define WB_WEEKNUMBER               ((WinBits)0x00020000)
 // Needs to be in agreement with the WinBits in the TabBar or
 // we move it to \vcl\inc\wintypes.hxx
 #ifndef WB_RANGESELECT
@@ -184,7 +176,6 @@ private:
     long            mnLines;
     long            mnDayWidth;
     long            mnDayHeight;
-    long            mnWeekWidth;
     WinBits         mnWinStyle;
     sal_Int16       mnFirstYear;
     sal_Int16       mnLastYear;
diff --git a/svtools/source/control/calendar.cxx b/svtools/source/control/calendar.cxx
index b60e68df6331..ec424b404be7 100644
--- a/svtools/source/control/calendar.cxx
+++ b/svtools/source/control/calendar.cxx
@@ -42,7 +42,6 @@
 #define DAY_OFFY                        2
 #define MONTH_BORDERX                   4
 #define MONTH_OFFY                      3
-#define WEEKNUMBER_OFFX                 4
 #define WEEKDAY_OFFY                    3
 #define TITLE_OFFY                      3
 #define TITLE_BORDERY                   2
@@ -319,35 +318,12 @@ void Calendar::ImplFormat()
 
         vcl::Font aOldFont = GetFont();
 
-        // Wochenanzeige beruecksichtigen
-        if ( mnWinStyle & WB_WEEKNUMBER )
-        {
-            vcl::Font aTempFont = aOldFont;
-            ImplGetWeekFont( aTempFont );
-            SetFont( aTempFont );
-            mnWeekWidth = GetTextWidth( a99Text )+WEEKNUMBER_OFFX;
-            SetFont( aOldFont );
-        }
-        else
-            mnWeekWidth = 0;
-
-        if ( mnWinStyle & WB_BOLDTEXT )
-        {
-            vcl::Font aFont = aOldFont;
-            if ( aFont.GetWeight() < WEIGHT_BOLD )
-                aFont.SetWeight( WEIGHT_BOLD );
-            else
-                aFont.SetWeight( WEIGHT_NORMAL );
-            SetFont( aFont );
-        }
-
         long n99TextWidth = GetTextWidth( a99Text );
         long nTextHeight = GetTextHeight();
 
         // calculate width and x-position
         mnDayWidth      = n99TextWidth+DAY_OFFX;
         mnMonthWidth    = mnDayWidth*7;
-        mnMonthWidth   += mnWeekWidth;
         mnMonthWidth   += MONTH_BORDERX*2;
         mnMonthPerLine  = aOutSize.Width() / mnMonthWidth;
         if ( !mnMonthPerLine )
@@ -356,7 +332,6 @@ void Calendar::ImplFormat()
         mnMonthWidth   += nOver;
         mnDaysOffX      = MONTH_BORDERX;
         mnDaysOffX     += nOver/2;
-        mnDaysOffX     += mnWeekWidth;
 
         // calculate height and y-position
         mnDayHeight     = nTextHeight + DAY_OFFY;
@@ -380,9 +355,6 @@ void Calendar::ImplFormat()
         maNextRect.Right()  = maNextRect.Left()+nSpinSize;
         maNextRect.Bottom() = maNextRect.Top()+nSpinSize;
 
-        if ( mnWinStyle & WB_BOLDTEXT )
-            SetFont( aOldFont );
-
         // Calculate DayOfWeekText (gets displayed in a narrow font)
         maDayOfWeekText.clear();
         long nStartOffX = 0;
@@ -393,8 +365,6 @@ void Calendar::ImplFormat()
             OUString aDayOfWeek( maCalendarWrapper.getDisplayName(
                         i18n::CalendarDisplayIndex::DAY, nDay, 2));
             long nOffX = (mnDayWidth-GetTextWidth( aDayOfWeek ))/2;
-            if ( mnWinStyle & WB_BOLDTEXT )
-                nOffX++;
             if ( !nDayOfWeek )
                 nStartOffX = nOffX;
             else
@@ -862,40 +832,9 @@ void Calendar::ImplDraw(vcl::RenderContext& rRenderContext)
             nDeltaY = nDayY + mnDayHeight;
             rRenderContext.SetLineColor(rStyleSettings.GetWindowTextColor());
             Point aStartPos(nDayX, nDeltaY);
-            if (mnWinStyle & WB_WEEKNUMBER)
-                aStartPos.X() -= WEEKNUMBER_OFFX - 2;
             rRenderContext.DrawLine(aStartPos, Point(nDayX + (7 * mnDayWidth), nDeltaY));
             rRenderContext.DrawTextArray(Point(nDayX + mnDayOfWeekAry[0], nDayY), maDayOfWeekText, &(mnDayOfWeekAry[1]));
 
-            // display weeknumbers
-            if (mnWinStyle & WB_WEEKNUMBER)
-            {
-                nDayX = nX + mnDaysOffX;
-                nDayY = nY + mnWeekDayOffY;
-                nDeltaY = nDayY + mnDayHeight;
-                long nMonthHeight = mnDayHeight * 6;
-                rRenderContext.DrawLine(Point(nDayX - WEEKNUMBER_OFFX + 2, nDeltaY),
-                                        Point(nDayX - WEEKNUMBER_OFFX + 2, nDeltaY + nMonthHeight));
-                vcl::Font aOldFont = rRenderContext.GetFont();
-                vcl::Font aTempFont = aOldFont;
-                ImplGetWeekFont(aTempFont);
-                rRenderContext.SetFont(aTempFont);
-                nDayX -= mnWeekWidth;
-                nDayY = nY + mnDaysOffY;
-                maCalendarWrapper.setGregorianDateTime(aDate);
-                for (sal_uInt16 nWeekCount = 0; nWeekCount < 6; ++nWeekCount)
-                {
-                    sal_Int32 nWeek = maCalendarWrapper.getValue(i18n::CalendarFieldIndex::WEEK_OF_YEAR);
-                    OUString aWeekText(OUString::number(nWeek));
-                    long nOffX = (mnWeekWidth - WEEKNUMBER_OFFX) - rRenderContext.GetTextWidth(aWeekText);
-                    long nOffY = (mnDayHeight - GetTextHeight()) / 2;
-                    rRenderContext.DrawText(Point(nDayX + nOffX, nDayY + nOffY), aWeekText);
-                    nDayY += mnDayHeight;
-                    maCalendarWrapper.addValue(i18n::CalendarFieldIndex::DAY_OF_MONTH, 7);
-                }
-                rRenderContext.SetFont(aOldFont);
-            }
-
             // display days
             sal_uInt16 nDaysInMonth = aDate.GetDaysInMonth();
             nDayX = nX + mnDaysOffX;
@@ -1899,37 +1838,11 @@ Size Calendar::CalcWindowSizePixel() const
     OUString  a99Text("99");
     vcl::Font aOldFont = GetFont();
 
-    // take display of week into account
-    long nWeekWidth;
-    if ( mnWinStyle & WB_WEEKNUMBER )
-    {
-        vcl::Font aTempFont = aOldFont;
-        ImplGetWeekFont( aTempFont );
-        const_cast<Calendar*>(this)->SetFont( aTempFont );
-        nWeekWidth = GetTextWidth( a99Text )+WEEKNUMBER_OFFX;
-        const_cast<Calendar*>(this)->SetFont( aOldFont );
-    }
-    else
-        nWeekWidth = 0;
-
-    if ( mnWinStyle & WB_BOLDTEXT )
-    {
-        vcl::Font aFont = aOldFont;
-        if ( aFont.GetWeight() < WEIGHT_BOLD )
-            aFont.SetWeight( WEIGHT_BOLD );
-        else
-            aFont.SetWeight( WEIGHT_NORMAL );
-        const_cast<Calendar*>(this)->SetFont( aFont );
-    }
-
     Size    aSize;
     long    n99TextWidth = GetTextWidth( a99Text );
     long    nTextHeight = GetTextHeight();
 
-    if ( mnWinStyle & WB_BOLDTEXT )
-        const_cast<Calendar*>(this)->SetFont( aOldFont );
-
-    aSize.Width()  += ((n99TextWidth+DAY_OFFX)*7) + nWeekWidth;
+    aSize.Width()  += ((n99TextWidth+DAY_OFFX)*7);
     aSize.Width()  += MONTH_BORDERX*2;
 
     aSize.Height()  = nTextHeight + TITLE_OFFY + (TITLE_BORDERY*2);


More information about the Libreoffice-commits mailing list