diff options
author | Luv Sharma <luvsharma.del@gmail.com> | 2023-12-31 17:48:48 +0530 |
---|---|---|
committer | Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> | 2024-01-01 14:27:36 +0100 |
commit | 6c9dda18242bce6a37f7c43277ab4647a70401c8 (patch) | |
tree | 9ee7a12c7b7eeb11a1f4107aaa3b8e6dc813b39c /extensions | |
parent | a3f21172fdb7fed6eb61be9199980421bad71101 (diff) |
tdf#148251 Use std::swap instead of using temporary values
Change-Id: Iac18ab1e64e58749e300f71f7e61d4a31c66355e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161496
Tested-by: Jenkins
Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/test/ole/AxTestComponents/Basic.cpp | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/extensions/test/ole/AxTestComponents/Basic.cpp b/extensions/test/ole/AxTestComponents/Basic.cpp index 8aad56e8af52..85fbb649f923 100644 --- a/extensions/test/ole/AxTestComponents/Basic.cpp +++ b/extensions/test/ole/AxTestComponents/Basic.cpp @@ -1053,9 +1053,7 @@ STDMETHODIMP CBasic::outDate(DATE* val) STDMETHODIMP CBasic::inoutDate(DATE* val) { - DATE tmp = *val; - *val = m_date; - m_date = tmp; + std::swap(*val, m_date); return S_OK; } @@ -1098,10 +1096,7 @@ STDMETHODIMP CBasic::outDecimal(DECIMAL* val) STDMETHODIMP CBasic::inoutDecimal(DECIMAL* val) { - DECIMAL tmp; - tmp = * val; - * val = m_decimal; - m_decimal = tmp; + std::swap(*val, m_decimal); return S_OK; } @@ -1131,9 +1126,7 @@ STDMETHODIMP CBasic::outScode(SCODE* val) STDMETHODIMP CBasic::inoutSCode(SCODE* val) { - SCODE tmp = *val; - * val = m_scode; - m_scode = tmp; + std::swap(*val, m_scode); return S_OK; } @@ -1302,9 +1295,7 @@ STDMETHODIMP CBasic::prpMultiArg2GetValues(VARIANT* val1, VARIANT* valProperty) STDMETHODIMP CBasic::get_prpMultiArg3(LONG* val1, LONG* pVal) { - long aLong = *val1; - *val1 = m_long; - m_long = aLong; + std::swap(*val1, m_long); * pVal = m_long2; return S_OK; @@ -1312,9 +1303,7 @@ STDMETHODIMP CBasic::get_prpMultiArg3(LONG* val1, LONG* pVal) STDMETHODIMP CBasic::put_prpMultiArg3(LONG* val1, LONG newVal) { - long aLong = *val1; - *val1 = m_long; - m_long = aLong; + std::swap(*val1, m_long); m_long2 = newVal; return S_OK; |