summaryrefslogtreecommitdiff
path: root/jvmfwk
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2016-11-16 23:40:25 +0100
committerCaolán McNamara <caolanm@redhat.com>2016-11-17 08:49:47 +0000
commit7e819f20f36ed0208ad9a46bdccbdb52fb353b54 (patch)
tree5d41a2a9155b4febe4098fec97ed9d5d4f0a4a84 /jvmfwk
parentd1909ab7940109ce7d43da04e480db4e82b8310f (diff)
Fix regression in bubbleSortVersion
...introduced with 789055bc2acb4c71483fd60ea258d158bd5aec10 "clang-tidy performance-unnecessary-copy-initialization" (so partially revert it). Whatever clang-tidy erroneously reported there, cur and next are lvalue references into vec, so this attempted copy now actually overwrote one with the other. The result was that if multiple JREs are detected on the system, "Options - LibreOffice - Advanced" would list a single one multiple times. Change-Id: I7ef454c0f37669722812383848602dc2bacf7cd1 (cherry picked from commit 36a329b6395257d7df2013d23ba4205a5ef72f4d) Reviewed-on: https://gerrit.libreoffice.org/30923 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'jvmfwk')
-rw-r--r--jvmfwk/plugins/sunmajor/pluginlib/util.cxx3
1 files changed, 2 insertions, 1 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
index f1d33b1313ee..98883e96c133 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/util.cxx
@@ -731,8 +731,9 @@ void bubbleSortVersion(vector<rtl::Reference<VendorBase> >& vec)
}
if(nCmp == 1) // cur > next
{
+ rtl::Reference<VendorBase> less = next;
vec.at(j-1)= cur;
- vec.at(j)= next;
+ vec.at(j)= less;
}
}
++cIter;