[Libreoffice-commits] core.git: wizards/source

Jean-Pierre Ledure jp at ledure.be
Sun Jan 4 08:11:06 PST 2015


 wizards/source/access2base/Application.xba |   35 +++++++++++++++++++++--------
 1 file changed, 26 insertions(+), 9 deletions(-)

New commits:
commit 8cc32a8e464c26a479f45dd2d9bf0c4df261e572
Author: Jean-Pierre Ledure <jp at ledure.be>
Date:   Sun Jan 4 17:07:47 2015 +0100

    Access2Base - Extend CommandBars scope to most modules
    
    Refine list of supported modules beyond database forms only
    
    Change-Id: I6f43234d653a564fa740724b01b7f2bde58d371d

diff --git a/wizards/source/access2base/Application.xba b/wizards/source/access2base/Application.xba
index c542e22..f5cb6c9 100644
--- a/wizards/source/access2base/Application.xba
+++ b/wizards/source/access2base/Application.xba
@@ -430,6 +430,7 @@ Dim oWindow As Object, iWindowType As Integer
 Dim i As Integer, j As Integer, k As Integer, bFound As Boolean
 Dim sSupportedModules() As Variant, vModules() As Variant, oModuleUI As Object
 Dim oToolbar As Object, sToolbarName As String, vUIElements() As Variant, sToolbarFullName As String, iBuiltin As Integer
+Dim sFileSuffix As String
 
 Const cstCustom = "CUSTOM"
 
@@ -450,17 +451,33 @@ Const cstCustom = "CUSTOM"
 	
 	iWindowType = oWindow.WindowType
 	Select Case iWindowType			'	Supported window types only
-		Case	acForm
+		Case acForm
 			sSupportedModules = Array(	"com.sun.star.sdb.FormDesign"	)
-		Case	acBasicIDE _
-				, acDatabaseWindow _
-				, acReport _
-				, acDocument _
-				, acTable _
-				, acQuery _
-				, acDiagram
-			sSupportedModules = Array()
+		Case acBasicIDE
+			sSupportedModules = Array(	"com.sun.star.script.BasicIDE"	)
+		Case acDatabaseWindow
+			sSupportedModules = Array(	"com.sun.star.sdb.OfficeDatabaseDocument"	)
+		Case acReport
+			sSupportedModules = Array(	"com.sun.star.sdb.TextReportDesign"	)
+		Case acDocument
+			sFileSuffix = ""
+			If Len(oWindow._Name) > 4 Then sFileSuffix = LCase(Right(oWindow._Name, 4))
+			Select Case sFileSuffix
+				Case ".ods"				:	sSupportedModules = Array(	"com.sun.star.sheet.SpreadsheetDocument"	)
+				Case ".odt", ".odm"		:	sSupportedModules = Array(	"com.sun.star.text.TextDocument"	)
+				Case ".odp"				:	sSupportedModules = Array(	"com.sun.star.presentation.PresentationDocument"	)
+				Case ".odg"				:	sSupportedModules = Array(	"com.sun.star.drawing.DrawingDocument"	)
+				Case ".odf"				:	sSupportedModules = Array(	"com.sun.star.formula.FormulaProperties"	)
+				Case Else				:	sSupportedModules = Array()
+			End Select
+		Case acTable, acQuery
+			sSupportedModules = Array(	"com.sun.star.sdb.DataSourceBrowser" _
+										, "com.sun.star.sdb.TableDataView" _
+										)
+		Case acDiagram
+			sSupportedModules = Array(	"com.sun.star.sdb.RelationDesign"	)
 		Case Else
+			sSupportedModules = Array()
 	End Select
 
 	'	Find all standard and custom toolbars stored in LibO/AOO Base


More information about the Libreoffice-commits mailing list