summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2024-10-24 18:12:52 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2024-10-25 08:57:51 +0200
commit05a38a21092c063126d6923d0dfb47ba5d39d5c2 (patch)
tree70f7bfc2d87d56bd234dbfc03dd3e6cf28bb12bb
parent02692566ad9fc7c3484f8581ffa0004cd4e43987 (diff)
tdf#130857 VclBuilder: Move extractActive to BuilderBase
Turn this helper function into a static function in the BuilderBase class, for reuse in QtBuilder in an upcoming commit. Change-Id: I68c7e62816ff5fdd1c2a02cf5e42f90b32cff627 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/175571 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--include/vcl/builderbase.hxx2
-rw-r--r--vcl/source/window/builder.cxx26
2 files changed, 15 insertions, 13 deletions
diff --git a/include/vcl/builderbase.hxx b/include/vcl/builderbase.hxx
index 64e6bf6532d1..f7216864c11e 100644
--- a/include/vcl/builderbase.hxx
+++ b/include/vcl/builderbase.hxx
@@ -44,6 +44,8 @@ public:
typedef stringmap Adjustment;
typedef stringmap TextBuffer;
+ static sal_Int32 extractActive(stringmap& rMap);
+
protected:
BuilderBase(std::u16string_view sUIDir, const OUString& rUIFile, bool bLegacy);
virtual ~BuilderBase() = default;
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 0a820713a680..c54014053d85 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1285,18 +1285,6 @@ bool VclBuilder::extractAdjustmentToMap(const OUString& id, VclBuilder::stringma
namespace
{
- sal_Int32 extractActive(VclBuilder::stringmap &rMap)
- {
- sal_Int32 nActiveId = 0;
- VclBuilder::stringmap::iterator aFind = rMap.find(u"active"_ustr);
- if (aFind != rMap.end())
- {
- nActiveId = aFind->second.toInt32();
- rMap.erase(aFind);
- }
- return nActiveId;
- }
-
bool extractSelectable(VclBuilder::stringmap &rMap)
{
bool bSelectable = false;
@@ -3495,7 +3483,7 @@ template<typename T> static bool insertItems(vcl::Window *pWindow, VclBuilder::s
if (!pContainer)
return false;
- sal_uInt16 nActiveId = extractActive(rMap);
+ sal_uInt16 nActiveId = BuilderBase::extractActive(rMap);
for (auto const& item : rItems)
{
sal_Int32 nPos = pContainer->InsertEntry(item.m_sItem);
@@ -3754,6 +3742,18 @@ bool BuilderBase::hasOrientationVertical(VclBuilder::stringmap &rMap)
return bVertical;
}
+sal_Int32 BuilderBase::extractActive(VclBuilder::stringmap& rMap)
+{
+ sal_Int32 nActiveId = 0;
+ VclBuilder::stringmap::iterator aFind = rMap.find(u"active"_ustr);
+ if (aFind != rMap.end())
+ {
+ nActiveId = aFind->second.toInt32();
+ rMap.erase(aFind);
+ }
+ return nActiveId;
+}
+
bool BuilderBase::extractEntry(VclBuilder::stringmap &rMap)
{
bool bHasEntry = false;