Kaydet (Commit) 98747742 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

loplugin:singlevalfields in cui

Change-Id: Iead1e3130779566661eccf91556816724afcaa66
Reviewed-on: https://gerrit.libreoffice.org/26635Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 22864b44
......@@ -229,7 +229,6 @@ SvxMacroTabPage_::SvxMacroTabPage_(vcl::Window* pParent, const OString& rID,
: SfxTabPage( pParent, rID, rUIXMLDescription, &rAttrSet ),
m_xAppEvents(nullptr),
m_xDocEvents(nullptr),
bReadOnly(false),
bDocModified(false),
bAppEvents(false),
bInitialized(false)
......
......@@ -165,10 +165,7 @@ IconChoiceDialog::IconChoiceDialog ( vcl::Window* pParent, const OUString& rID,
pExampleSet ( nullptr ),
pRanges ( nullptr ),
bHideResetBtn ( false ),
bModal ( false ),
bInOK ( false ),
bItemsReset ( false )
bInOK ( false )
{
get(m_pOKBtn, "ok");
get(m_pApplyBtn, "apply");
......@@ -232,8 +229,6 @@ void IconChoiceDialog::dispose()
//SetViewOptUserItem( aTabPageOpt, aPageData );
}
if ( pData->bOnDemand )
delete &pData->pPage->GetItemSet();
pData->pPage.disposeAndClear();
}
delete pData;
......@@ -283,7 +278,6 @@ SvxIconChoiceCtrlEntry* IconChoiceDialog::AddTabPage(
maPageList.push_back( pData );
pData->fnGetRanges = nullptr;
pData->bOnDemand = false;
sal_uInt16 *pId = new sal_uInt16 ( nId );
SvxIconChoiceCtrlEntry* pEntry = m_pIconCtrl->InsertEntry( rIconText, rChoiceIcon );
......@@ -370,13 +364,8 @@ IMPL_LINK_NOARG_TYPED(IconChoiceDialog, OkHdl, Button*, void)
if ( OK_Impl() )
{
if ( bModal )
EndDialog( Ok() );
else
{
Ok();
Close();
}
Ok();
Close();
}
}
......@@ -387,13 +376,8 @@ IMPL_LINK_NOARG_TYPED(IconChoiceDialog, ApplyHdl, Button*, void)
if ( OK_Impl() )
{
if ( bModal )
EndDialog( Ok() );
else
{
Ok();
Close();
}
Ok();
Close();
}
}
......@@ -404,14 +388,7 @@ IMPL_LINK_NOARG_TYPED(IconChoiceDialog, ResetHdl, Button*, void)
IconChoicePageData* pData = GetPageData ( mnCurrentPageId );
DBG_ASSERT( pData, "Id nicht bekannt" );
if ( pData->bOnDemand )
{
// CSet on AIS has problems here, therefore separated
const SfxItemSet* _pSet = &( pData->pPage->GetItemSet() );
pData->pPage->Reset( *const_cast<SfxItemSet*>(_pSet) );
}
else
pData->pPage->Reset( *pSet );
pData->pPage->Reset( *pSet );
}
......@@ -431,30 +408,13 @@ void IconChoiceDialog::ActivatePageImpl ()
DBG_ASSERT( !maPageList.empty(), "keine Pages angemeldet" );
IconChoicePageData* pData = GetPageData ( mnCurrentPageId );
DBG_ASSERT( pData, "Id nicht bekannt" );
bool bReadOnly = false;
if ( pData )
{
if ( !pData->pPage )
{
const SfxItemSet* pTmpSet = nullptr;
if ( pSet )
{
if ( bItemsReset && pSet->GetParent() )
pTmpSet = pSet->GetParent();
else
pTmpSet = pSet;
}
pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, *CreateInputItemSet( mnCurrentPageId ) );
if ( pTmpSet && !pData->bOnDemand )
pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, *pTmpSet );
else
pData->pPage = (pData->fnCreatePage)( m_pTabContainer, this, *CreateInputItemSet( mnCurrentPageId ) );
if ( pData->bOnDemand )
pData->pPage->Reset( (SfxItemSet &)pData->pPage->GetItemSet() );
else
pData->pPage->Reset( *pSet );
pData->pPage->Reset( *pSet );
PageCreated( mnCurrentPageId, *pData->pPage );
}
......@@ -468,15 +428,9 @@ void IconChoiceDialog::ActivatePageImpl ()
if ( pExampleSet )
pData->pPage->ActivatePage( *pExampleSet );
SetHelpId( pData->pPage->GetHelpId() );
bReadOnly = false;
}
if ( bReadOnly || bHideResetBtn )
m_pResetBtn->Hide();
else
m_pResetBtn->Show();
m_pResetBtn->Show();
}
......@@ -545,14 +499,7 @@ void IconChoiceDialog::ResetPageImpl ()
DBG_ASSERT( pData, "Id nicht bekannt" );
if ( pData->bOnDemand )
{
// CSet on AIS has problems here, therefore separated
const SfxItemSet* _pSet = &pData->pPage->GetItemSet();
pData->pPage->Reset( *const_cast<SfxItemSet*>(_pSet) );
}
else
pData->pPage->Reset( *pSet );
pData->pPage->Reset( *pSet );
}
/**********************************************************************
......@@ -656,7 +603,6 @@ short IconChoiceDialog::Execute()
void IconChoiceDialog::Start()
{
m_pCancelBtn->SetClickHdl( LINK( this, IconChoiceDialog, CancelHdl ) );
bModal = false;
Start_Impl();
}
......@@ -765,13 +711,7 @@ short IconChoiceDialog::Ok()
if ( pPage )
{
if ( pData->bOnDemand )
{
SfxItemSet& rSet = (SfxItemSet&)pPage->GetItemSet();
rSet.ClearItem();
_bModified |= pPage->FillItemSet( &rSet );
}
else if ( pSet && !pPage->HasExchangeSupport() )
if ( pSet && !pPage->HasExchangeSupport() )
{
SfxItemSet aTmp( *pSet->GetPool(), pSet->GetRanges() );
......
......@@ -337,8 +337,6 @@ private:
sal_uInt16 m_nDlgType;
bool* m_pbAreaTP;
bool m_bDisable;
XFillAttrSetItem m_aXFillAttr;
SfxItemSet& m_rXFSet;
SfxMapUnit m_ePoolUnit;
......@@ -647,7 +645,7 @@ class SvxColorTabPage : public SfxTabPage
using TabPage::DeactivatePage;
private:
XPropertyListType meType;
static const XPropertyListType meType = XCOLOR_LIST;
VclPtr<Window> mpTopDlg;
VclPtr<CheckBox> m_pBoxEmbed;
......
......@@ -48,7 +48,6 @@ struct IconChoicePageData
CreatePage fnCreatePage; ///< pointer to the factory
GetPageRanges fnGetRanges; ///< pointer to the ranges-function
VclPtr<IconChoicePage> pPage; ///< the TabPage itself
bool bOnDemand; ///< Flag: ItemSet onDemand
bool bRefresh; ///< Flag: page has to be newly initialized
// constructor
......@@ -57,7 +56,6 @@ struct IconChoicePageData
fnCreatePage ( fnPage ),
fnGetRanges ( fnRanges ),
pPage ( nullptr ),
bOnDemand ( false ),
bRefresh ( false )
{}
};
......@@ -123,10 +121,7 @@ private:
SfxItemSet* pExampleSet;
sal_uInt16* pRanges;
bool bHideResetBtn;
bool bModal;
bool bInOK;
bool bItemsReset;
DECL_LINK_TYPED( ChosePageHdl_Impl, SvtIconChoiceCtrl*, void );
DECL_LINK_TYPED( OkHdl, Button*, void );
......
......@@ -71,7 +71,7 @@ protected:
css::uno::Reference< css::util::XModifiable > m_xModifiable;
EventsHash m_appEventsHash;
EventsHash m_docEventsHash;
bool bReadOnly, bDocModified, bAppEvents, bInitialized;
bool bDocModified, bAppEvents, bInitialized;
EventDisplayNames aDisplayNames;
SvxMacroTabPage_( vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription, const SfxItemSet& rItemSet );
......
......@@ -246,7 +246,6 @@ private:
m_xEventHdl;
css::uno::Reference< css::awt::XContainerWindowProvider >
m_xWinProvider;
bool m_bIsWindowHidden;
void CreateDialogWithHandler();
bool DispatchAction( const OUString& rAction );
......
......@@ -2155,9 +2155,7 @@ ExtensionsTabPage::ExtensionsTabPage(
m_sPageURL ( rPageURL ),
m_sEventHdl ( rEvtHdl ),
m_xWinProvider ( rProvider ),
m_bIsWindowHidden ( false )
m_xWinProvider ( rProvider )
{
}
......@@ -2272,7 +2270,6 @@ void ExtensionsTabPage::ActivatePage()
if ( m_xPage.is() )
{
m_xPage->setVisible( true );
m_bIsWindowHidden = false;
}
}
......
......@@ -305,7 +305,6 @@ struct SvxColorTabPageShadow
SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttrs)
: SfxTabPage(pParent, "ColorPage", "cui/ui/colorpage.ui", &rInAttrs)
, meType( XCOLOR_LIST )
, mpTopDlg( GetParentDialog() )
, pShadow ( new SvxColorTabPageShadow() )
, rOutAttrs ( rInAttrs )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment