summaryrefslogtreecommitdiff
path: root/sfx2
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2022-04-13 16:49:27 +0100
committerAndras Timar <andras.timar@collabora.com>2022-04-14 14:02:12 +0200
commit43bb6472ef3942585f0991ee02a64565e8c751c6 (patch)
tree0aea6532678d43e40e7b69be7f828f937b71a22e /sfx2
parentd3842b708a71bcadddf79a518de1175b622a4917 (diff)
Resolves: tdf#141625 give enough space to see full date+time
Change-Id: I31193783231f27494ed1507faa143697e8facc30 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132987 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos <fitojb@ubuntu.com>
Diffstat (limited to 'sfx2')
-rw-r--r--sfx2/source/dialog/dialoghelper.cxx8
-rw-r--r--sfx2/source/dialog/versdlg.cxx8
2 files changed, 8 insertions, 8 deletions
diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx
index 93e697b29517..9585c8baac80 100644
--- a/sfx2/source/dialog/dialoghelper.cxx
+++ b/sfx2/source/dialog/dialoghelper.cxx
@@ -32,17 +32,17 @@ Size getPreviewOptionsSize(const OutputDevice& rReference)
return rReference.LogicToPixel(Size(70, 27), MapMode(MapUnit::MapAppFont));
}
-OUString getWidestTime(const LocaleDataWrapper& rWrapper)
+OUString getWidestDateTime(const LocaleDataWrapper& rWrapper, bool bWithSec)
{
Date aDate(22, 12, 2000);
tools::Time aTime(22, 59, 59);
DateTime aDateTime(aDate, aTime);
- return formatTime(aDateTime, rWrapper);
+ return formatDateTime(aDateTime, rWrapper, bWithSec);
}
-OUString formatTime(const DateTime& rDateTime, const LocaleDataWrapper& rWrapper)
+OUString formatDateTime(const DateTime& rDateTime, const LocaleDataWrapper& rWrapper, bool bWithSec)
{
- return rWrapper.getDate(rDateTime) + " " + rWrapper.getTime(rDateTime, false);
+ return rWrapper.getDate(rDateTime) + " " + rWrapper.getTime(rDateTime, bWithSec);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx
index 6de0d866c30b..53ea62b0eccd 100644
--- a/sfx2/source/dialog/versdlg.cxx
+++ b/sfx2/source/dialog/versdlg.cxx
@@ -115,7 +115,7 @@ namespace
void setColSizes(weld::TreeView& rVersionBox)
{
// recalculate the datetime column width
- int nWidestTime(rVersionBox.get_pixel_size(getWidestTime(Application::GetSettings().GetLocaleDataWrapper())).Width());
+ int nWidestTime(rVersionBox.get_pixel_size(getWidestDateTime(Application::GetSettings().GetLocaleDataWrapper(), false)).Width());
int nW1 = rVersionBox.get_pixel_size(rVersionBox.get_column_title(1)).Width();
int nMax = std::max(nWidestTime, nW1) + 12; // max width + a little offset
@@ -217,7 +217,7 @@ void SfxVersionDialog::Init_Impl()
for (size_t n = 0; n < m_pTable->size(); ++n)
{
SfxVersionInfo *pInfo = m_pTable->at( n );
- OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
+ OUString aEntry = formatDateTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper(), false);
m_xVersionBox->append(OUString::number(reinterpret_cast<sal_Int64>(pInfo)), aEntry);
auto nLastRow = m_xVersionBox->n_children() - 1;
m_xVersionBox->set_text(nLastRow, pInfo->aAuthor, 1);
@@ -394,7 +394,7 @@ SfxViewVersionDialog_Impl::SfxViewVersionDialog_Impl(weld::Window *pParent, SfxV
OUString sAuthor = rInfo.aAuthor.isEmpty() ? SfxResId(STR_NO_NAME_SET) : rInfo.aAuthor;
const LocaleDataWrapper& rLocaleWrapper( Application::GetSettings().GetLocaleDataWrapper() );
- m_xDateTimeText->set_label(m_xDateTimeText->get_label() + formatTime(rInfo.aCreationDate, rLocaleWrapper));
+ m_xDateTimeText->set_label(m_xDateTimeText->get_label() + formatDateTime(rInfo.aCreationDate, rLocaleWrapper, false));
m_xSavedByText->set_label(m_xSavedByText->get_label() + sAuthor);
m_xEdit->set_text(rInfo.aComment);
m_xEdit->set_size_request(40 * m_xEdit->get_approximate_digit_width(),
@@ -459,7 +459,7 @@ void SfxCmisVersionsDialog::LoadVersions()
for (size_t n = 0; n < m_pTable->size(); ++n)
{
SfxVersionInfo *pInfo = m_pTable->at( n );
- OUString aEntry = formatTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper());
+ OUString aEntry = formatDateTime(pInfo->aCreationDate, Application::GetSettings().GetLocaleDataWrapper(), false);
m_xVersionBox->append(OUString::number(reinterpret_cast<sal_Int64>(pInfo)), aEntry);
auto nLastRow = m_xVersionBox->n_children() - 1;
m_xVersionBox->set_text(nLastRow, pInfo->aAuthor, 1);