diff options
author | Caolán McNamara <caolanm@redhat.com> | 2022-04-13 16:49:27 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2022-04-14 09:54:37 +0200 |
commit | c15fceae5e70483daf8355a9b7d53215b7643c2b (patch) | |
tree | 81f3bb5ca98dae54e60710d43a426776ab462747 /chart2 | |
parent | a1f9fea520f5b3f5d54a284886aa531693f32e7a (diff) |
Resolves: tdf#141625 give enough space to see full date+time
Change-Id: I31193783231f27494ed1507faa143697e8facc30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132977
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/controller/dialogs/tp_Scale.cxx | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/chart2/source/controller/dialogs/tp_Scale.cxx b/chart2/source/controller/dialogs/tp_Scale.cxx index 5c60dce0872d..7147dfa84a31 100644 --- a/chart2/source/controller/dialogs/tp_Scale.cxx +++ b/chart2/source/controller/dialogs/tp_Scale.cxx @@ -26,6 +26,7 @@ #include <svx/svxids.hrc> #include <osl/diagnose.h> +#include <sfx2/dialoghelper.hxx> #include <svx/chrtitem.hxx> #include <svl/eitem.hxx> #include <svl/intitem.hxx> @@ -557,6 +558,12 @@ void ScaleTabPage::SetNumFormat() nFmt = pNumFormatter->GetStandardFormat( SvNumFormatType::TIME, pFormat->GetLanguage() ); else nFmt = pNumFormatter->GetStandardFormat( SvNumFormatType::TIME ); + + // tdf#141625 give enough space to see full date+time + int nWidestTime(m_xFmtFldMin->get_pixel_size(getWidestDateTime(Application::GetSettings().GetLocaleDataWrapper(), true)).Width()); + int nWidthChars = std::ceil(nWidestTime / m_xFmtFldMin->get_approximate_digit_width()) + 1; + m_xFmtFldMin->set_width_chars(nWidthChars); + m_xFmtFldMax->set_width_chars(nWidthChars); } if( m_nAxisType == chart2::AxisType::DATE && ( eType != SvNumFormatType::DATE && eType != SvNumFormatType::DATETIME) ) |