LibreOffice Module vcl (master) 1
Namespaces | Macros | Functions
field2.cxx File Reference
#include <sal/config.h>
#include <algorithm>
#include <string_view>
#include <comphelper/diagnose_ex.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/string.hxx>
#include <o3tl/string_view.hxx>
#include <officecfg/Office/Common.hxx>
#include <vcl/svapp.hxx>
#include <vcl/event.hxx>
#include <vcl/toolkit/field.hxx>
#include <vcl/unohelp.hxx>
#include <vcl/settings.hxx>
#include <vcl/weldutils.hxx>
#include <svdata.hxx>
#include <com/sun/star/i18n/XCharacterClassification.hpp>
#include <com/sun/star/i18n/CalendarFieldIndex.hdl>
#include <unotools/localedatawrapper.hxx>
#include <unotools/calendarwrapper.hxx>
#include <unotools/charclass.hxx>
#include <svl/numformat.hxx>
#include <svl/zforlist.hxx>
#include <tools/duration.hxx>
Include dependency graph for field2.cxx:

Go to the source code of this file.

Namespaces

namespace  weld
 

Macros

#define EDITMASK_LITERAL   'L'
 
#define EDITMASK_ALPHA   'a'
 
#define EDITMASK_UPPERALPHA   'A'
 
#define EDITMASK_ALPHANUM   'c'
 
#define EDITMASK_UPPERALPHANUM   'C'
 
#define EDITMASK_NUM   'N'
 
#define EDITMASK_NUMSPACE   'n'
 
#define EDITMASK_ALLCHAR   'x'
 
#define EDITMASK_UPPERALLCHAR   'X'
 

Functions

uno::Reference< i18n::XCharacterClassification > const & ImplGetCharClass ()
 
static sal_UnicodeImplAddString (sal_Unicode *pBuf, const OUString &rStr)
 
static sal_UnicodeImplAddNum (sal_Unicode *pBuf, sal_uLong nNumber, int nMinLen)
 
static sal_UnicodeImplAddSNum (sal_Unicode *pBuf, sal_Int32 nNumber, int nMinLen)
 
static sal_uInt16 ImplGetNum (const sal_Unicode *&rpBuf, bool &rbError)
 
static void ImplSkipDelimiters (const sal_Unicode *&rpBuf)
 
static bool ImplIsPatternChar (sal_Unicode cChar, char cEditMask)
 
static sal_Unicode ImplPatternChar (sal_Unicode cChar, char cEditMask)
 
static bool ImplCommaPointCharEqual (sal_Unicode c1, sal_Unicode c2)
 
static OUString ImplPatternReformat (const OUString &rStr, const OString &rEditMask, std::u16string_view rLiteralMask, sal_uInt16 nFormatFlags)
 
static void ImplPatternMaxPos (std::u16string_view rStr, const OString &rEditMask, sal_uInt16 nFormatFlags, bool bSameMask, sal_Int32 nCursorPos, sal_Int32 &rPos)
 
static OUString ImplPatternProcessStrictModify (const OUString &rText, const OString &rEditMask, std::u16string_view rLiteralMask, bool bSameMask)
 
static void ImplPatternProcessStrictModify (Edit *pEdit, const OString &rEditMask, std::u16string_view rLiteralMask, bool bSameMask)
 
static void ImplPatternProcessStrictModify (weld::Entry &rEntry, const OString &rEditMask, std::u16string_view rLiteralMask, bool bSameMask)
 
static sal_Int32 ImplPatternLeftPos (std::string_view rEditMask, sal_Int32 nCursorPos)
 
static sal_Int32 ImplPatternRightPos (std::u16string_view rStr, const OString &rEditMask, sal_uInt16 nFormatFlags, bool bSameMask, sal_Int32 nCursorPos)
 
static bool ImplPatternProcessKeyInput (IEditImplementation &rEdit, const KeyEvent &rKEvt, const OString &rEditMask, std::u16string_view rLiteralMask, bool bStrictFormat, bool bSameMask, bool &rbInKeyInput)
 
 weld::IMPL_LINK (PatternFormatter, KeyInputHdl, const KeyEvent &, rKEvt, bool)
 
static ExtDateFieldFormat ImplGetExtFormat (LongDateOrder eOld)
 
static sal_uInt16 ImplCutNumberFromString (OUString &rStr)
 
static bool ImplCutMonthName (OUString &rStr, std::u16string_view _rLookupMonthName)
 
static sal_uInt16 ImplGetMonthFromCalendarItem (OUString &rStr, const uno::Sequence< i18n::CalendarItem2 > &rMonths)
 
static sal_uInt16 ImplCutMonthFromString (OUString &rStr, OUString &rCalendarName, const LocaleDataWrapper &rLocaleData, const CalendarWrapper &rCalendarWrapper)
 
static OUString ImplGetDateSep (const LocaleDataWrapper &rLocaleDataWrapper, ExtDateFieldFormat eFormat)
 
static bool ImplDateProcessKeyInput (const KeyEvent &rKEvt, ExtDateFieldFormat eFormat, const LocaleDataWrapper &rLocaleDataWrapper)
 
static void ImplDateIncrementDay (Date &rDate, bool bUp)
 
static void ImplDateIncrementMonth (Date &rDate, bool bUp)
 
static void ImplDateIncrementYear (Date &rDate, bool bUp)
 
 weld::IMPL_LINK_NOARG (DateFormatter, FormatOutputHdl, LinkParamNone *, bool)
 
 weld::IMPL_LINK (DateFormatter, ParseInputHdl, sal_Int64 *, result, TriState)
 
static bool ImplTimeProcessKeyInput (const KeyEvent &rKEvt, bool bStrictFormat, bool bDuration, TimeFieldFormat eFormat, const LocaleDataWrapper &rLocaleDataWrapper)
 
static bool ImplIsOnlyDigits (const OUString &_rStr)
 
static bool ImplIsValidTimePortion (bool _bSkipInvalidCharacters, const OUString &_rStr)
 
static bool ImplCutTimePortion (OUStringBuffer &_rStr, sal_Int32 _nSepPos, bool _bSkipInvalidCharacters, short *_pPortion)
 
 weld::IMPL_LINK_NOARG (TimeFormatter, FormatOutputHdl, LinkParamNone *, bool)
 
 weld::IMPL_LINK (TimeFormatter, ParseInputHdl, sal_Int64 *, result, TriState)
 
 weld::IMPL_LINK (TimeFormatter, CursorChangedHdl, weld::Entry &, rEntry, void)
 

Macro Definition Documentation

◆ EDITMASK_ALLCHAR

#define EDITMASK_ALLCHAR   'x'

Definition at line 59 of file field2.cxx.

◆ EDITMASK_ALPHA

#define EDITMASK_ALPHA   'a'

Definition at line 53 of file field2.cxx.

◆ EDITMASK_ALPHANUM

#define EDITMASK_ALPHANUM   'c'

Definition at line 55 of file field2.cxx.

◆ EDITMASK_LITERAL

#define EDITMASK_LITERAL   'L'

Definition at line 52 of file field2.cxx.

◆ EDITMASK_NUM

#define EDITMASK_NUM   'N'

Definition at line 57 of file field2.cxx.

◆ EDITMASK_NUMSPACE

#define EDITMASK_NUMSPACE   'n'

Definition at line 58 of file field2.cxx.

◆ EDITMASK_UPPERALLCHAR

#define EDITMASK_UPPERALLCHAR   'X'

Definition at line 60 of file field2.cxx.

◆ EDITMASK_UPPERALPHA

#define EDITMASK_UPPERALPHA   'A'

Definition at line 54 of file field2.cxx.

◆ EDITMASK_UPPERALPHANUM

#define EDITMASK_UPPERALPHANUM   'C'

Definition at line 56 of file field2.cxx.

Function Documentation

◆ ImplAddNum()

static sal_Unicode * ImplAddNum ( sal_Unicode pBuf,
sal_uLong  nNumber,
int  nMinLen 
)
static

Definition at line 82 of file field2.cxx.

Referenced by ImplAddSNum().

◆ ImplAddSNum()

static sal_Unicode * ImplAddSNum ( sal_Unicode pBuf,
sal_Int32  nNumber,
int  nMinLen 
)
static

Definition at line 117 of file field2.cxx.

References ImplAddNum().

◆ ImplAddString()

static sal_Unicode * ImplAddString ( sal_Unicode pBuf,
const OUString &  rStr 
)
static

Definition at line 75 of file field2.cxx.

◆ ImplCommaPointCharEqual()

static bool ImplCommaPointCharEqual ( sal_Unicode  c1,
sal_Unicode  c2 
)
static

Definition at line 219 of file field2.cxx.

Referenced by ImplPatternProcessKeyInput(), and ImplPatternReformat().

◆ ImplCutMonthFromString()

static sal_uInt16 ImplCutMonthFromString ( OUString &  rStr,
OUString &  rCalendarName,
const LocaleDataWrapper rLocaleData,
const CalendarWrapper rCalendarWrapper 
)
static

◆ ImplCutMonthName()

static bool ImplCutMonthName ( OUString &  rStr,
std::u16string_view  _rLookupMonthName 
)
static

Definition at line 1205 of file field2.cxx.

References index.

Referenced by ImplGetMonthFromCalendarItem().

◆ ImplCutNumberFromString()

static sal_uInt16 ImplCutNumberFromString ( OUString &  rStr)
static

Definition at line 1190 of file field2.cxx.

References nValue, and o3tl::toInt32().

Referenced by ImplCutMonthFromString().

◆ ImplCutTimePortion()

static bool ImplCutTimePortion ( OUStringBuffer &  _rStr,
sal_Int32  _nSepPos,
bool  _bSkipInvalidCharacters,
short *  _pPortion 
)
static

Definition at line 2320 of file field2.cxx.

References ImplIsValidTimePortion().

◆ ImplDateIncrementDay()

static void ImplDateIncrementDay ( Date rDate,
bool  bUp 
)
static

Definition at line 1599 of file field2.cxx.

References Date::AddDays().

Referenced by DateField::ImplDateSpinArea().

◆ ImplDateIncrementMonth()

static void ImplDateIncrementMonth ( Date rDate,
bool  bUp 
)
static

Definition at line 1605 of file field2.cxx.

References Date::AddMonths().

Referenced by DateField::ImplDateSpinArea().

◆ ImplDateIncrementYear()

static void ImplDateIncrementYear ( Date rDate,
bool  bUp 
)
static

Definition at line 1611 of file field2.cxx.

References Date::AddYears().

Referenced by DateField::ImplDateSpinArea().

◆ ImplDateProcessKeyInput()

static bool ImplDateProcessKeyInput ( const KeyEvent rKEvt,
ExtDateFieldFormat  eFormat,
const LocaleDataWrapper rLocaleDataWrapper 
)
static

◆ ImplGetCharClass()

uno::Reference< i18n::XCharacterClassification > const & ImplGetCharClass ( )

◆ ImplGetDateSep()

static OUString ImplGetDateSep ( const LocaleDataWrapper rLocaleDataWrapper,
ExtDateFieldFormat  eFormat 
)
static

◆ ImplGetExtFormat()

static ExtDateFieldFormat ImplGetExtFormat ( LongDateOrder  eOld)
static

Definition at line 1178 of file field2.cxx.

References ShortDDMMYY, ShortMMDDYY, and ShortYYMMDD.

◆ ImplGetMonthFromCalendarItem()

static sal_uInt16 ImplGetMonthFromCalendarItem ( OUString &  rStr,
const uno::Sequence< i18n::CalendarItem2 > &  rMonths 
)
static

Definition at line 1212 of file field2.cxx.

References FullName, i, and ImplCutMonthName().

Referenced by ImplCutMonthFromString().

◆ ImplGetNum()

static sal_uInt16 ImplGetNum ( const sal_Unicode *&  rpBuf,
bool &  rbError 
)
static

Definition at line 127 of file field2.cxx.

◆ ImplIsOnlyDigits()

static bool ImplIsOnlyDigits ( const OUString &  _rStr)
static

Definition at line 2299 of file field2.cxx.

References i.

Referenced by ImplIsValidTimePortion().

◆ ImplIsPatternChar()

static bool ImplIsPatternChar ( sal_Unicode  cChar,
char  cEditMask 
)
static

◆ ImplIsValidTimePortion()

static bool ImplIsValidTimePortion ( bool  _bSkipInvalidCharacters,
const OUString &  _rStr 
)
static

Definition at line 2310 of file field2.cxx.

References ImplIsOnlyDigits().

Referenced by ImplCutTimePortion().

◆ ImplPatternChar()

static sal_Unicode ImplPatternChar ( sal_Unicode  cChar,
char  cEditMask 
)
static

◆ ImplPatternLeftPos()

static sal_Int32 ImplPatternLeftPos ( std::string_view  rEditMask,
sal_Int32  nCursorPos 
)
static

Definition at line 469 of file field2.cxx.

References EDITMASK_LITERAL.

Referenced by ImplPatternProcessKeyInput().

◆ ImplPatternMaxPos()

static void ImplPatternMaxPos ( std::u16string_view  rStr,
const OString &  rEditMask,
sal_uInt16  nFormatFlags,
bool  bSameMask,
sal_Int32  nCursorPos,
sal_Int32 &  rPos 
)
static

◆ ImplPatternProcessKeyInput()

static bool ImplPatternProcessKeyInput ( IEditImplementation &  rEdit,
const KeyEvent rKEvt,
const OString &  rEditMask,
std::u16string_view  rLiteralMask,
bool  bStrictFormat,
bool  bSameMask,
bool &  rbInKeyInput 
)
static

◆ ImplPatternProcessStrictModify() [1/3]

static OUString ImplPatternProcessStrictModify ( const OUString &  rText,
const OString &  rEditMask,
std::u16string_view  rLiteralMask,
bool  bSameMask 
)
static

◆ ImplPatternProcessStrictModify() [2/3]

static void ImplPatternProcessStrictModify ( Edit pEdit,
const OString &  rEditMask,
std::u16string_view  rLiteralMask,
bool  bSameMask 
)
static

◆ ImplPatternProcessStrictModify() [3/3]

static void ImplPatternProcessStrictModify ( weld::Entry rEntry,
const OString &  rEditMask,
std::u16string_view  rLiteralMask,
bool  bSameMask 
)
static

◆ ImplPatternReformat()

static OUString ImplPatternReformat ( const OUString &  rStr,
const OString &  rEditMask,
std::u16string_view  rLiteralMask,
sal_uInt16  nFormatFlags 
)
static

◆ ImplPatternRightPos()

static sal_Int32 ImplPatternRightPos ( std::u16string_view  rStr,
const OString &  rEditMask,
sal_uInt16  nFormatFlags,
bool  bSameMask,
sal_Int32  nCursorPos 
)
static

Definition at line 486 of file field2.cxx.

References EDITMASK_LITERAL, and ImplPatternMaxPos().

Referenced by ImplPatternProcessKeyInput().

◆ ImplSkipDelimiters()

static void ImplSkipDelimiters ( const sal_Unicode *&  rpBuf)
static

Definition at line 146 of file field2.cxx.

◆ ImplTimeProcessKeyInput()

static bool ImplTimeProcessKeyInput ( const KeyEvent rKEvt,
bool  bStrictFormat,
bool  bDuration,
TimeFieldFormat  eFormat,
const LocaleDataWrapper rLocaleDataWrapper 
)
static