This function only redirected to the OdfUtils version and many callers
already had an existing instance of OdfUtils to use. Any callers who did
not have an instance of OdfUtils now create one to continue using the
function.
In particular, to allow SplitParagraph to transform with SetParagraphStyle,
the source paragraph boundaries for the split paragraph op also need to
be recorded.
In order to allow convergence between collaborative clients, the split
paragraph op needs to specify what the resulting style of the new
paragraph will be.
* remove @license tag (to prevent Closure compiler keeping the comment)
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released webodf.js
* separate license header by empty line from following content
The length parameter is incorrect under many circumstances, and has
proven so difficult to get correct that the cache implementation now
ignores it entirely. Remove this tech debt to simplify future ops.
* Adapt places where OpSplitParagraph is initialized
to also add the moveCursor flag.
* Let SplitParagraph vs SplitParagraph execute normally
at the same position.
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.
Paragraph splitting carried a very slight optimisation that would insert
the new paragraph before the current one if the current paragraph was
empty. This would cause the reported step position start to be incorrect
as the actual step that changed was position−1.
This alternate code path has been removed to ensure the reported step
changes are always correct.
The new implementation should be equivalent in every way, except
it now is able to benefit from the cached step information to be
significantly more faster.
This patch also addresses parts of issue #3.
* 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.
Splitting a paragraph just before whitespace was causing the cursor to
incorrectly reset, and the leading space to be discarded.
* Re-aligned OdfUtils.isSignificantWhitespace to match description in
README_cursorpositions
* Fixed operationtest "DeleteExposesSpace2" which incorrectly specified
trailing whitespace should be treated as significant
* Reduced number of introduced empty text nodes. This causes issues with
OdtDocument.getPositionInTextNode
The root node element of the flat ODF, <document>, is not a direct child of the
variable "sizer" in the odf.OdfCanvas code) which is used to implement the
zooming feature, by using the scale() transformation via the styles.
Problem is that this scaling does not also scale the actual space used by the
element. To fix this there is a method fixContainerSize() which is used to adapt
the size of the canvas element to the actual rendering size of the document
content. This code then sets the width and height properties to fixed values.
But all this results in another problem: the canvas element is not resized
automatically by the usual DOM behaviour if the content below the <document>
node or the CSS applied to it parts is changed.
The initial plan was to use DOMSubtreeModified & friends, to have the
odf.OdfCanvas care for updates itself. But as it seems outdated and has quite
some overhead on larger changes to the document, in the end it was decided to go
for now with the approach that was chosen for the style changes, to rely on the
document modifying ops to trigger the needed canvas updates themselves. Not
perfect, but seemed consistent at least.
Also:
* merge paragraphEdited event of ops.OdtDocument into paragraphChanged event of ops.Session
* remove any event subscription/emitting from ops.OdtDocument