29#include <officecfg/Office/Common.hxx>
39#include <com/sun/star/i18n/XCharacterClassification.hpp>
40#include <com/sun/star/i18n/CalendarFieldIndex.hdl>
51#define EDITMASK_LITERAL 'L'
52#define EDITMASK_ALPHA 'a'
53#define EDITMASK_UPPERALPHA 'A'
54#define EDITMASK_ALPHANUM 'c'
55#define EDITMASK_UPPERALPHANUM 'C'
56#define EDITMASK_NUM 'N'
57#define EDITMASK_NUMSPACE 'n'
58#define EDITMASK_ALLCHAR 'x'
59#define EDITMASK_UPPERALLCHAR 'X'
76 memcpy( pBuf, rStr.getStr(), rStr.getLength() *
sizeof(
sal_Unicode) );
77 pBuf += rStr.getLength();
88 *pTempBuf =
static_cast<sal_Unicode>(nNumber % 10) +
'0';
111 while ( pTempBuf != aTempBuf );
134 sal_uInt16 nNumber = 0;
135 while( ( *rpBuf >=
'0' ) && ( *rpBuf <=
'9' ) )
138 nNumber += *rpBuf -
'0';
147 while( ( *rpBuf ==
',' ) || ( *rpBuf ==
'.' ) || ( *rpBuf ==
';' ) ||
148 ( *rpBuf ==
':' ) || ( *rpBuf ==
'-' ) || ( *rpBuf ==
'/' ) )
160 OUString aCharStr(cChar);
164 catch (
const css::uno::Exception&)
222 else if ( ((c1 ==
'.') || (c1 ==
',')) &&
223 ((c2 ==
'.') || (c2 ==
',')) )
230 const OString& rEditMask,
231 std::u16string_view rLiteralMask,
232 sal_uInt16 nFormatFlags )
234 if (rEditMask.isEmpty())
237 OUStringBuffer aOutStr(rLiteralMask);
242 sal_Int32 nStrIndex = 0;
246 while (
i < rEditMask.getLength() )
248 if ( nStrIndex >= rStr.getLength() )
251 cChar = rStr[nStrIndex];
252 cLiteral = rLiteralMask[
i];
253 cMask = rEditMask[
i];
267 while (
n < rEditMask.getLength() )
287 aOutStr[
i] = cTempChar;
293 if ( cLiteral == cChar )
302 while (
n < rEditMask.getLength() )
325 return aOutStr.makeStringAndClear();
329 sal_uInt16 nFormatFlags,
bool bSameMask,
330 sal_Int32 nCursorPos, sal_Int32& rPos )
334 sal_Int32 nMaxPos = rStr.size();
342 (rStr[nMaxPos-1] !=
' ') )
348 sal_Int32 nTempPos = nMaxPos;
349 while ( nTempPos < rEditMask.getLength() )
360 if ( rPos > nMaxPos )
364 if ( rPos < nCursorPos )
369 const OString& rEditMask,
370 std::u16string_view rLiteralMask,
373 OUString aText(rText);
376 if (bSameMask && !rEditMask.isEmpty())
379 sal_Int32 nMaxLen = aText.getLength();
380 while (
i < nMaxLen )
391 aText = aText.copy(
i );
398 const OString& rEditMask,
399 std::u16string_view rLiteralMask,
402 OUString aText = pEdit->
GetText();
408 if ( aNewText == aText )
413 sal_Int64 nMaxSel = std::max( aSel.
Min(), aSel.
Max() );
414 if ( nMaxSel >= aText.getLength() )
416 sal_Int32 nMaxPos = aNewText.getLength();
418 if ( aSel.
Min() == aSel.
Max() )
420 aSel.
Min() = nMaxPos;
423 else if ( aSel.
Min() > aSel.
Max() )
424 aSel.
Min() = nMaxPos;
426 aSel.
Max() = nMaxPos;
428 pEdit->
SetText( aNewText, aSel );
432 const OString& rEditMask,
433 std::u16string_view rLiteralMask,
442 if (aNewText == aText)
446 int nStartPos, nEndPos;
449 int nMaxSel = std::max(nStartPos, nEndPos);
450 if (nMaxSel >= aText.getLength())
452 sal_Int32 nMaxPos = aNewText.getLength();
454 if (nStartPos == nEndPos)
459 else if (nStartPos > nMaxPos)
471 sal_Int32 nNewPos = nCursorPos;
472 sal_Int32 nTempPos = nNewPos;
477 nNewPos = nTempPos-1;
486 sal_uInt16 nFormatFlags,
bool bSameMask,
487 sal_Int32 nCursorPos )
490 sal_Int32 nNewPos = nCursorPos;
492 for(sal_Int32 nTempPos = nNewPos+1; nTempPos < rEditMask.getLength(); ++nTempPos )
500 ImplPatternMaxPos( rStr, rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos );
506 class IEditImplementation
509 virtual ~IEditImplementation() {}
511 virtual OUString GetText()
const = 0;
512 virtual void SetText(
const OUString& rStr,
const Selection& rSelection) = 0;
515 virtual void SetSelection(
const Selection& rSelection) = 0;
517 virtual bool IsInsertMode()
const = 0;
519 virtual void SetModified() = 0;
524 const OString& rEditMask,
525 std::u16string_view rLiteralMask,
530 if ( rEditMask.isEmpty() || !bStrictFormat )
533 sal_uInt16 nFormatFlags = 0;
534 Selection aOldSel = rEdit.GetSelection();
537 sal_uInt16 nKeyCode = aCode.
GetCode();
539 sal_Int32 nCursorPos =
static_cast<sal_Int32
>(aOldSel.
Max());
549 aSel.
Min() = aOldSel.
Min();
550 rEdit.SetSelection( aSel );
559 nCursorPos = aSel.
Min();
562 aSel.
Min() = aOldSel.
Min();
565 rEdit.SetSelection( aSel );
572 while ( (nNewPos < rEditMask.getLength()) &&
577 if ( nCursorPos < nNewPos )
578 nNewPos = nCursorPos;
581 aSel.
Min() = aOldSel.
Min();
582 rEdit.SetSelection( aSel );
585 else if ( nKeyCode ==
KEY_END )
588 nNewPos = rEditMask.getLength();
596 nCursorPos =
static_cast<sal_Int32
>(aSel.
Min());
597 ImplPatternMaxPos( rEdit.GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos );
598 aSel.
Max() = nNewPos;
600 aSel.
Min() = aOldSel.
Min();
603 rEdit.SetSelection( aSel );
608 OUString aOldStr( rEdit.GetText() );
609 OUStringBuffer
aStr( aOldStr );
613 nNewPos =
static_cast<sal_Int32
>(aSel.
Min());
619 aStr.remove(
static_cast<sal_Int32
>(aSel.
Min()),
static_cast<sal_Int32
>(aSel.
Len()) );
622 std::u16string_view aRep = rLiteralMask.substr(
static_cast<sal_Int32
>(aSel.
Min()),
static_cast<sal_Int32
>(aSel.
Len()) );
623 aStr.remove( aSel.
Min(), aRep.size() );
624 aStr.insert( aSel.
Min(), aRep );
637 if ( nNewPos != nTempPos )
642 aStr.remove( nNewPos, 1 );
646 aStr[nNewPos] = rLiteralMask[nNewPos];
651 OUString sStr =
aStr.makeStringAndClear();
652 if ( aOldStr != sStr )
657 rEdit.SetText( sStr,
Selection( nNewPos ) );
659 rbInKeyInput =
false;
662 rEdit.SetSelection(
Selection( nNewPos ) );
682 nNewPos = aSel.
Min();
684 if ( nNewPos < rEditMask.getLength() )
700 while ( nTempPos < rEditMask.getLength() )
709 ImplPatternMaxPos( rEdit.GetText(), rEditMask, nFormatFlags, bSameMask, nNewPos, nTempPos );
710 if ( nTempPos > nNewPos )
712 rEdit.SetSelection(
Selection( nTempPos ) );
729 OUStringBuffer
aStr(rEdit.GetText());
731 if ( bSameMask && rEdit.IsInsertMode() )
734 sal_Int32
n =
aStr.getLength();
735 while (
n && (
n > nNewPos) )
737 if ( (
aStr[
n-1] !=
' ') &&
748 if (
aStr.getLength() < rEditMask.getLength() )
751 if (
aStr.getLength() < nNewPos )
752 aStr.append( rLiteralMask.substr(
aStr.getLength(), nNewPos-
aStr.getLength()) );
753 if ( nNewPos <
aStr.getLength() )
754 aStr.insert( cChar, nNewPos );
755 else if ( nNewPos < rEditMask.getLength() )
767 std::u16string_view aRep = rLiteralMask.substr( aSel.
Min(), aSel.
Len() );
768 aStr.remove( aSel.
Min(), aRep.size() );
769 aStr.insert( aSel.
Min(), aRep );
772 if ( nNewPos <
aStr.getLength() )
773 aStr[nNewPos] = cChar;
774 else if ( nNewPos < rEditMask.getLength() )
781 const OUString sStr =
aStr.makeStringAndClear();
783 rEdit.SetText( sStr, aNewSel );
785 rbInKeyInput =
false;
794 bool ImplSetMask(
const OString& rEditMask, OUString& rLiteralMask)
796 bool bSameMask =
true;
798 if (rEditMask.getLength() != rLiteralMask.getLength())
800 OUStringBuffer
aBuf(rLiteralMask);
801 if (rEditMask.getLength() <
aBuf.getLength())
802 aBuf.setLength(rEditMask.getLength());
805 rLiteralMask =
aBuf.makeStringAndClear();
812 while ( i < rEditMask.getLength() )
814 char cTemp = rEditMask[
i];
824 if ( i < rLiteralMask.getLength() )
826 if ( rLiteralMask[i] !=
' ' )
847PatternFormatter::PatternFormatter(
Edit* pEdit)
851 mbInPattKeyInput =
false;
854PatternFormatter::~PatternFormatter()
858void PatternFormatter::SetMask(
const OString& rEditMask,
859 const OUString& rLiteralMask )
861 m_aEditMask = rEditMask;
862 maLiteralMask = rLiteralMask;
863 mbSameMask = ImplSetMask(m_aEditMask, maLiteralMask);
869 class EntryImplementation :
public IEditImplementation
873 : m_rFormatter(rFormatter)
874 , m_rEntry(rFormatter.get_widget())
878 virtual OUString GetText()
const override
880 return m_rEntry.get_text();
883 virtual void SetText(
const OUString& rStr,
const Selection& rSelection)
override
885 m_rEntry.set_text(rStr);
886 SetSelection(rSelection);
891 int nStartPos, nEndPos;
892 m_rEntry.get_selection_bounds(nStartPos, nEndPos);
896 virtual void SetSelection(
const Selection& rSelection)
override
898 auto nMin = rSelection.
Min();
899 auto nMax = rSelection.
Max();
900 m_rEntry.select_region(nMin < 0 ? 0 : nMin, nMax == SELECTION_MAX ? -1 : nMax);
903 virtual bool IsInsertMode()
const override
905 return !m_rEntry.get_overwrite_mode();
908 virtual void SetModified()
override
910 m_rFormatter.Modify();
932 const OUString& rLiteralMask)
972 if (m_aKeyPressHdl.Call(rKEvt))
974 if (rKEvt.GetKeyCode().IsMod2())
976 EntryImplementation aAdapt(*
this);
979 m_bSameMask, m_bInPattKeyInput);
983void PatternFormatter::SetString(
const OUString& rStr )
987 GetField()->SetText( rStr );
988 MarkToBeReformatted(
false );
992OUString PatternFormatter::GetString()
const
1000void PatternFormatter::Reformat()
1004 ImplSetText(
ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, 0 ) );
1005 if ( !mbSameMask && IsStrictFormat() && !GetField()->
IsReadOnly() )
1006 GetField()->SetInsertMode(
false );
1012 , PatternFormatter(this)
1017void PatternField::dispose()
1025 class EditImplementation :
public IEditImplementation
1028 EditImplementation(
Edit& rEdit)
1033 virtual OUString GetText()
const override
1035 return m_rEdit.GetText();
1038 virtual void SetText(
const OUString& rStr,
const Selection& rSelection)
override
1040 m_rEdit.SetText(rStr, rSelection);
1045 return m_rEdit.GetSelection();
1048 virtual void SetSelection(
const Selection& rSelection)
override
1050 m_rEdit.SetSelection(rSelection);
1053 virtual bool IsInsertMode()
const override
1055 return m_rEdit.IsInsertMode();
1058 virtual void SetModified()
override
1060 m_rEdit.SetModifyFlag();
1073 EditImplementation aAdapt(*GetField());
1076 ImplIsSameMask(), ImplGetInPattKeyInput() ) )
1083bool PatternField::EventNotify(
NotifyEvent& rNEvt )
1086 MarkToBeReformatted(
false );
1089 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
1096void PatternField::Modify()
1098 if ( !ImplGetInPattKeyInput() )
1100 if ( IsStrictFormat() )
1103 MarkToBeReformatted(
true );
1111 , PatternFormatter(this)
1116void PatternBox::dispose()
1126 EditImplementation aAdapt(*GetField());
1129 ImplIsSameMask(), ImplGetInPattKeyInput() ) )
1139 MarkToBeReformatted(
false );
1142 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
1149void PatternBox::Modify()
1151 if ( !ImplGetInPattKeyInput() )
1153 if ( IsStrictFormat() )
1156 MarkToBeReformatted(
true );
1162void PatternBox::ReformatAll()
1165 SetUpdateMode(
false );
1166 const sal_Int32 nEntryCount = GetEntryCount();
1167 for ( sal_Int32 i=0;
i < nEntryCount; ++
i )
1171 InsertEntry( aStr, i );
1173 PatternFormatter::Reformat();
1174 SetUpdateMode(
true );
1181 case LongDateOrder::YDM:
1184 case LongDateOrder::YMD:
1192 while (i1 != rStr.getLength() && (rStr[i1] <
'0' || rStr[i1] >
'9')) {
1196 while (i2 != rStr.getLength() && rStr[i2] >=
'0' && rStr[i2] <=
'9') {
1200 rStr = rStr.copy(std::min(i2+1, rStr.getLength()));
1206 sal_Int32
index = 0;
1207 rStr = rStr.replaceFirst(_rLookupMonthName,
"", &
index);
1213 const sal_uInt16 nMonths = rMonths.getLength();
1214 for (sal_uInt16
i=0;
i < nMonths; ++
i)
1230 const OUString aDefaultCalendarName( rCalendarWrapper.
getUniqueID());
1231 rCalendarName = aDefaultCalendarName;
1234 const uno::Sequence< i18n::CalendarItem2 > aMonths = rCalendarWrapper.
getMonths();
1240 const uno::Sequence< i18n::CalendarItem2 > aGenitiveMonths = rCalendarWrapper.
getGenitiveMonths();
1241 if (aGenitiveMonths != aMonths)
1247 const uno::Sequence< i18n::CalendarItem2 > aPartitiveMonths = rCalendarWrapper.
getPartitiveMonths();
1248 if (aPartitiveMonths != aMonths)
1258 const uno::Sequence< i18n::Calendar2 > aCalendars = rLocaleData.
getAllCalendars();
1259 if (aCalendars.getLength() > 1)
1261 for (
const auto& rCalendar : aCalendars)
1263 if (rCalendar.Name != aDefaultCalendarName)
1265 rCalendarName = rCalendar.Name;
1271 if (rCalendar.Months != rCalendar.GenitiveMonths)
1278 if (rCalendar.Months != rCalendar.PartitiveMonths)
1285 rCalendarName = aDefaultCalendarName;
1309 ((cChar >=
'0') && (cChar <=
'9')) ||
1316 sal_uInt16 nDay = 0;
1317 sal_uInt16 nMonth = 0;
1318 sal_uInt16 nYear = 0;
1319 bool bError =
false;
1320 OUString
aStr( rStr );
1324 OUString aCalendarName;
1328 case LongDateOrder::MDY:
1333 case LongDateOrder::DMY:
1338 case LongDateOrder::YDM:
1343 case LongDateOrder::YMD:
1350 if (aCalendarName !=
"gregorian")
1354 bError = !nDay || !nMonth || !nYear;
1359 aCW.setDateTime(0.5);
1360 aCW.setValue( i18n::CalendarFieldIndex::DAY_OF_MONTH, nDay);
1361 aCW.setValue( i18n::CalendarFieldIndex::MONTH, nMonth - 1);
1362 aCW.setValue( i18n::CalendarFieldIndex::YEAR, nYear);
1363 bError = !aCW.isValid();
1366 Date aDate = aCW.getEpochStart() + aCW.getDateTime();
1379 OUString aDateSep =
ImplGetDateSep( rLocaleDataWrapper, eDateOrder );
1380 sal_Int32 nSepPos =
aStr.indexOf( aDateSep );
1383 nSepPos =
aStr.indexOf( aDateSep, nSepPos+1 );
1384 if ( ( nSepPos < 0 ) || ( nSepPos == (
aStr.getLength()-1) ) )
1393 switch ( eDateOrder )
1433 OSL_FAIL(
"DateOrder???" );
1438 if ( bError || !nDay || !nMonth )
1441 Date aNewDate( nDay, nMonth, nYear );
1442 DateFormatter::ExpandCentury( aNewDate, officecfg::Office::Common::DateFormat::TwoDigitYear::get() );
1443 if ( aNewDate.IsValidDate() )
1451void DateFormatter::ImplDateReformat(
const OUString& rStr, OUString& rOutStr )
1454 if (!TextToDate(rStr, aDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper()))
1457 Date aTempDate = aDate;
1458 if ( aTempDate > GetMax() )
1459 aTempDate = GetMax();
1460 else if ( aTempDate < GetMin() )
1461 aTempDate = GetMin();
1463 rOutStr = ImplGetDateAsText( aTempDate );
1475 case DateOrder::DMY:
1478 case DateOrder::MDY:
1493 bool bShowCentury =
false;
1503 bShowCentury =
true;
1508 bShowCentury =
false;
1512 if ( !bShowCentury )
1515 sal_uInt16 nTwoDigitYearStart = officecfg::Office::Common::DateFormat::TwoDigitYear::get();
1519 if ( (nYear < nTwoDigitYearStart) || (nYear >= nTwoDigitYearStart+100) )
1520 bShowCentury =
true;
1526 eExtFormat = ResolveSystemFormat(eExtFormat, rLocaleData);
1529 sal_uInt16 nDay = rDate.
GetDay();
1530 sal_uInt16 nMonth = rDate.
GetMonth();
1531 sal_Int16 nYear = rDate.
GetYear();
1532 sal_uInt16 nYearLen = bShowCentury ? 4 : 2;
1534 if ( !bShowCentury )
1549 pFormatter->
ChangeIntl( aFormatterLang.getLanguageType(
false));
1586 OSL_FAIL(
"DateOrder???" );
1590 return OUString(aBuf, pBuf-aBuf);
1593OUString DateFormatter::ImplGetDateAsText(
const Date& rDate )
const
1595 return DateFormatter::FormatDate(rDate, GetExtDateFormat(), ImplGetLocaleDataWrapper(), maStaticFormatter);
1600 DateFormatter::ExpandCentury( rDate );
1601 rDate.
AddDays( bUp ? 1 : -1 );
1606 DateFormatter::ExpandCentury( rDate );
1612 DateFormatter::ExpandCentury( rDate );
1616bool DateFormatter::ImplAllowMalformedInput()
const
1618 return !IsEnforceValidValue();
1637 nPos = rText.find( aDateSep, nPos );
1638 if (nPos == std::u16string_view::npos ||
static_cast<sal_Int32
>(nPos) >= nCursor)
1657 Date aDate( GetDate() );
1658 Selection aSelection = GetField()->GetSelection();
1661 if (
static_cast<sal_Int32
>(aSelection.
Len()) == aText.getLength() )
1666 sal_Int8 nDateArea = GetDateArea(eFormat, aText, aSelection.
Max(), ImplGetLocaleDataWrapper());
1709 OSL_FAIL(
"invalid conversion" );
1714 ImplNewFieldValue( aDate );
1717DateFormatter::DateFormatter(
Edit* pEdit)
1722 , maMax(31, 12, 2200)
1723 , mbLongFormat(false)
1724 , mbShowDateCentury(true)
1726 , mbEnforceValidValue(true)
1730DateFormatter::~DateFormatter()
1736 if (!mxCalendarWrapper)
1739 mxCalendarWrapper->loadDefaultCalendar( GetLocale() );
1742 return *mxCalendarWrapper;
1747 mnExtDateFormat = eFormat;
1755 if (bResolveSystemFormat)
1756 eDateFormat = ResolveSystemFormat(eDateFormat, ImplGetLocaleDataWrapper());
1761void DateFormatter::ReformatAll()
1766void DateFormatter::SetMin(
const Date& rNewMin )
1769 if ( !IsEmptyFieldValue() )
1773void DateFormatter::SetMax(
const Date& rNewMax )
1776 if ( !IsEmptyFieldValue() )
1780void DateFormatter::SetLongFormat(
bool bLong )
1782 mbLongFormat = bLong;
1803 if (bShowDateCentury)
1805 switch (eExtDateFormat)
1824 switch (eExtDateFormat)
1842 return eExtDateFormat;
1846void DateFormatter::SetShowDateCentury(
bool bShowDateCentury )
1848 mbShowDateCentury = bShowDateCentury;
1850 SetExtDateFormat(ChangeDateCentury(GetExtDateFormat(), bShowDateCentury));
1855void DateFormatter::SetDate(
const Date& rNewDate )
1857 ImplSetUserDate( rNewDate );
1858 maFieldDate = maLastDate;
1859 maLastDate = GetDate();
1862void DateFormatter::ImplSetUserDate(
const Date& rNewDate,
Selection const * pNewSelection )
1864 Date aNewDate = rNewDate;
1865 if ( aNewDate > maMax )
1867 else if ( aNewDate < maMin )
1869 maLastDate = aNewDate;
1872 ImplSetText( ImplGetDateAsText( aNewDate ), pNewSelection );
1875void DateFormatter::ImplNewFieldValue(
const Date& rDate )
1880 Selection aSelection = GetField()->GetSelection();
1882 OUString aText = GetField()->GetText();
1885 if (
static_cast<sal_Int32
>(aSelection.
Max()) == aText.getLength() )
1887 if ( !aSelection.
Len() )
1892 Date aOldLastDate = maLastDate;
1893 ImplSetUserDate( rDate, &aSelection );
1894 maLastDate = aOldLastDate;
1897 if ( GetField()->GetText() != aText )
1899 GetField()->SetModifyFlag();
1900 GetField()->Modify();
1910 if (TextToDate(GetField()->GetText(), aDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper()))
1912 if ( aDate > maMax )
1914 else if ( aDate < maMin )
1922 if ( !ImplAllowMalformedInput() )
1924 if ( maLastDate.GetDate() )
1926 else if ( !IsEmptyFieldValueEnabled() )
1937void DateFormatter::SetEmptyDate()
1942bool DateFormatter::IsEmptyDate()
const
1946 if ( GetField() && MustBeReformatted() && IsEmptyFieldValueEnabled() )
1948 if ( GetField()->GetText().isEmpty() )
1952 else if ( !maLastDate.GetDate() )
1955 bEmpty = !TextToDate(GetField()->GetText(), aDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper());
1961void DateFormatter::Reformat()
1966 if ( GetField()->GetText().isEmpty() && ImplGetEmptyFieldValue() )
1970 ImplDateReformat( GetField()->GetText(), aStr );
1972 if ( !
aStr.isEmpty() )
1974 ImplSetText( aStr );
1975 (void)TextToDate(aStr, maLastDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper());
1979 if ( maLastDate.GetDate() )
1980 SetDate( maLastDate );
1981 else if ( !IsEmptyFieldValueEnabled() )
1985 ImplSetText( OUString() );
1986 SetEmptyFieldValueData(
true );
1991void DateFormatter::ExpandCentury(
Date& rDate )
1993 ExpandCentury(rDate, officecfg::Office::Common::DateFormat::TwoDigitYear::get());
1996void DateFormatter::ExpandCentury(
Date& rDate, sal_uInt16 nTwoDigitYearStart )
1998 sal_Int16 nDateYear = rDate.
GetYear();
1999 if ( 0 <= nDateYear && nDateYear < 100 )
2001 sal_uInt16 nCentury = nTwoDigitYearStart / 100;
2002 if ( nDateYear < (nTwoDigitYearStart % 100) )
2004 rDate.
SetYear( nDateYear + (nCentury*100) );
2010 DateFormatter(this),
2011 maFirst( GetMin() ),
2014 SetText( ImplGetLocaleDataWrapper().getDate( ImplGetFieldDate() ) );
2041 MarkToBeReformatted(
false );
2044 if ( MustBeReformatted() )
2049 bool bTextLen = !
GetText().isEmpty();
2050 if ( bTextLen || !IsEmptyFieldValueEnabled() )
2052 if ( !ImplAllowMalformedInput() )
2056 Date aDate( 0, 0, 0 );
2057 if (TextToDate(
GetText(), aDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper()))
2066 SetEmptyFieldValueData(
true );
2081 ImplResetLocaleDataWrapper();
2088 MarkToBeReformatted(
true );
2112 ImplNewFieldValue(
maLast );
2118 , DateFormatter(this)
2120 SetText( ImplGetLocaleDataWrapper().getDate( ImplGetFieldDate() ) );
2124void DateBox::dispose()
2149 ImplResetLocaleDataWrapper();
2157 MarkToBeReformatted(
false );
2160 if ( MustBeReformatted() )
2162 bool bTextLen = !GetText().isEmpty();
2163 if ( bTextLen || !IsEmptyFieldValueEnabled() )
2168 SetEmptyFieldValueData(
true );
2176void DateBox::Modify()
2178 MarkToBeReformatted(
true );
2182void DateBox::ReformatAll()
2185 SetUpdateMode(
false );
2186 const sal_Int32 nEntryCount = GetEntryCount();
2187 for ( sal_Int32 i=0;
i < nEntryCount; ++
i )
2189 ImplDateReformat( GetEntry( i ), aStr );
2191 InsertEntry( aStr, i );
2193 DateFormatter::Reformat();
2194 SetUpdateMode(
true );
2252 ImplSetTextImpl(sText,
nullptr);
2261 bool bRet = ::DateFormatter::TextToDate(GetEntryText(), aResult, ResolveSystemFormat(m_eFormat, rLocaleDataWrapper),
2262 rLocaleDataWrapper, GetCalendarWrapper());
2271 bool bStrictFormat,
bool bDuration,
2277 if ( !bStrictFormat )
2284 ((cChar >=
'0') && (cChar <=
'9')) ||
2285 rLocaleDataWrapper.
getTimeSep() == OUStringChar(cChar) ||
2286 (rLocaleDataWrapper.
getTimeAM().indexOf(cChar) != -1) ||
2287 (rLocaleDataWrapper.
getTimePM().indexOf(cChar) != -1) ||
2289 (cChar ==
'a') || (cChar ==
'A') || (cChar ==
'm') || (cChar ==
'M') || (cChar ==
'p') || (cChar ==
'P') ||
2291 (bDuration && (cChar ==
'-')) )
2301 for ( sal_Int32
i = 0;
i < _rStr.getLength(); ++
i, ++_pChr )
2303 if ( *_pChr < '0' || *_pChr >
'9' )
2311 if ( !_bSkipInvalidCharacters )
2313 if ( ( _rStr.getLength() > 2 ) || _rStr.isEmpty() || !
ImplIsOnlyDigits( _rStr ) )
2319static bool ImplCutTimePortion( OUStringBuffer& _rStr, sal_Int32 _nSepPos,
bool _bSkipInvalidCharacters,
short* _pPortion )
2321 OUString sPortion(_rStr.subView(0, _nSepPos));
2323 if (_nSepPos < _rStr.getLength())
2324 _rStr.remove(0, _nSepPos + 1);
2330 *_pPortion =
static_cast<short>(sPortion.toInt32());
2334bool TimeFormatter::TextToTime(std::u16string_view rStr,
tools::Time& rTime,
2336 bool bDuration,
const LocaleDataWrapper& rLocaleDataWrapper,
bool _bSkipInvalidCharacters)
2338 OUStringBuffer
aStr(rStr);
2342 sal_Int64 nNanoSec = 0;
2349 if (!rLocaleDataWrapper.
getTimeSep().isEmpty())
2351 OUStringBuffer aSepStr(
",.;:/");
2353 aSepStr.append(
'-');
2356 for (sal_Int32 i = 0;
i < aSepStr.getLength(); ++
i)
2358 if (rLocaleDataWrapper.
getTimeSep() == OUStringChar(aSepStr[i]))
2360 for ( sal_Int32 j = 0; j <
aStr.getLength(); j++ )
2362 if (aStr[j] == aSepStr[i])
2368 bool bNegative =
false;
2369 sal_Int32 nSepPos =
aStr.indexOf( rLocaleDataWrapper.
getTimeSep() );
2370 if ( aStr[0] ==
'-' )
2375 nSepPos =
aStr.getLength();
2380 if ( !
aStr.isEmpty() && aStr[0] ==
'-' )
2388 if ( !
aStr.isEmpty() && aStr[0] ==
'-' )
2394 if ( !
aStr.isEmpty() && aStr[0] ==
'-' )
2404 else if ( nSepPos < 0 )
2407 nMinute += nSecond / 60;
2409 nHour += nMinute / 60;
2415 aStr.remove( 0, nSepPos+1 );
2418 if ( !
aStr.isEmpty() &&
aStr[0] ==
'-' )
2424 aStr.remove( 0, nSepPos+1 );
2427 if ( !
aStr.isEmpty() &&
aStr[0] ==
'-' )
2434 aStr.remove( 0, nSepPos+1 );
2438 nHour += nMinute / 60;
2444 nMinute += nSecond / 60;
2446 nHour += nMinute / 60;
2454 assert(
aStr.getLength() >= 1);
2458 while (
aStr.getLength() > nLen && aStr[nLen] >=
'0' && aStr[nLen] <=
'9' )
2469 nNanoSec = (nNanoSec + 5) / 10;
2474 assert(nNanoSec > -1000000000 && nNanoSec < 1000000000);
2475 if ( (nMinute > 59) || (nSecond > 59) || (nNanoSec > 1000000000) )
2479 nSecond = nNanoSec = 0;
2485 if ( bNegative || (nHour < 0) || (nMinute < 0) ||
2486 (nSecond < 0) || (nNanoSec < 0) )
2489 OUString aUpperCaseStr =
aStr.toString().toAsciiUpperCase();
2490 OUString aAMlocalised(rLocaleDataWrapper.
getTimeAM().toAsciiUpperCase());
2491 OUString aPMlocalised(rLocaleDataWrapper.
getTimePM().toAsciiUpperCase());
2493 if ( (nHour < 12) && ( ( aUpperCaseStr.indexOf(
"PM" ) >= 0 ) || ( aUpperCaseStr.indexOf( aPMlocalised ) >= 0 ) ) )
2496 if ( (nHour == 12) && ( ( aUpperCaseStr.indexOf(
"AM" ) >= 0 ) || ( aUpperCaseStr.indexOf( aAMlocalised ) >= 0 ) ) )
2499 aTime =
tools::Time(
static_cast<sal_uInt16
>(nHour),
static_cast<sal_uInt16
>(nMinute),
static_cast<sal_uInt16
>(nSecond),
2500 static_cast<sal_uInt32
>(nNanoSec) );
2504 assert( !bNegative || (nHour < 0) || (nMinute < 0) ||
2505 (nSecond < 0) || (nNanoSec < 0) );
2506 if ( bNegative || (nHour < 0) || (nMinute < 0) ||
2507 (nSecond < 0) || (nNanoSec < 0) )
2511 nHour = nHour < 0 ? -nHour : nHour;
2512 nMinute = nMinute < 0 ? -nMinute : nMinute;
2513 nSecond = nSecond < 0 ? -nSecond : nSecond;
2514 nNanoSec = nNanoSec < 0 ? -nNanoSec : nNanoSec;
2517 aTime =
tools::Time(
static_cast<sal_uInt16
>(nHour),
static_cast<sal_uInt16
>(nMinute),
static_cast<sal_uInt16
>(nSecond),
2518 static_cast<sal_uInt32
>(nNanoSec) );
2528void TimeFormatter::ImplTimeReformat( std::u16string_view rStr, OUString& rOutStr )
2531 if ( !TextToTime( rStr, aTime,
GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() ) )
2535 if ( aTempTime > GetMax() )
2536 aTempTime = GetMax() ;
2537 else if ( aTempTime < GetMin() )
2538 aTempTime = GetMin();
2540 bool bSecond =
false;
2541 bool b100Sec =
false;
2548 n += aTempTime.
GetMin() * 60L;
2550 rOutStr = OUString::number( n );
2551 rOutStr += ImplGetLocaleDataWrapper().getTime100SecSep();
2552 std::ostringstream ostr;
2556 rOutStr += OUString::createFromAscii(ostr.str());
2558 else if ( mbDuration )
2559 rOutStr = ImplGetLocaleDataWrapper().getDuration( aTempTime, bSecond, b100Sec );
2562 rOutStr = ImplGetLocaleDataWrapper().getTime( aTempTime, bSecond, b100Sec );
2565 if ( aTempTime.
GetHour() > 12 )
2568 aT.SetHour( aT.GetHour() % 12 );
2569 rOutStr = ImplGetLocaleDataWrapper().getTime( aT, bSecond, b100Sec );
2572 if ( aTempTime.
GetHour() < 12 )
2580bool TimeFormatter::ImplAllowMalformedInput()
const
2582 return !IsEnforceValidValue();
2585int TimeFormatter::GetTimeArea(
TimeFieldFormat eFormat, std::u16string_view rText,
int nCursor,
2594 for (
size_t i = 1, nPos = 0;
i <= 4;
i++ )
2596 size_t nPos1 = rText.find(rLocaleDataWrapper.
getTimeSep(), nPos);
2599 if (nPos1 != std::u16string_view::npos && nPos2 != std::u16string_view::npos)
2600 nPos = std::min(nPos1, nPos2);
2601 else if (nPos1 != std::u16string_view::npos)
2605 if (nPos == std::u16string_view::npos ||
static_cast<sal_Int32
>(nPos) >= nCursor)
2617 if (nPos == std::u16string_view::npos ||
static_cast<sal_Int32
>(nPos) >= nCursor)
2627 bool bDuration, std::u16string_view rText,
int nCursor,
2632 int nTimeArea = GetTimeArea(eFormat, rText, nCursor, rLocaleDataWrapper);
2637 if ( nTimeArea == 1 )
2639 else if ( nTimeArea == 2 )
2641 else if ( nTimeArea == 3 )
2643 else if ( nTimeArea == 4 )
2647 aAddTime = -aAddTime;
2653 if ( aTime > aAbsMaxTime )
2654 aTime = aAbsMaxTime;
2656 if ( aTime < aAbsMinTime )
2657 aTime = aAbsMinTime;
2664void TimeField::ImplTimeSpinArea(
bool bUp )
2669 OUString aText( GetText() );
2672 aTime = TimeFormatter::SpinTime(bUp, aTime,
GetFormat(), IsDuration(), aText, aSelection.
Max(), ImplGetLocaleDataWrapper());
2674 ImplNewFieldValue( aTime );
2678TimeFormatter::TimeFormatter(
Edit* pEdit)
2682 , maMax(23, 59, 59, 999999999)
2686 , mbEnforceValidValue(true)
2691TimeFormatter::~TimeFormatter()
2695void TimeFormatter::ReformatAll()
2703 if ( !IsEmptyFieldValue() )
2710 if ( !IsEmptyFieldValue() )
2714void TimeFormatter::SetTimeFormat(
TimeFormat eNewFormat )
2716 mnTimeFormat = eNewFormat;
2722 meFormat = eNewFormat;
2726void TimeFormatter::SetDuration(
bool bNewDuration )
2728 mbDuration = bNewDuration;
2734 SetUserTime( rNewTime );
2735 maFieldTime = maLastTime;
2736 SetEmptyFieldValueData(
false );
2739void TimeFormatter::ImplNewFieldValue(
const tools::Time& rTime )
2744 Selection aSelection = GetField()->GetSelection();
2746 OUString aText = GetField()->GetText();
2749 if (
static_cast<sal_Int32
>(aSelection.
Max()) == aText.getLength() )
2751 if ( !aSelection.
Len() )
2757 ImplSetUserTime( rTime, &aSelection );
2758 maLastTime = aOldLastTime;
2761 if ( GetField()->GetText() != aText )
2763 GetField()->SetModifyFlag();
2764 GetField()->Modify();
2772 bool b100Sec =
false;
2783 std::ostringstream ostr;
2787 aStr += OUString::createFromAscii(ostr.str());
2789 else if ( bDuration )
2795 aStr = rLocaleData.
getTime( rNewTime, bSec, b100Sec );
2798 if ( rNewTime.
GetHour() > 12 )
2801 aT.SetHour( aT.GetHour() % 12 );
2805 if ( rNewTime.
GetHour() < 12 )
2815void TimeFormatter::ImplSetUserTime(
const tools::Time& rNewTime,
Selection const * pNewSelection )
2818 if ( aNewTime > GetMax() )
2819 aNewTime = GetMax();
2820 else if ( aNewTime < GetMin() )
2821 aNewTime = GetMin();
2822 maLastTime = aNewTime;
2826 OUString
aStr = TimeFormatter::FormatTime(aNewTime, meFormat, GetTimeFormat(), mbDuration, ImplGetLocaleDataWrapper());
2827 ImplSetText( aStr, pNewSelection );
2831void TimeFormatter::SetUserTime(
const tools::Time& rNewTime )
2833 ImplSetUserTime( rNewTime );
2842 bool bAllowMalformed = ImplAllowMalformedInput();
2843 if ( TextToTime( GetField()->GetText(), aTime,
GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMalformed ) )
2845 if ( aTime > GetMax() )
2847 else if ( aTime < GetMin() )
2852 if ( bAllowMalformed )
2862void TimeFormatter::Reformat()
2867 if ( GetField()->GetText().isEmpty() && ImplGetEmptyFieldValue() )
2871 ImplTimeReformat( GetField()->GetText(), aStr );
2873 if ( !
aStr.isEmpty() )
2875 ImplSetText( aStr );
2876 (void)TextToTime(aStr, maLastTime,
GetFormat(), IsDuration(), ImplGetLocaleDataWrapper());
2879 SetTime( maLastTime );
2884 TimeFormatter(this),
2885 maFirst( GetMin() ),
2888 SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime,
false ) );
2892void TimeField::dispose()
2912 MarkToBeReformatted(
false );
2915 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
2917 if ( !ImplAllowMalformedInput() )
2922 if ( TextToTime( GetText(), aTime,
GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(),
false ) )
2939 ImplResetLocaleDataWrapper();
2944void TimeField::Modify()
2946 MarkToBeReformatted(
true );
2952 ImplTimeSpinArea(
true );
2956void TimeField::Down()
2958 ImplTimeSpinArea(
false );
2962void TimeField::First()
2964 ImplNewFieldValue( maFirst );
2968void TimeField::Last()
2970 ImplNewFieldValue( maLast );
2981 SetDuration(
false );
2988 SetDuration(
false );
2995 SetDuration(
false );
3002 SetDuration(
false );
3008 SetDuration(
true );
3014 SetDuration(
true );
3018 default: OSL_FAIL(
"ExtTimeFieldFormat unknown!" );
3021 if ( GetField() && !GetField()->GetText().isEmpty() )
3028 , TimeFormatter(this)
3030 SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime,
false ) );
3034void TimeBox::dispose()
3054 MarkToBeReformatted(
false );
3057 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
3070 ImplResetLocaleDataWrapper();
3075void TimeBox::Modify()
3077 MarkToBeReformatted(
true );
3081void TimeBox::ReformatAll()
3084 SetUpdateMode(
false );
3085 const sal_Int32 nEntryCount = GetEntryCount();
3086 for ( sal_Int32 i=0;
i < nEntryCount; ++
i )
3088 ImplTimeReformat( GetEntry( i ), aStr );
3090 InsertEntry( aStr, i );
3092 TimeFormatter::Reformat();
3093 SetUpdateMode(
true );
3146 ImplSetTextImpl(sText,
nullptr);
3155 bool bRet = ::TimeFormatter::TextToTime(GetEntryText(), aResult, m_eFormat, m_bDuration, rLocaleDataWrapper);
3164 int nStartPos, nEndPos;
3165 rEntry.get_selection_bounds(nStartPos, nEndPos);
3168 const int nTimeArea = ::TimeFormatter::GetTimeArea(m_eFormat, GetEntryText(), nEndPos, rLocaleData);
3170 int nIncrements = 1;
3173 nIncrements = 1000 * 60 * 60;
3174 else if (nTimeArea == 2)
3175 nIncrements = 1000 * 60;
3176 else if (nTimeArea == 3)
3179 SetSpinSize(nIncrements);
const LocaleDataWrapper & GetLocaleDataWrapper() const
static const AllSettings & GetSettings()
Gets the application's settings.
css::uno::Sequence< css::i18n::CalendarItem2 > getGenitiveMonths() const
css::uno::Sequence< css::i18n::CalendarItem2 > getMonths() const
OUString getUniqueID() const
css::uno::Sequence< css::i18n::CalendarItem2 > getPartitiveMonths() const
static bool isLetterNumericType(sal_Int32 nType)
static bool isLetterType(sal_Int32 nType)
static bool isNumericType(sal_Int32 nType)
A widget used to choose from a list of items and which has an entry.
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void Modify() override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
virtual bool EventNotify(NotifyEvent &rNEvt) override
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
virtual bool EventNotify(NotifyEvent &rNEvt) override
virtual void Up() override
virtual void First() override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
virtual void Last() override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void Modify() override
virtual bool PreNotify(NotifyEvent &rNEvt) override
void ImplDateSpinArea(bool bUp)
virtual void Down() override
DateField(vcl::Window *pParent, WinBits nWinStyle)
sal_Int32 GetDate() const
void AddDays(sal_Int32 nAddDays)
sal_Int16 GetYear() const
sal_uInt16 GetDay() const
void AddYears(sal_Int16 nAddYears)
sal_uInt16 GetYearUnsigned() const
void SetYear(sal_Int16 nNewYear)
void AddMonths(sal_Int32 nAddMonths)
sal_uInt16 GetMonth() const
virtual void SetText(const OUString &rStr) override
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual const Selection & GetSelection() const
virtual OUString GetText() const override
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
LanguageType getLanguageType(bool bResolveSystem=true) const
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
css::uno::Sequence< css::i18n::Calendar2 > getAllCalendars() const
const OUString & getDateSep() const
const OUString & getTime100SecSep() const
const OUString & getTimeSep() const
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
const OUString & getTimeAM() const
LanguageTag getLoadedLanguageTag() const
OUString getDuration(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
DateOrder getDateOrder() const
const OUString & getTimePM() const
OUString getTime(const tools::Time &rTime, bool bSec=true, bool b100Sec=false) const
LongDateOrder getLongDateOrder() const
const LanguageTag & getLanguageTag() const
const KeyEvent * GetKeyEvent() const
NotifyEventType GetType() const
virtual bool EventNotify(NotifyEvent &rNEvt) override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
sal_uInt16 GetGroup() const
sal_uInt16 GetCode() const
virtual SAL_DLLPRIVATE void SetMinValue(double dMin) override
virtual SAL_DLLPRIVATE void SetMaxValue(double dMin) override
virtual SAL_DLLPRIVATE OUString GetEntryText() const override
virtual bool get_editable() const =0
virtual void select_region(int nStartPos, int nEndPos)=0
virtual void set_text(const OUString &rText)=0
virtual bool get_selection_bounds(int &rStartPos, int &rEndPos)=0
virtual void set_overwrite_mode(bool bOn)=0
virtual OUString get_text() const =0
#define DBG_UNHANDLED_EXCEPTION(...)
virtual void SetText(const OUString &rStr) override
virtual SotClipboardFormatId GetFormat(const TransferableDataHelper &aHelper) override
static OUString ImplGetDateSep(const LocaleDataWrapper &rLocaleDataWrapper, ExtDateFieldFormat eFormat)
static bool ImplDateProcessKeyInput(const KeyEvent &rKEvt, ExtDateFieldFormat eFormat, const LocaleDataWrapper &rLocaleDataWrapper)
#define EDITMASK_UPPERALLCHAR
static bool ImplCutMonthName(OUString &rStr, std::u16string_view _rLookupMonthName)
#define EDITMASK_NUMSPACE
#define EDITMASK_UPPERALPHA
static sal_Unicode * ImplAddString(sal_Unicode *pBuf, const OUString &rStr)
static sal_Unicode * ImplAddSNum(sal_Unicode *pBuf, sal_Int32 nNumber, int nMinLen)
static bool ImplCommaPointCharEqual(sal_Unicode c1, sal_Unicode c2)
static sal_Unicode ImplPatternChar(sal_Unicode cChar, char cEditMask)
static bool ImplTimeProcessKeyInput(const KeyEvent &rKEvt, bool bStrictFormat, bool bDuration, TimeFieldFormat eFormat, const LocaleDataWrapper &rLocaleDataWrapper)
static sal_Unicode * ImplAddNum(sal_Unicode *pBuf, sal_uLong nNumber, int nMinLen)
static void ImplPatternMaxPos(std::u16string_view rStr, const OString &rEditMask, sal_uInt16 nFormatFlags, bool bSameMask, sal_Int32 nCursorPos, sal_Int32 &rPos)
static sal_uInt16 ImplCutMonthFromString(OUString &rStr, OUString &rCalendarName, const LocaleDataWrapper &rLocaleData, const CalendarWrapper &rCalendarWrapper)
static OUString ImplPatternProcessStrictModify(const OUString &rText, const OString &rEditMask, std::u16string_view rLiteralMask, bool bSameMask)
#define EDITMASK_UPPERALPHANUM
static bool ImplPatternProcessKeyInput(IEditImplementation &rEdit, const KeyEvent &rKEvt, const OString &rEditMask, std::u16string_view rLiteralMask, bool bStrictFormat, bool bSameMask, bool &rbInKeyInput)
static bool ImplIsOnlyDigits(const OUString &_rStr)
static bool ImplIsValidTimePortion(bool _bSkipInvalidCharacters, const OUString &_rStr)
static sal_uInt16 ImplCutNumberFromString(OUString &rStr)
#define EDITMASK_ALPHANUM
static void ImplSkipDelimiters(const sal_Unicode *&rpBuf)
static sal_uInt16 ImplGetNum(const sal_Unicode *&rpBuf, bool &rbError)
static ExtDateFieldFormat ImplGetExtFormat(LongDateOrder eOld)
static bool ImplCutTimePortion(OUStringBuffer &_rStr, sal_Int32 _nSepPos, bool _bSkipInvalidCharacters, short *_pPortion)
static sal_Int32 ImplPatternRightPos(std::u16string_view rStr, const OString &rEditMask, sal_uInt16 nFormatFlags, bool bSameMask, sal_Int32 nCursorPos)
static void ImplDateIncrementMonth(Date &rDate, bool bUp)
static sal_Int32 ImplPatternLeftPos(std::string_view rEditMask, sal_Int32 nCursorPos)
static bool ImplIsPatternChar(sal_Unicode cChar, char cEditMask)
static void ImplDateIncrementYear(Date &rDate, bool bUp)
static void ImplDateIncrementDay(Date &rDate, bool bUp)
static sal_uInt16 ImplGetMonthFromCalendarItem(OUString &rStr, const uno::Sequence< i18n::CalendarItem2 > &rMonths)
uno::Reference< i18n::XCharacterClassification > const & ImplGetCharClass()
static OUString ImplPatternReformat(const OUString &rStr, const OString &rEditMask, std::u16string_view rLiteralMask, sal_uInt16 nFormatFlags)
#define PATTERN_FORMAT_EMPTYLITERALS
constexpr OUStringLiteral IsReadOnly(u"IsReadOnly")
OUString FormatNumber(sal_uInt32 nNum, SvxNumType nFormat, LanguageType nLang=LANGUAGE_NONE)
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEYGROUP_MISC
constexpr sal_uInt16 KEYGROUP_FKEYS
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_INSERT
constexpr sal_uInt16 KEY_BACKSPACE
constexpr sal_uInt16 KEY_END
constexpr sal_uInt16 KEYGROUP_CURSOR
const LanguageTag & getLocale()
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
Reference< XComponentContext > getProcessComponentContext()
sal_Int32 toInt32(std::u16string_view str, sal_Int16 radix=10)
sal_Int64 toInt64(std::u16string_view str, sal_Int16 radix=10)
Any GetTime(const OUString &val)
css::uno::Reference< css::i18n::XCharacterClassification > CreateCharacterClassification()
sal_Int64 ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
IMPL_LINK_NOARG(HexColorControl, OnAsyncModifyHdl, void *, void)
IMPL_LINK(CustomWeld, DoResize, const Size &, rSize, void)
css::uno::Reference< css::i18n::XCharacterClassification > m_xCharClass
ImplSVData * ImplGetSVData()
void GetSelection(struct ESelection &rSel, SvxTextForwarder const *pForwarder) noexcept
@ Short24H
the first 4 of these are only used by base/dbaccess