[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - connectivity/source
Lionel Elie Mamane
lionel at mamane.lu
Fri Jun 28 05:27:10 PDT 2013
connectivity/source/commontools/dbconversion.cxx | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
New commits:
commit fe89aa916601e53637259c757a4da433fbc4feda
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date: Thu Jun 27 08:50:37 2013 +0200
fdo#66216 fix DBTypeConversion::toTimeString format
std::ostringstream::width is not sticky
Change-Id: I32d77bec68506b7691a4f86dadb24e62fdc13d42
Reviewed-on: https://gerrit.libreoffice.org/4564
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/connectivity/source/commontools/dbconversion.cxx b/connectivity/source/commontools/dbconversion.cxx
index 0150cdd..513a8b0 100644
--- a/connectivity/source/commontools/dbconversion.cxx
+++ b/connectivity/source/commontools/dbconversion.cxx
@@ -28,6 +28,8 @@
#include <com/sun/star/util/Time.hpp>
#include <com/sun/star/util/DateTime.hpp>
#include <rtl/ustrbuf.hxx>
+#include <sstream>
+#include <iomanip>
#define MAX_DAYS 3636532
@@ -83,11 +85,12 @@ namespace dbtools
OUString DBTypeConversion::toTimeString(const Time& rTime)
{
std::ostringstream ostr;
+ using std::setw;
ostr.fill('0');
- ostr.width(2);
- ostr << rTime.Hours << ":" << rTime.Minutes << ":" << rTime.Seconds;
- ostr.width(9);
- ostr << "." << rTime.NanoSeconds;
+ ostr << setw(2) << rTime.Hours << ":"
+ << setw(2) << rTime.Minutes << ":"
+ << setw(2) << rTime.Seconds << "."
+ << setw(9) << rTime.NanoSeconds;
return OUString::createFromAscii(ostr.str().c_str());
}
More information about the Libreoffice-commits
mailing list