recent documents: Don't assign the same values twice.

Change-Id: I85be809dd390a0dcd19a388a85930e1dc0893305
This commit is contained in:
Jan Holesovsky 2014-04-26 12:16:18 +02:00
parent 1c67ba28d1
commit 367b254c73

View File

@ -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;
}
}