wizards/com/sun/star/wizards/db/DBMetaData.java | 7 +++++- wizards/com/sun/star/wizards/db/RecordParser.java | 14 ++++++++++-- wizards/com/sun/star/wizards/db/SQLQueryComposer.java | 2 - wizards/com/sun/star/wizards/form/FormWizard.java | 2 - wizards/com/sun/star/wizards/report/DBColumn.java | 4 +-- wizards/com/sun/star/wizards/report/ReportTextDocument.java | 4 +-- wizards/com/sun/star/wizards/table/FieldFormatter.java | 2 - wizards/com/sun/star/wizards/table/Finalizer.java | 2 - wizards/com/sun/star/wizards/table/TableWizard.java | 2 - 9 files changed, 27 insertions(+), 12 deletions(-)
New commits: commit 5fcc0a0c65a1856a1fb9930b0c64bedeb0a2878a Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Sep 24 08:39:04 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Sep 24 18:08:06 2024 +0200 cid#1608090 PA: Public Attribute Change-Id: I8ea0d65e01affa7b2a7b787bebcf5bc2ca3b63f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173839 Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> Tested-by: Jenkins diff --git a/wizards/com/sun/star/wizards/db/RecordParser.java b/wizards/com/sun/star/wizards/db/RecordParser.java index 4c93a0364a58..53c37032200e 100644 --- a/wizards/com/sun/star/wizards/db/RecordParser.java +++ b/wizards/com/sun/star/wizards/db/RecordParser.java @@ -46,7 +46,7 @@ public class RecordParser extends QueryMetaData private XComponent xRowSetComponent; private XInteractionHandler xInteraction; public FieldColumn[] GroupFieldColumns; - public FieldColumn[] RecordFieldColumns; + private FieldColumn[] RecordFieldColumns; /** Creates a new instance of RecordParser */ public RecordParser(XMultiServiceFactory _xMSF) @@ -55,6 +55,16 @@ public class RecordParser extends QueryMetaData getInterfaces(); } + public FieldColumn[] getRecordFieldColumns() + { + return RecordFieldColumns; + } + + public void setRecordFieldColumns(FieldColumn[] recordFieldColumns) + { + RecordFieldColumns = recordFieldColumns; + } + private void getInterfaces() { try diff --git a/wizards/com/sun/star/wizards/report/DBColumn.java b/wizards/com/sun/star/wizards/report/DBColumn.java index 40c01e51490b..e53b0649d271 100644 --- a/wizards/com/sun/star/wizards/report/DBColumn.java +++ b/wizards/com/sun/star/wizards/report/DBColumn.java @@ -79,9 +79,9 @@ public class DBColumn this.CurDBMetaData = _CurDBMetaData; this.CurRecordTable = _CurRecordTable; bIsGroupColumn = false; - if (CurDBMetaData.RecordFieldColumns != null) + if (CurDBMetaData.getRecordFieldColumns() != null) { - CurDBField = CurDBMetaData.getFieldColumnByFieldName(CurDBMetaData.RecordFieldColumns[i].getFieldName()); + CurDBField = CurDBMetaData.getFieldColumnByFieldName(CurDBMetaData.getRecordFieldColumns()[i].getFieldName()); } else { diff --git a/wizards/com/sun/star/wizards/report/ReportTextDocument.java b/wizards/com/sun/star/wizards/report/ReportTextDocument.java index 9d2fa7434b2c..b7f7c2a04de9 100644 --- a/wizards/com/sun/star/wizards/report/ReportTextDocument.java +++ b/wizards/com/sun/star/wizards/report/ReportTextDocument.java @@ -472,14 +472,14 @@ class ReportTextDocument extends com.sun.star.wizards.text.TextDocument implemen DelFieldName }); CurDBMetaData.setRecordFieldNames(aNewList); - CurDBMetaData.RecordFieldColumns = removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.RecordFieldColumns); + CurDBMetaData.setRecordFieldColumns(removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.getRecordFieldColumns())); CurDBMetaData.setFieldColumns(removeFieldColumnByFieldName(DelFieldName, CurDBMetaData.getFieldColumns())); } i--; } } - java.util.Arrays.sort(CurDBMetaData.RecordFieldColumns, this); + java.util.Arrays.sort(CurDBMetaData.getRecordFieldColumns(), this); } catch (Exception exception) { commit 3e831187387c7b3fc584c1164c4497a140911f3c Author: Caolán McNamara <caolan.mcnam...@collabora.com> AuthorDate: Tue Sep 24 08:34:47 2024 +0100 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Tue Sep 24 18:07:56 2024 +0200 cid#1608290 PA: Public Attribute Change-Id: I3fe12f088e6bd2951a9dfdf62b156eb33a44750b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173838 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/wizards/com/sun/star/wizards/db/DBMetaData.java b/wizards/com/sun/star/wizards/db/DBMetaData.java index 6637f759331c..d319af18285a 100644 --- a/wizards/com/sun/star/wizards/db/DBMetaData.java +++ b/wizards/com/sun/star/wizards/db/DBMetaData.java @@ -88,7 +88,7 @@ public class DBMetaData private java.util.ArrayList<CommandObject> CommandObjects = new ArrayList<CommandObject>(1); private Locale aLocale; private String DataSourceName; - public com.sun.star.sdbc.XConnection DBConnection; + private com.sun.star.sdbc.XConnection DBConnection; private com.sun.star.sdb.tools.XConnectionTools m_connectionTools; public com.sun.star.lang.XMultiServiceFactory xMSF; private XComponent xConnectionComponent; @@ -137,6 +137,11 @@ public class DBMetaData private long lDateCorrection = INVALID; private boolean bdisposeConnection = false; + public com.sun.star.sdbc.XConnection getDBConnection() + { + return DBConnection; + } + public XPropertySet getDataSourcePropertySet() { return xDataSourcePropertySet; diff --git a/wizards/com/sun/star/wizards/db/RecordParser.java b/wizards/com/sun/star/wizards/db/RecordParser.java index 217e705faf6f..4c93a0364a58 100644 --- a/wizards/com/sun/star/wizards/db/RecordParser.java +++ b/wizards/com/sun/star/wizards/db/RecordParser.java @@ -156,7 +156,7 @@ public class RecordParser extends QueryMetaData try { Helper.setUnoPropertyValue(xRowSet, "DataSourceName", getDataSourceName()); - Helper.setUnoPropertyValue(xRowSet, PropertyNames.ACTIVE_CONNECTION, DBConnection); + Helper.setUnoPropertyValue(xRowSet, PropertyNames.ACTIVE_CONNECTION, getDBConnection()); Helper.setUnoPropertyValue(xRowSet, PropertyNames.COMMAND, Command); Helper.setUnoPropertyValue(xRowSet, PropertyNames.COMMAND_TYPE, Integer.valueOf(_nCommandType)); // CommandType xExecute.executeWithCompletion(xInteraction); diff --git a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java index 84a6cd97012b..55719dfb51f7 100644 --- a/wizards/com/sun/star/wizards/db/SQLQueryComposer.java +++ b/wizards/com/sun/star/wizards/db/SQLQueryComposer.java @@ -50,7 +50,7 @@ public class SQLQueryComposer try { setDBMetaData(_CurDBMetaData); - xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, CurDBMetaData.DBConnection); + xMSF = UnoRuntime.queryInterface(XMultiServiceFactory.class, CurDBMetaData.getDBConnection()); final Object oQueryComposer = xMSF.createInstance("com.sun.star.sdb.SingleSelectQueryComposer"); m_xQueryAnalyzer = UnoRuntime.queryInterface(XSingleSelectQueryAnalyzer.class, oQueryComposer); m_queryComposer = UnoRuntime.queryInterface(XSingleSelectQueryComposer.class, m_xQueryAnalyzer); diff --git a/wizards/com/sun/star/wizards/form/FormWizard.java b/wizards/com/sun/star/wizards/form/FormWizard.java index 70e9f01c3b73..0a2aa0fd35f0 100644 --- a/wizards/com/sun/star/wizards/form/FormWizard.java +++ b/wizards/com/sun/star/wizards/form/FormWizard.java @@ -338,7 +338,7 @@ public class FormWizard extends DatabaseObjectWizard { curFormDocument.oSubFormDBMetaData.getConnection(new PropertyValue[] { - Properties.createProperty(PropertyNames.ACTIVE_CONNECTION, curFormDocument.oMainFormDBMetaData.DBConnection) + Properties.createProperty(PropertyNames.ACTIVE_CONNECTION, curFormDocument.oMainFormDBMetaData.getDBConnection()) }); curFormDocument.getProgressBar().setValue(20); buildSteps(); diff --git a/wizards/com/sun/star/wizards/table/FieldFormatter.java b/wizards/com/sun/star/wizards/table/FieldFormatter.java index fe2bc6ce06d1..9ae61e9d8a6f 100644 --- a/wizards/com/sun/star/wizards/table/FieldFormatter.java +++ b/wizards/com/sun/star/wizards/table/FieldFormatter.java @@ -212,7 +212,7 @@ public class FieldFormatter implements XItemListener 82, 158, 52, IFieldFormatStep, Short.valueOf(curtabindex++), 166, 50 }); //, "HID:WIZARDS_HID_DLGTABLE_COLMODIFIER" curTableDescriptor = _curTableDescriptor; - Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.ACTIVE_CONNECTION, _curTableDescriptor.DBConnection); + Helper.setUnoPropertyValue(oColumnDescriptorModel, PropertyNames.ACTIVE_CONNECTION, _curTableDescriptor.getDBConnection()); txtfieldname.setMaxTextLen((short) this.curTableDescriptor.getMaxColumnNameLength()); } else diff --git a/wizards/com/sun/star/wizards/table/Finalizer.java b/wizards/com/sun/star/wizards/table/Finalizer.java index fd4567a584e3..f7a25d2fc7e3 100644 --- a/wizards/com/sun/star/wizards/table/Finalizer.java +++ b/wizards/com/sun/star/wizards/table/Finalizer.java @@ -99,7 +99,7 @@ public class Finalizer String sCatalog = PropertyNames.EMPTY_STRING; try { - sCatalog = curtabledescriptor.DBConnection.getCatalog(); + sCatalog = curtabledescriptor.getDBConnection().getCatalog(); } catch (SQLException e1) { diff --git a/wizards/com/sun/star/wizards/table/TableWizard.java b/wizards/com/sun/star/wizards/table/TableWizard.java index 67e0f537fe67..608bc24c6b61 100644 --- a/wizards/com/sun/star/wizards/table/TableWizard.java +++ b/wizards/com/sun/star/wizards/table/TableWizard.java @@ -298,7 +298,7 @@ public class TableWizard extends DatabaseObjectWizard implements XTextListener Object oFormWizard = this.xMSF.createInstance("com.sun.star.wizards.form.CallFormWizard"); NamedValueCollection wizardContext = new NamedValueCollection(); - wizardContext.put( PropertyNames.ACTIVE_CONNECTION, curTableDescriptor.DBConnection ); + wizardContext.put( PropertyNames.ACTIVE_CONNECTION, curTableDescriptor.getDBConnection() ); wizardContext.put( "DataSource", curTableDescriptor.getDataSource() ); wizardContext.put( PropertyNames.COMMAND_TYPE, CommandType.TABLE ); wizardContext.put( PropertyNames.COMMAND, scomposedtablename );