42 case SvNumFormatType::NUMBER:
44 case SvNumFormatType::CURRENCY:
46 case SvNumFormatType::PERCENT:
48 case SvNumFormatType::DATE:
49 case SvNumFormatType::DATETIME:
51 case SvNumFormatType::TIME:
53 case SvNumFormatType::SCIENTIFIC:
55 case SvNumFormatType::FRACTION:
57 case SvNumFormatType::LOGICAL:
67 sal_uInt32 nFormatKey,
69 const OUString& rNumStr)
75 sal_uInt32 nFormatKey,
77 const OUString* pNumStr)
84 : pFormatter(pNumFormatter)
85 , pCurFmtTable(nullptr)
86 , eValType(eNumValType)
88 , nCurFormatKey(nFormatKey)
91 , pCurCurrencyEntry(nullptr)
92 , bBankingSymbol(false)
94 , bUseStarFormat(false)
95 , bIsDefaultValNum(true)
118 const OUString* pNumStr)
119 : pFormatter(pNumFormatter)
120 , pCurFmtTable(nullptr)
121 , eValType(eNumValType)
123 , nCurFormatKey(nFormatKey)
126 , pCurCurrencyEntry(nullptr)
127 , bBankingSymbol(false)
129 , bUseStarFormat(false)
130 , bIsDefaultValNum(false)
174 std::vector<OUString>& rFmtEntries)
186 std::vector<OUString>& rFmtEntries)
194 const Color*& rpFontColor)
216 sal_uInt16& rCatLbSelPos,
short& rFmtSelPos,
217 std::vector<OUString>& rFmtEntries)
219 bool bInserted =
false;
232 OSL_FAIL(
"duplicate format!");
269 else if (rErrPos != 0)
275 OSL_FAIL(
"duplicate format!");
282 short& rFmtSelPos, std::vector<OUString>& rFmtEntries)
294 ::std::vector<sal_uInt32>::iterator nAt =
GetAdded_Impl(nDelKey);
310 sal_uInt16 nPrecision, sal_uInt16 nLeadingZeroes,
311 sal_uInt16 nCurrencyPos)
315 sal_Int32 rErrPos = 0;
316 std::vector<OUString> aFmtEList;
323 sal_uInt16 rCatLbSelPos = 0;
324 short rFmtSelPos = 0;
332 nPrecision, nLeadingZeroes);
338 nPrecision, nLeadingZeroes);
357 sal_uInt16& rPrecision, sal_uInt16& rLeadingZeroes,
358 sal_uInt16& rCatLbPos)
370 bool bTestBanking =
false;
386 const Color*& rpFontColor)
388 rpFontColor =
nullptr;
461 bool bTestBanking =
false;
482 sal_uInt16& nFmtLbSelPos,
483 std::vector<OUString>& rFmtEntries,
484 OUString& rPrevString,
const Color*& rpPrevColor)
506 nFmtLbSelPos = (nSelPos !=
SELPOS_NONE) ?
static_cast<sal_uInt16
>(nSelPos) : 0;
566 bool bSuppressDuplicates)
582 case SvNumFormatType::NUMBER:
586 case SvNumFormatType::PERCENT:
590 case SvNumFormatType::CURRENCY:
595 case SvNumFormatType::DATE:
599 case SvNumFormatType::TIME:
603 case SvNumFormatType::SCIENTIFIC:
607 case SvNumFormatType::FRACTION:
616 case SvNumFormatType::LOGICAL:
620 case SvNumFormatType::TEXT:
635 bool bSuppressDuplicates)
651 bool bSuppressDuplicates)
675 bool bSuppressDuplicates,
677 bool bSuppressIsoDateTime)
682 if (pNumEntry ==
nullptr)
699 = bSuppressIsoDateTime && bSuppressDuplicates
700 && (aNewFormNInfo ==
"YYYY-MM-DD HH:MM:SS" || aNewFormNInfo ==
"YYYY-MM-DD\"T\"HH:MM:SS");
704 || std::find(rList.begin(), rList.end(), aNewFormNInfo) == rList.end()))
706 rList.push_back(aNewFormNInfo);
747 const NfCurrencyEntry* pTmpCurrencyEntry;
755 || (bFlag && pTmpCurrencyEntry ==
nullptr && rSymbol.isEmpty())
781 OUString aNewFormNInfo;
797 if (pNumEntry ==
nullptr)
809 rList.push_back(aNewFormNInfo);
817 sal_uInt32 nKey = rEntry.first;
822 bool bUserNewCurrency =
false;
825 const NfCurrencyEntry* pTmpCurrencyEntry;
832 bUserNewCurrency = (pTmpCurrencyEntry !=
nullptr);
835 if (!bUserNewCurrency && (pNumEntry->
GetType() & SvNumFormatType::DEFINED))
843 rList.push_back(aNewFormNInfo);
862 OUString aNewFormNInfo;
864 const NfCurrencyEntry* pTmpCurrencyEntry;
865 bool bTmpBanking, bAdaptSelPos;
867 OUString rBankSymbol;
869 std::vector<OUString> aList;
870 std::vector<sal_uInt32> aKeyList;
875 OUString rShortSymbol;
894 bAdaptSelPos =
false;
900 if (pTmpCurrencyEntry !=
nullptr)
902 rSymbol = pTmpCurrencyEntry->BuildSymbolString(
false);
903 rBankSymbol = pTmpCurrencyEntry->BuildSymbolString(
true);
904 rShortSymbol = pTmpCurrencyEntry->BuildSymbolString(bTmpBanking,
true);
909 sal_uInt32 nKey = rEntry.first;
920 bool bInsFlag =
false;
925 else if ((!bTmpBanking && aNewFormNInfo.indexOf(rSymbol) >= 0)
926 || (bTmpBanking && aNewFormNInfo.indexOf(rBankSymbol) >= 0))
930 else if (aNewFormNInfo.indexOf(rShortSymbol) >= 0)
933 const NfCurrencyEntry* pTstCurrencyEntry;
939 if (pTmpCurrencyEntry == pTstCurrencyEntry && bTstBanking == bTmpBanking)
947 aList.push_back(aNewFormNInfo);
948 aKeyList.push_back(nKey);
956 if (pTmpCurrencyEntry &&
nCurCategory != SvNumFormatType::ALL)
965 if (!bTmpBanking &&
nCurCategory != SvNumFormatType::ALL)
969 sal_uInt16 nCurrCount = rCurrencyTable.
size();
971 for (sal_uInt16
i = 0;
i < nCurrCount; ++
i)
973 const NfCurrencyEntry* pCurr = &rCurrencyTable[
i];
974 if (pCurr->GetLanguage() == eLang && pTmpCurrencyEntry != pCurr)
982 size_t nOldListCount = rList.size();
983 for (
size_t i = 0,
nPos = nOldListCount;
i < aWSStringsDtor.size(); ++
i)
986 OUString aInsStr(aWSStringsDtor[
i]);
988 for (j = 0; j < aList.size(); ++j)
990 if (aList[j] == aInsStr)
998 rList.push_back(aInsStr);
1003 rList.push_back(aList[j]);
1004 aList.erase(aList.begin() + j);
1006 aKeyList.erase(aKeyList.begin() + j);
1010 for (
size_t i = 0;
i < aKeyList.size(); ++
i)
1014 rList.push_back(aList[
i]);
1019 for (
size_t i = nOldListCount;
i < rList.size(); ++
i)
1043 OUString aNewFormNInfo;
1045 const bool bCatDefined = (eCategory == SvNumFormatType::DEFINED);
1046 const bool bCategoryMatch = (eCategory != SvNumFormatType::ALL && !bCatDefined);
1047 const bool bNatNumCurrency = (eCategory == SvNumFormatType::CURRENCY);
1053 if (bCategoryMatch && (pNumEntry->
GetMaskedType() & eCategory) != eCategory)
1056 const bool bUserDefined = bool(pNumEntry->
GetType() & SvNumFormatType::DEFINED);
1057 if (!bUserDefined && bCatDefined)
1063 const sal_uInt32 nKey = rEntry.first;
1068 if (bNatNumCurrency && (aNewFormNInfo.indexOf(
"NatNum12") < 0 || bUserDefined))
1082 rList.push_back(aNewFormNInfo);
1131 rCategory = SvNumFormatType::DEFINED;
1134 rCategory = SvNumFormatType::NUMBER;
1137 rCategory = SvNumFormatType::PERCENT;
1140 rCategory = SvNumFormatType::CURRENCY;
1143 rCategory = SvNumFormatType::DATE;
1146 rCategory = SvNumFormatType::TIME;
1149 rCategory = SvNumFormatType::SCIENTIFIC;
1152 rCategory = SvNumFormatType::FRACTION;
1155 rCategory = SvNumFormatType::LOGICAL;
1158 rCategory = SvNumFormatType::TEXT;
1162 rCategory = SvNumFormatType::ALL;
1172 case SvNumFormatType::DEFINED:
1175 case SvNumFormatType::NUMBER:
1178 case SvNumFormatType::PERCENT:
1181 case SvNumFormatType::CURRENCY:
1184 case SvNumFormatType::DATETIME:
1185 case SvNumFormatType::DATE:
1188 case SvNumFormatType::TIME:
1191 case SvNumFormatType::SCIENTIFIC:
1194 case SvNumFormatType::FRACTION:
1197 case SvNumFormatType::LOGICAL:
1200 case SvNumFormatType::TEXT:
1203 case SvNumFormatType::ALL:
1218 rpFontColor =
nullptr;
1234 if (pNumEntry !=
nullptr)
1252 if (pNumEntry !=
nullptr)
1275 if (pNumEntry !=
nullptr)
1281 return static_cast<short>(nMyType);
1307 if (pNumEntry !=
nullptr)
1309 if (pNumEntry->
GetType() & SvNumFormatType::DEFINED)
1341 if (pNumEntry !=
nullptr)
1371 OSL_FAIL(
"svx::SvxNumberFormatShell::GetListPos4Entry(), list got too large!");
1381 nSelP =
static_cast<short>(
i);
1398 bool bFlag = (pTmpCurrencyEntry ==
nullptr);
1400 SvxCurrencyToolBoxControl::GetCurrencySymbols(rList, bFlag,
aCurCurrencyList);
1402 if (pPos ==
nullptr)
1406 sal_uInt16 nTableCount = rCurrencyTable.
size();
1421 if (j != sal_uInt16(-1) && j < nTableCount && pTmpCurrencyEntry == &rCurrencyTable[j])
1423 *pPos =
static_cast<sal_uInt16
>(
i);
1442 if (nCurrencyPos != sal_uInt16(-1))
1444 pCurCurrencyEntry =
const_cast<NfCurrencyEntry*
>(&rCurrencyTable[nCurrencyPos]);
1472 bool bTestBanking =
false;
1476 if (
nPos != sal_uInt16(-1))
1478 sal_uInt16 nStart = 0;
1489 return sal_uInt16(-1);
1495 sal_uInt16
nPos = sal_uInt16(-1);
1501 OUString aSymbol, aExtension;
1509 bTestBanking, aSymbol, aExtension, pFormat->
GetLanguage());
1510 if (pTmpCurrencyEntry)
1514 if (pTmpCurrencyEntry == &rCurrencyTable[
i])
1527 const NfCurrencyEntry* pTmpCurrencyEntry = &rCurrencyTable[
i];
1528 OUString _aSymbol = pTmpCurrencyEntry->BuildSymbolString(
false);
1529 OUString aBankSymbol = pTmpCurrencyEntry->BuildSymbolString(
true);
1531 if (rFmtString.indexOf(_aSymbol) != -1)
1533 bTestBanking =
false;
1537 else if (rFmtString.indexOf(aBankSymbol) != -1)
1539 bTestBanking =
true;
1555 sal_uInt16
nPos = 0;
1558 if (pTmpCurrencyEntry == &rCurrencyTable[
i])
1565 sal_uInt16 nStart = 0;
1575 return sal_uInt16(-1);
1579 std::u16string_view rFmtString)
const
1583 if (
nPos != sal_uInt16(-1))
1592 for (
const OUString& s : aWSStringsDtor)
1594 if (s == rFmtString)
static LanguageType getRealLanguage(LanguageType nLang)
#define DBG_ASSERT(sCon, aError)
const o3tl::enumarray< SvxNumValCategory, double > fSvxNumValConst
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
#define NUMBERFORMAT_ENTRY_NEW_CURRENCY
std::vector< OUString > NfWSStringsDtor
NF_DATETIME_SYS_DDMMYYYY_HHMMSS
NF_DATETIME_ISO_YYYYMMDDTHHMMSS000
NF_DATETIME_ISO_YYYYMMDD_HHMMSS000
NF_DATETIME_SYS_DDMMYYYY_HHMM
NF_DATETIME_ISO_YYYYMMDD_HHMMSS
NF_DATETIME_ISO_YYYYMMDDTHHMMSS
constexpr sal_uInt32 NUMBERFORMAT_ENTRY_NOT_FOUND