Kaydet (Commit) 9107771a authored tarafından Jean-Pierre Ledure's avatar Jean-Pierre Ledure

Access2Base - Better window type recognition

Add'l BuiltIn i.o. Builtin (cfr. MSAccess property)

Change-Id: Idb539a8e259f76e96224526fd9e2b7a54effec1d
üst f21e8575
......@@ -430,7 +430,6 @@ 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"
......@@ -443,7 +442,7 @@ Const cstCustom = "CUSTOM"
bFound = False
iBuiltin = 1 ' Default = builtin
Set oWindow = _SelectWindow
Set oWindow = _SelectWindow()
If IsNull(oWindow.Frame) Then Goto Trace_WindowError
' List of 21 modules
......@@ -460,14 +459,12 @@ Const cstCustom = "CUSTOM"
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" )
Select Case oWindow.DocumentType
Case docCalc : sSupportedModules = Array( "com.sun.star.sheet.SpreadsheetDocument" )
Case docWriter : sSupportedModules = Array( "com.sun.star.text.TextDocument" )
Case docImpress : sSupportedModules = Array( "com.sun.star.presentation.PresentationDocument" )
Case docDraw : sSupportedModules = Array( "com.sun.star.drawing.DrawingDocument" )
Case docMath : sSupportedModules = Array( "com.sun.star.formula.FormulaProperties" )
Case Else : sSupportedModules = Array()
End Select
Case acTable, acQuery
......@@ -476,6 +473,8 @@ Const cstCustom = "CUSTOM"
)
Case acDiagram
sSupportedModules = Array( "com.sun.star.sdb.RelationDesign" )
Case acWelcome
sSupportedModules = Array( "com.sun.star.frame.StartModule" )
Case Else
sSupportedModules = Array()
End Select
......
......@@ -53,9 +53,9 @@ REM --- CLASS GET/LET/SET PROPERTIES ---
REM -----------------------------------------------------------------------------------------------------------------------
REM -----------------------------------------------------------------------------------------------------------------------
Property Get Builtin() As Boolean
Builtin = _PropertyGet("Builtin")
End Property ' Builtin (get)
Property Get BuiltIn() As Boolean
BuiltIn = _PropertyGet("BuiltIn")
End Property ' BuiltIn (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get Name() As String
......@@ -278,7 +278,7 @@ End Function
REM -----------------------------------------------------------------------------------------------------------------------
Private Function _PropertiesList() As Variant
_PropertiesList = Array("Builtin", "Name", "ObjectType", "Visible")
_PropertiesList = Array("BuiltIn", "Name", "ObjectType", "Visible")
End Function ' _PropertiesList
REM -----------------------------------------------------------------------------------------------------------------------
......@@ -294,7 +294,7 @@ Dim cstThisSub As String
Dim oLayout As Object, iElementIndex As Integer
Select Case UCase(psProperty)
Case UCase("Builtin")
Case UCase("BuiltIn")
_PropertyGet = ( _BarBuiltin = 1 )
Case UCase("Name")
_PropertyGet = _Name
......
......@@ -58,9 +58,9 @@ Property Get BeginGroup() As Boolean
End Property ' BeginGroup (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get Builtin() As Boolean
Builtin = _PropertyGet("Builtin")
End Property ' Builtin (get)
Property Get BuiltIn() As Boolean
BuiltIn = _PropertyGet("BuiltIn")
End Property ' BuiltIn (get)
REM -----------------------------------------------------------------------------------------------------------------------
Property Get Caption() As Variant
......@@ -199,7 +199,7 @@ REM ----------------------------------------------------------------------------
REM -----------------------------------------------------------------------------------------------------------------------
Private Function _PropertiesList() As Variant
_PropertiesList = Array("BeginGroup", "Builtin", "Caption", "Index" _
_PropertiesList = Array("BeginGroup", "BuiltIn", "Caption", "Index" _
, "ObjectType", "OnAction", "Parent" _
, "TooltipText", "Type", "Visible" _
)
......@@ -222,7 +222,7 @@ Const cstUnoPrefix = ".uno:"
Select Case UCase(psProperty)
Case UCase("BeginGroup")
_PropertyGet = _BeginGroup
Case UCase("Builtin")
Case UCase("BuiltIn")
sValue = _GetPropertyValue(_Element, "CommandURL", "")
_PropertyGet = ( _IsLeft(sValue, cstUnoPrefix) )
Case UCase("Caption")
......
......@@ -2257,6 +2257,10 @@ Dim oWindow As _Window
Set oFrame = oComp.Frame
iType = acDiagram
sName = ""
Case "com.sun.star.comp.sfx2.BackingComp" ' Welcome screen
Set oFrame = oComp.Frame
iType = acWelcome
sName = ""
Case Else ' Other Calc, ..., whatever documents
If Utils._hasUNOProperty(oComp, "Location") Then
vLocation = Split(oComp.getLocation(), "/")
......
......@@ -74,10 +74,10 @@ Public Function getBorderStyle(Optional pvObject As Variant) As Variant
End Function ' getBorderStyle
REM -----------------------------------------------------------------------------------------------------------------------
Public Function getBuiltin(Optional pvObject As Variant) As Boolean
If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments("getBuiltin")
getBuiltin = PropertiesGet._getProperty(pvObject, "Builtin")
End Function ' getBuiltin
Public Function getBuiltIn(Optional pvObject As Variant) As Boolean
If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments("getBuiltIn")
getBuiltIn = PropertiesGet._getProperty(pvObject, "BuiltIn")
End Function ' getBuiltIn
REM -----------------------------------------------------------------------------------------------------------------------
Public Function getButtonLeft(Optional pvObject As Variant) As Boolean
......@@ -798,9 +798,9 @@ Public Function _getProperty(pvItem As Variant, ByVal psProperty As String, ByVa
Case UCase("BorderStyle")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
_getProperty = pvItem.BorderStyle
Case UCase("Builtin")
Case UCase("BuiltIn")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJCOMMANDBAR, OBJCOMMANDBARCONTROL)) Then Goto Exit_Function
_getProperty = pvItem.Builtin
_getProperty = pvItem.BuiltIn
Case UCase("ButtonLeft")
If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
_getProperty = pvItem.ButtonLeft
......
......@@ -53,6 +53,7 @@ Global Const acTable = 0
Global Const acBasicIDE = 101
Global Const acDatabaseWindow = 102
Global Const acDocument = 111
Global Const acWelcome = 112
' Subtype if acDocument
Global Const docWriter = "Writer"
Global Const docCalc = "Calc"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment