vcl/source/control/longcurr.cxx | 5 ++--- vcl/source/control/scrbar.cxx | 2 +- vcl/source/control/slider.cxx | 38 +++++++++++++++++--------------------- vcl/source/control/spinfld.cxx | 15 +++++++-------- vcl/source/control/tabctrl.cxx | 28 ++++++++++++++-------------- 5 files changed, 41 insertions(+), 47 deletions(-)
New commits: commit 69a9cffb9e6285a8735e4b35cdea9db4b118063c Author: Christian M. Heller <christian.helle...@gmail.com> Date: Sun Mar 24 10:28:49 2013 -0400 fdo#39468 Translate German comments - vcl/source/control/ FYI: there is some code duplication noticeable between slider and scrbar Conflicts: vcl/source/control/longcurr.cxx vcl/source/control/lstbox.cxx vcl/source/control/menubtn.cxx vcl/source/control/morebtn.cxx vcl/source/control/prgsbar.cxx vcl/source/control/scrbar.cxx Change-Id: I736cf155e252293ed571cd44a6a395b15c4bf576 Reviewed-on: https://gerrit.libreoffice.org/2966 Reviewed-by: Thomas Arnhold <tho...@arnhold.org> Tested-by: Thomas Arnhold <tho...@arnhold.org> diff --git a/vcl/source/control/longcurr.cxx b/vcl/source/control/longcurr.cxx index ba5e5b3..52f28e8 100644 --- a/vcl/source/control/longcurr.cxx +++ b/vcl/source/control/longcurr.cxx @@ -188,7 +188,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue, bNegative = sal_True; } - // Throw out all unwanted chars + // delete unwanted characters for (xub_StrLen i=0; i < aStr1.Len(); ) { if ( (aStr1.GetChar( i ) >= '0') && (aStr1.GetChar( i ) <= '9') ) @@ -226,7 +226,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, BigInt& rValue, aStr = aStr1; aStr += aStr2.makeStringAndClear(); - // Boundscheck + // check range BigInt nValue( aStr ); if ( bRound ) { @@ -420,7 +420,6 @@ void LongCurrencyFormatter::SetUseThousandSep( sal_Bool b ) void LongCurrencyFormatter::SetDecimalDigits( sal_uInt16 nDigits ) { - if ( nDigits > 9 ) nDigits = 9; diff --git a/vcl/source/control/scrbar.cxx b/vcl/source/control/scrbar.cxx index 5df8e29..8a85bb5 100644 --- a/vcl/source/control/scrbar.cxx +++ b/vcl/source/control/scrbar.cxx @@ -1033,7 +1033,7 @@ void ScrollBar::MouseButtonDown( const MouseEvent& rMEvt ) // Should we start Tracking? if ( meScrollType != SCROLL_DONTKNOW ) { - // remember original position in case of abort or EndScroll-Delta + // store original position for cancel and EndScroll delta mnStartPos = mnThumbPos; // #92906# Call StartTracking() before ImplDoMouseAction(), otherwise // MouseButtonUp() / EndTracking() may be called if somebody is spending diff --git a/vcl/source/control/slider.cxx b/vcl/source/control/slider.cxx index b6e1913..6bfaa2a 100644 --- a/vcl/source/control/slider.cxx +++ b/vcl/source/control/slider.cxx @@ -222,7 +222,7 @@ void Slider::ImplUpdateRects( sal_Bool bUpdate ) long Slider::ImplCalcThumbPos( long nPixPos ) { - // Position berechnen + // calculate position long nCalcThumbPos; nCalcThumbPos = ImplMulDiv( nPixPos-mnThumbPixOffset, mnMaxRange-mnMinRange, mnThumbPixRange-1 ); nCalcThumbPos += mnMinRange; @@ -233,11 +233,10 @@ long Slider::ImplCalcThumbPos( long nPixPos ) long Slider::ImplCalcThumbPosPix( long nPos ) { - // Position berechnen + // calculate position long nCalcThumbPos; nCalcThumbPos = ImplMulDiv( nPos-mnMinRange, mnThumbPixRange-1, mnMaxRange-mnMinRange ); - // Am Anfang und Ende des Sliders versuchen wir die Anzeige korrekt - // anzuzeigen + // at the beginning and end we try to display Slider correctly if ( !nCalcThumbPos && (mnThumbPos > mnMinRange) ) nCalcThumbPos = 1; if ( nCalcThumbPos && @@ -327,7 +326,7 @@ void Slider::ImplDraw( sal_uInt16 nDrawFlags ) const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings(); sal_Bool bEnabled = IsEnabled(); - // Evt. noch offene Berechnungen nachholen + // do missing calculations if ( mbCalcSize ) ImplCalc( sal_False ); @@ -653,7 +652,7 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) meScrollType = SCROLL_DRAG; mnDragDraw = SLIDER_DRAW_THUMB; - // Zusaetzliche Daten berechnen + // calculate additional values Point aCenterPos = maThumbRect.Center(); if ( GetStyle() & WB_HORZ ) mnMouseOff = rMousePos.X()-aCenterPos.X(); @@ -685,10 +684,10 @@ void Slider::MouseButtonDown( const MouseEvent& rMEvt ) mnDragDraw = SLIDER_DRAW_CHANNEL; } - // Soll Tracking gestartet werden + // Shall we start Tracking? if( meScrollType != SCROLL_DONTKNOW ) { - // Startposition merken fuer Abbruch und EndScroll-Delta + // store Start position for cancel and EndScroll delta mnStartPos = mnThumbPos; ImplDoMouseAction( rMousePos, meScrollType != SCROLL_SET ); Update(); @@ -705,7 +704,7 @@ void Slider::MouseButtonUp( const MouseEvent& ) { if( SCROLL_SET == meScrollType ) { - // Button und PageRect-Status wieder herstellen + // reset Button and PageRect state const sal_uInt16 nOldStateFlags = mnStateFlags; mnStateFlags &= ~( SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN | SLIDER_STATE_THUMB_DOWN ); @@ -725,7 +724,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) { if ( rTEvt.IsTrackingEnded() ) { - // Button und PageRect-Status wieder herstellen + // reset Button and PageRect state sal_uInt16 nOldStateFlags = mnStateFlags; mnStateFlags &= ~(SLIDER_STATE_CHANNEL1_DOWN | SLIDER_STATE_CHANNEL2_DOWN | SLIDER_STATE_THUMB_DOWN); @@ -733,7 +732,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) ImplDraw( mnDragDraw ); mnDragDraw = 0; - // Bei Abbruch, die alte ThumbPosition wieder herstellen + // on cancel, reset the previous Thumb position if ( rTEvt.IsTrackingCanceled() ) { long nOldPos = mnThumbPos; @@ -744,8 +743,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) if ( meScrollType == SCROLL_DRAG ) { - // Wenn gedragt wurde, berechnen wir den Thumb neu, damit - // er wieder auf einer gerundeten ThumbPosition steht + // after dragging, recalculate to a rounded Thumb position ImplCalc(); Update(); @@ -766,7 +764,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) { const Point rMousePos = rTEvt.GetMouseEvent().GetPosPixel(); - // Dragging wird speziell behandelt + // special handling for dragging if ( meScrollType == SCROLL_DRAG ) { long nMovePix; @@ -775,8 +773,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) nMovePix = rMousePos.X()-(aCenterPos.X()+mnMouseOff); else nMovePix = rMousePos.Y()-(aCenterPos.Y()+mnMouseOff); - // Nur wenn sich Maus in die Scrollrichtung bewegt, muessen - // wir etwas tun + // only if the mouse moves in Scroll direction we have to act if ( nMovePix ) { mnThumbPixPos += nMovePix; @@ -802,8 +799,7 @@ void Slider::Tracking( const TrackingEvent& rTEvt ) else ImplDoMouseAction( rMousePos, rTEvt.IsTrackingRepeat() ); - // Wenn Slider-Werte so umgesetzt wurden, das es nichts - // mehr zum Tracking gibt, dann berechen wir hier ab + // end tracking if ScrollBar values indicate we are done if ( !IsVisible() ) EndTracking(); } @@ -954,20 +950,20 @@ void Slider::EndSlide() void Slider::SetRange( const Range& rRange ) { - // Range einpassen + // adjust Range Range aRange = rRange; aRange.Justify(); long nNewMinRange = aRange.Min(); long nNewMaxRange = aRange.Max(); - // Wenn Range sich unterscheidet, dann neuen setzen + // reset Range if different if ( (mnMinRange != nNewMinRange) || (mnMaxRange != nNewMaxRange) ) { mnMinRange = nNewMinRange; mnMaxRange = nNewMaxRange; - // Thumb einpassen + // adjust Thumb if ( mnThumbPos > mnMaxRange ) mnThumbPos = mnMaxRange; if ( mnThumbPos < mnMinRange ) diff --git a/vcl/source/control/spinfld.cxx b/vcl/source/control/spinfld.cxx index d50c521..0c58aee 100644 --- a/vcl/source/control/spinfld.cxx +++ b/vcl/source/control/spinfld.cxx @@ -178,7 +178,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, } } - // Oberen/linken Button malen + // draw upper/left Button sal_uInt16 nTempStyle = nStyle; if ( bUpperIn ) nTempStyle |= BUTTON_DRAW_PRESSED; @@ -225,14 +225,14 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, if( !bNativeOK ) aUpRect = aDecoView.DrawButton( rUpperRect, nTempStyle ); - // Unteren/rechten Button malen + // draw lower/right Button if ( bLowerIn ) nStyle |= BUTTON_DRAW_PRESSED; Rectangle aLowRect; if( !bNativeOK ) aLowRect = aDecoView.DrawButton( rLowerRect, nStyle ); - // Zusaetzliche Default-Kante wollen wir auch ausnutzen + // make use of additional default edge aUpRect.Left()--; aUpRect.Top()--; aUpRect.Right()++; @@ -242,8 +242,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, aLowRect.Right()++; aLowRect.Bottom()++; - // Wir malen auch in die Kante rein, damit man etwas erkennen kann, - // wenn das Rechteck zu klein ist + // draw into the edge, so that something is visible if the rectangle is too small if ( aUpRect.GetHeight() < 4 ) { aUpRect.Right()++; @@ -252,7 +251,7 @@ void ImplDrawSpinButton( OutputDevice* pOutDev, aLowRect.Bottom()++; } - // Symbolgroesse berechnen + // calculate Symbol size long nTempSize1 = aUpRect.GetWidth(); long nTempSize2 = aLowRect.GetWidth(); if ( Abs( nTempSize1-nTempSize2 ) == 1 ) @@ -426,7 +425,7 @@ void SpinField::MouseButtonDown( const MouseEvent& rMEvt ) } else if ( maDropDownRect.IsInside( rMEvt.GetPosPixel() ) ) { - // Rechts daneben liegt der DropDownButton: + // put DropDownButton to the right mbInDropDown = ShowDropDown( mbInDropDown ? sal_False : sal_True ); Paint( Rectangle( Point(), GetOutputSizePixel() ) ); } @@ -679,7 +678,7 @@ void SpinField::ImplCalcButtonAreas( OutputDevice* pDev, const Size& rOutSz, Rec else rDDArea.SetEmpty(); - // Je nach Hoehe, die groessen Berechnen + // calcuate sizes according to the height if ( GetStyle() & WB_SPIN ) { long nBottom1 = aSize.Height()/2; diff --git a/vcl/source/control/tabctrl.cxx b/vcl/source/control/tabctrl.cxx index 337b766..3e8eb51 100644 --- a/vcl/source/control/tabctrl.cxx +++ b/vcl/source/control/tabctrl.cxx @@ -85,7 +85,7 @@ struct ImplTabCtrlData #define TAB_BORDER_RIGHT 2 #define TAB_BORDER_BOTTOM 2 -// Fuer die Ermittlung von den Tab-Positionen +// for the Tab positions #define TAB_PAGERECT 0xFFFF // ======================================================================= @@ -234,7 +234,7 @@ void TabControl::ImplLoadRes( const ResId& rResId ) { sal_uLong nEle = ReadLongRes(); - // Item hinzufuegen + // add item for( sal_uLong i = 0; i < nEle; i++ ) { InsertPage( ResId( (RSHEADER_TYPE *)GetClassRes(), *rResId.GetResMgr() ) ); @@ -252,7 +252,7 @@ TabControl::~TabControl() ImplFreeLayoutData(); - // TabCtrl-Daten loeschen + // delete TabCtrl data if ( mpTabCtrlData ) { if( mpTabCtrlData->mpListBox ) @@ -310,7 +310,7 @@ Size TabControl::ImplGetItemSize( ImplTabItem* pItem, long nMaxWidth ) if ( pItem->maFormatText.Len() < TAB_EXTRASPACE_X ) aSize.Width() += TAB_EXTRASPACE_X-pItem->maFormatText.Len(); - // Evt. den Text kuerzen + // shorten Text if needed if ( aSize.Width()+4 >= nMaxWidth ) { rtl::OUString aAppendStr("..."); @@ -638,7 +638,7 @@ void TabControl::ImplChangeTabPage( sal_uInt16 nId, sal_uInt16 nOldId ) sal_Bool TabControl::ImplPosCurTabPage() { - // Aktuelle TabPage resizen/positionieren + // resize/position current TabPage ImplTabItem* pItem = ImplGetItem( GetCurPageId() ); if ( pItem && pItem->mpTabPage ) { @@ -762,7 +762,7 @@ void TabControl::ImplDrawItem( ImplTabItem* pItem, const Rectangle& rCurRect, bo else nOff = 0; - // Wenn wir die aktuelle Page sind, muessen wir etwas mehr zeichnen + // if this is the active Page, we have to draw a little more if ( pItem->mnId == mnCurPageId ) { nOff2 = 2; @@ -1041,7 +1041,7 @@ void TabControl::ImplPaint( const Rectangle& rRect, bool bLayout ) if( ! bLayout ) HideFocus(); - // Hier wird gegebenenfalls auch neu formatiert + // reformat if needed Rectangle aRect = ImplGetTabRect( TAB_PAGERECT ); // find current item @@ -1239,9 +1239,10 @@ void TabControl::setAllocation(const Size &rAllocation) mbFormat = sal_True; - // Aktuelle TabPage resizen/positionieren + // resize/position active TabPage sal_Bool bTabPage = ImplPosCurTabPage(); - // Feststellen, was invalidiert werden muss + + // check what needs to be invalidated Size aNewSize = rAllocation; long nNewWidth = aNewSize.Width(); for( std::vector< ImplTabItem >::iterator it = mpTabCtrlData->maItemList.begin(); @@ -1362,7 +1363,7 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) rtl::OUString aHelpId( rtl::OStringToOUString( GetHelpId( nItemId ), RTL_TEXTENCODING_UTF8 ) ); if ( !aHelpId.isEmpty() ) { - // Wenn eine Hilfe existiert, dann ausloesen + // call Help if existing Help* pHelp = Application::GetHelp(); if ( pHelp ) pHelp->Start( aHelpId, this ); @@ -1370,8 +1371,7 @@ void TabControl::RequestHelp( const HelpEvent& rHEvt ) } } - // Bei Quick- oder Balloon-Help zeigen wir den Text an, - // wenn dieser abgeschnitten ist + // for Quick or Ballon Help, we show the text, if it is cut if ( rHEvt.GetMode() & (HELPMODE_QUICK | HELPMODE_BALLOON) ) { ImplTabItem* pItem = ImplGetItem( nItemId ); @@ -1929,7 +1929,7 @@ void TabControl::SelectTabPage( sal_uInt16 nPageId ) { mnActPageId = nPageId; ActivatePage(); - // Page koennte im Activate-Handler umgeschaltet wurden sein + // Page could have been switched by the Activate handler nPageId = mnActPageId; mnActPageId = 0; SetCurPageId( nPageId ); @@ -1956,7 +1956,7 @@ void TabControl::SetTabPage( sal_uInt16 nPageId, TabPage* pTabPage ) if ( IsDefaultSize() ) SetTabPageSizePixel( pTabPage->GetSizePixel() ); - // Erst hier setzen, damit Resize nicht TabPage umpositioniert + // only set here, so that Resize does not reposition TabPage pItem->mpTabPage = pTabPage; queue_resize(); if ( pItem->mnId == mnCurPageId ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits