Commit Graph
25 Commits
Author SHA1 Message Date
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
Satvik Kumar a714866c52 Removed getParagraphElement from OdtDocument
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.
2014-08-13 23:15:50 +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
Philip Peitsch 06ecc7d8c8 Implement OpMergeParagraph
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.
2014-06-17 03:13:00 +10:00
Philip Peitsch 466a828303 Change OT to handle new paragraphStyleName property in SplitParagraph
In particular, to allow SplitParagraph to transform with SetParagraphStyle,
the source paragraph boundaries for the split paragraph op also need to
be recorded.
2014-06-13 23:50:13 +10:00
Philip Peitsch ff97ac053e Make SplitParagraph op specify the new paragraph style
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.
2014-06-13 22:46:48 +10:00
Philip Peitsch 5bcae8781e Ensure OpSetParagraphStyle position is first step within the paragraph
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.
2014-06-13 22:46:48 +10:00
Aditya Bhatt c165702542 Add a const gui.CommonConstraints, which lists
the common constraints that come with and are
respected by WebODF.

Use these constraints in all previous occurrences.
2014-06-06 15:11:32 +02:00
Aditya Bhatt a30858b8c3 Rename SessionContextCache to SessionContext.
Stops caching cursor range.
2014-06-06 15:11:32 +02:00
Aditya Bhatt f36aa2f79b Make text editing respect review mode constraints. 2014-06-06 15:11:31 +02:00
Friedrich W. H. Kossebau 1e2a4a8323 Normalize license headers of the webodf.js source files
* 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
2014-06-02 12:19:05 +02:00
Philip Peitsch cc759acac8 Eliminate unnecessary conversion from cursor steps to range 2014-05-23 10:43:22 +10:00
Philip Peitsch 70f0cbf5dc Apply merged paragraph styles using OpSetParagraphStyle
Reduce the complexity within the remove text operation and push it up to
the controller instead.
2014-05-23 00:34:59 +10:00
Friedrich W. H. Kossebau fa62c38767 remove no more needed returning of the class constructor at end of class files
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
2014-05-22 13:31:51 +02:00
Philip Peitsch ef3a57e180 Ensure merged paragraph style names are well defined
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.
2014-04-28 13:13:08 +10:00
Aditya Bhatt f9907179f8 Add property mergedParagraphStyleName to OpRemoveText spec.
* 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.
2014-04-24 23:25:11 +02:00
Philip Peitsch f255fd3fe2 Improve backspace and delete behaviour to function over inline roots
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.
2014-03-13 10:20:36 +11:00
Jos van den Oever e632ed2ae6 Make a large number of controllers 100% typed. 2014-02-08 13:37:50 +01:00
Jos van den Oever ed7270442f Remove loadClass calls from class files. The load system reads the dependencies from the manifest.json files now. 2014-02-07 15:38:09 +01:00
Friedrich W. H. Kossebau d2671e2a00 @returns -> @return 2014-01-31 15:33:43 +01:00
Philip Peitsch 1eb23dc159 Simplify PositionFilterChain to not use named filters
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.
2014-01-22 23:29:04 +11:00
lli 32f148930a Preserve the text style when splitting at the end of paragraph.
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.
2014-01-20 22:32:24 +11:00
Aditya Bhatt 6921bffe71 Rename TextManipulator to TextController 2014-01-15 13:37:47 +05:30