Wrong vtkSMProperty::CreateNewPrettyLabel behavior
vtkSMProperty::CreateNewPrettyLabel(const char*)
has two problems:
- when encountering names with multiple uppercase letters at the beginning of its argument, it will introduce a wrong space (eg:
FLUENTRenderCore
should becomeFLUENTRender Core
but becomesF LUENTRender Core
). - when encountering acronyms followed by words, words will not be split (which is normal according to the current intended behavior) (eg:
FLUENTRenderCore
should better becomeFLUENT Render Core
but would becomeFLUENTRender Core
).
Steps to reproduce first problem: Run the function with a custom main:
int main(void) {
std::cout << CreateNewPrettyLabel("MYSpace") << std::endl;
std::cout << CreateNewPrettyLabel("MYSPACE") << std::endl;
std::cout << CreateNewPrettyLabel("MySPACE") << std::endl;
std::cout << CreateNewPrettyLabel("MySPace") << std::endl;
std::cout << CreateNewPrettyLabel("MySpACE") << std::endl;
std::cout << CreateNewPrettyLabel("FLUENTRenderCore") << std::endl;
}
It gives
M YSpace // should give MYSpace
M YSPACE // should give MYSPACE
My SPACE // Ok
My SPace // Ok
My Sp ACE // Ok
F LUENTRender Core // should give FLUENTRender Core
MR
I have done an MR that fixes both issues to better split words: FLUENTRenderCore
would become FLUENT Render Core
Edited by NicolasB