summaryrefslogtreecommitdiff
path: root/Userland/Applications/Spreadsheet
AgeCommit message (Collapse)Author
2022-08-23LibJS: Replace GlobalObject with VM in Value AOs [Part 4/19]Linus Groh
This is where the fun begins. :^)
2022-08-23LibJS: Remove GlobalObject from VM::this_value()Linus Groh
This is a continuation of the previous six commits. The global object is only needed to return it if the execution context stack is empty, but that doesn't seem like a useful thing to allow in the first place - if you're not currently executing JS, and the execution context stack is empty, there is no this value to retrieve.
2022-08-23LibJS: Remove GlobalObject from VM::throw_completion()Linus Groh
This is a continuation of the previous five commits. A first big step into the direction of no longer having to pass a realm (or currently, a global object) trough layers upon layers of AOs! Unlike the create() APIs we can safely assume that this is only ever called when a running execution context and therefore current realm exists. If not, you can always manually allocate the Error and put it in a Completion :^) In the spec, throw exceptions implicitly use the current realm's intrinsics as well: https://tc39.es/ecma262/#sec-throw-an-exception
2022-08-23LibJS+LibWeb: Replace GlobalObject with Realm in Heap::allocate<T>()Linus Groh
This is a continuation of the previous three commits. Now that create() receives the allocating realm, we can simply forward that to allocate(), which accounts for the majority of these changes. Additionally, we can get rid of the realm_from_global_object() in one place, with one more remaining in VM::throw_completion().
2022-08-23LibJS+LibWeb: Replace GlobalObject with Realm in create() functionsLinus Groh
This is a continuation of the previous two commits. As allocating a JS cell already primarily involves a realm instead of a global object, and we'll need to pass one to the allocate() function itself eventually (it's bridged via the global object right now), the create() functions need to receive a realm as well. The plan is for this to be the highest-level function that actually receives a realm and passes it around, AOs on an even higher level will use the "current realm" concept via VM::current_realm() as that's what the spec assumes; passing around realms (or global objects, for that matter) on higher AO levels is pointless and unlike for allocating individual objects, which may happen outside of regular JS execution, we don't need control over the specific realm that is being used there.
2022-08-23LibJS+LibWeb: Replace GlobalObject with Realm in initialize() functionsLinus Groh
This is a continuation of the previous commit. Calling initialize() is the first thing that's done after allocating a cell on the JS heap - and in the common case of allocating an object, that's where properties are assigned and intrinsics occasionally accessed. Since those are supposed to live on the realm eventually, this is another step into that direction.
2022-08-23LibJS+LibWeb: Replace GlobalObject with Realm in object constructorsLinus Groh
No functional changes - we can still very easily get to the global object via `Realm::global_object()`. This is in preparation of moving the intrinsics to the realm and no longer having to pass a global object when allocating any object. In a few (now, and many more in subsequent commits) places we get a realm using `GlobalObject::associated_realm()`, this is intended to be temporary. For example, create() functions will later receive the same treatment and are passed a realm instead of a global object.
2022-08-15LibJS: Use NaN boxing to decrease the memory size of Valuesdavidot
Using the fact that there are 2^52-2 NaN representations we can "NaN-box" all the Values possible. This means that Value no longer has an explicit "Type" but that information is now stored in the bits of a double. This is done by "tagging" the top two bytes of the double. For a full explanation see the large comment with asserts at the top of Value. We can also use the exact representation of the tags to make checking properties like nullish, or is_cell quicker. But the largest gains are in the fact that the size of a Value is now halved. The SunSpider and other benchmarks have been ran to confirm that there are no regressions in performance compared to the previous implementation. The tests never performed worse and in some cases performed better. But the biggest differences can be seen in memory usage when large arrays are allocated. A simple test which allocates a 1000 arrays of size 100000 has roughly half the memory usage. There is also space in the representations for future expansions such as tuples and records. To ensure that Values on the stack and registers are not lost during garbage collection we also have to add a check to the Heap to check for any of the cell tags and extracting the canonical form of the pointer if it matches.
2022-08-14Base: Launch WebContent at session start-upLucas CHOLLET
2022-08-05LibJS: Let Shape store a Realm instead of a GlobalObjectAndreas Kling
This is a cautious first step towards being able to create JS objects before a global object has been instantiated.
2022-07-12Everywhere: Replace single-char StringView op. arguments with charssin-ack
This prevents us from needing a sv suffix, and potentially reduces the need to run generic code for a single character (as contains, starts_with, ends_with etc. for a char will be just a length and equality check). No functional changes.
2022-07-12Everywhere: Add sv suffix to strings relying on StringView(char const*)sin-ack
Each of these strings would previously rely on StringView's char const* constructor overload, which would call __builtin_strlen on the string. Since we now have operator ""sv, we can replace these with much simpler versions. This opens the door to being able to remove StringView(char const*). No functional changes.
2022-07-12Everywhere: Explicitly specify the size in StringView constructorssin-ack
This commit moves the length calculations out to be directly on the StringView users. This is an important step towards the goal of removing StringView(char const*), as it moves the responsibility of calculating the size of the string to the user of the StringView (which will prevent naive uses causing OOB access).
2022-06-30Spreadsheet: Make conditional-formatting condition-list scrollableFrHun
2022-06-30Spreadsheet: Use new layout systemFrHun
2022-06-26Spreadsheet: Display a detailed view of a cell error on hoverAli Mohammad Pur
With this, Spreadsheet can now show an almost full stack trace for the error (which is infintely better than just the error message).
2022-06-26Spreadsheet: Allow importing sheets into an existing workbookAli Mohammad Pur
2022-06-26Spreadsheet: Throw if lookup value doesn't exist and no default is givenAli Mohammad Pur
And explicitly state which value wasn't found and where in the error.
2022-06-26Spreadsheet: Make it possible to refer to ranges in other sheetsAli Mohammad Pur
Now the range A0:C4 in a sheet named "foo" can be represented as: R`sheet("foo"):A0:C4` This makes it possible to do cross-sheet lookups and more.
2022-06-26Spreadsheet: Prevent OOB access to text editor bufferAli Mohammad Pur
For some reason LibGUI sends two events for each edit, and one of them contains an OOB cursor if a character was deleted. This works around that for now.
2022-06-10LibGUI: Add layout spacer support to GMLFrHun
This is a bit of a hack, but it is an easy way to finally get spacers into GML. This will translate well if spacers are later to become child objects of the continer widget.
2022-05-29Everywhere: Fix a bunch of typosLinus Groh
2022-05-26Userland: Depend some applications on WebContent if it's being usedKarol Kosek
Deduced this mostly by looking at unveil()s.
2022-05-24Spreadsheet: Make save functions take a Core::File instead of a filenameKarol Kosek
This allows us to use FileSystemAccessClient functions.
2022-05-24Spreadsheet: Open files using FileSystemAccessClient::try_open_file()Karol Kosek
2022-05-24Spreadsheet: Remove unused Workbook::load() functionKarol Kosek
2022-05-24Spreadsheet: Use TRY() on file load and saveKarol Kosek
2022-05-22Spreadsheet: Recognize sheets files by mime type, not by file extensionKarol Kosek
These conditions weren't executed since 933a717f3b and always showed a file import/export wizard.
2022-05-15LibWebView: Move OutOfProcessWebView to a new LibWebView libraryDexesTTP
Also moves WebContentClient and the references to the generated IPC descriptions, since they are all components of OutOfProcessWebView. This patch has no functional changes.
2022-05-13LibGUI+Userland: Make Dialog::ExecResult an enum classSam Atkins
2022-04-18Spreadsheet: Sort functions by name in the help windowEli Youngs
2022-04-18Userland: Always construct Application with try_create()Sam Atkins
2022-04-13Spreadsheet: Implement undo functionality where missingmartinfalisse
Implement undo/redo functionality in the Spreadsheet application for the "extend" function, the drag-and-drop function, and when copying and pasting.
2022-04-13Spreadsheet: Make undo operation handle multiple cells at a timemartinfalisse
Instead of having the undo operation only be able to undo one cell for a given undo, make it able to handle multiple cells at a time. Please enter the commit message for your changes. Lines starting
2022-04-09LibGfx: Move other font-related files to LibGfx/Font/Simon Wanner
2022-04-06Spreadsheet: Change paste action's enabled state on clipboard changeKarol Kosek
Previously, the paste action was always enabled and always assumed that anything was selected, which led to a crash by clicking the paste action right after the application startup. This patch will automatically enable/disable the paste action depending on whether a selection exists (it usually does, except on the app launch and after adding a new tab) and if the clipboard mime type is a text/ group. So no, you can't paste an image into the app anymore, even though this mostly froze the app before...
2022-04-03Applications: Use default execpromises parameter to `pledge(..)`Brian Gianforcaro
2022-04-01Everywhere: Run clang-formatIdan Horowitz
2022-03-28Spreadsheet: Don't remove on_change tab function after loading a fileKarol Kosek
Forgot to remove that in c0c9825f67e649daf277e75829c8f4bce1428115, as this function was no longer declared and used... Until the previous commit. This meant that pressing the F2 key after opening a file no longer matched the current tab.
2022-03-28Spreadsheet: Create rename action using the GUI::CommonActions helperKarol Kosek
Besides from reusing more parts from the code, this allows us to call the action using the F2 key. That is also the reason why we have to reassign `m_tab_context_menu_sheet_view` on tab change.
2022-03-28Spreadsheet: Reuse save and rename actionsKarol Kosek
These parts of code were identical to their action counterparts.
2022-03-27WindowServer+LibGUI: Expose raw scroll wheel values to applicationscircl
This is useful, for instance, in games in which you can switch held items using the scroll wheel. In order to implement this, they previously would have to either add a hard-coded division by 4, or look up your mouse settings to adjust correctly. This commit adds an MouseEvent.wheel_raw_delta_x() and MouseEvent.wheel_raw_delta_y().
2022-03-26Spreadsheet: Update Undo / Redo button stateSimon Danner
2022-03-20Spreadsheet: Use the correct top-center alignment when set to Top+CenterAli Mohammad Pur
2022-03-20Spreadsheet: Allow the user to format Identity cells via JS expressionsAli Mohammad Pur
Also add some hints as to what the format field expects as it would be very confusing otherwise.
2022-03-20Spreadsheet: Only update the selection on primary mousedownAli Mohammad Pur
Otherwise we'd end up clearing the selected rect before doing anything with it if the user right-clicks on it.
2022-03-20Spreadsheet: Skip over "invalid" saved cell valuesAli Mohammad Pur
These can be generated by saving something that's not serialisable (e.g. functions), skip over them and let the load logic reevaluate them when needed.
2022-03-19Spreadsheet+LibGUI: Calculate cell position given scroll positionmartinfalisse
Take into account the current scroll position when calculating the position of cells. This way when the user scrolls either horizontally or vertically, the calculations done to find the cell position will be correct.
2022-03-19Spreadsheet: Handle case when drag-and-drop location is out of boundsmartinfalisse
When the drop location of a drag-and-drop operation is not valid, then don't continue with the drop_event. For example, if the ending location is the header row or header column, or is outside of the table, then should not continue.
2022-03-19Spreadsheet: Implement extend functionalitymartinfalisse
Implements ability to extend a cell's contents by clicking the bottom right of the cell and dragging in a linear direction. For now, the content that is extended is simply a copy of the target cell's values.