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>
This commit is contained in:
parent
02692566ad
commit
05a38a2109
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user