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
1 change: 1 addition & 0 deletions docs/notes/bugfix-22412.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Fix `tabAlign` property not saving when `tabStops` is not set
2 changes: 1 addition & 1 deletion engine/src/field.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2586,7 +2586,7 @@ IO_stat MCField::extendedsave(MCObjectOutputStream& p_stream, uint4 p_part, uint
}

// SN-2015-04-30: [[ Bug 15175 ]] Save the tabalign property of the field
if (ntabs != 0)
if (nalignments != 0)
{
t_flags |= FIELD_EXTRA_TABALIGN;
// Save number of tab alignments, and then each of them.
Expand Down
31 changes: 17 additions & 14 deletions tests/_testlib.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,7 @@ command TestEnsureJVM
end if
end TestEnsureJVM

command TestEnumPropRoundTrip pObjectType, pProperty, pValues
command TestPropRoundTrip pObjectType, pProperty, pValues
local tStack
put "TestRoundTrip" & pProperty into tStack
create stack tStack
Expand All @@ -766,20 +766,23 @@ command TestEnumPropRoundTrip pObjectType, pProperty, pValues
put the long id of stack tStack into tObject
end if

repeat for each item tValue in pValues
set the pProperty of tObject to tValue
TestAssert format("round trip %s '%s'", pProperty, tValue), \
the pProperty of tObject is tValue
TestDiagnostic format("%s is '%s'", pProperty, the pProperty of tObject)

save stack tStack
delete stack tStack
TestAssert format("round trip to disk %s '%s'", pProperty, tValue), \
the pProperty of tObject is tValue
TestDiagnostic format("%s is '%s'", pProperty, the pProperty of tObject)
repeat for each element tValue in pValues
_TestPropRoundTrip tStack, tObject, pProperty, tValue
end repeat

delete file the filename of stack tStack
delete stack tStack
end TestEnumPropRoundTrip

end TestPropRoundTrip

private command _TestPropRoundTrip pStack, pObject, pProperty, pValue
set the pProperty of pObject to pValue
TestAssert format("round trip %s '%s'", pProperty, pValue), \
the pProperty of pObject is pValue
TestDiagnostic format("%s is '%s'", pProperty, the pProperty of pObject)

save stack pStack
delete stack pStack
TestAssert format("round trip to disk %s '%s'", pProperty, pValue), \
the pProperty of pObject is pValue
TestDiagnostic format("%s is '%s'", pProperty, the pProperty of pObject)
end _TestPropRoundTrip
14 changes: 14 additions & 0 deletions tests/lcs/core/field/line-properties.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -191,3 +191,17 @@ on _TestMixedEffectiveLineProperties pProp, pValue1, pValue2

delete field "Test"
end _TestMixedEffectiveLineProperties

on TestLinePropertyRoundTrip
repeat for each element tTest in sTests
if not tTest["effective"] then
next repeat
end if

local tValues
put tTest["value-1"] into tValues[1]
put tTest["value-2"] into tValues[2]

TestPropRoundTrip "field", tTest["property"], tValues
end repeat
end TestLinePropertyRoundTrip
10 changes: 8 additions & 2 deletions tests/lcs/core/field/softkeyboardproperties.livecodescript
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ You should have received a copy of the GNU General Public License
along with LiveCode. If not see <http://www.gnu.org/licenses/>. */

on TestKeyboardTypeRoundTrip
TestEnumPropRoundTrip "field", "keyboardType", ",default,numeric,url,number,phone,contact,email"
local tValues
put ",default,numeric,url,number,phone,contact,email" into tValues
split tValues by comma
TestPropRoundTrip "field", "keyboardType", tValues
end TestKeyboardTypeRoundTrip

on TestReturnKeyTypeRoundTrip
TestEnumPropRoundTrip "field", "returnKeyType", ",default,go,google,join,next,route,search,send,yahoo,done,emergency call"
local tValues
put ",default,go,google,join,next,route,search,send,yahoo,done,emergency call" into tValues
split tValues by comma
TestPropRoundTrip "field", "returnKeyType", tValues
end TestReturnKeyTypeRoundTrip