Commit Graph
22 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau d2671e2a00 @returns -> @return 2014-01-31 15:33:43 +01:00
Philip Peitsch f963bc9675 Cache calculated style information when applying direct formatting
When direct formatting, often extremely similar (if not identical) style
hierarchies are being continually retrieved. Allowing external consumers
to provide a limited-life cache vastly speeds up the lookup for this data.
2014-01-24 13:35:16 +11:00
Philip Peitsch 9e98b2bce8 Invert type dependency between Formatting and TextStyleApplicator
A text style applicator is a class that modifies the styles tree via
a formatting object.
2013-12-06 01:27:20 +11:00
Jos van den Oever 3093828871 Break circular dependency between Formatting and TextStyleApplicator. 2013-12-02 13:01:56 +01:00
Philip Peitsch d11813cfb3 Extended watchdog timeouts to allow profiling on slower machines 2013-11-13 17:39:18 +11:00
Friedrich W. H. Kossebau c2a795e668 Update link to repo: now https://github.com/kogmbh/WebODF/ 2013-10-23 18:20:30 +02:00
Friedrich W. H. Kossebau 508570dab8 Add copy of the AGPL3 to sources (+ add to created zip files) 2013-10-21 17:55:16 +02:00
Friedrich W. H. Kossebau 1164be7ee4 Remove some unneeded listing of Node & NodeFilter in jslint globals 2013-10-08 16:00:12 +02:00
Lu Li 3b5b28afd5 refactor StyleNameGenerator into ObjectNameGenerator
- moved getAllStyleNames from Formatting to ObjectNameGenerator
- renamed StyleNameGeneratorTest to ObjectNameGeneratorTest and added a couple of more unit tests
2013-10-02 13:39:35 +10:00
Friedrich W. H. Kossebau d2f612b353 move more namespace strings to odf.Namespaces, more const typing of local copies 2013-09-22 19:21:17 +02:00
Philip Peitsch d73b8efb9e Adjust container re-use checks for applying direct styling
If the text node being considered was the 3rd child node (or later)
and the 1st node in the container was an unstyled text node, the
domUtils.rangeContainsNode check could incorrectly report the
parent container as suitable for re-use.
2013-09-20 14:28:00 +02:00
Philip Peitsch 5a86bddc6e Fix direct styling for selections that contain links
Usually the limits for a selection reference the first or last
text nodes. When the first text node is migrated to a new styled span,
the range limits will suddenly not include the following siblings that
should also be migrated. This causes moveToNewSpan to produce more
spans than necessary.
2013-09-20 14:28:00 +02:00
Philip Peitsch 9d1aa531d5 Extract re-usable concepts
* The extracted style name generator and logic for creating derived
styles will ease the implementation of paragraph direct-format support.
2013-09-06 03:53:09 +10:00
Friedrich W. H. Kossebau 27d2663f4b Add more types to API documentation of odf.* 2013-08-12 18:50:14 +02:00
Philip Peitsch 93960ca267 Always wrap styled text within a stylable container (text:span)
This ensures if the text node is within a non-stylable
element, the applicator first wraps the text in a container that can be
styled. This change will have no impact if the text is already in a
text:span as it usually is. This also ensures text properly styles
text:a content.

Note, the styling behaviour within text:a differs from LO significantly.
LibreOffice actually splits the bar text:a into multiple elements.
e.g.,:
<text:a>http://</text:a><text:span><text:a>webodf.org</text:a></text:span>

This patch will perform this styling as:
<text:a>http://<text:span>webodf.org</text:span></text:a>
2013-08-02 09:14:44 +02:00
Aditya Bhatt 1ce15f31a7 * Don't let annotation highlighting override normal ODF styles
* Add a highlighting and therefore a connector regardless of the
presence of annotation-end.
* Some :before css to render an arrowhead of the connector
2013-08-01 16:16:33 +02:00
Aditya Bhatt 302cc7a283 *Add an annotationsPane and position annotations onto it by styling them
via CSS
*Refactoring: Move common functions from TextStyleApplicator to DomUtils
and OdfUtils.
*Allow application of 'gui' style (with an annotation: namespace) in
TextStyleApplicator and Formatting.
*More CSS for annotations.
*Make OdfCanvas handle annotations.

Add an annotation:connector element to the highlight span for a dotted
line
2013-08-01 16:14:58 +02:00
Lu Li 0eff2c6a0a Refactor odf.Formatting class
* move getTextNode from OdfUtils to StyleHelper
* move some of the unit tests under FormattingTests to StyleHelperTests
2013-07-22 16:47:42 +02:00
Philip Peitsch a24682eb25 Fix crash when styling a text-only selection
OpApplyStyle was incorrectly assuming the common ancestor of
the selection range was a container, and could never be a text
node

* Added support for office:automatic-styles to operation tests
2013-07-16 15:01:08 +02:00
Philip Peitsch db4b386b00 Generated auto-styles names are now deterministic across clients
* Memberid is hashed to ensure it is always valid characters
2013-07-16 15:01:08 +02:00
Philip Peitsch 2af09cc034 Refactored out common DOM utility methods 2013-07-15 09:40:50 +02:00
Philip Peitsch c3a28b3ce3 Implemented support for direct formatting of selection
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
2013-07-02 21:19:36 +02:00