diff options
author | Michael Weghorn <m.weghorn@posteo.de> | 2014-12-20 20:47:39 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2014-12-21 19:07:03 +0100 |
commit | 8870e068cc7368ffa14a6938836b370d2a188b64 (patch) | |
tree | de1cc65476db4132af13ca0950af92a65cec6e67 /sc/source/ui/xmlsource | |
parent | 17402c73cfd513ade823a5f26c17371766047b6d (diff) |
fdo#39440 sc: reduce scope of local variables
This addresses some cppcheck warnings.
Change-Id: Icd031be4aeec07ba60804923e3506d64cf876dd8
Diffstat (limited to 'sc/source/ui/xmlsource')
-rw-r--r-- | sc/source/ui/xmlsource/xmlsourcedlg.cxx | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index 6a81c2248d09..39331ac79083 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -326,10 +326,9 @@ void ScXMLSourceDlg::DefaultElementSelected(SvTreeListEntry& rEntry) { // Only an element with no child elements (leaf element) can be linked. bool bHasChild = false; - ScOrcusXMLTreeParam::EntryData* pUserData = NULL; for (SvTreeListEntry* pChild = mpLbTree->FirstChild(&rEntry); pChild; pChild = mpLbTree->NextSibling(pChild)) { - pUserData = ScOrcusXMLTreeParam::getUserData(*pChild); + ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pChild); OSL_ASSERT(pUserData); if (pUserData->meType != ScOrcusXMLTreeParam::Attribute) { @@ -451,11 +450,10 @@ void ScXMLSourceDlg::SelectAllChildEntries(SvTreeListEntry& rEntry) bool ScXMLSourceDlg::IsParentDirty(SvTreeListEntry* pEntry) const { - ScOrcusXMLTreeParam::EntryData* pUserData = NULL; SvTreeListEntry* pParent = mpLbTree->GetParent(pEntry); while (pParent) { - pUserData = ScOrcusXMLTreeParam::getUserData(*pParent); + ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pParent); assert(pUserData); if (pUserData->maLinkedPos.IsValid()) { @@ -474,10 +472,9 @@ bool ScXMLSourceDlg::IsParentDirty(SvTreeListEntry* pEntry) const bool ScXMLSourceDlg::IsChildrenDirty(SvTreeListEntry* pEntry) const { - ScOrcusXMLTreeParam::EntryData* pUserData = NULL; for (SvTreeListEntry* pChild = mpLbTree->FirstChild(pEntry); pChild; pChild = mpLbTree->NextSibling(pChild)) { - pUserData = ScOrcusXMLTreeParam::getUserData(*pChild); + ScOrcusXMLTreeParam::EntryData* pUserData = ScOrcusXMLTreeParam::getUserData(*pChild); OSL_ASSERT(pUserData); if (pUserData->maLinkedPos.IsValid()) // Already linked. |