summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-02-11 16:31:47 +0100
committerCaolán McNamara <caolanm@redhat.com>2014-02-12 10:55:32 +0000
commit3e17c731cbe11c79c3283ffefecf4401bd8cb08e (patch)
treecb679972c9eb34159678065cc7b8dfa35775889c
parent3bb16f0eeb7fc8fe0331e0aa11f65e2114928d09 (diff)
nPDescPos is never read
...since b48f4e99e1d2935f84bc2fac1e6670dd83939673 "#86296# use page descriptor only if necessary", and this nicely removes the odd for(i = 0; i < nPDescCount + 1; i++) loop that read past the end of the maPageDescs vector. (cherry picked from commit 7fb6ae28ae7bebd67c2b9bf2cf517f1f7bb2777e) Conflicts: sw/source/core/unocore/unostyle.cxx Change-Id: I9b0f24231774eef7231eff4b053fd56c020c6e69 Reviewed-on: https://gerrit.libreoffice.org/8007 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--sw/source/core/unocore/unostyle.cxx14
1 files changed, 1 insertions, 13 deletions
diff --git a/sw/source/core/unocore/unostyle.cxx b/sw/source/core/unocore/unostyle.cxx
index 0e090be672a3..1631a49d1311 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1589,14 +1589,12 @@ struct SwStyleBase_Impl
SfxItemSet* pItemSet;
const String& rStyleName;
- sal_uInt16 nPDescPos;
SwStyleBase_Impl(SwDoc& rSwDoc, const String& rName) :
rDoc(rSwDoc),
pOldPageDesc(0),
pItemSet(0),
- rStyleName(rName),
- nPDescPos(0xffff)
+ rStyleName(rName)
{}
~SwStyleBase_Impl(){ delete pItemSet; }
@@ -1625,7 +1623,6 @@ const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
if(rDesc.GetName() == rStyleName)
{
pOldPageDesc = & rDesc;
- nPDescPos = i;
break;
}
}
@@ -1640,15 +1637,6 @@ const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
break;
}
}
- for(i = 0; i < nPDescCount + 1; i++)
- {
- const SwPageDesc& rDesc = rDoc.GetPageDesc( i );
- if(rDesc.GetName() == rStyleName)
- {
- nPDescPos = i;
- break;
- }
- }
}
}
return *pOldPageDesc;