Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions Toolset/libraries/revideextensionlibrary.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ private function __extensionPropertyInfoFromManifest pId, pManifestPath
local tCacheID
put __extensionCacheID("name", pID) into tCacheId

local tPropertyNames, tPropertyXMLData
local tPropertyNames, tPropertyXMLData, tPropNameList, tMaxOrder
repeat for each line tPropertyNode in tPropertyNodes
local tName
put revXMLAttribute(tXMLTree,"package" & "/" & tPropertyNode,"name") into tName
Expand All @@ -618,20 +618,30 @@ private function __extensionPropertyInfoFromManifest pId, pManifestPath
tPropertyXMLData[tName]["set"]
put revXMLAttribute(tXMLTree,"package" & "/" & tPropertyNode,"get") into \
tPropertyXMLData[tName]["get"]
put tName into tPropNameList[tPropertyNode]
put max(tMaxOrder, tPropertyXMLData[tName]["data"]["order"]) into tMaxOrder
end repeat

-- Sort by ordered props, then by order of appearance
repeat for each line tPropertyNode in tPropertyNodes
if tPropertyXMLData[tPropNameList[tPropertyNode]]["data"]["order"] \
is empty then
add 1 to tMaxOrder
put tMaxOrder into tPropertyXMLData[tPropNameList[tPropertyNode]]["data"]["order"]
end if
end repeat

put the keys of tPropertyXMLData into tPropertyNames
sort tPropertyNames by tPropertyXMLData[each]["data"]["order"]

local tOrder, tPropertyDataA
local tPropertyDataA
repeat for each line tProperty in tPropertyNames
local tIDEPropertyInfo, tPropertyInfoA
put tPropertyXMLData[tProperty]["data"] into tPropertyInfoA
put revIDEPropertyInfo(tProperty) into tIDEPropertyInfo
if tIDEPropertyInfo is not empty then
add 1 to tOrder
union tPropertyInfoA with tIDEPropertyInfo
put tPropertyInfoA into tPropertyDataA[tProperty]
put tOrder into tPropertyDataA[tProperty]["order"]
else
put tPropertyInfoA into tPropertyDataA[tProperty]
end if
Expand All @@ -654,7 +664,6 @@ private function __extensionPropertyInfoFromManifest pId, pManifestPath
put "com.livecode.pi." & tolower(tType) into tPropertyDataA[tProperty]["editor"]
end if
end if
put tOrder into tPropertyDataA[tProperty]["order"]
# Tag the property as a widget property, so we can order them
# correctly after the built-in props for the given section
put true into tPropertyDataA[tProperty]["widget_prop"]
Expand All @@ -673,10 +682,21 @@ private function __extensionPropertyInfoFromManifest pId, pManifestPath
__SetMetadata tMetadataKey, tMetadataValue, tDataA
end repeat

repeat for each line tProperty in idePropertyNames()
if tDataA[tProperty] is not empty then
union tDataA[tProperty] with revIDEPropertyInfo(tProperty)
put tDataA[tProperty] into tPropertyDataA[tProperty]
repeat for each key tProperty in tDataA
if tPropertyXMLData[tProperty] is not empty then
next repeat
end if
local tIDEPropInfoA
put revIDEPropertyInfo(tProperty) into tIDEPropInfoA
if tIDEPropInfoA is not empty then
# if this is a control property that we are overriding,
# tData might be non-empty for the property even though
# there was no property node in the XML
union tPropertyDataA[tProperty] with tDataA[tProperty]

# Now take any default property info that was not specified
# in the manifest
union tPropertyDataA[tProperty] with tIDEPropInfoA
end if
end repeat

Expand Down
1 change: 1 addition & 0 deletions notes/bugfix-20857.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Fix widget property ordering