connectivity/source/drivers/dbase/dindexnode.cxx | 22 +++++----- wizards/com/sun/star/wizards/report/DBColumn.java | 7 ++- wizards/com/sun/star/wizards/report/ReportTextDocument.java | 2 wizards/com/sun/star/wizards/report/ReportTextImplementation.java | 2 4 files changed, 19 insertions(+), 14 deletions(-)
New commits: commit d8d4efbe1faf6e3a4a048ab4bb8f23516ce13268 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Sat Sep 28 11:22:38 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Sep 28 20:22:40 2024 +0200 cid#1607041 PA: Public Attribute Change-Id: I8ec74e943232f98c861e035c0da11e8d75f8fa29 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174106 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/wizards/com/sun/star/wizards/report/DBColumn.java b/wizards/com/sun/star/wizards/report/DBColumn.java index 35bd99429a9a..d993ded1b1b0 100644 --- a/wizards/com/sun/star/wizards/report/DBColumn.java +++ b/wizards/com/sun/star/wizards/report/DBColumn.java @@ -46,7 +46,7 @@ public class DBColumn private XCell xValCell; private XTextRange xValTextCell; private XTextCursor xValCellCursor; - public XCell xNameCell; + private XCell xNameCell; private XTextRange xNameTextCell; private boolean bAlignLeft; private String CharFontName; @@ -183,6 +183,11 @@ public class DBColumn } } + public XCell getNameCell() + { + return xNameCell; + } + private void getTableColumns(String TableName) { try diff --git a/wizards/com/sun/star/wizards/report/ReportTextDocument.java b/wizards/com/sun/star/wizards/report/ReportTextDocument.java index 52d8e6d2ae96..8e1e325b874d 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextDocument.java +++ b/wizards/com/sun/star/wizards/report/ReportTextDocument.java @@ -448,7 +448,7 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen } CurDBColumn = new DBColumn(CurRecordTable, oTextTableHandler, CurDBMetaData, i - CurDBMetaData.getGroupFieldNames().length); } - if (CurDBColumn.xNameCell != null) + if (CurDBColumn.getNameCell() != null) { DBColumnsVector.add(CurDBColumn); } diff --git a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java index 9f8e77cd05ce..ead591e5e352 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextImplementation.java +++ b/wizards/com/sun/star/wizards/report/ReportTextImplementation.java @@ -436,7 +436,7 @@ public class ReportTextImplementation extends ReportImplementationHelper impleme for (int i = 0; i < iCount; i++) { CurDBColumn = getDoc().DBColumnsVector.get(i); - xNameCellCursor = ReportTextDocument.createTextCursor(CurDBColumn.xNameCell); + xNameCellCursor = ReportTextDocument.createTextCursor(CurDBColumn.getNameCell()); xNameCellCursor.gotoStart(false); FieldContent = getDoc().oTextFieldHandler.getUserFieldContent(xNameCellCursor); if (!FieldContent.equals(PropertyNames.EMPTY_STRING)) commit 645ae19dfc1645cd49df620cc62857f399974e99 Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Thu Sep 26 08:56:35 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Sat Sep 28 20:22:30 2024 +0200 cid#1606705 Overflowed constant and cid#1607841 Overflowed constant Change-Id: Ia84d2c0d29e485379fe6338a784306bc8ff5343b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174105 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/connectivity/source/drivers/dbase/dindexnode.cxx b/connectivity/source/drivers/dbase/dindexnode.cxx index 6857679c98f1..ba439d77bef4 100644 --- a/connectivity/source/drivers/dbase/dindexnode.cxx +++ b/connectivity/source/drivers/dbase/dindexnode.cxx @@ -969,28 +969,28 @@ bool ONDXPage::IsFull() const return Count() == rIndex.getHeader().db_maxkeys; } - sal_uInt16 ONDXPage::Search(const ONDXKey& rSearch) { // binary search later - sal_uInt16 i = NODE_NOTFOUND; - while (++i < Count()) - if ((*this)[i].GetKey() == rSearch) - break; + for (sal_uInt16 i = 0, nSize = Count(); i < nSize; ++i) + { + if (((*this)[i]).GetKey() == rSearch) + return i; + } - return (i < Count()) ? i : NODE_NOTFOUND; + return NODE_NOTFOUND; } - sal_uInt16 ONDXPage::Search(const ONDXPage* pPage) { - sal_uInt16 i = NODE_NOTFOUND; - while (++i < Count()) + for (sal_uInt16 i = 0, nSize = Count(); i < nSize; ++i) + { if (((*this)[i]).GetChild() == pPage) - break; + return i; + } // if not found, then we assume, that the page itself points to the page - return (i < Count()) ? i : NODE_NOTFOUND; + return NODE_NOTFOUND; } // runs recursively