tdf#120703 PVS: drop the unused code
V547 Expression '!pGroupInfo->m_pModule' is always false
The chunk of code updating module pointers was always doing nothing
since the beginning (commit 997cf427da6c6c1d145a74e3c23a2a1adb3e2e7d
from 2004), because the line to load the module was commented out.
So just remove it now.
Change-Id: I8db38e795662bba6b3b4693e7ba8a869a97acdd2
Reviewed-on: https://gerrit.libreoffice.org/63232
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index d8010ae..b748307 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1009,53 +1009,15 @@
{
if(pGroupInfo->m_bLoadError)
return;
else
{
if(pGroupInfo->m_pModule /*&& !pGroupInfo->pModule->IsLoaded()*/)
{
SfxModule* pOldModule = pGroupInfo->m_pModule;
bool bIdentical = pGroupInfo->m_pModule == pGroupInfo->m_pShell;
WaitObject aWait(this);
//pGroupInfo->pModule = pGroupInfo->pModule->Load();
if(!pGroupInfo->m_pModule)
{
pGroupInfo->m_bLoadError = true;
std::unique_ptr<weld::MessageDialog> xInfoBox(Application::CreateMessageDialog(pBox->GetFrameWeld(),
VclMessageType::Info, VclButtonsType::Ok,
sNotLoadedError));
xInfoBox->run();
return;
}
if(bIdentical)
pGroupInfo->m_pShell = pGroupInfo->m_pModule;
// now test whether there was the same module in other groups, too (e. g. Text+HTML)
SvTreeListEntry* pTemp = pTreeLB->First();
while(pTemp)
{
if(!pTreeLB->GetParent(pTemp) && pTemp != pEntry)
{
OptionsGroupInfo* pTGInfo = static_cast<OptionsGroupInfo *>(pTemp->GetUserData());
if(pTGInfo->m_pModule == pOldModule)
{
pTGInfo->m_pModule = pGroupInfo->m_pModule;
if(bIdentical)
pTGInfo->m_pShell = pGroupInfo->m_pModule;
}
}
pTemp = pTreeLB->Next(pTemp);
}
}
if(!pGroupInfo->m_pInItemSet)
pGroupInfo->m_pInItemSet = pGroupInfo->m_pShell
? pGroupInfo->m_pShell->CreateItemSet( pGroupInfo->m_nDialogId )
: CreateItemSet( pGroupInfo->m_nDialogId );
if(!pGroupInfo->m_pOutItemSet)
pGroupInfo->m_pOutItemSet = o3tl::make_unique<SfxItemSet>(
*pGroupInfo->m_pInItemSet->GetPool(),
pGroupInfo->m_pInItemSet->GetRanges());
}
if(!pGroupInfo->m_pInItemSet)
pGroupInfo->m_pInItemSet = pGroupInfo->m_pShell
? pGroupInfo->m_pShell->CreateItemSet( pGroupInfo->m_nDialogId )
: CreateItemSet( pGroupInfo->m_nDialogId );
if(!pGroupInfo->m_pOutItemSet)
pGroupInfo->m_pOutItemSet = o3tl::make_unique<SfxItemSet>(
*pGroupInfo->m_pInItemSet->GetPool(),
pGroupInfo->m_pInItemSet->GetRanges());
TabPageParent pPageParent(pTabBox);