Commit graph

428 commits

Author SHA1 Message Date
AnotherTest 7b4fa860d2 Spreadsheet: Check for parse errors after parsing the source
There won't be any parse errors before we actually try to parse
something.
Fixes input like "=1+" crashing the spreadsheet instead of just causing
an error in the cell.
2021-03-22 17:46:17 +01:00
AnotherTest fef165f1d2 Spreadsheet: Do not assume that user input has balanced parenthesis
Otherwise people with broken paren keys, or people with entertaining
ideas like "=9\b)" will cause an assert to trip.
Fixes #5909.
2021-03-22 17:46:17 +01:00
AnotherTest 9b68f91c0b Spreadsheet: Add an export wizard, and support for custom CSV exports
Fixes #4269.
2021-03-22 07:43:58 +01:00
AnotherTest bba3a7a2cb Spreadsheet: Ignore empty cells when calculating data bounds
There's no reason to use extra rows/columns to represent empty cells
when exporting.
2021-03-22 07:43:58 +01:00
AnotherTest 8bd138cbbe Spreadsheet/XSV: Make the writer respect QuoteAll
Also make the header container type generic, and name an enum.
2021-03-22 07:43:58 +01:00
AnotherTest 3c151b3de6 Spreadsheet: Add an import wizard, and add support for custom CSV files
Fixes the import half of #4269.
2021-03-22 07:43:58 +01:00
AnotherTest 3bbcde9192 Spreadsheet/XSV: Add at() accessors
These are just aliases for operator[].
Also make the headers() getter return a vector of empty strings when the
csv file has no explicit headers.
2021-03-22 07:43:58 +01:00
AnotherTest c1d67d6b17 Spreadsheet: Don't assume that the 'cells' field is an object
It might be missing, or not be an object.
Fixes #4821.
2021-03-22 07:43:58 +01:00
AnotherTest 9f8d518e82 Spreadsheet: Only append new columns/rows every 50ms
Fixes #5550.
2021-03-22 07:43:58 +01:00
thankyouverycool 7beae8042a Spreadsheet: Set default width for columns 2021-03-18 07:49:55 +01:00
Andreas Kling d792200a55 LibJS: Rename GlobalObject::initialize() => initialize_global_object()
This function was shadowing Object::initialize() which cannot be called
on global objects and has a different set of parameters.
2021-03-17 16:53:35 +01:00
Andreas Kling ef1e5db1d0 Everywhere: Remove klog(), dbg() and purge all LogStream usage :^)
Good-bye LogStream. Long live AK::Format!
2021-03-12 17:29:37 +01:00
Idan Horowitz 147d30ae4f Spreadsheet: Implement the cut operation for cells
This is done by adding another field to our custom
text/x-spreadsheet-data mime-type that specifies the
action (just copy/cut for now)
2021-03-01 11:37:02 +01:00
thankyouverycool 132ca7e37b Spreadsheet: Merge File menu into 'Spreadsheet' app menu
This is the common convention among the other apps. Also remove
a superfluous separator
2021-02-26 13:50:00 +01:00
Jelle Raaijmakers 9473c694dc Spreadsheet: Fix cell identifier label
Commit 6a6f19a72 broke the cell position display in the top left of the
Spreadsheet window and the title of the cell type dialog, causing the
application to crash when interacting with cells beyond column FE.
2021-02-25 23:32:22 +01:00
AnotherTest 6a6f19a72f Spreadsheet: Store the column index in a Position instead of its name
This will make constructing (and destructing) Positions a lot cheaper
(as it no longer needs to ref() and unref() a String).
Resulted from #5483, but doesn't fix it.
2021-02-24 21:02:02 +01:00
Andreas Kling 5d180d1f99 Everywhere: Rename ASSERT => VERIFY
(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
2021-02-23 20:56:54 +01:00
Linus Groh 3583b62ad3 LibGUI: Swap order of InputBox value and parent window args
This is now consistent with the other dialog classes.
2021-02-20 12:19:46 +01:00
Andreas Kling a50ba0a491 LibSyntax: Make rehighlight() take Gfx::Palette as by const-reference 2021-02-11 23:52:39 +01:00
AnotherTest 09a43969ba Everywhere: Replace dbgln<flag>(...) with dbgln_if(flag, ...)
Replacement made by `find Kernel Userland -name '*.h' -o -name '*.cpp' | sed -i -Ee 's/dbgln\b<(\w+)>\(/dbgln_if(\1, /g'`
2021-02-08 18:08:55 +01:00
Andreas Kling ddbf20ecf6 LibSyntax+LibGUI+LibJS: Move JS syntax highlighter to LibJS
This is a little bit messy but the basic idea is:

Syntax::Highlighter now has a Syntax::HighlighterClient to talk to the
outside world. It mostly communicates in LibGUI primitives that are
available in headers, so inlineable.

GUI::TextEditor inherits from Syntax::HighlighterClient.

This let us to move GUI::JSSyntaxHighlighter to JS::SyntaxHighlighter
and remove LibGUI's dependency on LibJS.
2021-02-07 16:56:02 +01:00
Andreas Kling 43c7d7d285 LibSyntax: Move GUI::Highlighter to Syntax::Highlighter in LibSyntax
This is a move towards dropping more LibGUI dependencies.
2021-02-07 15:15:10 +01:00
asynts 8465683dcf Everywhere: Debug macros instead of constexpr.
This was done with the following script:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/dbgln<debug_([a-z_]+)>/dbgln<\U\1_DEBUG>/' {} \;

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec sed -i -E 's/if constexpr \(debug_([a-z0-9_]+)/if constexpr \(\U\1_DEBUG/' {} \;
2021-01-25 09:47:36 +01:00
asynts acdcf59a33 Everywhere: Remove unnecessary debug comments.
It would be tempting to uncomment these statements, but that won't work
with the new changes.

This was done with the following commands:

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/#define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/#define/ { toggle = 1 }' {} \;

    find . \( -name '*.cpp' -o -name '*.h' -o -name '*.in' \) -not -path './Toolchain/*' -not -path './Build/*' -exec awk -i inplace '$0 !~ /\/\/ #define/ { if (!toggle) { print; } else { toggle = !toggle } } ; $0 ~/\/\/ #define/ { toggle = 1 }' {} \;
2021-01-25 09:47:36 +01:00
asynts 27bc48e06c Everywhere: Replace a bundle of dbg with dbgln.
These changes are arbitrarily divided into multiple commits to make it
easier to find potentially introduced bugs with git bisect.
2021-01-22 22:14:30 +01:00
Andreas Kling d312011708 Everywhere: Drop "shared_buffer" in most GUI programs, pledge "recvfd"
Now that WindowServer broadcasts the system theme using an anonymous
file, we need clients to pledge "recvfd" so they can receive it.

Some programs keep the "shared_buffer" pledge since it's still used for
a handful of things.
2021-01-16 19:30:32 +01:00
Andreas Kling 20915795a8 Everywhere: Pledge "sendfd" in WindowServer client programs
This is needed for the new way we transfer window backing stores.
2021-01-15 14:10:32 +01:00
Andreas Kling dc28c07fa5 Applications: Move to Userland/Applications/ 2021-01-12 12:05:23 +01:00