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 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;