133 Commits
Author SHA1 Message Date
Friedrich W. H. Kossebau be0969b526 Make odf.Formatting's buildStyleChain() not ignore root containers 2015-04-02 11:49:03 +02:00
Friedrich W. H. Kossebau 49d3181fca Some unit tests for the documentModified property 2015-01-17 19:34:54 +01:00
Friedrich W. H. Kossebau 2ae93c5ef8 Remove hardcoded dep of OdtDocument code on op UpdateMetadata
Following initial design there should be multiple different operation sets
possible, all working on the same document classes.
So relying on a certain optype and its spec in the code of ops.OdtDocument
is conflicting with that.
2015-01-17 18:16:20 +01:00
Philip Peitsch 3172ad8dec Convert core.DomUtils into a static singleton 2014-09-12 10:17:09 +10:00
Philip Peitsch 3c74fb4f27 Add tests demonstrating remaining line ending detection flaws
Line ending detection is still not stable when the wrap point doesn't
span a cursor position (as happens when the wrap occurs over
whitespace). Fixing this issue is not easy, so these tests demonstrate
the current bad behaviour so at least it is somewhat documented.
2014-09-10 21:55:02 +10:00
Philip Peitsch f37c59d985 Detect line endings when wrapping occurs between elements
Line ending detection was relying on wrapping occurring near or in a block
of collapsed whitespace. When wrapping occurs between two elements, both
previous and next rectangles may be defined, though the vertical overlap
will be absent.
2014-09-10 21:55:01 +10:00
Philip Peitsch 5445b52a7a Use text style from the selection start when splitting a paragraph 2014-08-14 23:16:45 +10:00
Philip Peitsch 36be9398d9 Fix crash if a split paragraph occurs with no text elements selected 2014-08-14 22:33:30 +10:00
Philip Peitsch d18d2b5b8a Migrate SelectionMover.createPositionIterator to OdtDocument
Remove the SelectionMover file entirely as it no longer contains any
functionality.
2014-08-05 10:12:17 +10:00
Philip Peitsch eb93117fc6 Fix direct cursor styling behaviour
Recent changes to Formatting.getAppliedStyles return type were not correctly
spread through the DirectFormattingController. Update the CC types and fix
incorrect type usages in this controller.

To help preserve future sanity, some rough unit tests have been added for
the specifically fixed branches ONLY.

Fixes #723.
2014-07-29 20:27:32 +10:00
Philip Peitsch 615f592473 Re-implement navigate-by-line cursor movement 2014-07-23 02:17:20 +10:00
Philip Peitsch adc5a08759 Re-implement navigate-to-line-boundary cursor movement 2014-07-23 02:17:19 +10: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 7f80e8e163 Normalize license headers of editor/benchmark/tests/firefox-addon/viewer source files
* remove @license tag, for consistency with library source files
* use copyright@kogmbh.com email address everywhere
* remove "additional permission", to be added only to released stuff
* separate license header by empty line from following content
2014-06-02 17:49:46 +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
Friedrich W. H. Kossebau 5e3d2d708f Add gui.MetadataController 2014-05-27 15:03:53 +02:00
Philip Peitsch 6aa3895c9e Remove unnecessary test returns (again!)
These were just cleaned up, and here someone has gone and reintroduced
them again! What gives!
2014-05-23 10:43:24 +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 5a4086feb9 Don't crash if the requested range is outside the any document root
Fixes a crash when running the benchmark.
2014-03-31 22:48:09 +11:00
Philip Peitsch 48d06917b9 Use the start node rather than cursor for word boundary expansion
The SelectionController interfaces allow word-expansion to occur on
arbitrary ranges that may not be tied directly to the cursor (e.g., when
used via the selectRange interface). This means the correct root to use
in all circumstances is the starting node & offset.
2014-03-26 10:14:45 +11:00
Philip Peitsch 2af751acdd Crop range selection to the anchor root
Fix an unhandled case if the anchor and focus points of a range were in
two separate roots. The select range logic will now clip the range to
the closest valid edge within the anchor's root.
2014-03-26 10:14:45 +11:00
Philip Peitsch 3cd6d6a5d1 Re-implement paragraph & document selection using step iterators
Changes in adjustSelectionByNode logic fixes extend-by-paragraph
problem (issue #335).
2014-03-24 19:08:05 +11:00
Philip Peitsch ffb7d74ee4 Remove SelectionMover functions that are only used in tests
There are no worthwhile unit tests in SelectionMoverTests after these
are cleaned out, so for now the whole class file has been removed.

Mid-term, the SelectionMover class is to be removed as soon as an
implementation of navigate-by-line-boundaries has been created for
the step-iterator approach.
2014-02-14 02:03:39 +11:00
Philip Peitsch bbe28003fc Remove superseded SelectionMover.countStepsToPosition 2014-02-13 11:28:13 +11:00
Philip Peitsch 8d63854f39 Cope with non-latin alphabets when searching for word boundaries
This has been sourced from http://apps.timwhitlock.info/js/regex, which
creates these sets using the cset JS library. The set includes all
punctuation components only.

Addresses issue #268
2014-02-12 13:03:17 +11:00
Philip Peitsch 14f92e09fe Rewrite range-based word boundary expansion to use step iterators 2014-02-12 13:03:17 +11:00
Philip Peitsch f2bcb12be7 Rewrite move & select via word boundaries to use a step iterator 2014-02-12 13:03:17 +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
Jos van den Oever 265b7d3768 Rename ops.Document.getCursors to ops.Document.getMemberIds. 2014-02-05 14:24:25 +01:00
Jos van den Oever a9e64e645f Remove circular dependency between OdtDocument and OdtCursor.
OdtCursor does not depend on OdtDocument any more. In fact, it is not specific
to ODF any more so at some point it could be renamed.
2014-02-05 14:24:25 +01:00
Jos van den Oever 9e0059236d Add a general document interface for use in operations.
The UndoManager and TrivialUndoManager classes are adapted to the generalized interface.
2014-02-04 10:01:08 +01:00
Friedrich W. H. Kossebau d2671e2a00 @returns -> @return 2014-01-31 15:33:43 +01:00
Andreas Obergrusberger 45ebc8e02a Add ctrl+arrow per-word cursor movement 2014-01-30 21:33:39 +01:00
Philip Peitsch 08fffa8ab1 Drastically improve the performance of undo ops grouping on large states
Continuous typing causes the undo states to potentially become extremely
large. The naive assumption that some of the arrays in use would stay
small causes immense slow-downs when determining whether to create a new
undo state.

These bottlenecks have now been removed, and the search depth of various
grouping conditions have been limited to psmaller sizes.
2014-01-29 23:21:01 +11:00
Philip Peitsch 8c7de7c698 Refactor how style summary is retrieved to use cached values
When selecting or modifying large areas of content, the multiple
style information lookup becomes quite expensive. These can be greatly
sped up by using a common cached value + associated query object
instead.
2014-01-29 00:46:52 +11:00
Philip Peitsch 34d1e37d21 Re-use session.enqueue to replay operations for the undo manager
An executing operation needs to emit various other signals (e.g.,
signalOperationStart) in order for various other controllers and UI
managers to perform correctly (e.g., preserving focus, re-drawing
the selection etc.).

The simplest way to ensure this happens is to use the session.enqueue
call. The UndoManager will ignore any new operations while performing
an undo.
2014-01-23 23:01:27 +11:00
Philip Peitsch 9394ac7d63 Allow edit & non-edit ops to interleave if edit ops are continuous
Previously an edit would always start a new undo state if there last
operation in the current undo state was a non-edit. This change means
moving the cursor around will not reset the redo stack, more closely
matching other office suites.
2014-01-23 23:01:27 +11:00
Philip Peitsch bf712a77fb Use operation groups to improve undo behaviour
Support has been added for operation groups. Operation groups (i.e.,
a group of ops queued together) are never split across multiple undo
states.

When groups are used, a new operation will be considered continuous
with the current undo state if it is continuous with the most recent
operation of the same type in the most recent group in the existing
undo state.
2014-01-23 23:01:27 +11:00
Philip Peitsch e5afad1eb3 Ensure continuous operation is actually adjacent to existing edit ops 2014-01-23 23:01:26 +11:00
Philip Peitsch c840055d58 Improve some documentation and variable names in undo stack 2014-01-23 23:01:26 +11:00
Philip Peitsch 9a84cb73be Clarify names & usage of the undo manager 2014-01-09 00:14:02 +11:00
Philip Peitsch e2ec5af9d4 Don’t reset the undo manager state when entering or exiting edit mode
This allows consumers to enter and exit edit mode multiple times without
the undo stack being reset. Once the initial undo state has been captured
after the document is loaded, there is no major problems with preserving
the undo state (other than the undo manager’s shameful performance).
2014-01-08 21:48:32 +11:00
Jos van den Oever 545c15fedb Add more type information to class UnitTester.
The names of the test functions are now passed separately from the function in
a structure. The reason for this is that Closure Compiler does not allow adding
additional fields to functions.
2013-11-26 16:55:00 +01:00
Friedrich W. H. Kossebau 248e35ad8b Rename AnnotationManager to AnnotationController
also call do not call AnnotationViewManager objects not annotationManager
2013-11-19 19:56:15 +01:00
Philip Peitsch 553739907b Condensed countBackwardSteps & countForwardSteps into countSteps on SelectionMover
Most consumers of this interface were re-implementing a "countSteps"
equivalent.
2013-10-25 22:12:09 +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