Kaydet (Commit) 904aff19 authored tarafından Philipp Weissenbacher's avatar Philipp Weissenbacher Kaydeden (comit) Noel Power

Translate German comments, fix some WS

Change-Id: Ic52fc416aea9d1ca7235613aed7cf494f17ae21a
Reviewed-on: https://gerrit.libreoffice.org/4361Reviewed-by: 's avatarNoel Power <noel.power@suse.com>
Tested-by: 's avatarNoel Power <noel.power@suse.com>
üst 8fd1bd18
......@@ -65,9 +65,6 @@ const sal_uInt8 ImpSvNumberInputScan::nMatchedUsedAsReturn = 0x10;
* would work, together with the nTimezonePos handling in GetTimeRef(). */
#define NF_RECOGNIZE_ISO8601_TIMEZONES 0
//---------------------------------------------------------------------------
// Konstruktor
ImpSvNumberInputScan::ImpSvNumberInputScan( SvNumberFormatter* pFormatterP )
:
pUpperMonthText( NULL ),
......@@ -92,9 +89,6 @@ ImpSvNumberInputScan::ImpSvNumberInputScan( SvNumberFormatter* pFormatterP )
}
//---------------------------------------------------------------------------
// Destruktor
ImpSvNumberInputScan::~ImpSvNumberInputScan()
{
Reset();
......@@ -110,9 +104,6 @@ ImpSvNumberInputScan::~ImpSvNumberInputScan()
}
//---------------------------------------------------------------------------
// Reset
void ImpSvNumberInputScan::Reset()
{
nMonth = 0;
......@@ -148,8 +139,6 @@ void ImpSvNumberInputScan::Reset()
}
//---------------------------------------------------------------------------
//
// static
inline bool ImpSvNumberInputScan::MyIsdigit( sal_Unicode c )
{
......@@ -157,8 +146,6 @@ inline bool ImpSvNumberInputScan::MyIsdigit( sal_Unicode c )
}
//---------------------------------------------------------------------------
//
void ImpSvNumberInputScan::TransformInput( OUString& rStr )
{
sal_Int32 nPos, nLen;
......@@ -178,12 +165,10 @@ void ImpSvNumberInputScan::TransformInput( OUString& rStr )
}
//---------------------------------------------------------------------------
// StringToDouble
//
// Only simple unsigned floating point values without any error detection,
// decimal separator has to be '.'
/**
* Only simple unsigned floating point values without any error detection,
* decimal separator has to be '.'
*/
double ImpSvNumberInputScan::StringToDouble( const OUString& rStr, bool bForceFraction )
{
double fNum = 0.0;
......@@ -218,27 +203,25 @@ double ImpSvNumberInputScan::StringToDouble( const OUString& rStr, bool bForceFr
}
//---------------------------------------------------------------------------
// NextNumberStringSymbol
//
// Zerlegt die Eingabe in Zahlen und Strings fuer die weitere
// Verarbeitung (Turing-Maschine).
//---------------------------------------------------------------------------
// Ausgangs Zustand = GetChar
//---------------+-------------------+-----------------------+---------------
// Alter Zustand | gelesenes Zeichen | Aktion | Neuer Zustand
//---------------+-------------------+-----------------------+---------------
// GetChar | Ziffer | Symbol=Zeichen | GetValue
// | Sonst | Symbol=Zeichen | GetString
//---------------|-------------------+-----------------------+---------------
// GetValue | Ziffer | Symbol=Symbol+Zeichen | GetValue
// | Sonst | Dec(CharPos) | Stop
//---------------+-------------------+-----------------------+---------------
// GetString | Ziffer | Dec(CharPos) | Stop
// | Sonst | Symbol=Symbol+Zeichen | GetString
//---------------+-------------------+-----------------------+---------------
enum ScanState // States der Turing-Maschine
/**
* Splits up the input into numbers and strings for further processing
* (by the Turing machine).
*
* Starting state = GetChar
* ---------------+-------------------+-----------------------------+---------------
* Old State | Character read | Event | New state
* ---------------+-------------------+-----------------------------+---------------
* GetChar | Number | Symbol = Character | GetValue
* | Else | Symbol = Character | GetString
* ---------------|-------------------+-----------------------------+---------------
* GetValue | Number | Symbol = Symbol + Character | GetValue
* | Else | Dec(CharPos) | Stop
* ---------------+-------------------+-----------------------------+---------------
* GetString | Number | Dec(CharPos) | Stop
* | Else | Symbol = Symbol + Character | GetString
* ---------------+-------------------+-----------------------------+---------------
*/
enum ScanState // States of the Turing machine
{
SsStop = 0,
SsStart = 1,
......@@ -314,9 +297,6 @@ bool ImpSvNumberInputScan::NextNumberStringSymbol( const sal_Unicode*& pStr,
}
//---------------------------------------------------------------------------
// SkipThousands
// FIXME: should be grouping; it is only used though in case nAnzStrings is
// near SV_MAX_ANZ_INPUT_STRINGS, in NumberStringDivision().
......@@ -386,9 +366,6 @@ bool ImpSvNumberInputScan::SkipThousands( const sal_Unicode*& pStr,
}
//---------------------------------------------------------------------------
// NumberStringDivision
void ImpSvNumberInputScan::NumberStringDivision( const OUString& rString )
{
const sal_Unicode* pStr = rString.getStr();
......@@ -396,12 +373,12 @@ void ImpSvNumberInputScan::NumberStringDivision( const OUString& rString )
while ( pStr < pEnd && nAnzStrings < SV_MAX_ANZ_INPUT_STRINGS )
{
if ( NextNumberStringSymbol( pStr, sStrArray[nAnzStrings] ) )
{ // Zahl
{ // Number
IsNum[nAnzStrings] = true;
nNums[nAnzNums] = nAnzStrings;
nAnzNums++;
if (nAnzStrings >= SV_MAX_ANZ_INPUT_STRINGS - 7 &&
nPosThousandString == 0) // nur einmal
nPosThousandString == 0) // Only once
{
if ( SkipThousands( pStr, sStrArray[nAnzStrings] ) )
{
......@@ -418,9 +395,9 @@ void ImpSvNumberInputScan::NumberStringDivision( const OUString& rString )
}
//---------------------------------------------------------------------------
// Whether rString contains rWhat at nPos
/**
* Whether rString contains rWhat at nPos
*/
bool ImpSvNumberInputScan::StringContainsImpl( const OUString& rWhat,
const OUString& rString, sal_Int32 nPos )
{
......@@ -432,9 +409,9 @@ bool ImpSvNumberInputScan::StringContainsImpl( const OUString& rWhat,
}
//---------------------------------------------------------------------------
// Whether pString contains rWhat at nPos
/**
* Whether pString contains rWhat at nPos
*/
bool ImpSvNumberInputScan::StringPtrContainsImpl( const OUString& rWhat,
const sal_Unicode* pString, sal_Int32 nPos )
{
......@@ -458,11 +435,9 @@ bool ImpSvNumberInputScan::StringPtrContainsImpl( const OUString& rWhat,
}
//---------------------------------------------------------------------------
// SkipChar
//
// ueberspringt genau das angegebene Zeichen
/**
* Skips the supplied char
*/
inline bool ImpSvNumberInputScan::SkipChar( sal_Unicode c, const OUString& rString,
sal_Int32& nPos )
{
......@@ -475,11 +450,9 @@ inline bool ImpSvNumberInputScan::SkipChar( sal_Unicode c, const OUString& rStri
}
//---------------------------------------------------------------------------
// SkipBlanks
//
// Ueberspringt Leerzeichen
/**
* Skips blanks
*/
inline void ImpSvNumberInputScan::SkipBlanks( const OUString& rString,
sal_Int32& nPos )
{
......@@ -495,11 +468,9 @@ inline void ImpSvNumberInputScan::SkipBlanks( const OUString& rString,
}
//---------------------------------------------------------------------------
// SkipString
//
// jump over rWhat in rString at nPos
/**
* jump over rWhat in rString at nPos
*/
inline bool ImpSvNumberInputScan::SkipString( const OUString& rWhat,
const OUString& rString, sal_Int32& nPos )
{
......@@ -512,11 +483,9 @@ inline bool ImpSvNumberInputScan::SkipString( const OUString& rWhat,
}
//---------------------------------------------------------------------------
// GetThousandSep
//
// recognizes exactly ,111 in {3} and {3,2} or ,11 in {3,2} grouping
/**
* Recognizes exactly ,111 in {3} and {3,2} or ,11 in {3,2} grouping
*/
inline bool ImpSvNumberInputScan::GetThousandSep( const OUString& rString,
sal_Int32& nPos,
sal_uInt16 nStringPos )
......@@ -551,14 +520,12 @@ inline bool ImpSvNumberInputScan::GetThousandSep( const OUString& rString,
}
//---------------------------------------------------------------------------
// GetLogical
//
// Conversion of text to logial value
// "true" => 1:
// "false"=> -1:
// else => 0:
/**
* Conversion of text to logical value
* "true" => 1:
* "false"=> -1:
* else => 0:
*/
short ImpSvNumberInputScan::GetLogical( const OUString& rString )
{
short res;
......@@ -580,12 +547,10 @@ short ImpSvNumberInputScan::GetLogical( const OUString& rString )
}
//---------------------------------------------------------------------------
// GetMonth
//
// Converts a string containing a month name (JAN, January) at nPos into the
// month number (negative if abbreviated), returns 0 if nothing found
/**
* Converts a string containing a month name (JAN, January) at nPos into the
* month number (negative if abbreviated), returns 0 if nothing found
*/
short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos )
{
// #102136# The correct English form of month September abbreviated is
......@@ -654,12 +619,10 @@ short ImpSvNumberInputScan::GetMonth( const OUString& rString, sal_Int32& nPos )
}
//---------------------------------------------------------------------------
// GetDayOfWeek
//
// Converts a string containing a DayOfWeek name (Mon, Monday) at nPos into the
// DayOfWeek number + 1 (negative if abbreviated), returns 0 if nothing found
/**
* Converts a string containing a DayOfWeek name (Mon, Monday) at nPos into the
* DayOfWeek number + 1 (negative if abbreviated), returns 0 if nothing found
*/
int ImpSvNumberInputScan::GetDayOfWeek( const OUString& rString, sal_Int32& nPos )
{
int res = 0; // no day found
......@@ -692,13 +655,11 @@ int ImpSvNumberInputScan::GetDayOfWeek( const OUString& rString, sal_Int32& nPos
}
//---------------------------------------------------------------------------
// GetCurrency
//
// Lesen eines Waehrungssysmbols
// '$' => true
// sonst => false
/**
* Reading a currency symbol
* '$' => true
* else => false
*/
bool ImpSvNumberInputScan::GetCurrency( const OUString& rString, sal_Int32& nPos,
const SvNumberformat* pFormat )
{
......@@ -737,20 +698,18 @@ bool ImpSvNumberInputScan::GetCurrency( const OUString& rString, sal_Int32& nPos
}
//---------------------------------------------------------------------------
// GetTimeAmPm
//
// Lesen des Zeitsymbols (AM od. PM) f. kurze Zeitangabe
//
// Rueckgabe:
// "AM" od. "PM" => true
// sonst => false
//
// nAmPos:
// "AM" => 1
// "PM" => -1
// sonst => 0
/**
* Reading the time period specifier (AM/PM) for the 12 hour clock
*
* Returns:
* "AM" or "PM" => true
* else => false
*
* nAmPos:
* "AM" => 1
* "PM" => -1
* else => 0
*/
bool ImpSvNumberInputScan::GetTimeAmPm( const OUString& rString, sal_Int32& nPos )
{
......@@ -776,13 +735,11 @@ bool ImpSvNumberInputScan::GetTimeAmPm( const OUString& rString, sal_Int32& nPos
}
//---------------------------------------------------------------------------
// GetDecSep
//
// Lesen eines Dezimaltrenners (',')
// ',' => true
// sonst => false
/**
* Read a decimal separator (',')
* ',' => true
* else => false
*/
inline bool ImpSvNumberInputScan::GetDecSep( const OUString& rString, sal_Int32& nPos )
{
if ( rString.getLength() > nPos )
......@@ -798,9 +755,9 @@ inline bool ImpSvNumberInputScan::GetDecSep( const OUString& rString, sal_Int32&
}
//---------------------------------------------------------------------------
// read a hundredth seconds separator
/**
* Reading a hundredth seconds separator
*/
inline bool ImpSvNumberInputScan::GetTime100SecSep( const OUString& rString, sal_Int32& nPos )
{
if ( rString.getLength() > nPos )
......@@ -816,15 +773,13 @@ inline bool ImpSvNumberInputScan::GetTime100SecSep( const OUString& rString, sal
}
//---------------------------------------------------------------------------
// GetSign
//
// Lesen eines Vorzeichens, auch Klammer !?!
// '+' => 1
// '-' => -1
// '(' => -1, nNegCheck = 1
// sonst => 0
/**
* Read a sign including brackets
* '+' => 1
* '-' => -1
* '(' => -1, nNegCheck = 1
* else => 0
*/
int ImpSvNumberInputScan::GetSign( const OUString& rString, sal_Int32& nPos )
{
if (rString.getLength() > nPos)
......@@ -833,7 +788,7 @@ int ImpSvNumberInputScan::GetSign( const OUString& rString, sal_Int32& nPos )
case '+':
nPos++;
return 1;
case '(': // '(' aehnlich wie '-' ?!?
case '(': // '(' similar to '-' ?!?
nNegCheck = 1;
//! fallthru
case '-':
......@@ -847,14 +802,12 @@ int ImpSvNumberInputScan::GetSign( const OUString& rString, sal_Int32& nPos )
}
//---------------------------------------------------------------------------
// GetESign
//
// Lesen eines Vorzeichens, gedacht fuer Exponent ?!?
// '+' => 1
// '-' => -1
// sonst => 0
/**
* Read a sign with an exponent
* '+' => 1
* '-' => -1
* else => 0
*/
short ImpSvNumberInputScan::GetESign( const OUString& rString, sal_Int32& nPos )
{
if (rString.getLength() > nPos)
......@@ -875,12 +828,10 @@ short ImpSvNumberInputScan::GetESign( const OUString& rString, sal_Int32& nPos )
}
//---------------------------------------------------------------------------
// GetNextNumber
//
// i counts string portions, j counts numbers thereof.
// It should had been called SkipNumber instead.
/**
* i counts string portions, j counts numbers thereof.
* It should had been called SkipNumber instead.
*/
inline bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j )
{
if ( i < nAnzStrings && IsNum[i] )
......@@ -893,9 +844,6 @@ inline bool ImpSvNumberInputScan::GetNextNumber( sal_uInt16& i, sal_uInt16& j )
}
//---------------------------------------------------------------------------
// GetTimeRef
bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber,
sal_uInt16 nIndex, // j-value of the first numeric time part of input, default 0
sal_uInt16 nAnz ) // count of numeric time parts
......@@ -974,9 +922,6 @@ bool ImpSvNumberInputScan::GetTimeRef( double& fOutNumber,
}
//---------------------------------------------------------------------------
// ImplGetDay
sal_uInt16 ImpSvNumberInputScan::ImplGetDay( sal_uInt16 nIndex )
{
sal_uInt16 nRes = 0;
......@@ -994,12 +939,9 @@ sal_uInt16 ImpSvNumberInputScan::ImplGetDay( sal_uInt16 nIndex )
}
//---------------------------------------------------------------------------
// ImplGetMonth
sal_uInt16 ImpSvNumberInputScan::ImplGetMonth( sal_uInt16 nIndex )
{
// preset invalid month number
// Preset invalid month number
sal_uInt16 nRes = pFormatter->GetCalendar()->getNumberOfMonthsInYear();
if (sStrArray[nNums[nIndex]].getLength() <= 2)
......@@ -1015,11 +957,9 @@ sal_uInt16 ImpSvNumberInputScan::ImplGetMonth( sal_uInt16 nIndex )
}
//---------------------------------------------------------------------------
// ImplGetYear
//
// 30 -> 1930, 29 -> 2029, oder 56 -> 1756, 55 -> 1855, ...
/**
* 30 -> 1930, 29 -> 2029, or 56 -> 1756, 55 -> 1855, ...
*/
sal_uInt16 ImpSvNumberInputScan::ImplGetYear( sal_uInt16 nIndex )
{
sal_uInt16 nYear = 0;
......@@ -1039,7 +979,6 @@ sal_uInt16 ImpSvNumberInputScan::ImplGetYear( sal_uInt16 nIndex )
return nYear;
}
//---------------------------------------------------------------------------
bool ImpSvNumberInputScan::MayBeIso8601()
{
......@@ -1065,7 +1004,6 @@ bool ImpSvNumberInputScan::MayBeIso8601()
return nMayBeIso8601 > 1;
}
//---------------------------------------------------------------------------
bool ImpSvNumberInputScan::CanForceToIso8601( DateFormat eDateFormat )
{
......@@ -1108,7 +1046,6 @@ bool ImpSvNumberInputScan::CanForceToIso8601( DateFormat eDateFormat )
return nCanForceToIso8601 > 1;
}
//---------------------------------------------------------------------------
bool ImpSvNumberInputScan::MayBeMonthDate()
{
......@@ -1155,7 +1092,6 @@ bool ImpSvNumberInputScan::MayBeMonthDate()
return nMayBeMonthDate > 1;
}
//---------------------------------------------------------------------------
bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt )
{
......@@ -1292,7 +1228,6 @@ bool ImpSvNumberInputScan::IsAcceptedDatePattern( sal_uInt16 nStartPatternAt )
return false;
}
//---------------------------------------------------------------------------
bool ImpSvNumberInputScan::SkipDatePatternSeparator( sal_uInt16 nParticle, sal_Int32 & rPos )
{
......@@ -1345,7 +1280,6 @@ bool ImpSvNumberInputScan::SkipDatePatternSeparator( sal_uInt16 nParticle, sal_I
return false;
}
//---------------------------------------------------------------------------
sal_uInt16 ImpSvNumberInputScan::GetDatePatternNumbers()
{
......@@ -1357,7 +1291,6 @@ sal_uInt16 ImpSvNumberInputScan::GetDatePatternNumbers()
return nDatePatternNumbers;
}
//---------------------------------------------------------------------------
sal_uInt32 ImpSvNumberInputScan::GetDatePatternOrder()
{
......@@ -1382,7 +1315,6 @@ sal_uInt32 ImpSvNumberInputScan::GetDatePatternOrder()
return nOrder;
}
//---------------------------------------------------------------------------
DateFormat ImpSvNumberInputScan::GetDateOrder()
{
......@@ -1458,9 +1390,6 @@ DateFormat ImpSvNumberInputScan::GetDateOrder()
return pFormatter->GetLocaleData()->getDateFormat();
}
//---------------------------------------------------------------------------
// GetDateRef
bool ImpSvNumberInputScan::GetDateRef( double& fDays, sal_uInt16& nCounter,
const SvNumberformat* pFormat )
{
......@@ -2015,13 +1944,11 @@ input for the following reasons:
}
//---------------------------------------------------------------------------
// ScanStartString
//
// ersten String analysieren
// Alles weg => true
// sonst => false
/**
* Analyze first string
* All gone => true
* else => false
*/
bool ImpSvNumberInputScan::ScanStartString( const OUString& rString,
const SvNumberformat* pFormat )
{
......@@ -2152,13 +2079,11 @@ bool ImpSvNumberInputScan::ScanStartString( const OUString& rString,
}
//---------------------------------------------------------------------------
// ScanMidString
//
// String in der Mitte analysieren
// Alles weg => true
// sonst => false
/**
* Analyze string in the middle
* All gone => true
* else => false
*/
bool ImpSvNumberInputScan::ScanMidString( const OUString& rString,
sal_uInt16 nStringPos, const SvNumberformat* pFormat )
{
......@@ -2465,13 +2390,11 @@ bool ImpSvNumberInputScan::ScanMidString( const OUString& rString,
}
//---------------------------------------------------------------------------
// ScanEndString
//
// Schlussteil analysieren
// Alles weg => true
// sonst => false
/**
* Analyze the end
* All gone => true
* else => false
*/
bool ImpSvNumberInputScan::ScanEndString( const OUString& rString,
const SvNumberformat* pFormat )
{
......@@ -2886,12 +2809,10 @@ bool ImpSvNumberInputScan::ScanStringNumFor( const OUString& rString, /
}
//---------------------------------------------------------------------------
// IsNumberFormatMain
//
// Recognizes types of number, exponential, fraction, percent, currency, date, time.
// Else text => return false
/**
* Recognizes types of number, exponential, fraction, percent, currency, date, time.
* Else text => return false
*/
bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString, // string to be analyzed
const SvNumberformat* pFormat ) // maybe number format set to match against
{
......@@ -3194,8 +3115,9 @@ bool ImpSvNumberInputScan::IsNumberFormatMain( const OUString& rString,
}
//---------------------------------------------------------------------------
// return true or false depending on the nMatched... state and remember usage
/**
* Return true or false depending on the nMatched... state and remember usage
*/
bool ImpSvNumberInputScan::MatchedReturn()
{
if ( nMatchedAllStrings & ~nMatchedVirgin )
......@@ -3207,9 +3129,9 @@ bool ImpSvNumberInputScan::MatchedReturn()
}
//---------------------------------------------------------------------------
// Initialize uppercase months and weekdays
/**
* Initialize uppercase months and weekdays
*/
void ImpSvNumberInputScan::InitText()
{
sal_Int32 j, nElems;
......@@ -3283,14 +3205,9 @@ void ImpSvNumberInputScan::InitText()
}
//===========================================================================
// P U B L I C
//---------------------------------------------------------------------------
// ChangeIntl
//
// MUST be called if International/Locale is changed
/**
* MUST be called if International/Locale is changed
*/
void ImpSvNumberInputScan::ChangeIntl()
{
sal_Unicode cDecSep = pFormatter->GetNumDecimalSep()[0];
......@@ -3311,9 +3228,6 @@ void ImpSvNumberInputScan::InvalidateDateAcceptancePatterns()
}
//---------------------------------------------------------------------------
// ChangeNullDate
void ImpSvNumberInputScan::ChangeNullDate( const sal_uInt16 Day,
const sal_uInt16 Month,
const sal_uInt16 Year )
......@@ -3329,11 +3243,9 @@ void ImpSvNumberInputScan::ChangeNullDate( const sal_uInt16 Day,
}
//---------------------------------------------------------------------------
// IsNumberFormat
//
// => does rString represent a number (also date, time et al)
/**
* Does rString represent a number (also date, time et al)
*/
bool ImpSvNumberInputScan::IsNumberFormat( const OUString& rString, // string to be analyzed
short& F_Type, // IN: old type, OUT: new type
double& fOutNumber, // OUT: number if convertible
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment