summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorLuc Castermans <luc@bassenge.castermans.org>2012-07-01 21:10:41 +0200
committerPhilipp Riemer <ruderphilipp@gmail.com>2012-07-02 01:27:30 +0200
commit16c4e5506b10284611f2653f867fe09ce75b6a18 (patch)
treea4aabb9a296723691c3ee0369c1c3a8028aa334a /vcl
parenta4a4bde34e5e3f60143ca8d5ae053237da18712e (diff)
translated german comments
Change-Id: Ia99de2167bbc401d212eb9cf04883f3f8270f44f
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/app/dbggui.cxx4
-rw-r--r--vcl/source/app/help.cxx15
-rw-r--r--vcl/source/app/idlemgr.cxx2
-rw-r--r--vcl/source/app/settings.cxx50
-rw-r--r--vcl/source/app/svapp.cxx32
-rw-r--r--vcl/source/app/svmain.cxx14
-rw-r--r--vcl/source/app/timer.cxx31
-rw-r--r--vcl/source/control/button.cxx39
-rw-r--r--vcl/source/control/edit.cxx42
-rw-r--r--vcl/source/control/field.cxx66
-rw-r--r--vcl/source/control/field2.cxx132
11 files changed, 197 insertions, 230 deletions
diff --git a/vcl/source/app/dbggui.cxx b/vcl/source/app/dbggui.cxx
index c36f866fea2f..fcf5a4c6e4ae 100644
--- a/vcl/source/app/dbggui.cxx
+++ b/vcl/source/app/dbggui.cxx
@@ -1608,7 +1608,7 @@ long SolarMessageBoxExecutor::doIt()
{
long nResult = RET_NO;
- // Tracking beenden und Mouse freigeben, damit die Boxen nicht haengen
+ // Stop tracking and release mouse, to assure boxes do not hang
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->maWinData.mpTrackWin )
pSVData->maWinData.mpTrackWin->EndTracking( ENDTRACK_CANCEL );
@@ -1789,7 +1789,7 @@ void DbgGUIStart()
if ( pData )
{
DbgDialog* pDialog = new DbgDialog;
- // Fuer den Debug-Dialog schalten wir Dialogtests aus
+ // we switch off dialog tests for the debug dialog
sal_uLong nOldFlags = pData->nTestFlags;
pData->nTestFlags &= ~DBG_TEST_DIALOG;
if ( !pDialog->Execute() )
diff --git a/vcl/source/app/help.cxx b/vcl/source/app/help.cxx
index b968ca1aadc7..48881ba03561 100644
--- a/vcl/source/app/help.cxx
+++ b/vcl/source/app/help.cxx
@@ -283,8 +283,7 @@ void Help::HideTip( sal_uLong nId )
HelpTextWindow* pHelpWin = (HelpTextWindow*)nId;
Window* pFrameWindow = pHelpWin->ImplGetFrameWindow();
pHelpWin->Hide();
- // Update ausloesen, damit ein Paint sofort ausgeloest wird, da
- // wir den Hintergrund nicht sichern
+ // trigger update, so that a Paint is instantly triggered since we do not save the background
pFrameWindow->ImplUpdateAll();
delete pHelpWin;
ImplGetSVData()->maHelpData.mnLastHelpHideTime = Time::GetSystemTicks();
@@ -374,7 +373,7 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
Point aTmpPoint;
sal_uInt16 nCharsInLine = 35 + ((maHelpText.Len()/100)*5);
XubString aXXX;
- aXXX.Fill( nCharsInLine, 'x' ); // Durchschnittliche Breite, damit nicht jedes Fenster anders.
+ aXXX.Fill( nCharsInLine, 'x' ); // average width to have all windows consistent
long nWidth = GetTextWidth( aXXX );
Size aTmpSize( nWidth, 0x7FFFFFFF );
Rectangle aTry1( aTmpPoint, aTmpSize );
@@ -384,10 +383,10 @@ void HelpTextWindow::SetHelpText( const String& rHelpText )
nDrawFlags |= TEXT_DRAW_MNEMONIC;
Rectangle aTextRect = GetTextRect( aTry1, maHelpText, nDrawFlags );
- // Spaeter mal eine geeignete Breite ermitteln...
+ // get a better width later...
maTextRect = aTextRect;
- // Sicherheitsabstand...
+ // safety distance...
maTextRect.SetPos( Point( HELPTEXTMARGIN_BALLOON, HELPTEXTMARGIN_BALLOON ) );
}
@@ -461,7 +460,7 @@ void HelpTextWindow::ShowHelp( sal_uInt16 nDelayMode )
sal_uLong nTimeout = 0;
if ( nDelayMode != HELPDELAY_NONE )
{
- // Im ExtendedHelp-Fall die Hilfe schneller anzeigen
+ // In case of ExtendedHelp display help sooner
if ( ImplGetSVData()->maHelpData.mbExtHelpMode )
nTimeout = 15;
else
@@ -519,8 +518,8 @@ Size HelpTextWindow::CalcOutSize() const
void HelpTextWindow::RequestHelp( const HelpEvent& /*rHEvt*/ )
{
- // Nur damit nicht von Window::RequestHelp() ein
- // ShowQuickHelp/ShowBalloonHelp am HelpTextWindow aufgerufen wird.
+ // Just to assure that Window::RequestHelp() is not called by
+ // ShowQuickHelp/ShowBalloonHelp in the HelpTextWindow.
}
// -----------------------------------------------------------------------
diff --git a/vcl/source/app/idlemgr.cxx b/vcl/source/app/idlemgr.cxx
index 7548b5ca62f6..45038abedb83 100644
--- a/vcl/source/app/idlemgr.cxx
+++ b/vcl/source/app/idlemgr.cxx
@@ -92,7 +92,7 @@ sal_Bool ImplIdleMgr::InsertIdleHdl( const Link& rLink, sal_uInt16 nPriority )
mpIdleList->push_back( pIdleData );
}
- // Wenn Timer noch nicht gestartet ist, dann starten
+ // if Timer was not started already then start it now
if ( !maTimer.IsActive() )
maTimer.Start();
diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx
index 02457d1791e5..9684e38511b8 100644
--- a/vcl/source/app/settings.cxx
+++ b/vcl/source/app/settings.cxx
@@ -123,7 +123,7 @@ MouseSettings::MouseSettings( const MouseSettings& rSet )
{
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "MouseSettings: RefCount overflow" );
- // shared Instance Daten uebernehmen und Referenzcounter erhoehen
+ // copy shared instance data and increment reference counter
mpData = rSet.mpData;
mpData->mnRefCount++;
}
@@ -132,7 +132,7 @@ MouseSettings::MouseSettings( const MouseSettings& rSet )
MouseSettings::~MouseSettings()
{
- // Daten loeschen, wenn letzte Referenz
+ // delete data if last reference
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -145,10 +145,10 @@ const MouseSettings& MouseSettings::operator =( const MouseSettings& rSet )
{
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "MouseSettings: RefCount overflow" );
- // Zuerst Referenzcounter erhoehen, damit man sich selbst zuweisen kann
+ // increment reference counter first, to be able to assign oneself
rSet.mpData->mnRefCount++;
- // Daten loeschen, wenn letzte Referenz
+ // delete data if last reference
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -163,7 +163,7 @@ const MouseSettings& MouseSettings::operator =( const MouseSettings& rSet )
void MouseSettings::CopyData()
{
- // Falls noch andere Referenzen bestehen, dann kopieren
+ // copy if another references exist
if ( mpData->mnRefCount != 1 )
{
mpData->mnRefCount--;
@@ -445,7 +445,7 @@ StyleSettings::StyleSettings( const StyleSettings& rSet )
{
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "StyleSettings: RefCount overflow" );
- // shared Instance Daten uebernehmen und Referenzcounter erhoehen
+ // copy shared instance data and increment reference counter
mpData = rSet.mpData;
mpData->mnRefCount++;
}
@@ -454,7 +454,7 @@ StyleSettings::StyleSettings( const StyleSettings& rSet )
StyleSettings::~StyleSettings()
{
- // Daten loeschen, wenn letzte Referenz
+ // if last reference then delete data
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -714,10 +714,10 @@ const StyleSettings& StyleSettings::operator =( const StyleSettings& rSet )
{
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "StyleSettings: RefCount overflow" );
- // Zuerst Referenzcounter erhoehen, damit man sich selbst zuweisen kann
+ // increase reference counter first, to be able to assign oneself
rSet.mpData->mnRefCount++;
- // Daten loeschen, wenn letzte Referenz
+ // if last reference then delete data
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -732,7 +732,7 @@ const StyleSettings& StyleSettings::operator =( const StyleSettings& rSet )
void StyleSettings::CopyData()
{
- // Falls noch andere Referenzen bestehen, dann kopieren
+ // copy if other references exist
if ( mpData->mnRefCount != 1 )
{
mpData->mnRefCount--;
@@ -886,7 +886,7 @@ MiscSettings::MiscSettings( const MiscSettings& rSet )
{
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "MiscSettings: RefCount overflow" );
- // shared Instance Daten uebernehmen und Referenzcounter erhoehen
+ // copy shared instance data and increment reference counter
mpData = rSet.mpData;
mpData->mnRefCount++;
}
@@ -895,7 +895,7 @@ MiscSettings::MiscSettings( const MiscSettings& rSet )
MiscSettings::~MiscSettings()
{
- // Daten loeschen, wenn letzte Referenz
+ // if last reference then delete data
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -908,10 +908,10 @@ const MiscSettings& MiscSettings::operator =( const MiscSettings& rSet )
{
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "MiscSettings: RefCount overflow" );
- // Zuerst Referenzcounter erhoehen, damit man sich selbst zuweisen kann
+ // increase reference counter first, to be able to assign oneself
rSet.mpData->mnRefCount++;
- // Daten loeschen, wenn letzte Referenz
+ // if last reference then delete data
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -926,7 +926,7 @@ const MiscSettings& MiscSettings::operator =( const MiscSettings& rSet )
void MiscSettings::CopyData()
{
- // Falls noch andere Referenzen bestehen, dann kopieren
+ // copy if other references exist
if ( mpData->mnRefCount != 1 )
{
mpData->mnRefCount--;
@@ -1126,7 +1126,7 @@ HelpSettings::HelpSettings( const HelpSettings& rSet )
{
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "HelpSettings: RefCount overflow" );
- // shared Instance Daten uebernehmen und Referenzcounter erhoehen
+ // copy shared instance data and increment reference counter
mpData = rSet.mpData;
mpData->mnRefCount++;
}
@@ -1135,7 +1135,7 @@ HelpSettings::HelpSettings( const HelpSettings& rSet )
HelpSettings::~HelpSettings()
{
- // Daten loeschen, wenn letzte Referenz
+ // if last reference then delete data
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -1148,10 +1148,10 @@ const HelpSettings& HelpSettings::operator =( const HelpSettings& rSet )
{
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "HelpSettings: RefCount overflow" );
- // Zuerst Referenzcounter erhoehen, damit man sich selbst zuweisen kann
+ // increase reference counter first, to be able to assign oneself
rSet.mpData->mnRefCount++;
- // Daten loeschen, wenn letzte Referenz
+ // delete data if last reference
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -1166,7 +1166,7 @@ const HelpSettings& HelpSettings::operator =( const HelpSettings& rSet )
void HelpSettings::CopyData()
{
- // Falls noch andere Referenzen bestehen, dann kopieren
+ // copy of other references exist
if ( mpData->mnRefCount != 1 )
{
mpData->mnRefCount--;
@@ -1256,7 +1256,7 @@ AllSettings::AllSettings( const AllSettings& rSet )
DBG_CTOR( AllSettings, NULL );
DBG_ASSERT( rSet.mpData->mnRefCount < 0xFFFFFFFE, "Settings: RefCount overflow" );
- // shared Instance Daten uebernehmen und Referenzcounter erhoehen
+ // copy shared instance data and increse reference counter
mpData = rSet.mpData;
mpData->mnRefCount++;
}
@@ -1267,7 +1267,7 @@ AllSettings::~AllSettings()
{
DBG_DTOR( AllSettings, NULL );
- // Daten loeschen, wenn letzte Referenz
+ // if last reference then delete data
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -1282,10 +1282,10 @@ const AllSettings& AllSettings::operator =( const AllSettings& rSet )
DBG_CHKTHIS( AllSettings, NULL );
DBG_CHKOBJ( &rSet, AllSettings, NULL );
- // Zuerst Referenzcounter erhoehen, damit man sich selbst zuweisen kann
+ // increase reference counter first, to be able to assign oneself
rSet.mpData->mnRefCount++;
- // Daten loeschen, wenn letzte Referenz
+ // if last reference then delete data
if ( mpData->mnRefCount == 1 )
delete mpData;
else
@@ -1302,7 +1302,7 @@ void AllSettings::CopyData()
{
DBG_CHKTHIS( AllSettings, NULL );
- // Falls noch andere Referenzen bestehen, dann kopieren
+ // copy if other references exist
if ( mpData->mnRefCount != 1 )
{
mpData->mnRefCount--;
diff --git a/vcl/source/app/svapp.cxx b/vcl/source/app/svapp.cxx
index a8439f61dedc..3611f4386213 100644
--- a/vcl/source/app/svapp.cxx
+++ b/vcl/source/app/svapp.cxx
@@ -340,8 +340,7 @@ sal_uInt16 Application::Exception( sal_uInt16 nError )
{
switch ( nError & EXC_MAJORTYPE )
{
- // Bei System machen wir nichts und lassen dem System den
- // vortritt
+ // System has precedence (so do nothing)
case EXC_SYSTEM:
return 0;
@@ -564,10 +563,10 @@ extern int nImplSysDialog;
sal_Bool Application::IsUICaptured()
{
ImplSVData* pSVData = ImplGetSVData();
- // Wenn Mouse gecaptured, oder im TrackingModus oder im Auswahlmodus
- // eines FloatingWindows (wie Menus, Aufklapp-ToolBoxen) soll kein
- // weiteres Fenster aufgezogen werden
- // D&D aktive !!!
+
+ // If mouse was captured, or if in tracking- or in select-mode of a floatingwindow (e.g. menus
+ // or pulldown toolboxes) another window should be created
+ // D&D active !!!
if ( pSVData->maWinData.mpCaptureWin || pSVData->maWinData.mpTrackWin ||
pSVData->maWinData.mpFirstFloat || nImplSysDialog )
return sal_True;
@@ -652,7 +651,7 @@ void Application::SetSettings( const AllSettings& rSettings )
// Update all windows
Window* pFirstFrame = pSVData->maWinData.mpFirstFrame;
- // Daten, die neu berechnet werden muessen, zuruecksetzen
+ // Reset data that needs to be re-calculated
long nOldDPIX = 0;
long nOldDPIY = 0;
if ( pFirstFrame )
@@ -664,11 +663,10 @@ void Application::SetSettings( const AllSettings& rSettings )
Window* pFrame = pFirstFrame;
while ( pFrame )
{
- // AppFont-Cache-Daten zuruecksetzen
+ // restore AppFont cache data
pFrame->mpWindowImpl->mpFrameData->meMapUnit = MAP_PIXEL;
- // UpdateSettings am ClientWindow aufrufen, damit
- // die Daten nicht doppelt geupdatet werden
+ // call UpdateSettings from ClientWindow in order to prevent updating data twice
Window* pClientWin = pFrame;
while ( pClientWin->ImplGetClientWindow() )
pClientWin = pClientWin->ImplGetClientWindow();
@@ -677,8 +675,7 @@ void Application::SetSettings( const AllSettings& rSettings )
Window* pTempWin = pFrame->mpWindowImpl->mpFrameData->mpFirstOverlap;
while ( pTempWin )
{
- // UpdateSettings am ClientWindow aufrufen, damit
- // die Daten nicht doppelt geupdatet werden
+ // call UpdateSettings from ClientWindow in order to prevent updating data twice
pClientWin = pTempWin;
while ( pClientWin->ImplGetClientWindow() )
pClientWin = pClientWin->ImplGetClientWindow();
@@ -689,9 +686,8 @@ void Application::SetSettings( const AllSettings& rSettings )
pFrame = pFrame->mpWindowImpl->mpFrameData->mpNextFrame;
}
- // Wenn sich die DPI-Aufloesung fuer Screen-Ausgaben
- // geaendert hat, setzen wir auch bei allen
- // Screen-Kompatiblen VirDev's die neue Aufloesung
+ // if DPI resolution for screen output was changed set the new resolution for all
+ // screen compatible VirDev´s
pFirstFrame = pSVData->maWinData.mpFirstFrame;
if ( pFirstFrame )
{
@@ -1043,7 +1039,7 @@ sal_Bool Application::InsertIdleHdl( const Link& rLink, sal_uInt16 nPrio )
{
ImplSVData* pSVData = ImplGetSVData();
- // Falls er noch nicht existiert, dann anlegen
+ // create if not existing
if ( !pSVData->maAppData.mpIdleMgr )
pSVData->maAppData.mpIdleMgr = new ImplIdleMgr;
@@ -1180,7 +1176,7 @@ void Application::SetAppName( const XubString& rUniqueName )
{
ImplSVData* pSVData = ImplGetSVData();
- // Falls er noch nicht existiert, dann anlegen
+ // create if not existing
if ( !pSVData->maAppData.mpAppName )
pSVData->maAppData.mpAppName = new XubString( rUniqueName );
else
@@ -1204,7 +1200,7 @@ void Application::SetDisplayName( const UniString& rName )
{
ImplSVData* pSVData = ImplGetSVData();
- // Falls er noch nicht existiert, dann anlegen
+ // create if not existing
if ( !pSVData->maAppData.mpDisplayName )
pSVData->maAppData.mpDisplayName = new UniString( rName );
else
diff --git a/vcl/source/app/svmain.cxx b/vcl/source/app/svmain.cxx
index 959e055b0f45..75708556bd09 100644
--- a/vcl/source/app/svmain.cxx
+++ b/vcl/source/app/svmain.cxx
@@ -97,7 +97,7 @@ oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo
{
static bool bIn = false;
- // Wenn wir nocheinmal abstuerzen, verabschieden wir uns gleich
+ // if we crash again, bail out immediatly
if ( !bIn )
{
sal_uInt16 nVCLException = 0;
@@ -130,8 +130,7 @@ oslSignalAction SAL_CALL VCLExceptionSignal_impl( void* /*pData*/, oslSignalInfo
SolarMutexGuard aLock;
- // Timer nicht mehr anhalten, da ansonsten die UAE-Box
- // auch nicht mehr gepaintet wird
+ // do not stop timer because otherwise the UAE-Box will not be painted as well
ImplSVData* pSVData = ImplGetSVData();
if ( pSVData->mpApp )
{
@@ -168,7 +167,7 @@ int ImplSVMain()
if( bInit )
{
- // Application-Main rufen
+ // call application main
pSVData->maAppData.mbInAppMain = sal_True;
nReturn = pSVData->mpApp->Main();
pSVData->maAppData.mbInAppMain = sal_False;
@@ -298,8 +297,7 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
// soffice/sfx implementation creates the global service manager
pSVData->mpApp->Init();
- // Den AppFileName gleich holen und absolut machen, bevor das
- // WorkingDirectory sich aendert...
+ // Fetch AppFileName and make it absolute before the workdir changes...
rtl::OUString aExeFileName;
osl_getExecutableFile( &aExeFileName.pData );
@@ -313,10 +311,10 @@ sal_Bool InitVCL( const ::com::sun::star::uno::Reference< ::com::sun::star::lang
pSVData->maGDIData.mpScreenFontCache = new ImplFontCache( sal_False );
pSVData->maGDIData.mpGrfConverter = new GraphicConverter;
- // Exception-Handler setzen
+ // Set exception handler
pExceptionHandler = osl_addSignalHandler(VCLExceptionSignal_impl, NULL);
- // Debug-Daten initialisieren
+ // initialise debug data
DBGGUI_INIT();
return sal_True;
diff --git a/vcl/source/app/timer.cxx b/vcl/source/app/timer.cxx
index 3011cb282c26..a644a59203d9 100644
--- a/vcl/source/app/timer.cxx
+++ b/vcl/source/app/timer.cxx
@@ -51,8 +51,8 @@ struct ImplTimerData
Timer* mpSVTimer; // Pointer to SV Timer instance
sal_uLong mnUpdateTime; // Last Update Time
sal_uLong mnTimerUpdate; // TimerCallbackProcs on stack
- sal_Bool mbDelete; // Wurde Timer waehren Update() geloescht
- sal_Bool mbInTimeout; // Befinden wir uns im Timeout-Handler
+ sal_Bool mbDelete; // Was timer deleted during Update()?
+ sal_Bool mbInTimeout; // Are we in a timeout handler?
};
// =======================================================================
@@ -115,23 +115,22 @@ void Timer::ImplTimerCallbackProc()
pSVData->mnTimerUpdate++;
pSVData->mbNotAllTimerCalled = sal_True;
- // Suche Timer raus, wo der Timeout-Handler gerufen werden muss
+ // find timer where the timer handler needs to be called
pTimerData = pSVData->mpFirstTimerData;
while ( pTimerData )
{
- // Wenn Timer noch nicht neu ist und noch nicht geloescht wurde
- // und er sich nicht im Timeout-Handler befindet,
- // dann den Handler rufen, wenn die Zeit abgelaufen ist
+ // If the timer is not new, was not deleted, and if it is not in the timeout handler, then
+ // call the handler as soon as the time is up.
if ( (pTimerData->mnTimerUpdate < pSVData->mnTimerUpdate) &&
!pTimerData->mbDelete && !pTimerData->mbInTimeout )
{
- // Zeit abgelaufen
+ // time has expired
if ( (pTimerData->mnUpdateTime+pTimerData->mpSVTimer->mnTimeout) <= nTime )
{
- // Neue Updatezeit setzen
+ // set new update time
pTimerData->mnUpdateTime = nTime;
- // kein AutoTimer, dann anhalten
+ // if no AutoTimer than stop
if ( !pTimerData->mpSVTimer->mbAuto )
{
pTimerData->mpSVTimer->mbActive = sal_False;
@@ -148,19 +147,19 @@ void Timer::ImplTimerCallbackProc()
pTimerData = pTimerData->mpNext;
}
- // Neue Zeit ermitteln
+ // determine new time
sal_uLong nNewTime = Time::GetSystemTicks();
pPrevTimerData = NULL;
pTimerData = pSVData->mpFirstTimerData;
while ( pTimerData )
{
- // Befindet sich Timer noch im Timeout-Handler, dann ignorieren
+ // ignore if timer is still in timeout handler
if ( pTimerData->mbInTimeout )
{
pPrevTimerData = pTimerData;
pTimerData = pTimerData->mpNext;
}
- // Wurde Timer zwischenzeitlich zerstoert ?
+ // Was timer destroyed in the meantime?
else if ( pTimerData->mbDelete )
{
if ( pPrevTimerData )
@@ -176,7 +175,7 @@ void Timer::ImplTimerCallbackProc()
else
{
pTimerData->mnTimerUpdate = 0;
- // kleinste Zeitspanne ermitteln
+ // determine smallest time slot
if ( pTimerData->mnUpdateTime == nTime )
{
nDeltaTime = pTimerData->mpSVTimer->mnTimeout;
@@ -200,7 +199,7 @@ void Timer::ImplTimerCallbackProc()
}
}
- // Wenn keine Timer mehr existieren, dann Clock loeschen
+ // delete clock if no more timers available
if ( !pSVData->mpFirstTimerData )
{
pSVData->mpSalTimer->Stop();
@@ -261,7 +260,7 @@ void Timer::SetTimeout( sal_uLong nNewTimeout )
{
mnTimeout = nNewTimeout;
- // Wenn Timer aktiv, dann Clock erneuern
+ // if timer is active then renew clock
if ( mbActive )
{
ImplSVData* pSVData = ImplGetSVData();
@@ -297,7 +296,7 @@ void Timer::Start()
mpTimerData->mbDelete = sal_False;
mpTimerData->mbInTimeout = sal_False;
- // !!!!! Wegen SFX hinten einordnen !!!!!
+ // insert last due to SFX!
ImplTimerData* pPrev = NULL;
ImplTimerData* pData = pSVData->mpFirstTimerData;
while ( pData )
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 3e09946ed16f..57f50f41314d 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -1273,7 +1273,7 @@ void PushButton::Tracking( const TrackingEvent& rTEvt )
ImplDrawPushButton();
- // Bei Abbruch kein Click-Handler rufen
+ // do not call Click handler if aborted
if ( !rTEvt.IsTrackingCanceled() )
{
if ( ! ( ( GetStyle() & WB_REPEAT ) &&
@@ -1760,7 +1760,7 @@ OKButton::OKButton( Window* pParent, const ResId& rResId ) :
void OKButton::Click()
{
SAL_WARN_IF(!GetClickHdl(), "vcl", "No handler installed for OKButton");
- // Ist kein Link gesetzt, dann schliesse Parent
+ // close parent if no link set
if ( !GetClickHdl() )
{
Window* pParent = GetParent();
@@ -1770,7 +1770,7 @@ void OKButton::Click()
{
if ( ((Dialog*)pParent)->IsInExecute() )
((Dialog*)pParent)->EndDialog( sal_True );
- // gegen rekursive Aufrufe schuetzen
+ // prevent recursive calls
else if ( !((Dialog*)pParent)->IsInClose() )
{
if ( pParent->GetStyle() & WB_CLOSEABLE )
@@ -1827,7 +1827,7 @@ CancelButton::CancelButton( Window* pParent, const ResId& rResId ) :
void CancelButton::Click()
{
SAL_WARN_IF(!GetClickHdl(), "vcl", "No handler installed for CancelButton");
- // Ist kein Link gesetzt, dann schliesse Parent
+ // close parent if link not set
if ( !GetClickHdl() )
{
Window* pParent = GetParent();
@@ -1837,7 +1837,7 @@ void CancelButton::Click()
{
if ( ((Dialog*)pParent)->IsInExecute() )
((Dialog*)pParent)->EndDialog( sal_False );
- // gegen rekursive Aufrufe schuetzen
+ // prevent recursive calls
else if ( !((Dialog*)pParent)->IsInClose() )
{
if ( pParent->GetStyle() & WB_CLOSEABLE )
@@ -1894,7 +1894,7 @@ HelpButton::HelpButton( Window* pParent, const ResId& rResId ) :
void HelpButton::Click()
{
SAL_WARN_IF(!GetClickHdl(), "vcl", "No handler installed for HelpButton");
- // Ist kein Link gesetzt, loese Hilfe aus
+ // trigger help if no link set
if ( !GetClickHdl() )
{
Window* pFocusWin = Application::GetFocusWindow();
@@ -2066,7 +2066,7 @@ if ( bNativeOK == sal_False )
aImageSize.Width() = CalcZoom( aImageSize.Width() );
aImageSize.Height() = CalcZoom( aImageSize.Height() );
- // Border und Selektionsstatus ausgeben
+ // display border and selection status
aImageRect = aDecoView.DrawFrame( aImageRect, nButtonStyle );
if ( (ImplGetButtonState() & BUTTON_DRAW_PRESSED) || !bEnabled )
SetFillColor( rStyleSettings.GetFaceColor() );
@@ -2075,7 +2075,7 @@ if ( bNativeOK == sal_False )
SetLineColor();
DrawRect( aImageRect );
- // Image ausgeben
+ // display image
nButtonStyle = 0;
if ( !bEnabled )
nButtonStyle |= IMAGE_DRAW_DISABLE;
@@ -2138,7 +2138,7 @@ void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
pDev->Push( PUSH_CLIPREGION );
pDev->IntersectClipRegion( Rectangle( rPos, rSize ) );
- // kein Image-RadioButton
+ // no image radio button
if ( !maImage )
{
if ( ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) ) ||
@@ -2206,8 +2206,8 @@ void RadioButton::ImplDraw( OutputDevice* pDev, sal_uLong nDrawFlags,
ImplSetFocusRect( rStateRect );
-/* und oben -1, da CalcSize() auch Focus-Rechteck nicht mit einrechnet,
-da im Writer ansonsten die Images noch weiter oben haengen
+/* and above -1 because CalcSize() does not include focus-rectangle since images would be even
+ positioned higher in writer
rFocusRect = rStateRect;
rFocusRect.Left()--;
rFocusRect.Top()--;
@@ -2224,7 +2224,7 @@ da im Writer ansonsten die Images noch weiter oben haengen
long nTextHeight = pDev->GetTextHeight();
long nTextWidth = pDev->GetCtrlTextWidth( aText );
- // Positionen und Groessen berechnen
+ // calculate position and sizes
if ( aText.Len() && ! (ImplGetButtonState() & BUTTON_DRAW_NOTEXT) )
{
Size aTmpSize( (aImageSize.Width()+8), (aImageSize.Height()+8) );
@@ -2239,7 +2239,7 @@ da im Writer ansonsten die Images noch weiter oben haengen
aImageRect.Right() = aImageRect.Left()+aTmpSize.Width();
aImageRect.Bottom() = aImageRect.Top()+aTmpSize.Height();
- // Text ausgeben
+ // display text
Point aTxtPos = rPos;
if ( bTopImage )
{
@@ -2324,7 +2324,7 @@ void RadioButton::ImplUncheckAllOther()
{
mpWindowImpl->mnStyle |= WB_TABSTOP;
- // Gruppe mit RadioButtons durchgehen und die gecheckten Buttons
+ // iterate over radio button group and checked buttons
Window* pWindow;
WinBits nStyle;
if ( !(GetStyle() & WB_GROUP) )
@@ -2345,8 +2345,7 @@ void RadioButton::ImplUncheckAllOther()
return;
pWindow->ImplRemoveDel( &aDelData );
}
- // Um falsch gesetzt WB_TABSTOPS immer zu entfernen, nicht
- // innerhalb der if-Abfrage
+ // not inside if clause to always remove wrongly set WB_TABSTOPS
pWindow->mpWindowImpl->mnStyle &= ~WB_TABSTOP;
}
@@ -2376,8 +2375,8 @@ void RadioButton::ImplUncheckAllOther()
return;
pWindow->ImplRemoveDel( &aDelData );
}
- // Um falsch gesetzt WB_TABSTOPS immer zu entfernen, nicht
- // innerhalb der if-Abfrage
+
+ // not inside if clause to always remove wrongly set WB_TABSTOPS
pWindow->mpWindowImpl->mnStyle &= ~WB_TABSTOP;
}
@@ -2484,7 +2483,7 @@ void RadioButton::Tracking( const TrackingEvent& rTEvt )
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
- // Bei Abbruch kein Click-Handler rufen
+ // do not call click handler if aborted
if ( !rTEvt.IsTrackingCanceled() )
ImplCallClick();
else
@@ -3399,7 +3398,7 @@ void CheckBox::Tracking( const TrackingEvent& rTEvt )
ImplGetButtonState() &= ~BUTTON_DRAW_PRESSED;
- // Bei Abbruch kein Click-Handler rufen
+ // do not call click handler if aborted
if ( !rTEvt.IsTrackingCanceled() )
ImplCheck();
else
diff --git a/vcl/source/control/edit.cxx b/vcl/source/control/edit.cxx
index a18208c911ed..adeaf5ca6ddf 100644
--- a/vcl/source/control/edit.cxx
+++ b/vcl/source/control/edit.cxx
@@ -1002,8 +1002,7 @@ void Edit::ImplInsertText( const rtl::OUString& rStr, const Selection* pNewSel,
void Edit::ImplSetText( const XubString& rText, const Selection* pNewSelection )
{
- // Der Text wird dadurch geloescht das der alte Text komplett 'selektiert'
- // wird, dann InsertText, damit flackerfrei.
+ // we delete text by "selecting" the old text completely then calling InsertText; this is flicker free
if ( ( rText.Len() <= mnMaxTextLen ) && ( (rText != maText) || (pNewSelection && (*pNewSelection != maSelection)) ) )
{
ImplClearLayoutData();
@@ -1192,7 +1191,7 @@ void Edit::ImplShowCursor( sal_Bool bOnlyIfVisible )
nCursorWidth = GetTextWidth( aText, (xub_StrLen)maSelection.Max(), 1 );
long nCursorPosX = nTextPos + mnXOffset + ImplGetExtraOffset();
- // Cursor muss im sichtbaren Bereich landen:
+ // cursor should land in visible area
const Size aOutSize = GetOutputSizePixel();
if ( (nCursorPosX < 0) || (nCursorPosX >= aOutSize.Width()) )
{
@@ -1271,8 +1270,7 @@ void Edit::ImplAlign()
}
else if( mnAlign == EDIT_ALIGN_CENTER )
{
- // Mit Abfrage schoener, wenn gescrollt, dann aber nicht zentriert im gescrollten Zustand...
-// if ( nTextWidth < nOutWidth )
+ // would be nicer with check while scrolling but then it's not centred in scrolled state
mnXOffset = (nOutWidth - nTextWidth) / 2;
}
}
@@ -1465,7 +1463,7 @@ void Edit::MouseButtonDown( const MouseEvent& rMEvt )
StartTracking( STARTTRACK_SCROLLREPEAT );
}
- mbInMBDown = sal_True; // Dann im GetFocus nicht alles selektieren
+ mbInMBDown = sal_True; // then do not select all in GetFocus
GrabFocus();
mbInMBDown = sal_False;
}
@@ -1574,7 +1572,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
}
break;
- default: // wird dann evtl. unten bearbeitet.
+ default:
eFunc = KEYFUNC_DONTKNOW;
}
}
@@ -1590,7 +1588,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
if ( pImplFncGetSpecialChars )
{
- Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
+ Selection aSaveSel = GetSelection(); // if someone changes the selection in Get/LoseFocus, e.g. URL bar
XubString aChars = pImplFncGetSpecialChars( this, GetFont() );
SetSelection( aSaveSel );
if ( aChars.Len() )
@@ -1823,7 +1821,7 @@ sal_Bool Edit::ImplHandleKeyEvent( const KeyEvent& rKEvt )
{
if ( IsCharInput( rKEvt ) )
{
- bDone = sal_True; // Auch bei ReadOnly die Zeichen schlucken.
+ bDone = sal_True; // read characters also when in ReadOnly
if ( !mbReadOnly )
{
ImplInsertText(rtl::OUString(rKEvt.GetCharCode()), 0, sal_True);
@@ -1954,7 +1952,7 @@ void Edit::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, sal_u
{
Rectangle aClip( aPos, aSize );
if ( nTextHeight > aSize.Height() )
- aClip.Bottom() += nTextHeight-aSize.Height()+1; // Damit HP-Drucker nicht 'weg-optimieren'
+ aClip.Bottom() += nTextHeight-aSize.Height()+1; // prevent HP printers from 'optimizing'
pDev->IntersectClipRegion( aClip );
}
@@ -2139,11 +2137,11 @@ void Edit::Command( const CommandEvent& rCEvt )
}
mbActivePopup = sal_True;
- Selection aSaveSel = GetSelection(); // Falls jemand in Get/LoseFocus die Selektion verbiegt, z.B. URL-Zeile...
+ Selection aSaveSel = GetSelection(); // if someone changes selection in Get/LoseFocus, e.g. URL bar
Point aPos = rCEvt.GetMousePosPixel();
if ( !rCEvt.IsMouseEvent() )
{
- // !!! Irgendwann einmal Menu zentriert in der Selektion anzeigen !!!
+ // Show menu enventually centered in selection
Size aSize = GetOutputSizePixel();
aPos = Point( aSize.Width()/2, aSize.Height()/2 );
}
@@ -2237,8 +2235,8 @@ void Edit::Command( const CommandEvent& rCEvt )
sal_Bool bInsertMode = !mpIMEInfos->bWasCursorOverwrite;
delete mpIMEInfos;
mpIMEInfos = NULL;
- // Font wieder ohne Attribute einstellen, wird jetzt im Repaint nicht
- // mehr neu initialisiert
+
+ // set font without attributes, because it will not be re-initialised in Repaint anymore
ImplInitSettings( sal_True, sal_False, sal_False );
SetInsertMode( bInsertMode );
@@ -2335,7 +2333,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- mnXOffset = 0; // Falls vorher GrabFocus, als Groesse noch falsch.
+ mnXOffset = 0; // if GrabFocus before while size was still wrong
ImplAlign();
if ( !mpSubEdit )
ImplShowCursor( sal_False );
@@ -2347,7 +2345,7 @@ void Edit::StateChanged( StateChangedType nType )
{
if ( !mpSubEdit )
{
- // Es aendert sich nur die Textfarbe...
+ // change text color only
ImplInvalidateOrRepaint( 0, 0xFFFF );
}
}
@@ -2615,8 +2613,8 @@ void Edit::SetMaxTextLen( xub_StrLen nMaxLen )
void Edit::SetSelection( const Selection& rSelection )
{
- // Wenn von aussen z.B. im MouseButtonDown die Selektion geaendert wird,
- // soll nicht gleich ein Tracking() zuschlagen und die Selektion aendern.
+ // If the selection was changed from outside, e.g. by MouseButtonDown, don't call Tracking()
+ // directly afterwards which would change the selection again
if ( IsTracking() )
EndTracking();
else if ( mpSubEdit && mpSubEdit->IsTracking() )
@@ -2765,10 +2763,10 @@ void Edit::Undo()
void Edit::SetText( const XubString& rStr )
{
if ( mpSubEdit )
- mpSubEdit->SetText( rStr ); // Nicht direkt ImplSetText, falls SetText ueberladen
+ mpSubEdit->SetText( rStr ); // not directly ImplSetText if SetText overloaded
else
{
- Selection aNewSel( 0, 0 ); // Damit nicht gescrollt wird
+ Selection aNewSel( 0, 0 ); // prevent scrolling
ImplSetText( rStr, &aNewSel );
}
}
@@ -2880,8 +2878,8 @@ Size Edit::GetOptimalSize(WindowSizeType eType) const
Size Edit::CalcSize( xub_StrLen nChars ) const
{
- // Breite fuer n Zeichen, unabhaengig vom Inhalt.
- // Funktioniert nur bei FixedFont richtig, sonst Mittelwert.
+ // width for N characters, independent from content.
+ // works only correct for fixed fonts, average otherwise
Size aSz( GetTextWidth( XubString( 'x' ) ), GetTextHeight() );
aSz.Width() *= nChars;
aSz = CalcWindowSize( aSz );
diff --git a/vcl/source/control/field.cxx b/vcl/source/control/field.cxx
index 0bc5425b1fc2..34448cfb1571 100644
--- a/vcl/source/control/field.cxx
+++ b/vcl/source/control/field.cxx
@@ -107,14 +107,14 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
xub_StrLen nDecPos;
xub_StrLen i;
- // Reaktion auf leeren String
+ // react on empty string
if ( !rStr.Len() )
return sal_False;
- // Fuehrende und nachfolgende Leerzeichen entfernen
+ // remove leading and trailing spaces
aStr = string::strip(aStr, ' ');
- // Position des Dezimalpunktes suchen
+ // find position of decimal point
nDecPos = aStr.Search( rLocaleDataWrappper.getNumDecimalSep() );
if ( nDecPos != STRING_NOTFOUND )
{
@@ -124,7 +124,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
else
aStr1 = aStr;
- // Negativ ?
+ // negative?
if ( bCurrency )
{
if ( (aStr.GetChar( 0 ) == '(') && (aStr.GetChar( aStr.Len()-1 ) == ')') )
@@ -167,7 +167,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
bNegative = sal_True;
}
- // Alle unerwuenschten Zeichen rauswerfen
+ // remove all unwanted charaters
for ( i=0; i < aStr1.Len(); )
{
if ( (aStr1.GetChar( i ) >= '0') && (aStr1.GetChar( i ) <= '9') )
@@ -191,7 +191,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
if ( bNegative )
aStr1.Insert( '-', 0 );
- // Nachkommateil zurechtstutzen und dabei runden
+ // prune and round fraction
sal_Bool bRound = sal_False;
if ( aStr2.Len() > nDecDigits )
{
@@ -205,7 +205,7 @@ static sal_Bool ImplNumericGetValue( const XubString& rStr, double& rValue,
aStr = aStr1;
aStr += aStr2;
- // Bereichsueberpruefung
+ // check range
double nValue = rtl::OUString(aStr).toDouble();
if ( bRound )
{
@@ -742,19 +742,15 @@ void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue )
{
if ( GetField() )
{
- // !!! TH-18.2.99: Wenn wir Zeit haben sollte mal geklaert werden,
- // !!! warum nicht bei ImplSetUserValue() geprueft wird, ob
- // !!! sich der Wert aendert. Denn auch hier muesste dieses
- // !!! gemacht werden, da ansonsten der Modify-Aufruf
- // !!! nicht gemacht werden duerfte. Jedenfalls sollten die
- // !!! Wege von ImplNewFieldValue, ImplSetUserValue und
- // !!! ImplSetText ueberprueft und klarer gestalltet (mit Kommentar)
- // !!! werden, damit wir mal wissen, was dort ablaeuft!!!
+ // !!! We should check why we do not validate in ImplSetUserValue() if the value was
+ // changed. This should be done there as well since otherwise the call to Modify would not
+ // be allowed. Anyway, the paths from ImplNewFieldValue, ImplSetUserValue, and ImplSetText
+ // should be checked and clearly traced (with comment) in order to find out what happens.
Selection aSelection = GetField()->GetSelection();
aSelection.Justify();
XubString aText = GetField()->GetText();
- // Wenn bis ans Ende selektiert war, soll das auch so bleiben...
+ // leave it as is if selected until end
if ( (xub_StrLen)aSelection.Max() == aText.Len() )
{
if ( !aSelection.Len() )
@@ -766,7 +762,7 @@ void NumericFormatter::ImplNewFieldValue( sal_Int64 nNewValue )
ImplSetUserValue( nNewValue, &aSelection );
mnLastValue = nOldLastValue;
- // Modify am Edit wird nur bei KeyInput gesetzt...
+ // Modify during Edit is only set during KeyInput
if ( GetField()->GetText() != aText )
{
GetField()->SetModifyFlag();
@@ -1029,8 +1025,7 @@ void NumericBox::InsertValue( sal_Int64 nValue, sal_uInt16 nPos )
static sal_Bool ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rWrapper )
{
- // Es gibt hier kein sinnvolles StrictFormat, also alle
- // Zeichen erlauben
+ // no meaningfull strict format; therefore allow all characters
return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rWrapper );
}
@@ -1038,7 +1033,7 @@ static sal_Bool ImplMetricProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
static rtl::OUString ImplMetricGetUnitText(const rtl::OUString& rStr)
{
- // Einheitentext holen
+ // fetch unit text
rtl::OUStringBuffer aStr;
for (sal_Int32 i = rStr.getLength()-1; i >= 0; --i)
{
@@ -1506,7 +1501,7 @@ XubString MetricFormatter::CreateFieldText( sal_Int64 nValue ) const
void MetricFormatter::SetUserValue( sal_Int64 nNewValue, FieldUnit eInUnit )
{
- // Umrechnen auf eingestellte Einheiten
+ // convert to previously configured units
nNewValue = MetricField::ConvertValue( nNewValue, mnBaseValue, GetDecimalDigits(), eInUnit, meUnit );
NumericFormatter::SetUserValue( nNewValue );
}
@@ -1529,7 +1524,7 @@ sal_Int64 MetricFormatter::GetValue( FieldUnit eOutUnit ) const
else if ( nTempValue < mnMin )
nTempValue = (double)mnMin;
- // Umrechnen auf gewuenschte Einheiten
+ // convert to requested units
return MetricField::ConvertValue( (sal_Int64)nTempValue, mnBaseValue, GetDecimalDigits(), meUnit, eOutUnit );
}
@@ -1553,7 +1548,7 @@ sal_Int64 MetricFormatter::GetValue() const
void MetricFormatter::SetMin( sal_Int64 nNewMin, FieldUnit eInUnit )
{
- // Umrechnen auf gewuenschte Einheiten
+ // convert to requested units
NumericFormatter::SetMin( MetricField::ConvertValue( nNewMin, mnBaseValue, GetDecimalDigits(),
eInUnit, meUnit ) );
}
@@ -1562,7 +1557,7 @@ void MetricFormatter::SetMin( sal_Int64 nNewMin, FieldUnit eInUnit )
sal_Int64 MetricFormatter::GetMin( FieldUnit eOutUnit ) const
{
- // Umrechnen auf gewuenschte Einheiten
+ // convert to requested units
return MetricField::ConvertValue( NumericFormatter::GetMin(), mnBaseValue,
GetDecimalDigits(), meUnit, eOutUnit );
}
@@ -1571,7 +1566,7 @@ sal_Int64 MetricFormatter::GetMin( FieldUnit eOutUnit ) const
void MetricFormatter::SetMax( sal_Int64 nNewMax, FieldUnit eInUnit )
{
- // Umrechnen auf gewuenschte Einheiten
+ // convert to requested units
NumericFormatter::SetMax( MetricField::ConvertValue( nNewMax, mnBaseValue, GetDecimalDigits(),
eInUnit, meUnit ) );
}
@@ -1580,7 +1575,7 @@ void MetricFormatter::SetMax( sal_Int64 nNewMax, FieldUnit eInUnit )
sal_Int64 MetricFormatter::GetMax( FieldUnit eOutUnit ) const
{
- // Umrechnen auf gewuenschte Einheiten
+ // convert to requested units
return MetricField::ConvertValue( NumericFormatter::GetMax(), mnBaseValue,
GetDecimalDigits(), meUnit, eOutUnit );
}
@@ -1597,7 +1592,7 @@ void MetricFormatter::SetBaseValue( sal_Int64 nNewBase, FieldUnit eInUnit )
sal_Int64 MetricFormatter::GetBaseValue( FieldUnit eOutUnit ) const
{
- // Umrechnen auf gewuenschte Einheiten
+ // convert to requested units
return MetricField::ConvertValue( mnBaseValue, mnBaseValue, GetDecimalDigits(),
meUnit, eOutUnit );
}
@@ -1637,7 +1632,7 @@ void MetricFormatter::Reformat()
sal_Int64 MetricFormatter::GetCorrectedValue( FieldUnit eOutUnit ) const
{
- // Umrechnen auf gewuenschte Einheiten
+ // convert to requested units
return MetricField::ConvertValue( mnCorrectedValue, mnBaseValue, GetDecimalDigits(),
meUnit, eOutUnit );
}
@@ -1732,7 +1727,7 @@ sal_Int64 MetricField::GetFirst( FieldUnit eOutUnit ) const
void MetricField::SetLast( sal_Int64 nNewLast, FieldUnit eInUnit )
{
- // Umrechnen
+ // convert
nNewLast = MetricField::ConvertValue( nNewLast, mnBaseValue, GetDecimalDigits(),
eInUnit, meUnit );
mnLast = nNewLast;
@@ -1742,7 +1737,7 @@ void MetricField::SetLast( sal_Int64 nNewLast, FieldUnit eInUnit )
sal_Int64 MetricField::GetLast( FieldUnit eOutUnit ) const
{
- // Umrechnen
+ // conver
return MetricField::ConvertValue( mnLast, mnBaseValue, GetDecimalDigits(),
meUnit, eOutUnit );
}
@@ -1957,7 +1952,7 @@ void MetricBox::CustomConvert()
void MetricBox::InsertValue( sal_Int64 nValue, FieldUnit eInUnit, sal_uInt16 nPos )
{
- // Umrechnen auf eingestellte Einheiten
+ // convert to previously configured units
nValue = MetricField::ConvertValue( nValue, mnBaseValue, GetDecimalDigits(),
eInUnit, meUnit );
ComboBox::InsertEntry( CreateFieldText( nValue ), nPos );
@@ -1971,7 +1966,7 @@ sal_Int64 MetricBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const
ImplMetricGetValue( ComboBox::GetEntry( nPos ), nValue, mnBaseValue,
GetDecimalDigits(), ImplGetLocaleDataWrapper(), meUnit );
- // Umrechnen auf eingestellte Einheiten
+ // convert to previously configured units
sal_Int64 nRetValue = MetricField::ConvertValue( (sal_Int64)nValue, mnBaseValue, GetDecimalDigits(),
meUnit, eOutUnit );
@@ -1982,7 +1977,7 @@ sal_Int64 MetricBox::GetValue( sal_uInt16 nPos, FieldUnit eOutUnit ) const
sal_uInt16 MetricBox::GetValuePos( sal_Int64 nValue, FieldUnit eInUnit ) const
{
- // Umrechnen auf eingestellte Einheiten
+ // convert to previously configured units
nValue = MetricField::ConvertValue( nValue, mnBaseValue, GetDecimalDigits(),
eInUnit, meUnit );
return ComboBox::GetEntryPos( CreateFieldText( nValue ) );
@@ -2009,8 +2004,7 @@ sal_Int64 MetricBox::GetValue() const
static sal_Bool ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
sal_Bool, sal_Bool bUseThousandSep, const LocaleDataWrapper& rWrapper )
{
- // Es gibt hier kein sinnvolles StrictFormat, also alle
- // Zeichen erlauben
+ // no strict format set; therefore allow all characters
return ImplNumericProcessKeyInput( pEdit, rKEvt, sal_False, bUseThousandSep, rWrapper );
}
@@ -2019,7 +2013,7 @@ static sal_Bool ImplCurrencyProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
inline sal_Bool ImplCurrencyGetValue( const XubString& rStr, double& rValue,
sal_uInt16 nDecDigits, const LocaleDataWrapper& rWrapper )
{
- // Zahlenwert holen
+ // fetch number
return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper, sal_True );
}
diff --git a/vcl/source/control/field2.cxx b/vcl/source/control/field2.cxx
index 32e285e4f025..9244df52870f 100644
--- a/vcl/source/control/field2.cxx
+++ b/vcl/source/control/field2.cxx
@@ -265,19 +265,17 @@ static XubString ImplPatternReformat( const XubString& rStr,
cLiteral = rLiteralMask.GetChar(i);
cMask = rEditMask[i];
- // Aktuelle Position ein Literal
+ // current position is a literal
if ( cMask == EDITMASK_LITERAL )
{
- // Wenn es das Literal-Zeichen ist, uebernehmen, ansonsten
- // ignorieren, da es das naechste gueltige Zeichen vom String
- // sein kann
+ // if it is a literal copy otherwise ignore because it might be the next valid
+ // character of the string
if ( ImplKommaPointCharEqual( cChar, cLiteral ) )
nStrIndex++;
else
{
- // Ansonsten testen wir, ob es ein ungueltiges Zeichen ist.
- // Dies ist dann der Fall, wenn es nicht in das Muster
- // des naechsten nicht Literal-Zeichens passt
+ // Otherwise we check if it is a invalid character. This is the case if it does not
+ // fit in the pattern of the next non-literal character.
n = i+1;
while ( n < rEditMask.getLength() )
{
@@ -294,25 +292,23 @@ static XubString ImplPatternReformat( const XubString& rStr,
}
else
{
- // Gueltiges Zeichen an der Stelle
+ // valid character at this position
cTempChar = ImplPatternChar( cChar, cMask );
if ( cTempChar )
{
- // dann Zeichen uebernehmen
+ // use this character
aOutStr.SetChar( i, cTempChar );
nStrIndex++;
}
else
{
- // Wenn es das Literalzeichen ist, uebernehmen
+ // copy if it is a literal character
if ( cLiteral == cChar )
nStrIndex++;
else
{
- // Wenn das ungueltige Zeichen das naechste Literalzeichen
- // sein kann, dann springen wir bis dahin vor, ansonten
- // das Zeichen ignorieren
- // Nur machen, wenn leere Literale erlaubt sind
+ // If the invalid character might be the next literal character then we jump
+ // ahead to it, otherwise we ignore it. Do only if empty literals are allowed.
if ( nFormatFlags & PATTERN_FORMAT_EMPTYLITERALS )
{
n = i;
@@ -349,11 +345,10 @@ static void ImplPatternMaxPos( const XubString rStr, const rtl::OString& rEditMa
sal_uInt16 nCursorPos, sal_uInt16& rPos )
{
- // Letzte Position darf nicht groesser als der enthaltene String sein
+ // last position must not be longer than the contained string
xub_StrLen nMaxPos = rStr.Len();
- // Wenn keine leeren Literale erlaubt sind, auch Leerzeichen
- // am Ende ignorieren
+ // if non empty literals are allowed ignore blanks at the end as well
if ( bSameMask && !(nFormatFlags & PATTERN_FORMAT_EMPTYLITERALS) )
{
while ( nMaxPos )
@@ -364,8 +359,7 @@ static void ImplPatternMaxPos( const XubString rStr, const rtl::OString& rEditMa
nMaxPos--;
}
- // Wenn wir vor einem Literal stehen, dann solange weitersuchen,
- // bis erste Stelle nach Literal
+ // if we are in front of a literal, continue search until first character after the literal
xub_StrLen nTempPos = nMaxPos;
while ( nTempPos < rEditMask.getLength() )
{
@@ -380,7 +374,8 @@ static void ImplPatternMaxPos( const XubString rStr, const rtl::OString& rEditMa
if ( rPos > nMaxPos )
rPos = nMaxPos;
- // Zeichen sollte nicht nach links wandern
+
+ // charactr should not move left
if ( rPos < nCursorPos )
rPos = nCursorPos;
}
@@ -394,7 +389,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
{
XubString aText = pEdit->GetText();
- // Leerzeichen am Anfang entfernen
+ // remove leading blanks
if ( bSameMask && !(nFormatFlags & PATTERN_FORMAT_EMPTYLITERALS) )
{
xub_StrLen i = 0;
@@ -407,7 +402,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
i++;
}
- // Alle Literalzeichen beibehalten
+ // keep all literal characters
while ( i && (rEditMask[i] == EDITMASK_LITERAL) )
i--;
aText.Erase( 0, i );
@@ -416,8 +411,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
XubString aNewText = ImplPatternReformat( aText, rEditMask, rLiteralMask, nFormatFlags );
if ( aNewText != aText )
{
- // Selection so anpassen, das diese wenn sie vorher am Ende
- // stand, immer noch am Ende steht
+ // adjust selection such that it remains at the end if it was there before
Selection aSel = pEdit->GetSelection();
sal_uLong nMaxSel = Max( aSel.Min(), aSel.Max() );
if ( nMaxSel >= aText.Len() )
@@ -442,7 +436,7 @@ static void ImplPatternProcessStrictModify( Edit* pEdit,
static xub_StrLen ImplPatternLeftPos(const rtl::OString& rEditMask, xub_StrLen nCursorPos)
{
- // Vorheriges Zeichen suchen, was kein Literal ist
+ // search non-literal predecessor
xub_StrLen nNewPos = nCursorPos;
xub_StrLen nTempPos = nNewPos;
while ( nTempPos )
@@ -463,7 +457,7 @@ static xub_StrLen ImplPatternRightPos( const XubString& rStr, const rtl::OString
sal_uInt16 nFormatFlags, sal_Bool bSameMask,
xub_StrLen nCursorPos )
{
- // Naechstes Zeichen suchen, was kein Literal ist
+ // search non-literal successor
xub_StrLen nNewPos = nCursorPos;
xub_StrLen nTempPos = nNewPos;
while ( nTempPos < rEditMask.getLength() )
@@ -513,9 +507,8 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
}
else if ( nKeyCode == KEY_RIGHT )
{
- // Hier nehmen wir Selectionsanfang als minimum, da falls durch
- // Focus alles selektiert ist, ist eine kleine Position schon
- // erlaubt.
+ // Use the start of selection as minimum; even a small position is allowed in case that
+ // all was selected by the focus
Selection aSel( aOldSel );
aSel.Justify();
nCursorPos = (xub_StrLen)aSel.Min();
@@ -529,12 +522,13 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
}
else if ( nKeyCode == KEY_HOME )
{
- // Home ist Position des ersten nicht literalen Zeichens
+ // Home is the position of the first non-literal character
nNewPos = 0;
while ( (nNewPos < rEditMask.getLength()) &&
(rEditMask[nNewPos] == EDITMASK_LITERAL) )
nNewPos++;
- // Home sollte nicht nach rechts wandern
+
+ // Home should not move to the right
if ( nCursorPos < nNewPos )
nNewPos = nCursorPos;
Selection aSel( nNewPos );
@@ -545,14 +539,13 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
}
else if ( nKeyCode == KEY_END )
{
- // End ist die Position des letzten nicht literalen Zeichens
+ // End is position of last non-literal character
nNewPos = rEditMask.getLength();
while ( nNewPos &&
(rEditMask[nNewPos-1] == EDITMASK_LITERAL) )
nNewPos--;
- // Hier nehmen wir Selectionsanfang als minimum, da falls durch
- // Focus alles selektiert ist, ist eine kleine Position schon
- // erlaubt.
+ // Use the start of selection as minimum; even a small position is allowed in case that
+ // all was selected by the focus
Selection aSel( aOldSel );
aSel.Justify();
nCursorPos = (xub_StrLen)aSel.Min();
@@ -574,7 +567,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
aSel.Justify();
nNewPos = (xub_StrLen)aSel.Min();
- // Wenn Selection, dann diese Loeschen
+ // if selection then delete it
if ( aSel.Len() )
{
if ( bSameMask )
@@ -627,9 +620,8 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
}
else if ( nKeyCode == KEY_INSERT )
{
- // InsertModus kann man beim PatternField nur einstellen,
- // wenn Maske an jeder Eingabeposition die gleiche
- // ist
+ // you can only set InsertModus for a PatternField if the
+ // mask is equal at all input positions
if ( !bSameMask )
{
Sound::Beep();
@@ -652,23 +644,20 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
cChar = cPattChar;
else
{
- // Wenn kein gueltiges Zeichen, dann testen wir, ob der
- // Anwender zum naechsten Literal springen wollte. Dies machen
- // wir nur, wenn er hinter einem Zeichen steht, damit
- // eingebene Literale die automatisch uebersprungenen wurden
- // nicht dazu fuehren, das der Anwender dann da steht, wo
- // er nicht stehen wollte.
+ // If no valid character, check if the user wanted to jump to next literal. We do this
+ // only if we're after a character, so that literals that were skipped automatically
+ // do not influence the position anymore.
if ( nNewPos &&
(rEditMask[nNewPos-1] != EDITMASK_LITERAL) &&
!aSel.Len() )
{
- // Naechstes Zeichen suchen, was kein Literal ist
+ // search for next character not being a literal
nTempPos = nNewPos;
while ( nTempPos < rEditMask.getLength() )
{
if ( rEditMask[nTempPos] == EDITMASK_LITERAL )
{
- // Gilt nur, wenn ein Literalzeichen vorhanden
+ // only valid if no literal present
if ( (rEditMask[nTempPos+1] != EDITMASK_LITERAL ) &&
ImplKommaPointCharEqual( cChar, rLiteralMask.GetChar(nTempPos) ) )
{
@@ -697,8 +686,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
sal_Bool bError = sal_False;
if ( bSameMask && pEdit->IsInsertMode() )
{
- // Text um Spacezeichen und Literale am Ende kuerzen, bis zur
- // aktuellen Position
+ // crop spaces and literals at the end until current position
xub_StrLen n = aStr.Len();
while ( n && (n > nNewPos) )
{
@@ -715,7 +703,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
if ( aStr.Len() < rEditMask.getLength() )
{
- // String evtl. noch bis Cursor-Position erweitern
+ // possibly extend string until cursor position
if ( aStr.Len() < nNewPos )
aStr += rLiteralMask.Copy( aStr.Len(), nNewPos-aStr.Len() );
if ( nNewPos < aStr.Len() )
@@ -731,7 +719,7 @@ static sal_Bool ImplPatternProcessKeyInput( Edit* pEdit, const KeyEvent& rKEvt,
{
if ( aSel.Len() )
{
- // Selection loeschen
+ // delete selection
XubString aRep = rLiteralMask.Copy( (xub_StrLen)aSel.Min(), (xub_StrLen)aSel.Len() );
aStr.Replace( (xub_StrLen)aSel.Min(), aRep.Len(), aRep );
}
@@ -777,10 +765,8 @@ void PatternFormatter::ImplSetMask(const rtl::OString& rEditMask,
maLiteralMask.Expand(m_aEditMask.getLength(), ' ');
}
- // StrictModus erlaubt nur Input-Mode, wenn als Maske nur
- // gleiche Zeichen zugelassen werden und als Vorgabe nur
- // Spacezeichen vorgegeben werden, die durch die Maske
- // nicht zugelassen sind
+ // Strict mode allows only the input mode if only equal characters are allowed as mask and if
+ // only spaces are specified which are not allowed by the mask
xub_StrLen i = 0;
sal_Char c = 0;
while ( i < rEditMask.getLength() )
@@ -1270,7 +1256,7 @@ XubString DateFormatter::ImplGetDateAsText( const Date& rDate,
sal_uInt16 nTwoDigitYearStart = utl::MiscCfg().GetYear2000();
sal_uInt16 nYear = rDate.GetYear();
- // Wenn Jahr nicht im 2stelligen Grenzbereich liegt,
+ // If year is not in double digit range
if ( (nYear < nTwoDigitYearStart) || (nYear >= nTwoDigitYearStart+100) )
bShowCentury = sal_True;
}
@@ -1421,7 +1407,7 @@ sal_Bool DateFormatter::ImplAllowMalformedInput() const
void DateField::ImplDateSpinArea( sal_Bool bUp )
{
- // Wenn alles selektiert ist, Tage hochzaehlen
+ // increment days if all is selected
if ( GetField() )
{
Date aDate( GetDate() );
@@ -1442,7 +1428,7 @@ void DateField::ImplDateSpinArea( sal_Bool bUp )
}
else
{
- // Area suchen
+ // search area
xub_StrLen nPos = 0;
String aDateSep = ImplGetDateSep( ImplGetLocaleDataWrapper(), eFormat );
for ( xub_StrLen i = 1; i <= 3; i++ )
@@ -1767,7 +1753,8 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate )
Selection aSelection = GetField()->GetSelection();
aSelection.Justify();
XubString aText = GetField()->GetText();
- // Wenn bis ans Ende selektiert war, soll das auch so bleiben...
+
+ // If selected until the end then keep it that way
if ( (xub_StrLen)aSelection.Max() == aText.Len() )
{
if ( !aSelection.Len() )
@@ -1779,7 +1766,7 @@ void DateFormatter::ImplNewFieldValue( const Date& rDate )
ImplSetUserDate( rDate, &aSelection );
maLastDate = aOldLastDate;
- // Modify am Edit wird nur bei KeyInput gesetzt...
+ // Modify at Edit is only set at KeyInput
if ( GetField()->GetText() != aText )
{
GetField()->SetModifyFlag();
@@ -1805,10 +1792,8 @@ Date DateFormatter::GetDate() const
}
else
{
- // !!! TH-18.2.99: Wenn wir Zeit haben sollte einmal
- // !!! geklaert werden, warum dieses beim Datum gegenueber
- // !!! allen anderen Feldern anders behandelt wird.
- // !!! Siehe dazu Bug: 52304
+ // !!! We should find out why dates are treated differently than other fields (see
+ // also bug: 52384)
if ( !ImplAllowMalformedInput() )
{
@@ -1999,10 +1984,8 @@ long DateField::Notify( NotifyEvent& rNEvt )
{
if ( MustBeReformatted() )
{
- // !!! TH-18.2.99: Wenn wir Zeit haben sollte einmal
- // !!! geklaert werden, warum dieses beim Datum gegenueber
- // !!! allen anderen Feldern anders behandelt wird.
- // !!! Siehe dazu Bug: 52304
+ // !!! We should find out why dates are treated differently than other fields (see
+ // also bug: 52384)
sal_Bool bTextLen = GetText().Len() != 0;
if ( bTextLen || !IsEmptyFieldValueEnabled() )
@@ -2262,14 +2245,14 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
if ( !rStr.Len() )
return sal_False;
- // Nach Separatoren suchen
+ // Search for separators
if (!rLocaleDataWrapper.getTimeSep().isEmpty())
{
rtl::OUStringBuffer aSepStr(",.;:/");
if ( !bDuration )
aSepStr.append('-');
- // Die obigen Zeichen durch das Separatorzeichen ersetzen
+ // Replace characters above by the separator character
for (sal_Int32 i = 0; i < aSepStr.getLength(); ++i)
{
if (string::equals(rLocaleDataWrapper.getTimeSep(), aSepStr[i]))
@@ -2367,7 +2350,7 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
if ( n100Sec )
{
- xub_StrLen nLen = 1; // mindestens eine Ziffer, weil sonst n100Sec==0
+ xub_StrLen nLen = 1; // at least one digit, otherwise n100Sec==0
while ( aStr.GetChar(nLen) >= '0' && aStr.GetChar(nLen) <= '9' )
nLen++;
@@ -2379,7 +2362,7 @@ static sal_Bool ImplTimeGetValue( const XubString& rStr, Time& rTime,
n100Sec = n100Sec / 10;
nLen--;
}
- // Rundung bei negativen Zahlen???
+ // round if negative?
n100Sec = (n100Sec + 5) / 10;
}
else
@@ -2734,7 +2717,8 @@ void TimeFormatter::ImplNewFieldValue( const Time& rTime )
Selection aSelection = GetField()->GetSelection();
aSelection.Justify();
XubString aText = GetField()->GetText();
- // Wenn bis ans Ende selektiert war, soll das auch so bleiben...
+
+ // If selected until the end then keep it that way
if ( (xub_StrLen)aSelection.Max() == aText.Len() )
{
if ( !aSelection.Len() )
@@ -2746,7 +2730,7 @@ void TimeFormatter::ImplNewFieldValue( const Time& rTime )
ImplSetUserTime( rTime, &aSelection );
maLastTime = aOldLastTime;
- // Modify am Edit wird nur bei KeyInput gesetzt...
+ // Modify at Edit is only set at KeyInput
if ( GetField()->GetText() != aText )
{
GetField()->SetModifyFlag();