From 9d928231e71806d4cfe76af2159630bff242c5da Mon Sep 17 00:00:00 2001 From: Michael Weghorn Date: Mon, 29 Jan 2024 14:42:24 +0100 Subject: tdf#130857 VclBuilder: Extract static methods to new base class Extract static methods from VclBuilder to a new base class BuilderBase that can be reused by other builder implementations (like the upcoming one for the Qt-based VCL plugins) in the future. Change-Id: I719ab5fe1b8a6b36050815204550aae3e3dd25e0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162917 Tested-by: Jenkins Reviewed-by: Michael Weghorn --- include/vcl/builder.hxx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'include/vcl') diff --git a/include/vcl/builder.hxx b/include/vcl/builder.hxx index 64538f81272e..e53a89321095 100644 --- a/include/vcl/builder.hxx +++ b/include/vcl/builder.hxx @@ -64,12 +64,23 @@ struct ComboBoxTextItem } }; -/// Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar, etc. -class VCL_DLLPUBLIC VclBuilder +class VCL_DLLPUBLIC BuilderBase { public: typedef std::map stringmap; typedef std::map> accelmap; + +protected: + static void collectPangoAttribute(xmlreader::XmlReader& reader, stringmap& rMap); + static void collectAtkRelationAttribute(xmlreader::XmlReader& reader, stringmap& rMap); + static void collectAtkRoleAttribute(xmlreader::XmlReader& reader, stringmap& rMap); + static void collectAccelerator(xmlreader::XmlReader& reader, accelmap& rMap); +}; + +/// Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar, etc. +class VCL_DLLPUBLIC VclBuilder : public BuilderBase +{ +public: /// These functions create a new widget with parent pParent and return it in rRet typedef void (*customMakeWidget)(VclPtr &rRet, const VclPtr &pParent, stringmap &rVec); @@ -351,10 +362,6 @@ private: static OUString getStyleClass(xmlreader::XmlReader &reader); void applyPackingProperty(vcl::Window *pCurrent, vcl::Window *pParent, xmlreader::XmlReader &reader); void collectProperty(xmlreader::XmlReader &reader, stringmap &rVec) const; - static void collectPangoAttribute(xmlreader::XmlReader &reader, stringmap &rMap); - static void collectAtkRelationAttribute(xmlreader::XmlReader &reader, stringmap &rMap); - static void collectAtkRoleAttribute(xmlreader::XmlReader &reader, stringmap &rMap); - static void collectAccelerator(xmlreader::XmlReader &reader, accelmap &rMap); void insertMenuObject( Menu *pParent, -- cgit