summaryrefslogtreecommitdiff
path: root/wizards/source/sfdatabases/SF_Database.xba
diff options
context:
space:
mode:
authorJean-Pierre Ledure <jp@ledure.be>2024-10-06 16:00:38 +0200
committerJean-Pierre Ledure <jp@ledure.be>2024-10-07 15:04:20 +0200
commit0b6afed3b85b6599ecbd7e5ac97b080d3ffbbfbf (patch)
tree918e452133b0781288df619d821fdf8461bc8777 /wizards/source/sfdatabases/SF_Database.xba
parent1f16b88e9dbfe1477dd90e361394f5ffeac3e932 (diff)
ScriptForge Fix tdf#163219 With blocks
Reference: https://bugs.documentfoundation.org/show_bug.cgi?id=163219#c7 Everywhere the With block variable is defined or redefined inside the With block, the Basic code has been reviewed. Found in SFDatabases/SF_Database.xba/SetTransactionMode() SFDocuments/SF_Document.xba/Styles() ScriptForge/SF_Dictionary.xba/ImportFromPropertyValues() ScriptForge/SF_UI.xba/SetStatusBar() ScriptForge/SF_UI.xba/ShowProgressBar() Most changes consist in isolating the With block variable before the With block itself. No functional change. This solution is a workaround for the bug. IT DOES NOT SOLVE THE ROOT CAUSE. Change-Id: I48af29d3d9c8b1e36ef5a85c8cfe28f9639ae483 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174560 Reviewed-by: Jean-Pierre Ledure <jp@ledure.be> Tested-by: Jenkins
Diffstat (limited to 'wizards/source/sfdatabases/SF_Database.xba')
-rw-r--r--wizards/source/sfdatabases/SF_Database.xba12
1 files changed, 7 insertions, 5 deletions
diff --git a/wizards/source/sfdatabases/SF_Database.xba b/wizards/source/sfdatabases/SF_Database.xba
index 39f6d4fa62ca..9d7c278dcab9 100644
--- a/wizards/source/sfdatabases/SF_Database.xba
+++ b/wizards/source/sfdatabases/SF_Database.xba
@@ -938,10 +938,10 @@ Check:
If _ReadOnly Then GoTo Catch_ReadOnly
Try:
- With _Connection
- bCommit = ( TransactionMode &gt; com.sun.star.sdbc.TransactionIsolation.NONE )
- &apos; Replace the existing connection
- If Not IsNull(_Connection) Then
+ bCommit = ( TransactionMode &gt; com.sun.star.sdbc.TransactionIsolation.NONE )
+ &apos; Replace the existing connection
+ If Not IsNull(_Connection) Then
+ With _Connection
If .AutoCommit And bCommit Then
_CloseConnection()
Set _Connection = _DataSource.getIsolatedConnection(_User, _Password)
@@ -949,9 +949,11 @@ Try:
_CloseConnection()
Set _Connection = _DataSource.getConnection(_User, _Password)
End If
- End If
+ End With
+ End If
&apos; Set the transaction mode
+ With _Connection
If bCommit Then
.SetTransactionIsolation(CLng(TransactionMode))
.setAutoCommit(Not bCommit)