29#include <officecfg/Office/Common.hxx>
39#include <com/sun/star/i18n/XCharacterClassification.hpp>
40#include <com/sun/star/i18n/CalendarFieldIndex.hdl>
52#define EDITMASK_LITERAL 'L'
53#define EDITMASK_ALPHA 'a'
54#define EDITMASK_UPPERALPHA 'A'
55#define EDITMASK_ALPHANUM 'c'
56#define EDITMASK_UPPERALPHANUM 'C'
57#define EDITMASK_NUM 'N'
58#define EDITMASK_NUMSPACE 'n'
59#define EDITMASK_ALLCHAR 'x'
60#define EDITMASK_UPPERALLCHAR 'X'
77 memcpy( pBuf, rStr.getStr(), rStr.getLength() *
sizeof(
sal_Unicode) );
78 pBuf += rStr.getLength();
89 *pTempBuf =
static_cast<sal_Unicode>(nNumber % 10) +
'0';
112 while ( pTempBuf != aTempBuf );
135 sal_uInt16 nNumber = 0;
136 while( ( *rpBuf >=
'0' ) && ( *rpBuf <=
'9' ) )
139 nNumber += *rpBuf -
'0';
148 while( ( *rpBuf ==
',' ) || ( *rpBuf ==
'.' ) || ( *rpBuf ==
';' ) ||
149 ( *rpBuf ==
':' ) || ( *rpBuf ==
'-' ) || ( *rpBuf ==
'/' ) )
161 OUString aCharStr(cChar);
165 catch (
const css::uno::Exception&)
223 else if ( ((c1 ==
'.') || (c1 ==
',')) &&
224 ((c2 ==
'.') || (c2 ==
',')) )
231 const OString& rEditMask,
232 std::u16string_view rLiteralMask,
233 sal_uInt16 nFormatFlags )
235 if (rEditMask.isEmpty())
238 OUStringBuffer aOutStr(rLiteralMask);
243 sal_Int32 nStrIndex = 0;
247 while (
i < rEditMask.getLength() )
249 if ( nStrIndex >= rStr.getLength() )
252 cChar = rStr[nStrIndex];
253 cLiteral = rLiteralMask[
i];
254 cMask = rEditMask[
i];
268 while (
n < rEditMask.getLength() )
288 aOutStr[
i] = cTempChar;
294 if ( cLiteral == cChar )
303 while (
n < rEditMask.getLength() )
326 return aOutStr.makeStringAndClear();
330 sal_uInt16 nFormatFlags,
bool bSameMask,
331 sal_Int32 nCursorPos, sal_Int32& rPos )
335 sal_Int32 nMaxPos = rStr.size();
343 (rStr[nMaxPos-1] !=
' ') )
349 sal_Int32 nTempPos = nMaxPos;
350 while ( nTempPos < rEditMask.getLength() )
361 if ( rPos > nMaxPos )
365 if ( rPos < nCursorPos )
370 const OString& rEditMask,
371 std::u16string_view rLiteralMask,
374 OUString aText(rText);
377 if (bSameMask && !rEditMask.isEmpty())
380 sal_Int32 nMaxLen = aText.getLength();
381 while (
i < nMaxLen )
392 aText = aText.copy(
i );
399 const OString& rEditMask,
400 std::u16string_view rLiteralMask,
403 OUString aText = pEdit->
GetText();
409 if ( aNewText == aText )
414 sal_Int64 nMaxSel = std::max( aSel.
Min(), aSel.
Max() );
415 if ( nMaxSel >= aText.getLength() )
417 sal_Int32 nMaxPos = aNewText.getLength();
419 if ( aSel.
Min() == aSel.
Max() )
421 aSel.
Min() = nMaxPos;
424 else if ( aSel.
Min() > aSel.
Max() )
425 aSel.
Min() = nMaxPos;
427 aSel.
Max() = nMaxPos;
429 pEdit->
SetText( aNewText, aSel );
433 const OString& rEditMask,
434 std::u16string_view rLiteralMask,
443 if (aNewText == aText)
447 int nStartPos, nEndPos;
450 int nMaxSel = std::max(nStartPos, nEndPos);
451 if (nMaxSel >= aText.getLength())
453 sal_Int32 nMaxPos = aNewText.getLength();
455 if (nStartPos == nEndPos)
460 else if (nStartPos > nMaxPos)
472 sal_Int32 nNewPos = nCursorPos;
473 sal_Int32 nTempPos = nNewPos;
478 nNewPos = nTempPos-1;
487 sal_uInt16 nFormatFlags,
bool bSameMask,
488 sal_Int32 nCursorPos )
491 sal_Int32 nNewPos = nCursorPos;
493 for(sal_Int32 nTempPos = nNewPos+1; nTempPos < rEditMask.getLength(); ++nTempPos )
501 ImplPatternMaxPos( rStr, rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos );
507 class IEditImplementation
510 virtual ~IEditImplementation() {}
512 virtual OUString GetText()
const = 0;
513 virtual void SetText(
const OUString& rStr,
const Selection& rSelection) = 0;
516 virtual void SetSelection(
const Selection& rSelection) = 0;
518 virtual bool IsInsertMode()
const = 0;
520 virtual void SetModified() = 0;
525 const OString& rEditMask,
526 std::u16string_view rLiteralMask,
531 if ( rEditMask.isEmpty() || !bStrictFormat )
534 sal_uInt16 nFormatFlags = 0;
535 Selection aOldSel = rEdit.GetSelection();
538 sal_uInt16 nKeyCode = aCode.
GetCode();
540 sal_Int32 nCursorPos =
static_cast<sal_Int32
>(aOldSel.
Max());
550 aSel.
Min() = aOldSel.
Min();
551 rEdit.SetSelection( aSel );
560 nCursorPos = aSel.
Min();
563 aSel.
Min() = aOldSel.
Min();
566 rEdit.SetSelection( aSel );
573 while ( (nNewPos < rEditMask.getLength()) &&
578 if ( nCursorPos < nNewPos )
579 nNewPos = nCursorPos;
582 aSel.
Min() = aOldSel.
Min();
583 rEdit.SetSelection( aSel );
586 else if ( nKeyCode ==
KEY_END )
589 nNewPos = rEditMask.getLength();
597 nCursorPos =
static_cast<sal_Int32
>(aSel.
Min());
598 ImplPatternMaxPos( rEdit.GetText(), rEditMask, nFormatFlags, bSameMask, nCursorPos, nNewPos );
599 aSel.
Max() = nNewPos;
601 aSel.
Min() = aOldSel.
Min();
604 rEdit.SetSelection( aSel );
609 OUString aOldStr( rEdit.GetText() );
610 OUStringBuffer
aStr( aOldStr );
614 nNewPos =
static_cast<sal_Int32
>(aSel.
Min());
620 aStr.remove(
static_cast<sal_Int32
>(aSel.
Min()),
static_cast<sal_Int32
>(aSel.
Len()) );
623 std::u16string_view aRep = rLiteralMask.substr(
static_cast<sal_Int32
>(aSel.
Min()),
static_cast<sal_Int32
>(aSel.
Len()) );
624 aStr.remove( aSel.
Min(), aRep.size() );
625 aStr.insert( aSel.
Min(), aRep );
638 if ( nNewPos != nTempPos )
643 aStr.remove( nNewPos, 1 );
647 aStr[nNewPos] = rLiteralMask[nNewPos];
652 OUString sStr =
aStr.makeStringAndClear();
653 if ( aOldStr != sStr )
658 rEdit.SetText( sStr,
Selection( nNewPos ) );
660 rbInKeyInput =
false;
663 rEdit.SetSelection(
Selection( nNewPos ) );
683 nNewPos = aSel.
Min();
685 if ( nNewPos < rEditMask.getLength() )
701 while ( nTempPos < rEditMask.getLength() )
710 ImplPatternMaxPos( rEdit.GetText(), rEditMask, nFormatFlags, bSameMask, nNewPos, nTempPos );
711 if ( nTempPos > nNewPos )
713 rEdit.SetSelection(
Selection( nTempPos ) );
730 OUStringBuffer
aStr(rEdit.GetText());
732 if ( bSameMask && rEdit.IsInsertMode() )
735 sal_Int32
n =
aStr.getLength();
736 while (
n && (
n > nNewPos) )
738 if ( (
aStr[
n-1] !=
' ') &&
749 if (
aStr.getLength() < rEditMask.getLength() )
752 if (
aStr.getLength() < nNewPos )
753 aStr.append( rLiteralMask.substr(
aStr.getLength(), nNewPos-
aStr.getLength()) );
754 if ( nNewPos <
aStr.getLength() )
755 aStr.insert( cChar, nNewPos );
756 else if ( nNewPos < rEditMask.getLength() )
768 std::u16string_view aRep = rLiteralMask.substr( aSel.
Min(), aSel.
Len() );
769 aStr.remove( aSel.
Min(), aRep.size() );
770 aStr.insert( aSel.
Min(), aRep );
773 if ( nNewPos <
aStr.getLength() )
774 aStr[nNewPos] = cChar;
775 else if ( nNewPos < rEditMask.getLength() )
782 const OUString sStr =
aStr.makeStringAndClear();
784 rEdit.SetText( sStr, aNewSel );
786 rbInKeyInput =
false;
795 bool ImplSetMask(
const OString& rEditMask, OUString& rLiteralMask)
797 bool bSameMask =
true;
799 if (rEditMask.getLength() != rLiteralMask.getLength())
801 OUStringBuffer
aBuf(rLiteralMask);
802 if (rEditMask.getLength() <
aBuf.getLength())
803 aBuf.setLength(rEditMask.getLength());
806 rLiteralMask =
aBuf.makeStringAndClear();
813 while ( i < rEditMask.getLength() )
815 char cTemp = rEditMask[
i];
825 if ( i < rLiteralMask.getLength() )
827 if ( rLiteralMask[i] !=
' ' )
848PatternFormatter::PatternFormatter(
Edit* pEdit)
852 mbInPattKeyInput =
false;
855PatternFormatter::~PatternFormatter()
859void PatternFormatter::SetMask(
const OString& rEditMask,
860 const OUString& rLiteralMask )
862 m_aEditMask = rEditMask;
863 maLiteralMask = rLiteralMask;
864 mbSameMask = ImplSetMask(m_aEditMask, maLiteralMask);
870 class EntryImplementation :
public IEditImplementation
874 : m_rFormatter(rFormatter)
875 , m_rEntry(rFormatter.get_widget())
879 virtual OUString GetText()
const override
881 return m_rEntry.get_text();
884 virtual void SetText(
const OUString& rStr,
const Selection& rSelection)
override
886 m_rEntry.set_text(rStr);
887 SetSelection(rSelection);
892 int nStartPos, nEndPos;
893 m_rEntry.get_selection_bounds(nStartPos, nEndPos);
897 virtual void SetSelection(
const Selection& rSelection)
override
899 auto nMin = rSelection.
Min();
900 auto nMax = rSelection.
Max();
901 m_rEntry.select_region(nMin < 0 ? 0 : nMin, nMax == SELECTION_MAX ? -1 : nMax);
904 virtual bool IsInsertMode()
const override
906 return !m_rEntry.get_overwrite_mode();
909 virtual void SetModified()
override
911 m_rFormatter.Modify();
933 const OUString& rLiteralMask)
973 if (m_aKeyPressHdl.Call(rKEvt))
975 if (rKEvt.GetKeyCode().IsMod2())
977 EntryImplementation aAdapt(*
this);
980 m_bSameMask, m_bInPattKeyInput);
984void PatternFormatter::SetString(
const OUString& rStr )
988 GetField()->SetText( rStr );
989 MarkToBeReformatted(
false );
993OUString PatternFormatter::GetString()
const
1001void PatternFormatter::Reformat()
1005 ImplSetText(
ImplPatternReformat( GetField()->GetText(), m_aEditMask, maLiteralMask, 0 ) );
1006 if ( !mbSameMask && IsStrictFormat() && !GetField()->
IsReadOnly() )
1007 GetField()->SetInsertMode(
false );
1013 , PatternFormatter(this)
1018void PatternField::dispose()
1026 class EditImplementation :
public IEditImplementation
1029 EditImplementation(
Edit& rEdit)
1034 virtual OUString GetText()
const override
1036 return m_rEdit.GetText();
1039 virtual void SetText(
const OUString& rStr,
const Selection& rSelection)
override
1041 m_rEdit.SetText(rStr, rSelection);
1046 return m_rEdit.GetSelection();
1049 virtual void SetSelection(
const Selection& rSelection)
override
1051 m_rEdit.SetSelection(rSelection);
1054 virtual bool IsInsertMode()
const override
1056 return m_rEdit.IsInsertMode();
1059 virtual void SetModified()
override
1061 m_rEdit.SetModifyFlag();
1074 EditImplementation aAdapt(*GetField());
1077 ImplIsSameMask(), ImplGetInPattKeyInput() ) )
1084bool PatternField::EventNotify(
NotifyEvent& rNEvt )
1087 MarkToBeReformatted(
false );
1090 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
1097void PatternField::Modify()
1099 if ( !ImplGetInPattKeyInput() )
1101 if ( IsStrictFormat() )
1104 MarkToBeReformatted(
true );
1112 , PatternFormatter(this)
1117void PatternBox::dispose()
1127 EditImplementation aAdapt(*GetField());
1130 ImplIsSameMask(), ImplGetInPattKeyInput() ) )
1140 MarkToBeReformatted(
false );
1143 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
1150void PatternBox::Modify()
1152 if ( !ImplGetInPattKeyInput() )
1154 if ( IsStrictFormat() )
1157 MarkToBeReformatted(
true );
1163void PatternBox::ReformatAll()
1166 SetUpdateMode(
false );
1167 const sal_Int32 nEntryCount = GetEntryCount();
1168 for ( sal_Int32 i=0;
i < nEntryCount; ++
i )
1172 InsertEntry( aStr, i );
1174 PatternFormatter::Reformat();
1175 SetUpdateMode(
true );
1182 case LongDateOrder::YDM:
1185 case LongDateOrder::YMD:
1193 while (i1 != rStr.getLength() && (rStr[i1] <
'0' || rStr[i1] >
'9')) {
1197 while (i2 != rStr.getLength() && rStr[i2] >=
'0' && rStr[i2] <=
'9') {
1201 rStr = rStr.copy(std::min(i2+1, rStr.getLength()));
1207 sal_Int32
index = 0;
1208 rStr = rStr.replaceFirst(_rLookupMonthName,
"", &
index);
1214 const sal_uInt16 nMonths = rMonths.getLength();
1215 for (sal_uInt16
i=0;
i < nMonths; ++
i)
1231 const OUString aDefaultCalendarName( rCalendarWrapper.
getUniqueID());
1232 rCalendarName = aDefaultCalendarName;
1235 const uno::Sequence< i18n::CalendarItem2 > aMonths = rCalendarWrapper.
getMonths();
1241 const uno::Sequence< i18n::CalendarItem2 > aGenitiveMonths = rCalendarWrapper.
getGenitiveMonths();
1242 if (aGenitiveMonths != aMonths)
1248 const uno::Sequence< i18n::CalendarItem2 > aPartitiveMonths = rCalendarWrapper.
getPartitiveMonths();
1249 if (aPartitiveMonths != aMonths)
1259 const uno::Sequence< i18n::Calendar2 > aCalendars = rLocaleData.
getAllCalendars();
1260 if (aCalendars.getLength() > 1)
1262 for (
const auto& rCalendar : aCalendars)
1264 if (rCalendar.Name != aDefaultCalendarName)
1266 rCalendarName = rCalendar.Name;
1272 if (rCalendar.Months != rCalendar.GenitiveMonths)
1279 if (rCalendar.Months != rCalendar.PartitiveMonths)
1286 rCalendarName = aDefaultCalendarName;
1310 ((cChar >=
'0') && (cChar <=
'9')) ||
1317 sal_uInt16 nDay = 0;
1318 sal_uInt16 nMonth = 0;
1319 sal_uInt16 nYear = 0;
1320 bool bError =
false;
1321 OUString
aStr( rStr );
1325 OUString aCalendarName;
1329 case LongDateOrder::MDY:
1334 case LongDateOrder::DMY:
1339 case LongDateOrder::YDM:
1344 case LongDateOrder::YMD:
1351 if (aCalendarName !=
"gregorian")
1355 bError = !nDay || !nMonth || !nYear;
1360 aCW.setDateTime(0.5);
1361 aCW.setValue( i18n::CalendarFieldIndex::DAY_OF_MONTH, nDay);
1362 aCW.setValue( i18n::CalendarFieldIndex::MONTH, nMonth - 1);
1363 aCW.setValue( i18n::CalendarFieldIndex::YEAR, nYear);
1364 bError = !aCW.isValid();
1367 Date aDate = aCW.getEpochStart() + aCW.getDateTime();
1380 OUString aDateSep =
ImplGetDateSep( rLocaleDataWrapper, eDateOrder );
1381 sal_Int32 nSepPos =
aStr.indexOf( aDateSep );
1384 nSepPos =
aStr.indexOf( aDateSep, nSepPos+1 );
1385 if ( ( nSepPos < 0 ) || ( nSepPos == (
aStr.getLength()-1) ) )
1394 switch ( eDateOrder )
1434 OSL_FAIL(
"DateOrder???" );
1439 if ( bError || !nDay || !nMonth )
1442 Date aNewDate( nDay, nMonth, nYear );
1443 DateFormatter::ExpandCentury( aNewDate, officecfg::Office::Common::DateFormat::TwoDigitYear::get() );
1444 if ( aNewDate.IsValidDate() )
1452void DateFormatter::ImplDateReformat(
const OUString& rStr, OUString& rOutStr )
1455 if (!TextToDate(rStr, aDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper()))
1458 Date aTempDate = aDate;
1459 if ( aTempDate > GetMax() )
1460 aTempDate = GetMax();
1461 else if ( aTempDate < GetMin() )
1462 aTempDate = GetMin();
1464 rOutStr = ImplGetDateAsText( aTempDate );
1476 case DateOrder::DMY:
1479 case DateOrder::MDY:
1494 bool bShowCentury =
false;
1504 bShowCentury =
true;
1509 bShowCentury =
false;
1513 if ( !bShowCentury )
1516 sal_uInt16 nTwoDigitYearStart = officecfg::Office::Common::DateFormat::TwoDigitYear::get();
1520 if ( (nYear < nTwoDigitYearStart) || (nYear >= nTwoDigitYearStart+100) )
1521 bShowCentury =
true;
1527 eExtFormat = ResolveSystemFormat(eExtFormat, rLocaleData);
1530 sal_uInt16 nDay = rDate.
GetDay();
1531 sal_uInt16 nMonth = rDate.
GetMonth();
1532 sal_Int16 nYear = rDate.
GetYear();
1533 sal_uInt16 nYearLen = bShowCentury ? 4 : 2;
1535 if ( !bShowCentury )
1550 pFormatter->
ChangeIntl( aFormatterLang.getLanguageType(
false));
1587 OSL_FAIL(
"DateOrder???" );
1591 return OUString(aBuf, pBuf-aBuf);
1594OUString DateFormatter::ImplGetDateAsText(
const Date& rDate )
const
1596 return DateFormatter::FormatDate(rDate, GetExtDateFormat(), ImplGetLocaleDataWrapper(), maStaticFormatter);
1601 DateFormatter::ExpandCentury( rDate );
1602 rDate.
AddDays( bUp ? 1 : -1 );
1607 DateFormatter::ExpandCentury( rDate );
1613 DateFormatter::ExpandCentury( rDate );
1617bool DateFormatter::ImplAllowMalformedInput()
const
1619 return !IsEnforceValidValue();
1638 nPos = rText.find( aDateSep, nPos );
1639 if (nPos == std::u16string_view::npos ||
static_cast<sal_Int32
>(nPos) >= nCursor)
1658 Date aDate( GetDate() );
1659 Selection aSelection = GetField()->GetSelection();
1662 if (
static_cast<sal_Int32
>(aSelection.
Len()) == aText.getLength() )
1667 sal_Int8 nDateArea = GetDateArea(eFormat, aText, aSelection.
Max(), ImplGetLocaleDataWrapper());
1710 OSL_FAIL(
"invalid conversion" );
1715 ImplNewFieldValue( aDate );
1718DateFormatter::DateFormatter(
Edit* pEdit)
1723 , maMax(31, 12, 2200)
1724 , mbLongFormat(false)
1725 , mbShowDateCentury(true)
1727 , mbEnforceValidValue(true)
1731DateFormatter::~DateFormatter()
1737 if (!mxCalendarWrapper)
1740 mxCalendarWrapper->loadDefaultCalendar( GetLocale() );
1743 return *mxCalendarWrapper;
1748 mnExtDateFormat = eFormat;
1756 if (bResolveSystemFormat)
1757 eDateFormat = ResolveSystemFormat(eDateFormat, ImplGetLocaleDataWrapper());
1762void DateFormatter::ReformatAll()
1767void DateFormatter::SetMin(
const Date& rNewMin )
1770 if ( !IsEmptyFieldValue() )
1774void DateFormatter::SetMax(
const Date& rNewMax )
1777 if ( !IsEmptyFieldValue() )
1781void DateFormatter::SetLongFormat(
bool bLong )
1783 mbLongFormat = bLong;
1804 if (bShowDateCentury)
1806 switch (eExtDateFormat)
1825 switch (eExtDateFormat)
1843 return eExtDateFormat;
1847void DateFormatter::SetShowDateCentury(
bool bShowDateCentury )
1849 mbShowDateCentury = bShowDateCentury;
1851 SetExtDateFormat(ChangeDateCentury(GetExtDateFormat(), bShowDateCentury));
1856void DateFormatter::SetDate(
const Date& rNewDate )
1858 ImplSetUserDate( rNewDate );
1859 maFieldDate = maLastDate;
1860 maLastDate = GetDate();
1863void DateFormatter::ImplSetUserDate(
const Date& rNewDate,
Selection const * pNewSelection )
1865 Date aNewDate = rNewDate;
1866 if ( aNewDate > maMax )
1868 else if ( aNewDate < maMin )
1870 maLastDate = aNewDate;
1873 ImplSetText( ImplGetDateAsText( aNewDate ), pNewSelection );
1876void DateFormatter::ImplNewFieldValue(
const Date& rDate )
1881 Selection aSelection = GetField()->GetSelection();
1883 OUString aText = GetField()->GetText();
1886 if (
static_cast<sal_Int32
>(aSelection.
Max()) == aText.getLength() )
1888 if ( !aSelection.
Len() )
1893 Date aOldLastDate = maLastDate;
1894 ImplSetUserDate( rDate, &aSelection );
1895 maLastDate = aOldLastDate;
1898 if ( GetField()->GetText() != aText )
1900 GetField()->SetModifyFlag();
1901 GetField()->Modify();
1911 if (TextToDate(GetField()->GetText(), aDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper()))
1913 if ( aDate > maMax )
1915 else if ( aDate < maMin )
1923 if ( !ImplAllowMalformedInput() )
1925 if ( maLastDate.GetDate() )
1927 else if ( !IsEmptyFieldValueEnabled() )
1938void DateFormatter::SetEmptyDate()
1943bool DateFormatter::IsEmptyDate()
const
1947 if ( GetField() && MustBeReformatted() && IsEmptyFieldValueEnabled() )
1949 if ( GetField()->GetText().isEmpty() )
1953 else if ( !maLastDate.GetDate() )
1956 bEmpty = !TextToDate(GetField()->GetText(), aDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper());
1962void DateFormatter::Reformat()
1967 if ( GetField()->GetText().isEmpty() && ImplGetEmptyFieldValue() )
1971 ImplDateReformat( GetField()->GetText(), aStr );
1973 if ( !
aStr.isEmpty() )
1975 ImplSetText( aStr );
1976 (void)TextToDate(aStr, maLastDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper());
1980 if ( maLastDate.GetDate() )
1981 SetDate( maLastDate );
1982 else if ( !IsEmptyFieldValueEnabled() )
1986 ImplSetText( OUString() );
1987 SetEmptyFieldValueData(
true );
1992void DateFormatter::ExpandCentury(
Date& rDate )
1994 ExpandCentury(rDate, officecfg::Office::Common::DateFormat::TwoDigitYear::get());
1997void DateFormatter::ExpandCentury(
Date& rDate, sal_uInt16 nTwoDigitYearStart )
1999 sal_Int16 nDateYear = rDate.
GetYear();
2000 if ( 0 <= nDateYear && nDateYear < 100 )
2002 sal_uInt16 nCentury = nTwoDigitYearStart / 100;
2003 if ( nDateYear < (nTwoDigitYearStart % 100) )
2005 rDate.
SetYear( nDateYear + (nCentury*100) );
2011 DateFormatter(this),
2012 maFirst( GetMin() ),
2015 SetText( ImplGetLocaleDataWrapper().getDate( ImplGetFieldDate() ) );
2042 MarkToBeReformatted(
false );
2045 if ( MustBeReformatted() )
2050 bool bTextLen = !
GetText().isEmpty();
2051 if ( bTextLen || !IsEmptyFieldValueEnabled() )
2053 if ( !ImplAllowMalformedInput() )
2057 Date aDate( 0, 0, 0 );
2058 if (TextToDate(
GetText(), aDate, GetExtDateFormat(
true), ImplGetLocaleDataWrapper(), GetCalendarWrapper()))
2067 SetEmptyFieldValueData(
true );
2082 ImplResetLocaleDataWrapper();
2089 MarkToBeReformatted(
true );
2113 ImplNewFieldValue(
maLast );
2119 , DateFormatter(this)
2121 SetText( ImplGetLocaleDataWrapper().getDate( ImplGetFieldDate() ) );
2125void DateBox::dispose()
2150 ImplResetLocaleDataWrapper();
2158 MarkToBeReformatted(
false );
2161 if ( MustBeReformatted() )
2163 bool bTextLen = !GetText().isEmpty();
2164 if ( bTextLen || !IsEmptyFieldValueEnabled() )
2169 SetEmptyFieldValueData(
true );
2177void DateBox::Modify()
2179 MarkToBeReformatted(
true );
2183void DateBox::ReformatAll()
2186 SetUpdateMode(
false );
2187 const sal_Int32 nEntryCount = GetEntryCount();
2188 for ( sal_Int32 i=0;
i < nEntryCount; ++
i )
2190 ImplDateReformat( GetEntry( i ), aStr );
2192 InsertEntry( aStr, i );
2194 DateFormatter::Reformat();
2195 SetUpdateMode(
true );
2253 ImplSetTextImpl(sText,
nullptr);
2262 bool bRet = ::DateFormatter::TextToDate(GetEntryText(), aResult, ResolveSystemFormat(m_eFormat, rLocaleDataWrapper),
2263 rLocaleDataWrapper, GetCalendarWrapper());
2272 bool bStrictFormat,
bool bDuration,
2278 if ( !bStrictFormat )
2285 ((cChar >=
'0') && (cChar <=
'9')) ||
2286 rLocaleDataWrapper.
getTimeSep() == OUStringChar(cChar) ||
2287 (rLocaleDataWrapper.
getTimeAM().indexOf(cChar) != -1) ||
2288 (rLocaleDataWrapper.
getTimePM().indexOf(cChar) != -1) ||
2290 (cChar ==
'a') || (cChar ==
'A') || (cChar ==
'm') || (cChar ==
'M') || (cChar ==
'p') || (cChar ==
'P') ||
2292 (bDuration && (cChar ==
'-')) )
2302 for ( sal_Int32
i = 0;
i < _rStr.getLength(); ++
i, ++_pChr )
2304 if ( *_pChr < '0' || *_pChr >
'9' )
2312 if ( !_bSkipInvalidCharacters )
2314 if ( ( _rStr.getLength() > 2 ) || _rStr.isEmpty() || !
ImplIsOnlyDigits( _rStr ) )
2320static bool ImplCutTimePortion( OUStringBuffer& _rStr, sal_Int32 _nSepPos,
bool _bSkipInvalidCharacters,
short* _pPortion )
2322 OUString sPortion(_rStr.subView(0, _nSepPos));
2324 if (_nSepPos < _rStr.getLength())
2325 _rStr.remove(0, _nSepPos + 1);
2331 *_pPortion =
static_cast<short>(sPortion.toInt32());
2335bool TimeFormatter::TextToTime(std::u16string_view rStr,
tools::Time& rTime,
2337 bool bDuration,
const LocaleDataWrapper& rLocaleDataWrapper,
bool _bSkipInvalidCharacters)
2339 OUStringBuffer
aStr(rStr);
2343 sal_Int64 nNanoSec = 0;
2350 if (!rLocaleDataWrapper.
getTimeSep().isEmpty())
2352 OUStringBuffer aSepStr(
",.;:/");
2354 aSepStr.append(
'-');
2357 for (sal_Int32 i = 0;
i < aSepStr.getLength(); ++
i)
2359 if (rLocaleDataWrapper.
getTimeSep() == OUStringChar(aSepStr[i]))
2361 for ( sal_Int32 j = 0; j <
aStr.getLength(); j++ )
2363 if (aStr[j] == aSepStr[i])
2369 bool bNegative =
false;
2370 sal_Int32 nSepPos =
aStr.indexOf( rLocaleDataWrapper.
getTimeSep() );
2371 if ( aStr[0] ==
'-' )
2376 nSepPos =
aStr.getLength();
2381 if ( !
aStr.isEmpty() && aStr[0] ==
'-' )
2389 if ( !
aStr.isEmpty() && aStr[0] ==
'-' )
2395 if ( !
aStr.isEmpty() && aStr[0] ==
'-' )
2405 else if ( nSepPos < 0 )
2408 nMinute += nSecond / 60;
2410 nHour += nMinute / 60;
2416 aStr.remove( 0, nSepPos+1 );
2419 if ( !
aStr.isEmpty() &&
aStr[0] ==
'-' )
2425 aStr.remove( 0, nSepPos+1 );
2428 if ( !
aStr.isEmpty() &&
aStr[0] ==
'-' )
2435 aStr.remove( 0, nSepPos+1 );
2439 nHour += nMinute / 60;
2445 nMinute += nSecond / 60;
2447 nHour += nMinute / 60;
2455 assert(
aStr.getLength() >= 1);
2459 while (
aStr.getLength() > nLen && aStr[nLen] >=
'0' && aStr[nLen] <=
'9' )
2470 nNanoSec = (nNanoSec + 5) / 10;
2475 assert(nNanoSec > -1000000000 && nNanoSec < 1000000000);
2476 if ( (nMinute > 59) || (nSecond > 59) || (nNanoSec > 1000000000) )
2480 nSecond = nNanoSec = 0;
2486 if ( bNegative || (nHour < 0) || (nMinute < 0) ||
2487 (nSecond < 0) || (nNanoSec < 0) )
2490 OUString aUpperCaseStr =
aStr.toString().toAsciiUpperCase();
2491 OUString aAMlocalised(rLocaleDataWrapper.
getTimeAM().toAsciiUpperCase());
2492 OUString aPMlocalised(rLocaleDataWrapper.
getTimePM().toAsciiUpperCase());
2494 if ( (nHour < 12) && ( ( aUpperCaseStr.indexOf(
"PM" ) >= 0 ) || ( aUpperCaseStr.indexOf( aPMlocalised ) >= 0 ) ) )
2497 if ( (nHour == 12) && ( ( aUpperCaseStr.indexOf(
"AM" ) >= 0 ) || ( aUpperCaseStr.indexOf( aAMlocalised ) >= 0 ) ) )
2500 aTime =
tools::Time(
static_cast<sal_uInt16
>(nHour),
static_cast<sal_uInt16
>(nMinute),
static_cast<sal_uInt16
>(nSecond),
2501 static_cast<sal_uInt32
>(nNanoSec) );
2505 assert( !bNegative || (nHour < 0) || (nMinute < 0) ||
2506 (nSecond < 0) || (nNanoSec < 0) );
2507 if ( bNegative || (nHour < 0) || (nMinute < 0) ||
2508 (nSecond < 0) || (nNanoSec < 0) )
2512 nHour = nHour < 0 ? -nHour : nHour;
2513 nMinute = nMinute < 0 ? -nMinute : nMinute;
2514 nSecond = nSecond < 0 ? -nSecond : nSecond;
2515 nNanoSec = nNanoSec < 0 ? -nNanoSec : nNanoSec;
2518 aTime =
tools::Time(
static_cast<sal_uInt16
>(nHour),
static_cast<sal_uInt16
>(nMinute),
static_cast<sal_uInt16
>(nSecond),
2519 static_cast<sal_uInt32
>(nNanoSec) );
2529void TimeFormatter::ImplTimeReformat( std::u16string_view rStr, OUString& rOutStr )
2532 if ( !TextToTime( rStr, aTime,
GetFormat(), IsDuration(), ImplGetLocaleDataWrapper() ) )
2536 if ( aTempTime > GetMax() )
2537 aTempTime = GetMax() ;
2538 else if ( aTempTime < GetMin() )
2539 aTempTime = GetMin();
2541 bool bSecond =
false;
2542 bool b100Sec =
false;
2549 n += aTempTime.
GetMin() * 60L;
2551 rOutStr = OUString::number( n );
2552 rOutStr += ImplGetLocaleDataWrapper().getTime100SecSep();
2553 std::ostringstream ostr;
2557 rOutStr += OUString::createFromAscii(ostr.str());
2559 else if ( mbDuration )
2562 rOutStr = ImplGetLocaleDataWrapper().getDuration( aDuration, bSecond, b100Sec );
2566 rOutStr = ImplGetLocaleDataWrapper().getTime( aTempTime, bSecond, b100Sec );
2569 if ( aTempTime.
GetHour() > 12 )
2572 aT.SetHour( aT.GetHour() % 12 );
2573 rOutStr = ImplGetLocaleDataWrapper().getTime( aT, bSecond, b100Sec );
2576 if ( aTempTime.
GetHour() < 12 )
2584bool TimeFormatter::ImplAllowMalformedInput()
const
2586 return !IsEnforceValidValue();
2589int TimeFormatter::GetTimeArea(
TimeFieldFormat eFormat, std::u16string_view rText,
int nCursor,
2598 for (
size_t i = 1, nPos = 0;
i <= 4;
i++ )
2600 size_t nPos1 = rText.find(rLocaleDataWrapper.
getTimeSep(), nPos);
2603 if (nPos1 != std::u16string_view::npos && nPos2 != std::u16string_view::npos)
2604 nPos = std::min(nPos1, nPos2);
2605 else if (nPos1 != std::u16string_view::npos)
2609 if (nPos == std::u16string_view::npos ||
static_cast<sal_Int32
>(nPos) >= nCursor)
2621 if (nPos == std::u16string_view::npos ||
static_cast<sal_Int32
>(nPos) >= nCursor)
2631 bool bDuration, std::u16string_view rText,
int nCursor,
2636 int nTimeArea = GetTimeArea(eFormat, rText, nCursor, rLocaleDataWrapper);
2641 if ( nTimeArea == 1 )
2643 else if ( nTimeArea == 2 )
2645 else if ( nTimeArea == 3 )
2647 else if ( nTimeArea == 4 )
2651 aAddTime = -aAddTime;
2657 if ( aTime > aAbsMaxTime )
2658 aTime = aAbsMaxTime;
2660 if ( aTime < aAbsMinTime )
2661 aTime = aAbsMinTime;
2668void TimeField::ImplTimeSpinArea(
bool bUp )
2673 OUString aText( GetText() );
2676 aTime = TimeFormatter::SpinTime(bUp, aTime,
GetFormat(), IsDuration(), aText, aSelection.
Max(), ImplGetLocaleDataWrapper());
2678 ImplNewFieldValue( aTime );
2682TimeFormatter::TimeFormatter(
Edit* pEdit)
2686 , maMax(23, 59, 59, 999999999)
2690 , mbEnforceValidValue(true)
2695TimeFormatter::~TimeFormatter()
2699void TimeFormatter::ReformatAll()
2707 if ( !IsEmptyFieldValue() )
2714 if ( !IsEmptyFieldValue() )
2718void TimeFormatter::SetTimeFormat(
TimeFormat eNewFormat )
2720 mnTimeFormat = eNewFormat;
2726 meFormat = eNewFormat;
2730void TimeFormatter::SetDuration(
bool bNewDuration )
2732 mbDuration = bNewDuration;
2738 SetUserTime( rNewTime );
2739 maFieldTime = maLastTime;
2740 SetEmptyFieldValueData(
false );
2743void TimeFormatter::ImplNewFieldValue(
const tools::Time& rTime )
2748 Selection aSelection = GetField()->GetSelection();
2750 OUString aText = GetField()->GetText();
2753 if (
static_cast<sal_Int32
>(aSelection.
Max()) == aText.getLength() )
2755 if ( !aSelection.
Len() )
2761 ImplSetUserTime( rTime, &aSelection );
2762 maLastTime = aOldLastTime;
2765 if ( GetField()->GetText() != aText )
2767 GetField()->SetModifyFlag();
2768 GetField()->Modify();
2776 bool b100Sec =
false;
2787 std::ostringstream ostr;
2791 aStr += OUString::createFromAscii(ostr.str());
2793 else if ( bDuration )
2800 aStr = rLocaleData.
getTime( rNewTime, bSec, b100Sec );
2803 if ( rNewTime.
GetHour() > 12 )
2806 aT.SetHour( aT.GetHour() % 12 );
2810 if ( rNewTime.
GetHour() < 12 )
2820void TimeFormatter::ImplSetUserTime(
const tools::Time& rNewTime,
Selection const * pNewSelection )
2823 if ( aNewTime > GetMax() )
2824 aNewTime = GetMax();
2825 else if ( aNewTime < GetMin() )
2826 aNewTime = GetMin();
2827 maLastTime = aNewTime;
2831 OUString
aStr = TimeFormatter::FormatTime(aNewTime, meFormat, GetTimeFormat(), mbDuration, ImplGetLocaleDataWrapper());
2832 ImplSetText( aStr, pNewSelection );
2836void TimeFormatter::SetUserTime(
const tools::Time& rNewTime )
2838 ImplSetUserTime( rNewTime );
2847 bool bAllowMalformed = ImplAllowMalformedInput();
2848 if ( TextToTime( GetField()->GetText(), aTime,
GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(), !bAllowMalformed ) )
2850 if ( aTime > GetMax() )
2852 else if ( aTime < GetMin() )
2857 if ( bAllowMalformed )
2867void TimeFormatter::Reformat()
2872 if ( GetField()->GetText().isEmpty() && ImplGetEmptyFieldValue() )
2876 ImplTimeReformat( GetField()->GetText(), aStr );
2878 if ( !
aStr.isEmpty() )
2880 ImplSetText( aStr );
2881 (void)TextToTime(aStr, maLastTime,
GetFormat(), IsDuration(), ImplGetLocaleDataWrapper());
2884 SetTime( maLastTime );
2889 TimeFormatter(this),
2890 maFirst( GetMin() ),
2893 SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime,
false ) );
2897void TimeField::dispose()
2917 MarkToBeReformatted(
false );
2920 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
2922 if ( !ImplAllowMalformedInput() )
2927 if ( TextToTime( GetText(), aTime,
GetFormat(), IsDuration(), ImplGetLocaleDataWrapper(),
false ) )
2944 ImplResetLocaleDataWrapper();
2949void TimeField::Modify()
2951 MarkToBeReformatted(
true );
2957 ImplTimeSpinArea(
true );
2961void TimeField::Down()
2963 ImplTimeSpinArea(
false );
2967void TimeField::First()
2969 ImplNewFieldValue( maFirst );
2973void TimeField::Last()
2975 ImplNewFieldValue( maLast );
2986 SetDuration(
false );
2993 SetDuration(
false );
3000 SetDuration(
false );
3007 SetDuration(
false );
3013 SetDuration(
true );
3019 SetDuration(
true );
3023 default: OSL_FAIL(
"ExtTimeFieldFormat unknown!" );
3026 if ( GetField() && !GetField()->GetText().isEmpty() )
3033 , TimeFormatter(this)
3035 SetText( ImplGetLocaleDataWrapper().getTime( maFieldTime,
false ) );
3039void TimeBox::dispose()
3059 MarkToBeReformatted(
false );
3062 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
3075 ImplResetLocaleDataWrapper();
3080void TimeBox::Modify()
3082 MarkToBeReformatted(
true );
3086void TimeBox::ReformatAll()
3089 SetUpdateMode(
false );
3090 const sal_Int32 nEntryCount = GetEntryCount();
3091 for ( sal_Int32 i=0;
i < nEntryCount; ++
i )
3093 ImplTimeReformat( GetEntry( i ), aStr );
3095 InsertEntry( aStr, i );
3097 TimeFormatter::Reformat();
3098 SetUpdateMode(
true );
3151 ImplSetTextImpl(sText,
nullptr);
3160 bool bRet = ::TimeFormatter::TextToTime(GetEntryText(), aResult, m_eFormat, m_bDuration, rLocaleDataWrapper);
3169 int nStartPos, nEndPos;
3170 rEntry.get_selection_bounds(nStartPos, nEndPos);
3173 const int nTimeArea = ::TimeFormatter::GetTimeArea(m_eFormat, GetEntryText(), nEndPos, rLocaleData);
3175 int nIncrements = 1;
3178 nIncrements = 1000 * 60 * 60;
3179 else if (nTimeArea == 2)
3180 nIncrements = 1000 * 60;
3181 else if (nTimeArea == 3)
3184 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
OUString getDuration(const tools::Duration &rDuration, bool bSec=true, bool b100Sec=false) const
const css::uno::Reference< css::uno::XComponentContext > & getComponentContext() const
const OUString & getTimeAM() const
LanguageTag getLoadedLanguageTag() 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