281 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau 0a13b44fd3 Add transformAddAnnotationRemoveAnnotation 2015-05-06 18:39:15 +02:00
Friedrich W. H. Kossebau 19a3ffce2d Add transformRemoveAnnotationRemoveAnnotation 2015-05-06 18:39:15 +02:00
Friedrich W. H. Kossebau 0327e69611 Support multiple annotations in TransformationTests' linkAnnotationEndToStart 2015-05-06 18:39:15 +02:00
Friedrich W. H. Kossebau 2875939211 Add transformAddAnnotationAddAnnotation 2015-05-06 18:39:15 +02:00
Friedrich W. H. Kossebau 298e09ae03 Add Alice & Bob as default members in TransformationTests 2015-04-21 16:58:50 +02:00
Friedrich W. H. Kossebau 50b0213b3c Add transformRemoveAnnotationRemoveText 2015-04-21 16:58:50 +02:00
Friedrich W. H. Kossebau ad38426eb4 Add transformRemoveAnnotationSetParagraphStyle 2015-04-21 16:58:50 +02:00
Friedrich W. H. Kossebau 10a3553a9d Add transformRemoveAnnotationSplitParagraph 2015-04-21 16:58:50 +02:00
Friedrich W. H. Kossebau a00e838764 Add transformMoveCursorRemoveAnnotation 2015-04-21 16:58:50 +02:00
Friedrich W. H. Kossebau f3f495b832 Add transformMergeParagraphRemoveAnnotation 2015-04-21 16:58:50 +02:00
Friedrich W. H. Kossebau 1b9fdca1bf Add transformInsertTextRemoveAnnotation 2015-04-21 16:58:50 +02:00
Friedrich W. H. Kossebau 773ff97d8b Move bookkeeping about setup method to test description 2015-04-21 16:58:50 +02:00
Friedrich W. H. Kossebau 419eb54788 Add transformApplyDirectStylingRemoveAnnotation 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau a23d98a53f Add transformAddAnnotationRemoveText 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau f4b49d8993 add transformAddAnnotationMergeParagraph 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau 63c19e91a0 Add transformAddAnnotationApplyDirectStyling 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau f156d9e27a Add transformAddAnnotationSetParagraphStyle 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau bf89109feb Add transformAddAnnotationSplitParagraph 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau f9f24a6fcc Add transformAddAnnotationMoveCursor 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau db51dfdfe8 Add transformAddAnnotationInsertText 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau 69ac4062de Add noop transformations against AddAnnotation & RemoveAnnotation 2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau 706d76422e Add supports for custom test setups in TransformationTests
similiar code as in OperationTests
2015-04-21 16:58:49 +02:00
Friedrich W. H. Kossebau 1d24d462c8 In OpAddAnnotation support annotated ranges with 0 length
Before 0 length was assumed to be an annotation without a range
2015-03-26 13:42:23 +01:00
Friedrich W. H. Kossebau 45726eb701 Fix OpMergeParagraph to not remove empty text:p of annotations' text 2015-03-25 11:11:29 +01:00
Philip Peitsch 4afcc165ed Reduce the number of places aware that the root element can be replaced
Replacing the root element is currently a by-product of the undo impl.
Reducing the number of places aware of this impl detail helps ensure
future undo managers have less clean-up work to do when this behaviour
is finally removed.
2015-02-15 16:53:19 +11:00
Philip Peitsch 9fba50ac69 Fix position instability around highlighted annotations
By checking only nodes that pass the supplied node filter, the position
logic can safely ignore out-of-place cursors near highlighted annotations.

Note, this can't re-use PositionIterator.previousNode, because the logic
requires the previous sibling of the current container's previous sibling.
2014-09-30 11:29:33 +10:00
Philip Peitsch 1586b9f36c Add additional tests showing position stability problems 2014-09-30 11:29:33 +10:00
Philip Peitsch 14190c2b26 Add test showing position stability issue near annotations 2014-09-30 11:29:33 +10:00
Philip Peitsch 2185247868 Report one test per cursor position document fragment 2014-09-24 09:04:01 +10:00
Philip Peitsch e72e8b8b25 Fix doc length check when iterating backwards 2014-09-24 09:04:01 +10:00
Philip Peitsch 1cd6d61a50 Verify the number of steps vs. expected number of cursor positions 2014-09-24 09:04:00 +10:00
Philip Peitsch bb56bc684c Convert odf.OdfUtils into a static singleton 2014-09-12 10:33:27 +10:00
Philip Peitsch 3172ad8dec Convert core.DomUtils into a static singleton 2014-09-12 10:17:09 +10:00
Philip Peitsch d6ced212b0 Migrate per-node checks out of TextPositionFilter
Moving these checks into a node filter ensures it is only required
once per node, rather than once per node-position.

This results in a 60% improvement in position iteration speed.
2014-09-12 09:21:22 +10:00
Satvik Kumar a19452ab54 Filter out meaningless text nodes from unit tests
Some unit tests compare an XML snippet before and after the execution of a
set of operations. For this comparison to pass all the text nodes had to
be exactly the same even if they were not contained in an ODF paragraph.

This imposed a limitation on the tests as they could not have any
whitespace between node structures that were compared in the test files.
Having whitespace is useful to format the test XML data so that it is more
human readable/editable.

This commit filters out any text nodes not contained by an ODF paragraph
so that any test comparisons won't be affected by these text nodes.
2014-09-11 18:55:03 +10:00
Philip Peitsch 29f228a9f3 Support selection & deletion of more ODF fields
* Includes a tool to help parse the RNG to figure out text containers
* Add demonstration section to visual-tests document

Fixes #772
2014-09-11 15:32:27 +10:00
Philip Peitsch 7809834473 Fix OT when two adjacent paragraphs are merged backwards
Transforms were not ensuring a consistent style name was applied to the
merged paragraph on all clients.
2014-08-19 01:27:06 +10:00
Philip Peitsch 1284f83535 Add unit tests showing MergeParagraph OT issue 2014-08-19 01:27:06 +10:00
Philip Peitsch ea0723a6ea Fix preservation of foreign elements on paragraph merge
This behaviour was working prior to the merge paragraph operation being
introduced. A new edge case was introduced related to cleaning up empty
spans that caused this to regress.
2014-08-13 00:13:06 +10:00
Philip Peitsch e03940b19b Add test demonstrating foreign elements are discarded on paragraph merge 2014-08-12 22:52:34 +10:00
Philip Peitsch 3141621018 Allow merge paragraph to handle unexpected nodes near paragraph boundaries
getTextElements may return some unexpected text nodes if the step filters
haven't correctly identified the first/last step in the paragraph. Rather
than failing completely in this case, simply log the unexpected items and
skip them.

getTextElements itself still needs to be fixed in these cases, but the
harm caused by such mistakes is slightly reduced in this instance.
2014-08-11 15:08:45 +10:00
Philip Peitsch 72ca4a3b5e Add test showing merge paragraph assert with some exotic odf elements 2014-08-11 14:56:15 +10:00
Satvik Kumar 865541a3ed Use core.StepsDirection enum for rounding direction
The rounding direction constants in OdtStepsTranslator overlap with the
existing enum in core.StepsDirection. It makes sense to use that enum here
to specify rounding behaviour in converting DOM points to steps so the
constants have been removed and the enum has been substituted for all
usages.
2014-08-07 23:53:05 +10:00
Satvik Kumar 482e98da74 Remove rounding predicate from step conversion
This removes the option to provide a rounding predicate to decide whether
to round up or down from the convertDomPointToCursorStep method. It is replaced
with an enum that specifies whether to round up or down. The predicate was
removed as all callers supplied the same function to indicate they wanted
round up behaviour and this predicate was being duplicated.

The rounding parameter is optional and defaults to rounding down to the
previous step which is the same as before this commit.
2014-08-07 23:07:57 +10:00
Friedrich W. H. Kossebau 11f6c74916 Workaround for Firefox failing on RemoveText_CopesWithEmptyTextNodes 2014-08-07 11:25:22 +02:00
Philip Peitsch d18d2b5b8a Migrate SelectionMover.createPositionIterator to OdtDocument
Remove the SelectionMover file entirely as it no longer contains any
functionality.
2014-08-05 10:12:17 +10:00
Philip Peitsch c08af33ea5 Remove the SelectionMover class and associated code
The removed tests have been superseded by SelectionController tests covering
the same functionality.
2014-08-02 13:14:10 +10:00
Aditya Bhatt f1eb83ac56 Order the new setParagraphStyle OT tests to have
some degree of alphabetical order in the tests file.
2014-06-23 10:13:13 +02:00
Aditya Bhatt 75ceb5d3b3 Add OT for SetParagraphStyle vs SetParagraphStyle 2014-06-22 03:20:51 +02:00
Aditya Bhatt 1d6b7a75bf Add OT for RemoveText vs SetParagraphStyle 2014-06-22 03:15:31 +02:00