summaryrefslogtreecommitdiff
path: root/cui/source/options/treeopt.cxx
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-08-28 16:36:00 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-08-28 22:01:29 +0200
commite08b4144d9d0f0b05ef0f1c51c111d5a56e616a5 (patch)
treeeb32653d2c2926a0cb2e490054a4e818e4f262c8 /cui/source/options/treeopt.cxx
parent918316ba57230b1eaaf5138507546f743687e52b (diff)
move GetMinimumEditHeight calc to weldutils and reuse in calc
Change-Id: I3980bbaf269260243c8fcd8fe95cc03deac144ee Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101558 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source/options/treeopt.cxx')
-rw-r--r--cui/source/options/treeopt.cxx10
1 files changed, 3 insertions, 7 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 55447259e940..f96f0ceefab3 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -100,6 +100,7 @@
#include <unotools/viewoptions.hxx>
#include <vcl/help.hxx>
#include <vcl/svapp.hxx>
+#include <vcl/weldutils.hxx>
#include <vcl/window.hxx>
#include <sal/log.hxx>
@@ -483,13 +484,8 @@ void OfaTreeOptionsDialog::InitWidgets()
xTabBox = m_xBuilder->weld_container("box");
Size aSize(xTreeLB->get_approximate_digit_width() * 82, xTreeLB->get_height_rows(30));
#if HAVE_FEATURE_GPGME
- {
- // load this little .ui just to measure the height of an Entry
- std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(m_xDialog.get(), "cui/ui/namedialog.ui"));
- std::unique_ptr<weld::Entry> xEntry(xBuilder->weld_entry("name_entry"));
- // tdf#115015: make enough space for crypto settings (approx. 14 text edits + padding)
- aSize.setHeight((xEntry->get_preferred_size().Height() + 6) * 14);
- }
+ // tdf#115015: make enough space for crypto settings (approx. 14 text edits + padding)
+ aSize.setHeight((weld::GetMinimumEditHeight() + 6) * 14);
#endif
xTabBox->set_size_request(aSize.Width(), aSize.Height());
xTreeLB->set_size_request(xTreeLB->get_approximate_digit_width() * 30, aSize.Height());