From 9fd89a5952a48b473cee03a2681eb5d4cd6d1742 Mon Sep 17 00:00:00 2001 From: Ɓukasz Hryniuk Date: Sun, 4 Jan 2015 22:50:05 +0100 Subject: fdo#39440 reduce scope of local variables Beside scope changes, it fixes lack of initialization in a few places. Change-Id: Ia09fdb9845d8ac17256330a5ec5168401c84f0f2 Reviewed-on: https://gerrit.libreoffice.org/13755 Reviewed-by: Noel Grandin Tested-by: Noel Grandin --- cui/source/options/treeopt.cxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'cui/source/options') diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 05bb302140d1..99b7b7656421 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -1179,10 +1179,10 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId ) pRet->Put(aOptSet); utl::MiscCfg aMisc; - const SfxPoolItem* pItem; SfxViewFrame* pViewFrame = SfxViewFrame::Current(); if ( pViewFrame ) { + const SfxPoolItem* pItem = NULL; SfxDispatcher* pDispatch = pViewFrame->GetDispatcher(); // miscellaneous - Year2000 @@ -1229,11 +1229,11 @@ SfxItemSet* OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId ) aHyphen.GetMinLead() = (sal_uInt8)nMinLead; aHyphen.GetMinTrail() = (sal_uInt8)nMinTrail; - const SfxPoolItem* pItem; - SfxPoolItem* pClone; SfxViewFrame* pViewFrame = SfxViewFrame::Current(); if ( pViewFrame ) { + const SfxPoolItem* pItem = NULL; + SfxPoolItem* pClone = NULL; SfxDispatcher* pDispatch = pViewFrame->GetDispatcher(); if(SfxItemState::DEFAULT <= pDispatch->QueryState(SID_ATTR_LANGUAGE, pItem)) pRet->Put(SfxUInt16Item(SID_ATTR_LANGUAGE, static_cast(pItem)->GetLanguage())); @@ -1312,7 +1312,7 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet case SID_GENERAL_OPTIONS: { utl::MiscCfg aMisc; - const SfxPoolItem* pItem; + const SfxPoolItem* pItem = NULL; SfxItemSet aOptSet(SfxGetpApp()->GetPool(), SID_ATTR_QUICKLAUNCHER, SID_ATTR_QUICKLAUNCHER ); aOptSet.Put(rSet); if(aOptSet.Count()) @@ -1386,7 +1386,7 @@ void OfaTreeOptionsDialog::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet) { bool bSaveSpellCheck = false; - const SfxPoolItem* pItem; + const SfxPoolItem* pItem = NULL; if ( SfxItemState::SET == rSet.GetItemState( SID_SPELL_MODIFIED, false, &pItem ) ) { @@ -1407,7 +1407,7 @@ void OfaTreeOptionsDialog::ApplyLanguageOptions(const SfxItemSet& rSet) if ( pViewFrame ) { SfxDispatcher* pDispatch = pViewFrame->GetDispatcher(); - pItem = 0; + pItem = NULL; if(SfxItemState::SET == rSet.GetItemState( SID_ATTR_LANGUAGE, false, &pItem )) { pDispatch->Execute(pItem->Which(), SfxCallMode::ASYNCHRON, pItem, 0L); -- cgit