summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorƁukasz Hryniuk <lukasz.hryniuk@wp.pl>2015-01-04 22:50:05 +0100
committerNoel Grandin <noelgrandin@gmail.com>2015-01-07 06:47:04 +0000
commit9fd89a5952a48b473cee03a2681eb5d4cd6d1742 (patch)
tree1fbf98ba46e86989826adf5d559f51c82d59a5e5 /cui
parenta527ad98e58a7fc9af482f9088687d82e5c52cca (diff)
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 <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/treeopt.cxx12
1 files changed, 6 insertions, 6 deletions
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<const SvxLanguageItem*>(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);