QElectroTech 0.200.1-dev
Loading...
Searching...
No Matches
anonymous_namespace{numerotationcontextcommands.cpp} Namespace Reference

Functions

QString incrementAlpha (QString value)
 incrementAlpha Base-26 letter increment (a, b, ... z, aa, ab, ... az, ba, ...), the same algorithm as incrementing a spreadsheet column name. Carries right-to-left on 'z'/'Z' overflow; if the whole string overflows, a new leading letter is prepended (lowercase 'a').
QString decrementAlpha (QString value)
 decrementAlpha Inverse of incrementAlpha(): borrows right-to-left on 'a'/'A' underflow. Symmetric shrink case (e.g. "aa" -> "z"): once every position has borrowed, the leading letter is dropped rather than left as an extra 'z'. A single-letter value already at "a"/"A" has no representable predecessor and is left unchanged, the same way the numeric parts don't clamp but a blank label would be worse here than a value that stops decreasing.

Function Documentation

◆ decrementAlpha()

QString anonymous_namespace{numerotationcontextcommands.cpp}::decrementAlpha ( QString value)

decrementAlpha Inverse of incrementAlpha(): borrows right-to-left on 'a'/'A' underflow. Symmetric shrink case (e.g. "aa" -> "z"): once every position has borrowed, the leading letter is dropped rather than left as an extra 'z'. A single-letter value already at "a"/"A" has no representable predecessor and is left unchanged, the same way the numeric parts don't clamp but a blank label would be worse here than a value that stops decreasing.

Parameters
value: current alphabetic value; treated as "a" if empty.
Returns
the previous value.

◆ incrementAlpha()

QString anonymous_namespace{numerotationcontextcommands.cpp}::incrementAlpha ( QString value)

incrementAlpha Base-26 letter increment (a, b, ... z, aa, ab, ... az, ba, ...), the same algorithm as incrementing a spreadsheet column name. Carries right-to-left on 'z'/'Z' overflow; if the whole string overflows, a new leading letter is prepended (lowercase 'a').

Parameters
value: current alphabetic value; treated as "a" if empty.
Returns
the next value.