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:51:14 +0000
commit7885d938cb425df7b759c0a42871870921394eb6 (patch)
treeaedbea5e71c19c8a6cd4601ae7201eaac4c47ddc
parent3052cfd954ba16a01e4cf2e97ee493d6bf0a4a43 (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. Change-Id: I9b0f24231774eef7231eff4b053fd56c020c6e69 (cherry picked from commit 7fb6ae28ae7bebd67c2b9bf2cf517f1f7bb2777e) Reviewed-on: https://gerrit.libreoffice.org/8003 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 a1bc92679790..8ab87c19aa25 100644
--- a/sw/source/core/unocore/unostyle.cxx
+++ b/sw/source/core/unocore/unostyle.cxx
@@ -1588,14 +1588,12 @@ struct SwStyleBase_Impl
SfxItemSet* pItemSet;
const OUString& rStyleName;
- sal_uInt16 nPDescPos;
SwStyleBase_Impl(SwDoc& rSwDoc, const OUString& rName) :
rDoc(rSwDoc),
pOldPageDesc(0),
pItemSet(0),
- rStyleName(rName),
- nPDescPos(0xffff)
+ rStyleName(rName)
{}
~SwStyleBase_Impl(){ delete pItemSet; }
@@ -1624,7 +1622,6 @@ const SwPageDesc& SwStyleBase_Impl::GetOldPageDesc()
if(rDesc.GetName() == rStyleName)
{
pOldPageDesc = & rDesc;
- nPDescPos = i;
break;
}
}
@@ -1639,15 +1636,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;