From 367b254c73bf7b64135f0429d50d03fee749cef7 Mon Sep 17 00:00:00 2001 From: Jan Holesovsky Date: Sat, 26 Apr 2014 12:16:18 +0200 Subject: [PATCH] recent documents: Don't assign the same values twice. Change-Id: I85be809dd390a0dcd19a388a85930e1dc0893305 --- unotools/source/config/historyoptions.cxx | 13 +++++-------- 1 file 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; igetByName(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 xPrevSet; uno::Reference 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; } }