[Libreoffice-commits] core.git: 2 commits - svx/source vcl/source
Caolán McNamara
caolanm at redhat.com
Tue Dec 19 09:09:10 UTC 2017
svx/source/form/filtnav.cxx | 14 +++++++-------
vcl/source/window/builder.cxx | 7 ++++---
2 files changed, 11 insertions(+), 10 deletions(-)
New commits:
commit 386a73e0b76032b4992829bfdf9965854351b230
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 18 10:03:48 2017 +0000
remove a CONTAINER_APPEND use
Change-Id: I266a1741581a06a995c8cb012dcb18a32a38026d
Reviewed-on: https://gerrit.libreoffice.org/46699
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx
index 8a280a0a4a1a..37a91bf0d4e3 100644
--- a/svx/source/form/filtnav.cxx
+++ b/svx/source/form/filtnav.cxx
@@ -198,14 +198,14 @@ public:
class FmFilterInsertedHint : public FmFilterHint
{
- sal_uLong m_nPos; // Position relative to the parent of the data
+ size_t m_nPos; // Position relative to the parent of the data
public:
- FmFilterInsertedHint(FmFilterData* pData, sal_uLong nRelPos)
+ FmFilterInsertedHint(FmFilterData* pData, size_t nRelPos)
:FmFilterHint(pData)
,m_nPos(nRelPos){}
- sal_uLong GetPos() const { return m_nPos; }
+ size_t GetPos() const { return m_nPos; }
};
class FmFilterRemovedHint : public FmFilterHint
@@ -710,18 +710,18 @@ void FmFilterModel::AppendFilterItems( FmFormItem& _rFormItem )
}
}
-
void FmFilterModel::Insert(const ::std::vector<FmFilterData*>::iterator& rPos, FmFilterData* pData)
{
+ size_t nPos;
::std::vector<FmFilterData*>& rItems = pData->GetParent()->GetChildren();
- sal_uLong nPos = rPos == rItems.end() ? CONTAINER_APPEND : rPos - rItems.begin();
- if (nPos == CONTAINER_APPEND)
+ if (rPos == rItems.end())
{
+ nPos = rItems.size();
rItems.push_back(pData);
- nPos = rItems.size() - 1;
}
else
{
+ nPos = rPos - rItems.begin();
rItems.insert(rPos, pData);
}
commit 5f103b6f03bf9de16c0cc8d33a9a7082f05563f3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Dec 18 10:41:12 2017 +0000
coverity#1426313 Unchecked return value
Change-Id: Ic6eb7eec01ced2105144b123f8f9f8ecd25f6008
Reviewed-on: https://gerrit.libreoffice.org/46702
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm at redhat.com>
Tested-by: Caolán McNamara <caolanm at redhat.com>
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index 624e15f76ab4..536f07cd1b6a 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -1636,14 +1636,15 @@ VclPtr<vcl::Window> VclBuilder::makeObject(vcl::Window *pParent, const OString &
sModuleBuf.append("mergedlo");
sModuleBuf.append(SAL_DLLEXTENSION);
OUString sMergedModule = sModuleBuf.makeStringAndClear();
- pModule->loadRelative(&thisModule, sMergedModule);
+ bool ok = pModule->loadRelative(&thisModule, sMergedModule);
if (!pModule->getFunctionSymbol(sFunction))
{
- pModule->loadRelative(&thisModule, sModule);
+ ok = pModule->loadRelative(&thisModule, sModule);
}
#else
- pModule->loadRelative(&thisModule, sModule);
+ bool ok = pModule->loadRelative(&thisModule, sModule);
#endif
+ assert(ok || "bad module name in .ui"); (void)ok;
aI = m_aModuleMap.insert(std::make_pair(sModule, std::unique_ptr<osl::Module>(pModule))).first;
}
customMakeWidget pFunction = reinterpret_cast<customMakeWidget>(aI->second->getFunctionSymbol(sFunction));
More information about the Libreoffice-commits
mailing list