A common use-case for UI components is to only update the UI state just
before the next frame is rendered, irrespective of how many times a
signal is fired within a given batch of operations.
The event subscriptions object allows these to be easily created and
tracked, and also makes it easier to ensure all subscriptions are cleaned
up at the end.
Recent changes to Formatting.getAppliedStyles return type were not correctly
spread through the DirectFormattingController. Update the CC types and fix
incorrect type usages in this controller.
To help preserve future sanity, some rough unit tests have been added for
the specifically fixed branches ONLY.
Fixes#723.
* remove @license tag, for consistency with library source files
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released stuff
* separate license header by empty line from following content
Output from the headless Qt test runner is difficult to parse and
generally flows off screen very quickly. Appending the failed test names
makes it easier to troubleshoot which tests are problematic.
The StepsCache verification feature verifies the cache after every
modification to ensure it does not contain any bad data. This is quite
slow to do in practice, but is very helpful for debugging, and for
tests.
Layout tests can be added in layouttests.xml. A file is constructed from
ODF fragments and the loaded and layed out document is checked.
Only a few simple dimensions for are currently checked, more tests will follow.
There are no worthwhile unit tests in SelectionMoverTests after these
are cleaned out, so for now the whole class file has been removed.
Mid-term, the SelectionMover class is to be removed as soon as an
implementation of navigate-by-line-boundaries has been created for
the step-iterator approach.
All remaining OdtCursor tests are really testing other parts of the system that
are already covered in their own unit tests. For now, this file has been removed
and should be replaced later when OdtCursor gains additional tests.
When selecting or modifying large areas of content, the multiple
style information lookup becomes quite expensive. These can be greatly
sped up by using a common cached value + associated query object
instead.
Useful for ApplyDirectStyling vs. ApplyDirectStyling, as that in the current
simple implementation will result in inconsistent DOMs (e.g. names of automatic styles)
- moved getAllStyleNames from Formatting to ObjectNameGenerator
- renamed StyleNameGeneratorTest to ObjectNameGeneratorTest and added a couple of more unit tests
I hate you qt… I really do
qtjsruntimetest tests break if OdfCanvas is allowed to insert a
dynamic <link/> element. If a dynamic link is inserted, subsequent
dynamic style sheets (document.createElement('style')) fail to result in
new entries being added to document.styleSheets.
This can easily be seen by commenting out the following and running
ops.OdtCursorTests followed by ops.OdtDocumentTests. As ops.OdtDocumentTests
is the only test suite to rely on style behaviour functioning correctly and
will report failures.
When splitting text nodes, a more stable point will need to be found
for the end point if the start point is split, as DOM modifications
can potentially cause the end point to be lost
These undo rules attempts to implement undo/redo behaviour similar to
how LibreOffice behaves.
An undo state starts on an edit Operation. An undo state can be:
- One or more text inserts in the same direction
- One or more text removes in the same direction
- Any other individual edit operation (e.g., split paragraph, style
text, modify paragraph style)
-An undo state includes any trailing non-edit operations such as cursor
move.
There are challenges going backwards and forwards on separate op stacks
and generating identical states each time. As such, this has been implemented
by storing the operation into the state it's relevant to upon execution (rather
than traversal), and never splitting or modifying these during movements forwards
and backwards.
Applying a direct style to a range will result in new
automatic styles being created for each unique style
block with the desired text properties.
Formatted text is contained within a span element just
above each text node that is within an ODF container
element.
TODO
* Styles should be validated before being applied
* Empty spans should be removed when modifying styles
Each suite and test now has a link. Pressing the link will add a query to the tests page that will filter out only a particular suite or even a particular test.