diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-04-26 12:16:18 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-04-27 01:28:55 +0200 |
commit | 367b254c73bf7b64135f0429d50d03fee749cef7 (patch) | |
tree | 80169602052b1802835e830e2224ff782e6a2c4c /unotools/source | |
parent | 1c67ba28d1b9e52600d601898b36bd776f9b1a72 (diff) |
recent documents: Don't assign the same values twice.
Change-Id: I85be809dd390a0dcd19a388a85930e1dc0893305
Diffstat (limited to 'unotools/source')
-rw-r--r-- | unotools/source/config/historyoptions.cxx | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/unotools/source/config/historyoptions.cxx b/unotools/source/config/historyoptions.cxx index bc757d856abd..4f5dc38156c9 100644 --- a/unotools/source/config/historyoptions.cxx +++ b/unotools/source/config/historyoptions.cxx @@ -379,16 +379,13 @@ void SvtHistoryOptions_Impl::AppendItem(EHistoryType eHistory, for (sal_Int32 i=0; i<nLength; ++i) { - OUString sTmp; + OUString aItem; xOrderList->getByName(OUString::number(i)) >>= xSet; - xSet->getPropertyValue(s_sHistoryItemRef) >>= sTmp; + xSet->getPropertyValue(s_sHistoryItemRef) >>= aItem; - if(sURL == sTmp) + if (aItem == sURL) { - OUString sFind; - xOrderList->getByName(OUString::number(i)) >>= xSet; - xSet->getPropertyValue(s_sHistoryItemRef) >>= sFind; - for (sal_Int32 j=i-1; j>=0; --j) + for (sal_Int32 j = i - 1; j >= 0; --j) { uno::Reference<beans::XPropertySet> xPrevSet; uno::Reference<beans::XPropertySet> xNextSet; @@ -400,7 +397,7 @@ void SvtHistoryOptions_Impl::AppendItem(EHistoryType eHistory, xPrevSet->setPropertyValue(s_sHistoryItemRef, uno::makeAny(sTemp)); } xOrderList->getByName(OUString::number(0)) >>= xSet; - xSet->setPropertyValue(s_sHistoryItemRef, uno::makeAny(sFind)); + xSet->setPropertyValue(s_sHistoryItemRef, uno::makeAny(aItem)); break; } } |