diff options
| author | Neil <nyamatongwe@gmail.com> | 2025-12-04 13:17:48 +1100 |
|---|---|---|
| committer | Neil <nyamatongwe@gmail.com> | 2025-12-04 13:17:48 +1100 |
| commit | 3370ea39fa730ec22e4a2f5496729543c96cc98b (patch) | |
| tree | 748af799dbc015e1ef5cd93818be9b12f0bc820f /win32 | |
| parent | 2f9129b86903d5f0756217fa719d7f1d894acebf (diff) | |
| download | scintilla-mirror-3370ea39fa730ec22e4a2f5496729543c96cc98b.tar.gz | |
Feature [feature-requests:#1564]. Use vector to store FoldMaps as map is not
nothrow default constructable.
Diffstat (limited to 'win32')
| -rw-r--r-- | win32/ScintillaWin.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index f426c8c46..5f3258a5f 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -2848,14 +2848,16 @@ void CreateFoldMap(int codePage, FoldMap *foldingMap) { class CaseFolderDBCS : public CaseFolderTable { // Allocate the expandable storage here so that it does not need to be reallocated // for each call to Fold. - const FoldMap *foldingMap; - UINT cp; + const FoldMap *foldingMap = nullptr; + UINT cp = 0; public: explicit CaseFolderDBCS(UINT cp_) : cp(cp_) { - if (!DBCSHasFoldMap(cp)) { - CreateFoldMap(cp, DBCSGetMutableFoldMap(cp)); - } foldingMap = DBCSGetFoldMap(cp); + if (!foldingMap) { + FoldMap *pfm = DBCSCreateFoldMap(cp); + CreateFoldMap(cp, pfm); + foldingMap = pfm; + } } size_t Fold(char *folded, size_t sizeFolded, const char *mixed, size_t lenMixed) override; }; |
