diff options
Diffstat (limited to 'l10ntools/source/helper.hxx')
-rw-r--r-- | l10ntools/source/helper.hxx | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/l10ntools/source/helper.hxx b/l10ntools/source/helper.hxx index 59f86287fd72..ee03eda3a162 100644 --- a/l10ntools/source/helper.hxx +++ b/l10ntools/source/helper.hxx @@ -32,6 +32,7 @@ #include "sal/config.h" +#include <algorithm> #include <cassert> #include "rtl/string.hxx" @@ -99,6 +100,14 @@ inline sal_Int32 indexOfAnyAsciiL( return -1; } +template< typename T > inline T abbreviate( + T const & text, sal_Int32 start, sal_Int32 length) +{ + start = std::max(0, start); + assert(start <= text.getLength()); + return text.copy(start, std::min(text.getLength() - start, length)); +} + } #endif |