From e3f58fd53e0dbf467e4a37433b0f85835aa4a09a Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 23 Jul 2004 22:05:30 +0000 Subject: - Move formatInt to a better place --- src/xmlcomposer.cpp | 29 +++++++++++++++-------------- src/xmlcomposer.h | 4 ---- 2 files changed, 15 insertions(+), 18 deletions(-) diff --git a/src/xmlcomposer.cpp b/src/xmlcomposer.cpp index dd178fb..9f943ed 100644 --- a/src/xmlcomposer.cpp +++ b/src/xmlcomposer.cpp @@ -42,6 +42,21 @@ #include "domhelpers.h" #include "tags.h" + +wstring formatInt(int num) +{ + char buff[16]; + + // Certain OSs don't support swprintf :( + sprintf(buff, "%d", num); + + wstring n; + for(char* s = buff; *s; s++) + n.append(1, *s); + + return n; +} + /* ---------------------------------------------------------------------------------- * CONSTRUCTION */ @@ -295,20 +310,6 @@ void XmlComposer::incrementAutoCount(int type) m_autocount[type]++; } -wstring XmlComposer::formatInt(int num) -{ - char buff[16]; - - // Certain OSs don't support swprintf :( - sprintf(buff, "%d", num); - - wstring n; - for(char* s = buff; *s; s++) - n.append(1, *s); - - return n; -} - /* ---------------------------------------------------------------------------------- * CONVENIENCE MACROS USED BELOW diff --git a/src/xmlcomposer.h b/src/xmlcomposer.h index 97eb533..e857ace 100644 --- a/src/xmlcomposer.h +++ b/src/xmlcomposer.h @@ -125,10 +125,6 @@ public: { return m_options; } - // TODO: Should this be somewhere else? - static wstring formatInt(int num); - - // LevelHandler override protected: virtual void clear(); -- cgit v1.2.3