diff options
author | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-08-23 09:57:05 +0100 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-08-23 13:00:41 +0200 |
commit | a8aa643a07c2280a22c12adee4e358e100028d20 (patch) | |
tree | 2adfd57074d9f5cab85a20ae473f7fe4eb854c18 /sc | |
parent | f2b6a04f37e24e47984eb2539771a86cf7b08d4b (diff) |
Resolves: tdf#157486 measure with font used in the csv grid
and not with the font of the parent widget
Change-Id: Idddf63022a5f838c73c04735829335a3056c82af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/172307
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/dbgui/csvtablebox.cxx | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sc/source/ui/dbgui/csvtablebox.cxx b/sc/source/ui/dbgui/csvtablebox.cxx index 109406467967..2a3a16c0c550 100644 --- a/sc/source/ui/dbgui/csvtablebox.cxx +++ b/sc/source/ui/dbgui/csvtablebox.cxx @@ -28,8 +28,9 @@ ScCsvTableBox::ScCsvTableBox(weld::Builder& rBuilder) , mxGridWeld(new weld::CustomWeld(rBuilder, u"csvgrid"_ustr, *mxGrid)) , maEndScrollIdle("ScCsvTableBox maEndScrollIdle") { - Size aSize(mxScroll->get_approximate_digit_width() * 67, - mxScroll->get_text_height() * 10); + const OutputDevice& rRefDev = mxGrid->GetDrawingArea()->get_ref_device(); + Size aSize(rRefDev.approximate_digit_width() * 67, + rRefDev.GetTextHeight() * 10); // this needs to be larger than the ScCsvGrid initial size to get it // to stretch to fit, see ScCsvGrid::SetDrawingArea mxScroll->set_size_request(aSize.Width(), aSize.Height()); |