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 ...@@ -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 i As Integer, j As Integer, k As Integer, bFound As Boolean
Dim sSupportedModules() As Variant, vModules() As Variant, oModuleUI As Object 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 oToolbar As Object, sToolbarName As String, vUIElements() As Variant, sToolbarFullName As String, iBuiltin As Integer
Dim sFileSuffix As String
Const cstCustom = "CUSTOM" Const cstCustom = "CUSTOM"
...@@ -443,7 +442,7 @@ Const cstCustom = "CUSTOM" ...@@ -443,7 +442,7 @@ Const cstCustom = "CUSTOM"
bFound = False bFound = False
iBuiltin = 1 ' Default = builtin iBuiltin = 1 ' Default = builtin
Set oWindow = _SelectWindow Set oWindow = _SelectWindow()
If IsNull(oWindow.Frame) Then Goto Trace_WindowError If IsNull(oWindow.Frame) Then Goto Trace_WindowError
' List of 21 modules ' List of 21 modules
...@@ -460,14 +459,12 @@ Const cstCustom = "CUSTOM" ...@@ -460,14 +459,12 @@ Const cstCustom = "CUSTOM"
Case acReport Case acReport
sSupportedModules = Array( "com.sun.star.sdb.TextReportDesign" ) sSupportedModules = Array( "com.sun.star.sdb.TextReportDesign" )
Case acDocument Case acDocument
sFileSuffix = "" Select Case oWindow.DocumentType
If Len(oWindow._Name) > 4 Then sFileSuffix = LCase(Right(oWindow._Name, 4)) Case docCalc : sSupportedModules = Array( "com.sun.star.sheet.SpreadsheetDocument" )
Select Case sFileSuffix Case docWriter : sSupportedModules = Array( "com.sun.star.text.TextDocument" )
Case ".ods" : sSupportedModules = Array( "com.sun.star.sheet.SpreadsheetDocument" ) Case docImpress : sSupportedModules = Array( "com.sun.star.presentation.PresentationDocument" )
Case ".odt", ".odm" : sSupportedModules = Array( "com.sun.star.text.TextDocument" ) Case docDraw : sSupportedModules = Array( "com.sun.star.drawing.DrawingDocument" )
Case ".odp" : sSupportedModules = Array( "com.sun.star.presentation.PresentationDocument" ) Case docMath : sSupportedModules = Array( "com.sun.star.formula.FormulaProperties" )
Case ".odg" : sSupportedModules = Array( "com.sun.star.drawing.DrawingDocument" )
Case ".odf" : sSupportedModules = Array( "com.sun.star.formula.FormulaProperties" )
Case Else : sSupportedModules = Array() Case Else : sSupportedModules = Array()
End Select End Select
Case acTable, acQuery Case acTable, acQuery
...@@ -476,6 +473,8 @@ Const cstCustom = "CUSTOM" ...@@ -476,6 +473,8 @@ Const cstCustom = "CUSTOM"
) )
Case acDiagram Case acDiagram
sSupportedModules = Array( "com.sun.star.sdb.RelationDesign" ) sSupportedModules = Array( "com.sun.star.sdb.RelationDesign" )
Case acWelcome
sSupportedModules = Array( "com.sun.star.frame.StartModule" )
Case Else Case Else
sSupportedModules = Array() sSupportedModules = Array()
End Select End Select
......
...@@ -53,9 +53,9 @@ REM --- CLASS GET/LET/SET PROPERTIES --- ...@@ -53,9 +53,9 @@ REM --- CLASS GET/LET/SET PROPERTIES ---
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Property Get Builtin() As Boolean Property Get BuiltIn() As Boolean
Builtin = _PropertyGet("Builtin") BuiltIn = _PropertyGet("BuiltIn")
End Property ' Builtin (get) End Property ' BuiltIn (get)
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Property Get Name() As String Property Get Name() As String
...@@ -278,7 +278,7 @@ End Function ...@@ -278,7 +278,7 @@ End Function
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Private Function _PropertiesList() As Variant Private Function _PropertiesList() As Variant
_PropertiesList = Array("Builtin", "Name", "ObjectType", "Visible") _PropertiesList = Array("BuiltIn", "Name", "ObjectType", "Visible")
End Function ' _PropertiesList End Function ' _PropertiesList
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
...@@ -294,7 +294,7 @@ Dim cstThisSub As String ...@@ -294,7 +294,7 @@ Dim cstThisSub As String
Dim oLayout As Object, iElementIndex As Integer Dim oLayout As Object, iElementIndex As Integer
Select Case UCase(psProperty) Select Case UCase(psProperty)
Case UCase("Builtin") Case UCase("BuiltIn")
_PropertyGet = ( _BarBuiltin = 1 ) _PropertyGet = ( _BarBuiltin = 1 )
Case UCase("Name") Case UCase("Name")
_PropertyGet = _Name _PropertyGet = _Name
......
...@@ -58,9 +58,9 @@ Property Get BeginGroup() As Boolean ...@@ -58,9 +58,9 @@ Property Get BeginGroup() As Boolean
End Property ' BeginGroup (get) End Property ' BeginGroup (get)
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Property Get Builtin() As Boolean Property Get BuiltIn() As Boolean
Builtin = _PropertyGet("Builtin") BuiltIn = _PropertyGet("BuiltIn")
End Property ' Builtin (get) End Property ' BuiltIn (get)
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Property Get Caption() As Variant Property Get Caption() As Variant
...@@ -199,7 +199,7 @@ REM ---------------------------------------------------------------------------- ...@@ -199,7 +199,7 @@ REM ----------------------------------------------------------------------------
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Private Function _PropertiesList() As Variant Private Function _PropertiesList() As Variant
_PropertiesList = Array("BeginGroup", "Builtin", "Caption", "Index" _ _PropertiesList = Array("BeginGroup", "BuiltIn", "Caption", "Index" _
, "ObjectType", "OnAction", "Parent" _ , "ObjectType", "OnAction", "Parent" _
, "TooltipText", "Type", "Visible" _ , "TooltipText", "Type", "Visible" _
) )
...@@ -222,7 +222,7 @@ Const cstUnoPrefix = ".uno:" ...@@ -222,7 +222,7 @@ Const cstUnoPrefix = ".uno:"
Select Case UCase(psProperty) Select Case UCase(psProperty)
Case UCase("BeginGroup") Case UCase("BeginGroup")
_PropertyGet = _BeginGroup _PropertyGet = _BeginGroup
Case UCase("Builtin") Case UCase("BuiltIn")
sValue = _GetPropertyValue(_Element, "CommandURL", "") sValue = _GetPropertyValue(_Element, "CommandURL", "")
_PropertyGet = ( _IsLeft(sValue, cstUnoPrefix) ) _PropertyGet = ( _IsLeft(sValue, cstUnoPrefix) )
Case UCase("Caption") Case UCase("Caption")
......
...@@ -2257,6 +2257,10 @@ Dim oWindow As _Window ...@@ -2257,6 +2257,10 @@ Dim oWindow As _Window
Set oFrame = oComp.Frame Set oFrame = oComp.Frame
iType = acDiagram iType = acDiagram
sName = "" sName = ""
Case "com.sun.star.comp.sfx2.BackingComp" ' Welcome screen
Set oFrame = oComp.Frame
iType = acWelcome
sName = ""
Case Else ' Other Calc, ..., whatever documents Case Else ' Other Calc, ..., whatever documents
If Utils._hasUNOProperty(oComp, "Location") Then If Utils._hasUNOProperty(oComp, "Location") Then
vLocation = Split(oComp.getLocation(), "/") vLocation = Split(oComp.getLocation(), "/")
......
...@@ -74,10 +74,10 @@ Public Function getBorderStyle(Optional pvObject As Variant) As Variant ...@@ -74,10 +74,10 @@ Public Function getBorderStyle(Optional pvObject As Variant) As Variant
End Function ' getBorderStyle End Function ' getBorderStyle
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Public Function getBuiltin(Optional pvObject As Variant) As Boolean Public Function getBuiltIn(Optional pvObject As Variant) As Boolean
If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments("getBuiltin") If IsMissing(pvObject) Or IsEmpty(pvObject) Then Call _TraceArguments("getBuiltIn")
getBuiltin = PropertiesGet._getProperty(pvObject, "Builtin") getBuiltIn = PropertiesGet._getProperty(pvObject, "BuiltIn")
End Function ' getBuiltin End Function ' getBuiltIn
REM ----------------------------------------------------------------------------------------------------------------------- REM -----------------------------------------------------------------------------------------------------------------------
Public Function getButtonLeft(Optional pvObject As Variant) As Boolean Public Function getButtonLeft(Optional pvObject As Variant) As Boolean
...@@ -798,9 +798,9 @@ Public Function _getProperty(pvItem As Variant, ByVal psProperty As String, ByVa ...@@ -798,9 +798,9 @@ Public Function _getProperty(pvItem As Variant, ByVal psProperty As String, ByVa
Case UCase("BorderStyle") Case UCase("BorderStyle")
If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function If Not Utils._CheckArgument(pvItem, 1, OBJCONTROL) Then Goto Exit_Function
_getProperty = pvItem.BorderStyle _getProperty = pvItem.BorderStyle
Case UCase("Builtin") Case UCase("BuiltIn")
If Not Utils._CheckArgument(pvItem, 1, Array(OBJCOMMANDBAR, OBJCOMMANDBARCONTROL)) Then Goto Exit_Function If Not Utils._CheckArgument(pvItem, 1, Array(OBJCOMMANDBAR, OBJCOMMANDBARCONTROL)) Then Goto Exit_Function
_getProperty = pvItem.Builtin _getProperty = pvItem.BuiltIn
Case UCase("ButtonLeft") Case UCase("ButtonLeft")
If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function If Not Utils._CheckArgument(pvItem, 1, OBJEVENT) Then Goto Exit_Function
_getProperty = pvItem.ButtonLeft _getProperty = pvItem.ButtonLeft
......
...@@ -53,6 +53,7 @@ Global Const acTable = 0 ...@@ -53,6 +53,7 @@ Global Const acTable = 0
Global Const acBasicIDE = 101 Global Const acBasicIDE = 101
Global Const acDatabaseWindow = 102 Global Const acDatabaseWindow = 102
Global Const acDocument = 111 Global Const acDocument = 111
Global Const acWelcome = 112
' Subtype if acDocument ' Subtype if acDocument
Global Const docWriter = "Writer" Global Const docWriter = "Writer"
Global Const docCalc = "Calc" 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