bin/ui-rules-enforcer.py | 11 +++++++ solenv/sanitizers/ui/modules/swriter.suppr | 2 - sw/source/ui/index/cnttab.cxx | 3 -- sw/source/uibase/inc/swuicnttab.hxx | 1 sw/uiconfig/swriter/ui/tocentriespage.ui | 40 ++++------------------------- vcl/qt5/QtInstanceBuilder.cxx | 1 6 files changed, 19 insertions(+), 39 deletions(-)
New commits: commit 4c98f86bf9a5b55d1150fb6b07d04f9e925b5e35 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Aug 8 09:37:07 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Aug 9 01:00:49 2025 +0200 tdf#130857 Enforce GtkFrame's label child is a GtkLabel Extend ui-rules-enforcer.py to detect cases where a GtkFrame's "label" child is not a GtkLabel, but another kind of widget. Any existing cases breaking that rule were previously addressed in previous commits, see e.g. commit 82308d6a6853463f660dc6d6a11a2c12d198c4ed Author: Michael Weghorn <m.wegh...@posteo.de> Date: Thu Aug 7 16:15:12 2025 +0200 tdf#130857 svx: Don't use GtkBox as GtkFrame label child for an example and more background. Therefore, for a in `git ls-files "*.ui"`; do bin/ui-rules-enforcer.py $a; done doesn't report any issues any more, and adding this rule is meant to help preventing that any new ones are introduced. Change-Id: I367c2d52e32a66d123825f0ce820a29784c6f529 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189152 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/bin/ui-rules-enforcer.py b/bin/ui-rules-enforcer.py index 7e1002224a3e..da5e35f6e017 100755 --- a/bin/ui-rules-enforcer.py +++ b/bin/ui-rules-enforcer.py @@ -605,6 +605,16 @@ def enforce_no_productname_in_accessible_description(current, adjustments): if "%PRODUCTNAME" in child.text: raise Exception(sys.argv[1] + ': %PRODUCTNAME used in accessible-description:' , child.text) +def enforce_label_child_is_label(current): + # Ensure that only GtkLabel is used for a <child type="label">, + # which is an assumption that e.g. weld::Frame::set_label implementations make + label_children = current.findall(".//child[@type='label']") + for label_child in label_children: + for child in label_child: + classname = child.get('class') + if classname and classname != 'GtkLabel': + raise Exception(sys.argv[1] + ': <child type="label"> is not a GtkLabel', child.attrib.get("id")) + def enforce_menuitem_id(current): # gtk4 VCL plugin requires "id" attribute for menu items for child in current: @@ -644,6 +654,7 @@ remove_label_angle(root) remove_expander_label_fill(root) remove_expander_spacing(root) enforce_menubutton_indicator_consistency(root) +enforce_label_child_is_label(root) enforce_menuitem_id(root) enforce_active_in_group_consistency(root) enforce_entry_text_column_id_column_for_gtkcombobox(root) commit aa888ba5af68461566ed49d3e8a4c952bba3a693 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Aug 8 09:25:37 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Aug 9 01:00:43 2025 +0200 tdf#130857 sw: Don't use GtkBox as GtkFrame label child The "typeft" label was never shown, but only used to get the "Type" string in order to set it as the text for the "levelft" label in certain circumstances. Change the approach and use the already existing string resource STR_AUTH_FIELD_AUTHORITY_TYPE. That allows to drop the unused label, which in turn allows dropping the GtkBox previously containing both labels, which was set as the "label" child of the GtkFrame. Instead, set the "levelft" label directly as the label child, which is more in line with weld::Frame API expectations. The dialog can be triggered from Writer using "Insert" -> "Table of Contents and Index..." -> "Table of Contents, Index or Bibliography..." This commit is similar to previous commit commit 82308d6a6853463f660dc6d6a11a2c12d198c4ed Author: Michael Weghorn <m.wegh...@posteo.de> Date: Thu Aug 7 16:15:12 2025 +0200 tdf#130857 svx: Don't use GtkBox as GtkFrame label child See the commit message of the above-mentioned commit for more background. Change-Id: I88340d4f00dbe3b872f5547612694f0854f17238 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189151 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> diff --git a/solenv/sanitizers/ui/modules/swriter.suppr b/solenv/sanitizers/ui/modules/swriter.suppr index 220e3ca0cf1d..c1a0e0df5455 100644 --- a/solenv/sanitizers/ui/modules/swriter.suppr +++ b/solenv/sanitizers/ui/modules/swriter.suppr @@ -133,8 +133,6 @@ sw/uiconfig/swriter/ui/testmailsettings.ui://GtkLabel[@id='establish'] orphan-la sw/uiconfig/swriter/ui/testmailsettings.ui://GtkLabel[@id='find'] orphan-label sw/uiconfig/swriter/ui/testmailsettings.ui://GtkLabel[@id='result1'] orphan-label sw/uiconfig/swriter/ui/testmailsettings.ui://GtkLabel[@id='result2'] orphan-label -sw/uiconfig/swriter/ui/tocentriespage.ui://GtkLabel[@id='levelft'] orphan-label -sw/uiconfig/swriter/ui/tocentriespage.ui://GtkLabel[@id='typeft'] orphan-label sw/uiconfig/swriter/ui/tocentriespage.ui://GtkLabel[@id='label15'] orphan-label sw/uiconfig/swriter/ui/tocentriespage.ui://GtkLabel[@id='label16'] orphan-label sw/uiconfig/swriter/ui/tocentriespage.ui://GtkLabel[@id='label17'] orphan-label diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 337df748ed2c..4a9430bfdb19 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -1926,10 +1926,10 @@ namespace SwTOXEntryTabPage::SwTOXEntryTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rAttrSet) : SfxTabPage(pPage, pController, u"modules/swriter/ui/tocentriespage.ui"_ustr, u"TocEntriesPage"_ustr, &rAttrSet) , m_sDelimStr(SwResId(STR_DELIM)) + , m_sAuthTypeStr(SwResId(STR_AUTH_FIELD_AUTHORITY_TYPE)) , m_sNoCharStyle(SwResId(STR_NO_CHAR_STYLE)) , m_pCurrentForm(nullptr) , m_bInLevelHdl(false) - , m_xTypeFT(m_xBuilder->weld_label(u"typeft"_ustr)) , m_xLevelFT(m_xBuilder->weld_label(u"levelft"_ustr)) , m_xLevelLB(m_xBuilder->weld_tree_view(u"level"_ustr)) , m_xAllLevelsPB(m_xBuilder->weld_button(u"all"_ustr)) @@ -1979,7 +1979,6 @@ SwTOXEntryTabPage::SwTOXEntryTabPage(weld::Container* pPage, weld::DialogControl { const OUString sNoCharSortKey(SwResId(STR_NOSORTKEY)); - m_sAuthTypeStr = m_xTypeFT->get_label(); m_sLevelStr = m_xLevelFT->get_label(); m_xAuthFieldsLB->make_sorted(); m_xTokenWIN->SetTabPage(this); diff --git a/sw/source/uibase/inc/swuicnttab.hxx b/sw/source/uibase/inc/swuicnttab.hxx index d76fcb505bad..06c8e192fffc 100644 --- a/sw/source/uibase/inc/swuicnttab.hxx +++ b/sw/source/uibase/inc/swuicnttab.hxx @@ -317,7 +317,6 @@ class SwTOXEntryTabPage final : public SfxTabPage CurTOXType m_aLastTOXType; bool m_bInLevelHdl; - std::unique_ptr<weld::Label> m_xTypeFT; std::unique_ptr<weld::Label> m_xLevelFT; std::unique_ptr<weld::TreeView> m_xLevelLB; std::unique_ptr<weld::Button> m_xAllLevelsPB; diff --git a/sw/uiconfig/swriter/ui/tocentriespage.ui b/sw/uiconfig/swriter/ui/tocentriespage.ui index 0997b908d4c1..b59598fa2258 100644 --- a/sw/uiconfig/swriter/ui/tocentriespage.ui +++ b/sw/uiconfig/swriter/ui/tocentriespage.ui @@ -109,42 +109,14 @@ </object> </child> <child type="label"> - <object class="GtkBox" id="box1"> + <object class="GtkLabel" id="levelft"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="orientation">vertical</property> - <child> - <object class="GtkLabel" id="levelft"> - <property name="visible">True</property> - <property name="can-focus">False</property> - <property name="label" translatable="yes" context="tocentriespage|levelft">_Level</property> - <property name="use-underline">True</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">0</property> - </packing> - </child> - <child> - <object class="GtkLabel" id="typeft"> - <property name="can-focus">False</property> - <property name="no-show-all">True</property> - <property name="label" translatable="yes" context="tocentriespage|typeft">_Type</property> - <property name="use-underline">True</property> - <attributes> - <attribute name="weight" value="bold"/> - </attributes> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> - </child> + <property name="label" translatable="yes" context="tocentriespage|levelft">_Level</property> + <property name="use-underline">True</property> + <attributes> + <attribute name="weight" value="bold"/> + </attributes> </object> </child> </object> commit e8f269e610c467b8223c82ba271c6ae9ceba4d87 Author: Michael Weghorn <m.wegh...@posteo.de> AuthorDate: Fri Aug 8 09:00:46 2025 +0200 Commit: Michael Weghorn <m.wegh...@posteo.de> CommitDate: Sat Aug 9 01:00:35 2025 +0200 tdf#130857 qt weld: Support dialog asking whether to print form letter This means that native Qt widgets are used for that dialog now when using the qt5 or qt6 VCL plugin and starting LO with environment variable SAL_VCL_QT_USE_WELDED_WIDGETS=1 set. The dialog can be triggered as follows: * start Writer * "Insert" -> "Field" -> "More Fields" * switch to "Database" tab * select "Mail merge fields" for the type * click "Browse" button next to the "Add database file" label and select any database file * in the "Database Selection" treeview, select any column of the database * press the "Insert" button * close the "Fields" dialog * press Ctrl+P to trigger the print dialog, which triggers the dialog asking whether to print a form letter Change-Id: Iab9e5869f7540d5b7bc751156c63d6411defc40f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/189150 Reviewed-by: Michael Weghorn <m.wegh...@posteo.de> Tested-by: Jenkins diff --git a/vcl/qt5/QtInstanceBuilder.cxx b/vcl/qt5/QtInstanceBuilder.cxx index ba4fa4f30a2d..15e5f4d6a4c5 100644 --- a/vcl/qt5/QtInstanceBuilder.cxx +++ b/vcl/qt5/QtInstanceBuilder.cxx @@ -159,6 +159,7 @@ bool QtInstanceBuilder::IsUIFileSupported(const OUString& rUIFile, const weld::W u"modules/swriter/ui/inserttable.ui"_ustr, u"modules/swriter/ui/linenumbering.ui"_ustr, u"modules/swriter/ui/numberingnamedialog.ui"_ustr, + u"modules/swriter/ui/printmergedialog.ui"_ustr, u"modules/swriter/ui/renameautotextdialog.ui"_ustr, u"modules/swriter/ui/renameobjectdialog.ui"_ustr, u"modules/swriter/ui/rowheight.ui"_ustr,