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.
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.
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.
In order to improve the OT-ability of text and paragraph removal
with other operations, the merge behaviour has been extracted.
The logic for building up the necessary remove operations has
been encapsulated in TextController for now as all uses pass
through this point still.
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.
The merge paragraph op depends on the impacted paragraphs being identified
by the position of the first step within the paragraph. In order to
facilitate OT'ing of paragraph-based ops, all paragraph ops need to
consistently use the first step in the paragraph to identify the paragraph
they impact.
* 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
runtime.loadClass(...) no longer expects that eval(fileContent) yields
the constructor, and a few loaded files rely on that (e.g. all singletons/namespaces),
so let's be consistent
Though getAttributeNS is now standardised as of HTML4 to always return
null, according to MDN documentation browsers can return a variety of
values for a non-present attribute (generally null or ""). Update the
logic in TextController to always use "" for the merged style name as
the inline comment suggests is the expected behaviour.
* Make TextController specify the mergedParagraphStyleName
when generating a RemoveText operation. No longer let
OpRemoveText decide the merge order from the context.
* Remove the text:style-name attribute on a paragraph
if the aforementioned property is an empty string.
* Add tests for this.
Backspace and delete characters were "sticking" when encountering other
roots in the document (e.g., annotations). Improved logic uses step
iterators to improve the robustness of this calculation.
Partially fixes issue #56.
PositionFilterChains no longer have any need to allow adding or removal
of named filters. In practice, filters are only ever added just after
construction, and remain unchanged beyond this point. This allows a
slight simplification of the PositionFilterChain interface.
At the moment, splitting at the end of the following paragraph
<p style-name="standard">hello <span style-name="bold">world|</span></p>
will create a new paragraph like below
<p style-name="standard">|<span style-name="bold"></span></p>
The cursor is moved out of the span due to empty span is not considered as
a valid cursor position in the current design. this causes newly entered
text are not formatted correctly.
Merged DirectTextStyler and DirectParagraphStyler into
DirectFormattingController. These have become closely related concepts as
a result of changes in this patch.