[PATCH 1/2] Replace SvStringsISortDtor in edtwin.cxx and gloslst.[ch]xx
Brad Sowden
code at sowden.org
Mon Jun 4 05:01:24 PDT 2012
Hi,
This patch converts a SvStringsISortDtor to a vector and maintains
equivalent functionality.
Instead of sorting strings upon each insertion all strings are now added
and then a single sort and "unique" are applied (SvStringsISortDtor
behaves like a SET with regards to insertion, which is why "unique" is
applied). SwEditWin::ShowAutoTextCorrectQuickHelp() is the only place
where strings are added to the vector.
The change in behaviour from keeping the first inserted version of a
string to keeping the first version post-sort (case-insensitive ASCII
comparison) should have no material impact as the strings retrieved from
SwAutoCompleteWord are already unique (case-insensitive ASCII
comparison) and the capitalization of the string is generally changed
anyway to match the capitalization of the word to be auto-completed.
Also, there appears to be no logical reason to store the first inserted
version of a string over the first version post-sort.
* In previous patches that I've seen on the list it appears ok to
convert a vector of String pointers to simply a vector of String values
so I've done the same.
* I used a pointer to the vector as the move() function previously
copied and cleared all elements whereas a pointer swap would suffice.
* I've put a TODO in the code to replace the ASCII only case-insensitive
sort (existing limitation).
- make + make dev-install successful
- functionality tested ok
- licence statement on file
Cheers,
Brad
More information about the LibreOffice
mailing list