[Libreoffice-commits] core.git: sfx2/source
Vert D (via logerrit)
logerrit at kemper.freedesktop.org
Wed Dec 23 10:33:41 UTC 2020
sfx2/source/control/listview.cxx | 25 +++++++------------------
1 file changed, 7 insertions(+), 18 deletions(-)
New commits:
commit 421d3fe399e798212fb6c1a14b4f2de1e545eb3c
Author: Vert D <devoptmsoi at gmx.com>
AuthorDate: Tue Dec 22 00:46:49 2020 -0500
Commit: Heiko Tietze <heiko.tietze at documentfoundation.org>
CommitDate: Wed Dec 23 11:32:59 2020 +0100
fix columns widths and formated string
Change-Id: I99d4cf17a49ce78857b282b5be5d8c88ddd7e740
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108136
Tested-by: Jenkins
Tested-by: Heiko Tietze <heiko.tietze at documentfoundation.org>
Reviewed-by: Heiko Tietze <heiko.tietze at documentfoundation.org>
diff --git a/sfx2/source/control/listview.cxx b/sfx2/source/control/listview.cxx
index d4b8769447cc..8ed1255a594f 100644
--- a/sfx2/source/control/listview.cxx
+++ b/sfx2/source/control/listview.cxx
@@ -11,7 +11,7 @@
#include <sfx2/sfxresid.hxx>
#include <tools/urlobj.hxx>
-
+#include <tools/datetime.hxx>
#include <sfx2/strings.hrc>
#include <osl/file.hxx>
#include <osl/time.h>
@@ -55,7 +55,6 @@ ListView::ListView(std::unique_ptr<weld::TreeView> xTreeView)
aWidths.push_back(static_cast<int>(nDigitWidth * 22)); /* Category Column */
aWidths.push_back(static_cast<int>(nDigitWidth * 15)); /* Application Column */
aWidths.push_back(static_cast<int>(nDigitWidth * 18)); /* Modify Column */
- aWidths.push_back(static_cast<int>(nDigitWidth * 10)); /* Size Column */
mxTreeView->set_column_fixed_widths(aWidths);
mxTreeView->set_selection_mode(SelectionMode::Multiple);
@@ -346,23 +345,13 @@ static OUString getDisplayFileModifyTime(const OUString& rURL)
if (systemTimeValue.Seconds == 0)
return OUString();
TimeValue localTimeValue;
- oslDateTime dateTime;
osl_getLocalTimeFromSystemTime(&systemTimeValue, &localTimeValue);
- osl_getDateTimeFromTimeValue(&localTimeValue, &dateTime);
-
- struct tm tm;
- tm.tm_sec = dateTime.Seconds;
- tm.tm_min = dateTime.Minutes;
- tm.tm_hour = dateTime.Hours;
- tm.tm_mday = dateTime.Day;
- tm.tm_mon = dateTime.Month - 1;
- tm.tm_year = dateTime.Year - 1900;
- char ts[50];
- for (char& c : ts)
- c = ' ';
- strftime(ts, sizeof(ts), "%x %X", &tm);
- OUString sModifyTime(ts, sizeof(ts), RTL_TEXTENCODING_UTF8);
- return sModifyTime.trim();
+ const SvtSysLocale aSysLocale;
+ const LocaleDataWrapper& rLocaleWrapper = aSysLocale.GetLocaleData();
+ DateTime aDateTime = DateTime::CreateFromUnixTime(localTimeValue.Seconds);
+ OUString aDisplayDateTime
+ = rLocaleWrapper.getDate(aDateTime) + ", " + rLocaleWrapper.getTime(aDateTime, false);
+ return aDisplayDateTime;
}
static OUString getDisplayFileSize(const OUString& rURL)
More information about the Libreoffice-commits
mailing list