to make life easier by avoiding the need to listen
to various signals or look at optypes when you just
want to know whether any edits have taken place.
Groups of spaces will be represented with space character elements which
are not considered or returned as part of the fetched text nodes. This
logic has now been adjusted to fetch all text elements, which will return
non-text node character element as well.
Problem with the dipslay:block.
If we don't set a height for text:line-break, then there is no gaps
between sentences. As block element with no height doesn't take any space.
On the other hand if we do set a height for text:line-break, then all the
line breaks takes an empty line which is not exactly what we like. The
very first one should just end the line.
CaretManaer - hide caret if it is image selection; otherwise show and refresh cursor blinking
OdtCursor - introduce seletion type
OpAddAnnotation - reset seletion type to default after moved into annotion
area
OpMoveCursor - set the cursor's selection type
OpRemoveText - reset selecton type to default after deletion
problem: the text 'image description' is left bebind undeleted when trying to remove the image below
<draw:frame>
<draw:image/>
<svg:desc>image description</svg:desc>
</draw:frame>
The fix is: apart from delete all the odf element from target node as we currently doing, we also want to delete all those text nodes that their parent are odf elements.
In addition, i also made small behavior change to getTextElements method of OdfUtils.
Now for character elements such as text:s, text:tab and text:line-break, it returns only the odf element instead of both element and text data.
Eg. if the given range include a <text:s> </test:s> element, it return only the <text:s> element rather than both <text:s> and ' '
Under various conditions inserting or removing text should cause existing
whitespace to be upgraded, or allow it to be downgraded. Note, OpSplitParagraph
doesn't require downgrade checks as a split paragraph always requires
any leading or trailing spaces to be upgraded.
Failure to skip insignificant whitespace causes major issues when applying
direct formatting as the operation attempts to style text nodes that
have no parent paragraph (e.g., new line elements between paragraphs).
This causes problems with Flat ODT files, as these are pretty-printed
by LibreOffice, and hence contain a lot of whitespace.
* Documentation++
* Enable annotations by default in editor and viewer.
* Detach range in highlighter after use
Also: Annotation handling is broken when annotations overlap. Add TODO for
that.
annotation in html containers, adds connector elements, and a text
highlight.
Trigger OdfCanvas's anntationManager instance whenever any text
modification operation occurs.
This rewrite fixed 3 failing operation tests related to whitespace
behaviours.
The current implementation supports
* List & list item removal
* Image & frame remove
* Text removal
* Paragraph merging
As part of this, improvements were made to how the cursor positioning
is fixed to attempt to always keep the cursor in the paragraph it starts
in to avoid line jumping near paragraph boundaries.
Note: deleting selected text results anchor node is left behind in the dom
like <anchor></anchor><cursor>...</cursor>. this causes subsequent
OpInsertText to not work as expected due to the current implementation of
OdtDocument.getPositionInTextNode returns position in between the anchor
and cursor node. As a result, the very next character typed after deletion
will be highlighted, and any subsequent character typed will keep replacing
previously entered the character.
In order to address the above situation, call cursor.move(0) to reset its
selection to collapsed after remove the text
OpRemoveText depends heavily on there being text present
for the node to be considered for removal. A simple way
to allow deletion of tabs is to add some basic text content
(e.g., a tab char) so the text node is then considered and
the containing tab can be cleaned up.
* Modify css to preserve whitespace in tab elements
* Added assert to OperationsTest to ensure correct tab data
* Updated all tests to specify the correct tab text content
Only remove span or space elements if the text content is empty
AND there are no character-related children within the text span
* Added more tests to ensure movement around tabs is correct