qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java | 3 ++- qadevOOo/tests/java/ifc/table/_XAutoFormattable.java | 5 ++--- sc/inc/autoform.hxx | 2 +- sc/source/core/data/table4.cxx | 8 ++++---- sc/source/core/tool/autoform.cxx | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-)
New commits: commit 6bad4f6aed63c3fd54c46b269a285013e3ced553 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Tue Sep 6 12:41:25 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Sep 6 16:28:30 2022 +0200 cid#1509284 DMI: Dubious method invocation Change-Id: I1fd1f710ae2a6b8ebc9506a56d522006509fc935 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139515 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java index 8ab74dcda173..a7821ba2b88d 100644 --- a/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java +++ b/qadevOOo/tests/java/ifc/beans/_XFastPropertySet.java @@ -53,6 +53,8 @@ import com.sun.star.uno.UnoRuntime; * @see com.sun.star.beans.XFastPropertySet */ public class _XFastPropertySet extends MultiMethodTest { + public Random rnd = new Random(); + private static final class Prop { public final int handle; public final String name; @@ -184,7 +186,6 @@ public class _XFastPropertySet extends MultiMethodTest { props.add(new Prop(handle, name)); } // endfor - Random rnd = new Random(); int nr = rnd.nextInt(props.size()); prop = props.get(nr); } diff --git a/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java b/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java index 6473f17b7380..0c1d9a30009c 100644 --- a/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java +++ b/qadevOOo/tests/java/ifc/table/_XAutoFormattable.java @@ -44,6 +44,7 @@ import com.sun.star.uno.XInterface; */ public class _XAutoFormattable extends MultiMethodTest { public XAutoFormattable oObj = null; + public Random rnd = new Random(); /** * First 'Default' autoformat is set and a background of a cell @@ -82,8 +83,6 @@ public class _XAutoFormattable extends MultiMethodTest { String[] names = formats.getElementNames(); // getting one random not default style name - Random rnd = new Random(); - if (names.length > 1) { while (name.equals("Default")) { name = names[rnd.nextInt(names.length)]; @@ -123,4 +122,4 @@ public class _XAutoFormattable extends MultiMethodTest { protected void after() { disposeEnvironment(); } -} \ No newline at end of file +} commit 5c365c62aafc12f16bfcfe3804f95f2bb45c7421 Author: Caolán McNamara <caol...@redhat.com> AuthorDate: Thu Sep 1 11:32:04 2022 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Tue Sep 6 16:28:17 2022 +0200 cid#1509199 silence Constant expression result rename IsEqualData -> HasSameData Change-Id: I6294c847c284888e5537e04dc4f84314586c4b85 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/139514 Tested-by: Caolán McNamara <caol...@redhat.com> Reviewed-by: Caolán McNamara <caol...@redhat.com> diff --git a/sc/inc/autoform.hxx b/sc/inc/autoform.hxx index 15df248510d5..ee57b435f090 100644 --- a/sc/inc/autoform.hxx +++ b/sc/inc/autoform.hxx @@ -163,7 +163,7 @@ public: const ScNumFormatAbbrev& GetNumFormat( sal_uInt16 nIndex ) const; - bool IsEqualData( sal_uInt16 nIndex1, sal_uInt16 nIndex2 ) const; + bool HasSameData( sal_uInt16 nIndex1, sal_uInt16 nIndex2 ) const; void FillToItemSet( sal_uInt16 nIndex, SfxItemSet& rItemSet, const ScDocument& rDoc ) const; void GetFromItemSet( sal_uInt16 nIndex, const SfxItemSet& rItemSet, const ScNumFormatAbbrev& rNumFormat ); diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx index 64a73215d70f..6cf97e5d9caf 100644 --- a/sc/source/core/data/table4.cxx +++ b/sc/source/core/data/table4.cxx @@ -2617,7 +2617,7 @@ void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW // Left top corner AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo); // Left column - if (pData->IsEqualData(4, 8)) + if (pData->HasSameData(4, 8)) AutoFormatArea(nStartCol, nStartRow + 1, nStartCol, nEndRow - 1, *pPatternAttrs[4], nFormatNo); else { @@ -2641,7 +2641,7 @@ void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nIndex = 3; AutoFormatArea(nCol, nRow, nCol, nRow, *pPatternAttrs[nIndex], nFormatNo); // Right column - if (pData->IsEqualData(7, 11)) + if (pData->HasSameData(7, 11)) AutoFormatArea(nEndCol, nStartRow + 1, nEndCol, nEndRow - 1, *pPatternAttrs[7], nFormatNo); else { @@ -2681,11 +2681,11 @@ void ScTable::AutoFormat( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nIndex = 13; } // Body - if ((pData->IsEqualData(5, 6)) && (pData->IsEqualData(9, 10)) && (pData->IsEqualData(5, 9))) + if ((pData->HasSameData(5, 6)) && (pData->HasSameData(9, 10)) && (pData->HasSameData(5, 9))) AutoFormatArea(nStartCol + 1, nStartRow + 1, nEndCol-1, nEndRow - 1, *pPatternAttrs[5], nFormatNo); else { - if ((pData->IsEqualData(5, 9)) && (pData->IsEqualData(6, 10))) + if ((pData->HasSameData(5, 9)) && (pData->HasSameData(6, 10))) { nIndex = 5; for (nCol = nStartCol + 1; nCol < nEndCol; nCol++) diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 55676816bc15..32fde79e5735 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -378,7 +378,7 @@ const ScNumFormatAbbrev& ScAutoFormatData::GetNumFormat( sal_uInt16 nIndex ) con return GetField( nIndex ).GetNumFormat(); } -bool ScAutoFormatData::IsEqualData( sal_uInt16 nIndex1, sal_uInt16 nIndex2 ) const +bool ScAutoFormatData::HasSameData( sal_uInt16 nIndex1, sal_uInt16 nIndex2 ) const { bool bEqual = true; const ScAutoFormatDataField& rField1 = GetField( nIndex1 );