23 #include <string_view>
26 #include <osl/diagnose.h>
44 #include <rtl/math.hxx>
47 #include <boost/property_tree/ptree.hpp>
56 std::string FieldUnitToString(
FieldUnit unit)
78 case FieldUnit::POINT:
99 case FieldUnit::CUSTOM:
102 case FieldUnit::PERCENT:
105 case FieldUnit::MM_100TH:
108 case FieldUnit::PIXEL:
111 case FieldUnit::DEGREE:
114 case FieldUnit::SECOND:
117 case FieldUnit::MILLISECOND:
118 return "millisecond";
124 sal_Int64 ImplPower10( sal_uInt16 n )
129 for ( i=0; i < n; i++ )
135 bool ImplNumericProcessKeyInput(
const KeyEvent& rKEvt,
136 bool bStrictFormat,
bool bThousandSep,
139 if ( !bStrictFormat )
149 ((cChar >=
'0') && (cChar <=
'9')) ||
151 (bThousandSep && rLocaleDataWrapper.
getNumThousandSep() == OUStringChar(cChar)) ||
157 bool ImplNumericGetValue(
const OUString& rStr, sal_Int64& rValue,
159 bool bCurrency =
false )
161 OUString
aStr = rStr;
162 OUStringBuffer aStr1, aStr2, aStrNum, aStrDenom;
163 bool bNegative =
false;
165 sal_Int32 nDecPos, nFracDivPos;
169 if ( rStr.isEmpty() )
181 nFracDivPos = aStr.indexOf(
'/' );
187 sal_Int32 nFracNumPos = aStr.lastIndexOf(
' ', nFracDivPos);
190 if(nFracNumPos != -1 )
192 aStr1.append(aStr.subView(0, nFracNumPos));
193 aStrNum.append(aStr.subView(nFracNumPos+1, nFracDivPos-nFracNumPos-1));
194 aStrDenom.append(aStr.subView(nFracDivPos+1));
199 aStrNum.append(aStr.subView(0, nFracDivPos));
200 aStrDenom.append(aStr.subView(nFracDivPos+1));
205 else if ( nDecPos >= 0)
207 aStr1.append(aStr.subView(0, nDecPos));
208 aStr2.append(aStr.subView(nDecPos+1));
216 if ( aStr.startsWith(
"(") && aStr.endsWith(
")") )
220 for (sal_Int32 i=0; i < aStr.getLength(); i++ )
222 if ( (aStr[i] >=
'0') && (aStr[i] <=
'9') )
224 else if ( aStr[i] ==
'-' )
231 if (!bNegative && !aStr.isEmpty())
234 if ( (nFormat == 3) || (nFormat == 6) ||
235 (nFormat == 7) || (nFormat == 10) )
237 for (sal_Int32 i = aStr.getLength()-1; i > 0; --i )
239 if ( (aStr[i] >=
'0') && (aStr[i] <=
'9') )
241 else if ( aStr[i] ==
'-' )
252 if ( !aStr1.isEmpty() && aStr1[0] ==
'-')
254 if ( !aStrNum.isEmpty() && aStrNum[0] ==
'-')
260 for (sal_Int32 i=0; i < aStr1.getLength(); )
262 if ( (aStr1[i] >=
'0') && (aStr1[i] <=
'9') )
265 aStr1.remove( i, 1 );
269 for (sal_Int32 i=0; i < aStr2.getLength(); )
271 if ((aStr2[i] >=
'0') && (aStr2[i] <=
'9'))
279 for (sal_Int32 i=0; i < aStrNum.getLength(); )
281 if ((aStrNum[i] >=
'0') && (aStrNum[i] <=
'9'))
284 aStrNum.remove(i, 1);
287 for (sal_Int32 i=0; i < aStrDenom.getLength(); )
289 if ((aStrDenom[i] >=
'0') && (aStrDenom[i] <=
'9'))
292 aStrDenom.remove(i, 1);
297 if ( !bFrac && aStr1.isEmpty() && aStr2.isEmpty() )
299 else if ( bFrac && aStr1.isEmpty() && (aStrNum.isEmpty() || aStrDenom.isEmpty()) )
302 if ( aStr1.isEmpty() )
305 aStr1.insert(0,
"-");
310 sal_Int64 nWholeNum = aStr1.makeStringAndClear().toInt64();
311 sal_Int64 nNum = aStrNum.makeStringAndClear().toInt64();
312 sal_Int64 nDenom = aStrDenom.makeStringAndClear().toInt64();
313 if (nDenom == 0)
return false;
314 double nFrac2Dec = nWholeNum +
static_cast<double>(nNum)/nDenom;
315 OUStringBuffer aStrFrac;
316 aStrFrac.append(nFrac2Dec);
318 nDecPos = aStrFrac.indexOf(
'.');
321 aStr1.append(aStrFrac.getStr(), nDecPos);
322 aStr2.append(aStrFrac.getStr()+nDecPos+1);
330 if (aStr2.getLength() > nDecDigits)
332 if (aStr2[nDecDigits] >=
'5')
334 string::truncateToLength(aStr2, nDecDigits);
336 if (aStr2.getLength() < nDecDigits)
337 string::padToLength(aStr2, nDecDigits,
'0');
339 aStr = aStr1.makeStringAndClear() + aStr2.makeStringAndClear();
342 nValue = aStr.toInt64();
346 sal_Int32
nIndex = bNegative ? 1 : 0;
347 while (nIndex < aStr.getLength() && aStr[nIndex] ==
'0')
349 if( nIndex < aStr.getLength() )
368 void ImplUpdateSeparatorString( OUString& io_rText,
369 const OUString& rOldDecSep, std::u16string_view rNewDecSep,
370 const OUString& rOldThSep, std::u16string_view rNewThSep )
372 OUStringBuffer
aBuf( io_rText.getLength() );
373 sal_Int32 nIndexDec = 0, nIndexTh = 0, nIndex = 0;
376 while( nIndex != -1 )
378 nIndexDec = io_rText.indexOf( rOldDecSep, nIndex );
379 nIndexTh = io_rText.indexOf( rOldThSep, nIndex );
380 if( (nIndexTh != -1 && nIndexDec != -1 && nIndexTh < nIndexDec )
381 || (nIndexTh != -1 && nIndexDec == -1)
384 aBuf.append( pBuffer + nIndex, nIndexTh - nIndex );
385 aBuf.append( rNewThSep );
386 nIndex = nIndexTh + rOldThSep.getLength();
388 else if( nIndexDec != -1 )
390 aBuf.append( pBuffer + nIndex, nIndexDec - nIndex );
391 aBuf.append( rNewDecSep );
392 nIndex = nIndexDec + rOldDecSep.getLength();
396 aBuf.append( pBuffer + nIndex );
401 io_rText =
aBuf.makeStringAndClear();
404 void ImplUpdateSeparators(
const OUString& rOldDecSep, std::u16string_view rNewDecSep,
405 const OUString& rOldThSep, std::u16string_view rNewThSep,
408 bool bChangeDec = (rOldDecSep != rNewDecSep);
409 bool bChangeTh = (rOldThSep != rNewThSep );
411 if( !(bChangeDec || bChangeTh) )
416 OUString aText = pEdit->
GetText();
417 ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
425 for ( sal_Int32 i=0; i < nEntryCount; i++ )
429 ImplUpdateSeparatorString( aText, rOldDecSep, rNewDecSep, rOldThSep, rNewThSep );
552 , mbFormatting(false)
558 , mbThousandSep(true)
620 sal_Int64 nTempValue;
622 if (ImplNumericGetValue(rStr, nTempValue,
649 SAL_WARN(
"vcl",
"fail to convert the value: " << rStr );
673 return ( nValue / nFactor );
678 sal_Int64 nHalf = nFactor / 2;
679 return ((nValue - nHalf) / nFactor );
683 sal_Int64 nHalf = nFactor / 2;
684 return ((nValue + nHalf) / nFactor );
706 nValue = (nRemainder == 0) ? nValue +
mnSpinSize : nValue - nRemainder;
718 nValue = (nRemainder == 0) ? nValue -
mnSpinSize : nValue - nRemainder;
751 if ( static_cast<sal_Int32>(aSelection.
Max()) == aText.getLength() )
753 if ( !aSelection.
Len() )
763 if (
GetField()->GetText() != aText )
774 else if (nValue <
mnMin)
786 nTextLen = OUString(OUString::number(rFormatter.
GetMin())).getLength();
787 string::padToLength(aBuf, nTextLen,
'9');
792 nTextLen = OUString(OUString::number(rFormatter.
GetMax())).getLength();
793 string::padToLength(aBuf, nTextLen,
'9');
799 std::max(aMinTextSize.
Height(), aMaxTextSize.
Height()));
801 OUStringBuffer sBuf(
"999999999");
806 string::padToLength(aBuf, aBuf.getLength() + nDigits,
'9');
809 aRet.
setWidth( std::min(aRet.Width(), aMaxTextSize.
Width()) );
820 if ( !(nWinStyle & WB_HIDE ) )
824 void NumericBox::dispose()
830 Size NumericBox::CalcMinimumSize()
const
832 Size aRet(calcMinimumSize(*
this, *
this));
837 aRet.setWidth( std::max(aRet.Width(), aComboSugg.Width()) );
838 aRet.setHeight( std::max(aRet.Height(), aComboSugg.Height()) );
848 if ( ImplNumericProcessKeyInput( *rNEvt.
GetKeyEvent(), IsStrictFormat(), IsUseThousandSep(), ImplGetLocaleDataWrapper() ) )
858 MarkToBeReformatted(
false );
861 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
874 OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep();
875 OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep();
876 ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() );
877 OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep();
878 OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep();
879 ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep,
this );
884 void NumericBox::Modify()
886 MarkToBeReformatted(
true );
890 void NumericBox::ImplNumericReformat(
const OUString& rStr, sal_Int64& rValue,
893 if (ImplNumericGetValue(rStr, rValue, GetDecimalDigits(), ImplGetLocaleDataWrapper()))
895 sal_Int64 nTempVal = ClipAgainstMinMax(rValue);
896 rOutStr = CreateFieldText( nTempVal );
900 void NumericBox::ReformatAll()
904 SetUpdateMode(
false );
905 sal_Int32 nEntryCount = GetEntryCount();
906 for ( sal_Int32 i=0; i < nEntryCount; i++ )
908 ImplNumericReformat( GetEntry( i ), nValue, aStr );
910 InsertEntry( aStr, i );
913 SetUpdateMode(
true );
920 return ImplNumericProcessKeyInput( rKEvt,
false, bUseThousandSep, rWrapper );
927 for (sal_Int32 i = rStr.getLength()-1; i >= 0; --i)
938 return aStr.makeStringAndClear();
948 if (elem.second == rUnit)
960 OUString aStr = rMetricString.toAsciiLowerCase().replaceAll(
" ",
"");
963 if ( elem.first == aStr )
967 return FieldUnit::NONE;
981 case MapUnit::Map100thMM :
983 return FieldUnit::MM;
984 case MapUnit::Map10thMM :
986 return FieldUnit::MM;
987 case MapUnit::MapMM :
988 return FieldUnit::MM;
989 case MapUnit::MapCM :
990 return FieldUnit::CM;
991 case MapUnit::Map1000thInch :
993 return FieldUnit::INCH;
994 case MapUnit::Map100thInch :
996 return FieldUnit::INCH;
997 case MapUnit::Map10thInch :
999 return FieldUnit::INCH;
1000 case MapUnit::MapInch :
1001 return FieldUnit::INCH;
1002 case MapUnit::MapPoint :
1003 return FieldUnit::POINT;
1004 case MapUnit::MapTwip :
1005 return FieldUnit::TWIP;
1007 OSL_FAIL(
"default eInUnit" );
1010 return FieldUnit::NONE;
1015 return std::isfinite( nValue ) ? nValue : 0.0;
1020 sal_Int64
ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits,
1024 static_cast<double>(nValue), mnBaseValue, nDecDigits, eInUnit, eOutUnit));
1033 nLong =
static_cast<sal_Int64
>( std::round(nDouble) );
1043 return eOutUnit != FieldUnit::PERCENT
1044 && eOutUnit != FieldUnit::CUSTOM
1045 && eOutUnit != FieldUnit::NONE
1046 && eInUnit != MapUnit::MapPixel
1047 && eInUnit != MapUnit::MapSysFont
1048 && eInUnit != MapUnit::MapAppFont
1049 && eInUnit != MapUnit::MapRelative;
1065 nValue *= ImplPower10(nDigits);
1068 if ( eInUnit != eOutUnit )
1085 if ( !checkConversionUnits(eInUnit, eOutUnit) )
1087 OSL_FAIL(
"invalid parameters" );
1095 if (eFieldUnit == eOutUnit && nDigits == 0)
1100 return static_cast<sal_Int64
>(
1102 convertValue( nValue, nDecDigits, eFieldUnit, eOutUnit ) ) );
1108 if ( eInUnit != eOutUnit )
1110 if (eInUnit == FieldUnit::PERCENT && mnBaseValue > 0 && nValue > 0)
1112 sal_Int64 nDiv = 100 * ImplPower10(nDecDigits);
1114 if (mnBaseValue != 1)
1115 nValue *= mnBaseValue;
1135 if ( !checkConversionUnits(eInUnit, eOutUnit) )
1137 OSL_FAIL(
"invalid parameters" );
1144 return convertValue(nValue, nDecDigits, eFieldUnit, eOutUnit);
1150 if ( eInUnit == FieldUnit::PERCENT ||
1151 eInUnit == FieldUnit::CUSTOM ||
1152 eInUnit == FieldUnit::NONE ||
1153 eInUnit == FieldUnit::DEGREE ||
1154 eInUnit == FieldUnit::SECOND ||
1155 eInUnit == FieldUnit::MILLISECOND ||
1156 eInUnit == FieldUnit::PIXEL ||
1157 eOutUnit == MapUnit::MapPixel ||
1158 eOutUnit == MapUnit::MapSysFont ||
1159 eOutUnit == MapUnit::MapAppFont ||
1160 eOutUnit == MapUnit::MapRelative )
1162 OSL_FAIL(
"invalid parameters" );
1169 if ( nDecDigits < 0 )
1171 nValue *= ImplPower10(-nDecDigits);
1175 nValue /= ImplPower10(nDecDigits);
1178 if ( eFieldUnit != eInUnit )
1191 bool TextToValue(
const OUString& rStr,
double& rValue, sal_Int64 nBaseValue,
1196 if ( !ImplNumericGetValue( rStr, nValue, nDecDigits, rLocaleDataWrapper ) )
1215 double nTempVal = rValue;
1217 if ( nTempVal >
GetMax() )
1218 nTempVal =
static_cast<double>(
GetMax());
1219 else if ( nTempVal <
GetMin())
1220 nTempVal = static_cast<double>(
GetMin());
1236 if (eNewUnit == FieldUnit::MM_100TH)
1261 if (
meUnit == FieldUnit::PERCENT)
1263 double dValue = nValue;
1270 if(
meUnit == FieldUnit::CUSTOM )
1275 if (
meUnit != FieldUnit::NONE &&
meUnit != FieldUnit::DEGREE &&
meUnit != FieldUnit::INCH &&
meUnit != FieldUnit::FOOT)
1277 if (
meUnit == FieldUnit::INCH)
1279 OUString sDoublePrime =
u"\u2033";
1280 if (aSuffix !=
"\"" && aSuffix != sDoublePrime)
1283 aSuffix = sDoublePrime;
1285 else if (
meUnit == FieldUnit::FOOT)
1287 OUString sPrime =
u"\u2032";
1288 if (aSuffix !=
"'" && aSuffix != sPrime)
1315 if (nTempValue >
mnMax)
1316 nTempValue =
static_cast<double>(
mnMax);
1317 else if (nTempValue <
mnMin)
1318 nTempValue =
static_cast<double>(
mnMin);
1337 SetValue( nValue, FieldUnit::NONE );
1377 if ( !aStr.isEmpty() )
1407 return calcMinimumSize(*
this, *
this);
1412 if (rKey ==
"digits")
1414 else if (rKey ==
"spin-size")
1423 sal_Int64 nRawMax =
GetMax( nNewUnit );
1498 ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep,
this );
1538 rJsonWriter.
put(
"unit", FieldUnitToString(
GetUnit()));
1541 rJsonWriter.
put(
"value", sValue);
1564 Size aRet(calcMinimumSize(*
this, *
this));
1611 ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep,
this );
1628 for ( sal_Int32 i=0; i < nEntryCount; i++ )
1642 return ImplNumericProcessKeyInput( rKEvt,
false, bUseThousandSep, rWrapper );
1649 return ImplNumericGetValue( rStr, rValue, nDecDigits, rWrapper,
true );
1652 void CurrencyFormatter::ImplCurrencyReformat(
const OUString& rStr, OUString& rOutStr )
1655 if ( !ImplNumericGetValue( rStr, nValue, GetDecimalDigits(), ImplGetLocaleDataWrapper(),
true ) )
1658 sal_Int64 nTempVal = nValue;
1659 if ( nTempVal > GetMax() )
1660 nTempVal = GetMax();
1661 else if ( nTempVal < GetMin())
1662 nTempVal = GetMin();
1663 rOutStr = CreateFieldText( nTempVal );
1666 CurrencyFormatter::CurrencyFormatter(
Edit* pField)
1671 CurrencyFormatter::~CurrencyFormatter()
1675 void CurrencyFormatter::SetValue( sal_Int64 nNewValue )
1677 SetUserValue( nNewValue );
1678 SetEmptyFieldValueData(
false );
1681 OUString CurrencyFormatter::CreateFieldText( sal_Int64 nValue )
const
1683 return ImplGetLocaleDataWrapper().getCurr( nValue, GetDecimalDigits(),
1684 ImplGetLocaleDataWrapper().getCurrSymbol(),
1685 IsUseThousandSep() );
1688 sal_Int64 CurrencyFormatter::GetValueFromString(
const OUString& rStr)
const
1690 sal_Int64 nTempValue;
1691 if (
ImplCurrencyGetValue( rStr, nTempValue, GetDecimalDigits(), ImplGetLocaleDataWrapper() ) )
1693 return ClipAgainstMinMax(nTempValue);
1699 void CurrencyFormatter::Reformat()
1705 ImplCurrencyReformat( GetField()->GetText(), aStr );
1707 if ( !aStr.isEmpty() )
1709 ImplSetText( aStr );
1710 sal_Int64 nTemp = mnLastValue;
1712 mnLastValue = nTemp;
1720 , CurrencyFormatter(this)
1725 void CurrencyField::dispose()
1731 bool CurrencyField::PreNotify(
NotifyEvent& rNEvt )
1742 bool CurrencyField::EventNotify(
NotifyEvent& rNEvt )
1745 MarkToBeReformatted(
false );
1748 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
1761 OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep();
1762 OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep();
1763 ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() );
1764 OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep();
1765 OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep();
1766 ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep,
this );
1771 void CurrencyField::Modify()
1773 MarkToBeReformatted(
true );
1777 void CurrencyField::Up()
1783 void CurrencyField::Down()
1789 void CurrencyField::First()
1795 void CurrencyField::Last()
1803 , CurrencyFormatter(this)
1808 void CurrencyBox::dispose()
1825 bool CurrencyBox::EventNotify(
NotifyEvent& rNEvt )
1828 MarkToBeReformatted(
false );
1831 if ( MustBeReformatted() && (!GetText().isEmpty() || !IsEmptyFieldValueEnabled()) )
1844 OUString sOldDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep();
1845 OUString sOldThSep = ImplGetLocaleDataWrapper().getNumThousandSep();
1846 ImplGetLocaleDataWrapper().setLanguageTag( GetSettings().GetLanguageTag() );
1847 OUString sNewDecSep = ImplGetLocaleDataWrapper().getNumDecimalSep();
1848 OUString sNewThSep = ImplGetLocaleDataWrapper().getNumThousandSep();
1849 ImplUpdateSeparators( sOldDecSep, sNewDecSep, sOldThSep, sNewThSep,
this );
1854 void CurrencyBox::Modify()
1856 MarkToBeReformatted(
true );
1860 void CurrencyBox::ReformatAll()
1863 SetUpdateMode(
false );
1864 sal_Int32 nEntryCount = GetEntryCount();
1865 for ( sal_Int32 i=0; i < nEntryCount; i++ )
1867 ImplCurrencyReformat( GetEntry( i ), aStr );
1869 InsertEntry( aStr, i );
1871 CurrencyFormatter::Reformat();
1872 SetUpdateMode(
true );
constexpr sal_uInt16 KEYGROUP_MISC
sal_uInt16 getCurrNegativeFormat() const
virtual bool PreNotify(NotifyEvent &rNEvt) override
virtual bool set_property(const OString &rKey, const OUString &rValue) override
void setWidth(tools::Long nWidth)
const FieldUnitStringList & ImplGetCleanedFieldUnits()
virtual Size CalcMinimumSizeForText(const OUString &rString) const
void SetFirst(sal_Int64 nNewFirst, FieldUnit eInUnit)
FieldUnit StringToMetric(const OUString &rMetricString)
static const AllSettings & GetSettings()
Gets the application's settings.
static OUString ImplMetricToString(FieldUnit rUnit)
std::function< std::unique_ptr< UIObject >vcl::Window *)> FactoryFunction
virtual void Last() override
virtual void Modify() override
constexpr o3tl::Length FieldToO3tlLength(FieldUnit eU, o3tl::Length ePixelValue=o3tl::Length::px)
sal_uInt16 GetGroup() const
DataChangedEventType GetType() const
const KeyEvent * GetKeyEvent() const
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
virtual FactoryFunction GetUITestFactory() const override
virtual bool set_property(const OString &rKey, const OUString &rValue) override
static bool ImplMetricProcessKeyInput(const KeyEvent &rKEvt, bool bUseThousandSep, const LocaleDataWrapper &rWrapper)
virtual bool EventNotify(NotifyEvent &rNEvt) override
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
void SetEntryData(sal_Int32 nPos, void *pNewData)
OUString GetEntry(sal_Int32 nPos) const
static FieldUnit ImplMap2FieldUnit(MapUnit meUnit, tools::Long &nDecDigits)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
static FieldUnit ImplMetricGetUnit(const OUString &rStr)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
const BorderLinePrimitive2D *pCandidateB assert(pCandidateA)
AllSettingsFlags GetFlags() const
virtual void SetModifyFlag()
virtual const Selection & GetSelection() const
constexpr sal_uInt16 KEYGROUP_CURSOR
virtual void Modify() override
MetricBox(vcl::Window *pParent, WinBits nWinStyle)
static bool ImplCurrencyGetValue(const OUString &rStr, sal_Int64 &rValue, sal_uInt16 nDecDigits, const LocaleDataWrapper &rWrapper)
constexpr auto convert(N n, sal_Int64 mul, sal_Int64 div)
const LanguageTag & GetLanguageTag() const
virtual Size CalcMinimumSize() const override
const OUString & getNumDecimalSep() const
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual bool EventNotify(NotifyEvent &rNEvt) override
bool IsDropDownBox() const
virtual bool PreNotify(NotifyEvent &rNEvt)
constexpr sal_uInt16 KEYGROUP_FKEYS
static bool isAlpha(const sal_Unicode ch)
void setLanguageTag(const LanguageTag &rLanguageTag)
virtual bool EventNotify(NotifyEvent &rNEvt) override
static bool isControl(const sal_Unicode ch)
virtual void First() override
void SetUpdateMode(bool bUpdate)
virtual OUString GetText() const override
bool IsUpdateMode() const
tools::Long Width() const
void RemoveEntryAt(sal_Int32 nPos)
MouseNotifyEvent GetType() const
const AllSettings & GetSettings() const
static OUString ImplMetricGetUnitText(const OUString &rStr)
virtual Size CalcMinimumSize() const override
virtual void DumpAsPropertyTree(tools::JsonWriter &) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON...
bool TextToValue(const OUString &rStr, double &rValue, sal_Int64 nBaseValue, sal_uInt16 nDecDigits, const LocaleDataWrapper &rLocaleDataWrapper, FieldUnit eUnit)
void SetLast(sal_Int64 nNewLast, FieldUnit eInUnit)
virtual bool EventNotify(NotifyEvent &rNEvt) override
virtual bool PreNotify(NotifyEvent &rNEvt) override
const LocaleDataWrapper & GetNeutralLocaleDataWrapper() const
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
const OUString & getNumDecimalSepAlt() const
virtual void SetUnit(FieldUnit meUnit) override
const vcl::KeyCode & GetKeyCode() const
static OUString formatPercent(double dNumber, const LanguageTag &rLangTag)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void Down() override
sal_Int32 GetEntryCount() const
MetricField(vcl::Window *pParent, WinBits nWinStyle)
sal_Unicode GetCharCode() const
virtual void ReformatAll() override
virtual void Up() override
tools::Long Height() const
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects...
virtual bool PreNotify(NotifyEvent &rNEvt) override
void * GetEntryData(sal_Int32 nPos) const
const OUString & getNumThousandSep() const
void setHeight(tools::Long nHeight)
sal_Int64 ConvertValue(sal_Int64 nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
A widget used to choose from a list of items and which has an entry.
double ConvertDoubleValue(double nValue, sal_Int64 mnBaseValue, sal_uInt16 nDecDigits, FieldUnit eInUnit, FieldUnit eOutUnit)
#define SAL_WARN(area, stream)
OUString getNum(sal_Int64 nNumber, sal_uInt16 nDecimals, bool bUseThousandSep=true, bool bTrailingZeros=true) const
sal_Int32 InsertEntry(const OUString &rStr, sal_Int32 nPos=COMBOBOX_APPEND)
const FieldUnitStringList & ImplGetFieldUnits()
virtual void SetText(const OUString &rStr) override
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
Size CalcMinimumSize() const override
static bool ImplCurrencyProcessKeyInput(const KeyEvent &rKEvt, bool bUseThousandSep, const LocaleDataWrapper &rWrapper)
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...
static double nonValueDoubleToValueDouble(double nValue)