Commit graph

22944 commits

Author SHA1 Message Date
Miklos Vajna
33310613cd wsd: fix reading past the end of the clipboard in postProcessCopyPayload()
Add a way to search with an offset in findInVector() and then we can
avoid strstr() which assumes a null-terminated input, which may not be
the case.

	READ of size 55 at 0x606000068a56 thread T8 (docbroker_001)
	    #0 0x55d0d6718a5a in StrstrCheck(void*, char*, char const*, char const*) /home/abuild/rpmbuild/BUILD/llvm-15.0.7.src/build/../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:652:5
	    #1 0x55d0d6718882 in __interceptor_strstr /home/abuild/rpmbuild/BUILD/llvm-15.0.7.src/build/../projects/compiler-rt/lib/asan/../sanitizer_common/sanitizer_common_interceptors.inc:669:5
	    #2 0x55d0d71872c9 in ClientSession::postProcessCopyPayload(std::shared_ptr<Message> const&)::$_4::operator()(std::vector<char, std::allocator<char>>&) const /home/vmiklos/git/collaboraonline/online-23.05-san/wsd/ClientSession.cpp:1631:31

During unit-uno-command.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Id42669d912bab4746d9f7d99a192c4c3f1d175f7
2024-01-23 08:38:26 +00:00
Gülşah Köse
ee708edf0d Set titlebar max width equal to dialog container width
Prevents to overflow when the range name is long in conditinal format dialog

Reproducer steps to see long dialog:
1. Create a conditional format where the range is very long (inserted manually)
2. Home > Conditional formatting
3. Create
4. Scroll and paste the following in the Cell Range > Range:
`N3:AL4,N25:AA25,AC25:AL25,X11:AL11,N6:P7,Q5:AL10,Q12:AL13,N5:N7,O5:P5,N14:AL19,N11:P13,A8:C11,N8:P10,C20:J20,O20:AL20,A20:A27,D27,D10,T21:AL24,A3:K7,A12:K19,H8:K10,H27:K27,A28:K89,N26:AL89,M5,D11:K11,Q11:V11,L3:L89,N21:S22,N24:S24,M23:S23,B21:K26`
5. The title never gets truncated and the dialog is too wide

Signed-off-by: Gülşah Köse <gulsah.kose@collabora.com>
Change-Id: Ib845bc84a85d90dec87115cdcd10ae8704163081
2024-01-23 09:23:45 +01:00
Bayram Çiçek
0ad2c24f5c Calc: Don't switch tabs when context menu is triggered
- Trying to open context menu from a sheet tab also
changes the active tab. This occurs when right click
on a sheet tab (or long tap on mobile or tablet)

- moveLeft and moveRight of inactive tabs are
implemented.

- added _moveSheetLR and _moveOrCopySheet functions.

Signed-off-by: Bayram Çiçek <bayram.cicek@collabora.com>
Change-Id: I5b25a8cb363b8e04fd6dcec1f500e7ff2982b678
2024-01-22 12:49:38 +01:00
Miklos Vajna
56abb1c760 common: fix 0 read size in FileUtil::readFile()
/usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/stl_vector.h:1124:9: runtime error: reference binding to null pointer of type 'char'
    #0 0x557ce8c06055 in std::vector<char, std::allocator<char>>::operator[](unsigned long) /usr/bin/../lib64/gcc/x86_64-suse-linux/12/../../../../include/c++/12/bits/stl_vector.h:1124:2
    #1 0x557ce8f16e3f in FileUtil::readFile(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&, int) /home/vmiklos/git/collaboraonline/online-23.05-san/test/../common/FileUtil.cpp:449:37

While running toplevel 'make'. Both 'st.st_size' and 'off' were 0, so
this is an edge case.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I4899bffa48a761c84b6ee7d42776453b641ff5a7
2024-01-22 09:39:38 +00:00
Andras Timar
125591aff3 Update Helm Chart with new release 23.05.7.5
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ie99c37c4d7d318f1d5a077a233f3d188a7800a1f
2024-01-22 09:39:43 +01:00
Rob Pearson
72c065e9d1 Translated using Weblate (English (South Africa))
Currently translated at 100.0% (573 of 573 strings)

Translated using Weblate (English (New Zealand))

Currently translated at 100.0% (573 of 573 strings)

Translated using Weblate (English (United Kingdom))

Currently translated at 100.0% (573 of 573 strings)

Translated using Weblate (English (Australia))

Currently translated at 100.0% (573 of 573 strings)

Co-authored-by: Rob Pearson <rob.dunedin@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/en_AU/
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/en_GB/
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/en_NZ/
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/en_ZA/
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I20c30eb42a473a06f9c6bb4f20bafcb2e4137a16
2024-01-20 20:20:27 +01:00
Yaron Shahrabani
2e6fda9dfb Translated using Weblate (Hebrew)
Currently translated at 98.0% (562 of 573 strings)

Co-authored-by: Yaron Shahrabani <sh.yaron@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/he/
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I15bf026cc6c6225977cd947c4be013fc9b676a87
2024-01-20 20:20:27 +01:00
Caolán McNamara
03ada33e0c add a 'Tile update waste' to the top left as a percentage
make it bold with large text :-)

and move the exact figures back down to the bottom left

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I950ce3db288d63aef201f0a6274f778f2f05bc14
2024-01-20 11:53:40 +00:00
Caolán McNamara
79b376c4bd move tile load counts to top left
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ifc01586209eca7ebbbf2d546adfd7d8095a2e3d4
2024-01-20 11:53:40 +00:00
Caolán McNamara
b4a7acca2d increment global update for an empty delta, as we do for individual tile update
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I031522227bc332ba80df70ea46deb600047127e6
2024-01-20 11:53:40 +00:00
Caolán McNamara
c4be02c2b3 if img was null then we always deref on calling _applyDelta
in practice presumably img can't be null, seeing as currently hasContent
would then be true, then we always deref on calling this._applyDelta

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I48d2466c0a12e4f7084d57a55a963cea469cf2fa
2024-01-20 11:53:40 +00:00
Miklos Vajna
8d5be1286b cool#8023 clipboard: switch marker from outside-html to inside-body
As pointed out at
<https://github.com/CollaboraOnline/online/pull/8041#discussion_r1457933092>,
it's not valid to have a markup like <div><html>...</html></div>.

The old markup was <html><head><meta ...></head>...</html> and that got
stripped away.

Fix the problem by going with <html><body><div ...>...</div></body></html>
which survives browser sanitize and also is a valid HTML.

Both the browser side and the wsd side is updated to go with this
inside-body markup. This also allows simplifying setTextSelectionHTML(),
because the valid HTML means the browser automatically strips the
<style> element whtn converting to plain text. Also remove a leftover
debug code in ClientSession::preProcessSetClipboardPayload() that I
forgot to remove.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Icb0b26a37320ae98237222b450a861ebcb2f0c43
2024-01-19 17:07:34 +00:00
Caolán McNamara
d40acc283b lang ended up as "(null)" and docs from debug.html didn't load
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: Ie007dbdc2d4066c657d2a1cd05c6f4532404495b
2024-01-19 13:01:34 -04:00
Andras Timar
15f49bbb7e Bump version to 23.05.7.5
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I7f842b8fa30191424e0b1cce6a14c4056518a54f
2024-01-19 17:45:30 +01:00
Andras Timar
b35aca88c0 Translated using Weblate (German)
Currently translated at 100.0% (573 of 573 strings)

Co-authored-by: Andras Timar <andras.timar@collabora.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/de/
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I971289ee755819fb0445dfc64c315df5a7c9c681
2024-01-19 17:43:49 +01:00
Lily Logua
e684f1a291 Translated using Weblate (German)
Currently translated at 99.8% (572 of 573 strings)

Co-authored-by: Lily Logua <lily.logua@collabora.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/de/
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ibdb739b9aa086cc9e9816c63d2e5d8845fd334cd
2024-01-19 17:43:49 +01:00
Szymon Kłos
6546ab4501 Use once to call event handler just one time
Use dedicated option, don't do it manually.

https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener#once

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I2bce09c496ca7dd3267514bbb30308b7f7afe4f9
2024-01-19 14:40:01 +01:00
Szymon Kłos
d331120059 Move document tooltip helper to UIManager
so it is with all other showXXXX helpers

Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I0f009a1e380c0c5fd4ac8b43d19af74c25e58b40
2024-01-19 14:40:01 +01:00
Henry Castro
1a31a7baa0 browser: add logging token to send to server side
Change-Id: I252665637a3c5079e0c433f0b1a6c8197105e45f
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
9344c8000b wsd: add logging token javascript errors
The "logging.html" end point was intended to capture
unhandled javascript exceptions from client side,
only corner cases, when websocket is disconnected or
very early errors before websocket is created.
So add a token to restrict access.

Change-Id: I64b7d7f3b3ddd83f044fea21dc07285b4465b3be
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
fc4a8efefe browser: move function "isLocalStorageAllowed"
The variable initialization does not depend on
the conditional M4 macro expansion.

Change-Id: I39f0079ea668768724e0ca3175070e66dc858b0b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
28236b2405 browser: move iOS app init event listeners
The iOS app add event listeners is not a
conditional M4 macro expansion, so
move into the global.js file.

Change-Id: I3adb767cc191a73f0d9197af692e22dd72c6ab46
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
26dd660681 browser: remove unused function "Base64ToArrayBuffer"
Change-Id: Ibcdaf6a9e06b7cb169a1e59e8efc952a1291a6e5
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
1d08877b01 browser: remove unused function "onSlideClick"
Change-Id: I90ef1fda39c52ac231d6407fb14d1bacde9d3a7e
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
1ca7a26b9b browser: simplify no implicit access to L object
Change-Id: I59668b527af914a339bb9799f25edfad5584ea31
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
e2beaab73a browser: simplifiy global === window
Change-Id: I90b6d1b9c36329736e4bdcb1c13180a2a76fab2d
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
8631d573e2 browser: catch exceptions should include the stack trace
Change-Id: Ie7229612b0b08927704155b269d4d2ae77040cad
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
ad0f65be4d browser: if 'console.error' is invoked also invoke ...
'logServer' to save logging data to server side.

Change-Id: I7e5fd0d0f3aefaade1f34b98f9004af2579ba2bd
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
a722687c11 browser: simplify getParameterByName
Use built-in URLSearchParams object

Change-Id: I99effedabf39902ccabfa34285d62fc5df2d2e01
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Henry Castro
91a5831636 browser: simplify logServer
Use "fetch()" function to save logging client data
to server side.

Change-Id: I8b6a94b7ad7ae02ca00666759e3695867df4d372
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-19 10:54:42 +00:00
Marco Cecchetti
9f6824a620 fix linking error for clang 17
CXXLD    unittest
/usr/bin/ld: ../kit/unittest-Kit.o: in function
`Document::updateEditorSpeeds(int, int)':
/opt/shared/work/libreoffice/repo-online/online-cl/test/../kit/Kit.cpp:1488:(.text._ZN8Document18updateEditorSpeedsEii[_ZN8Document18updateEditorSpeedsEii]+0x2d9):
undefined reference to `ChildSession::getSpeed()'

Signed-off-by: Marco Cecchetti <marco.cecchetti@collabora.com>
Change-Id: If95662647d33f80dd98013b6bc81be897dd6ffc5
2024-01-19 08:56:13 +01:00
Miklos Vajna
b5d81234e5 cool#8023 browser: make sure 'style' content doesn't affect plain text selection
cypress_test/integration_tests/desktop/writer/top_toolbar_spec.js's
'Insert hyperlink.' testcase failed with:

	assert	expected **<p>** to have text **text text1link**, but the text was **@page { size: 8.5in 11in; margin: 0.79in }\t\tp { line-height: 115%; margin-bottom: 0.1in; background: transparent }\ttext text1link**

We typically ignore styles on import (and keep the ones in the document
already), so fix the problem by extracting part of stripHTML() into a
new stripStyle() and use that in setTextSelectionHTML(), which restores
the old behavior when it comes to the plain text version of our current
selection.

The old clipboard marker didn't have this problem, but that got removed
entirely with the new clipboard read HTML sanitize, which is even worse.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Id07bf8bc7b1701e53415bde3cf8773411d830e9c
2024-01-19 08:24:57 +01:00
Miklos Vajna
5dd39010f8 cool#8023 browser: generate and interpret new-style clipboard marker
Seeing:

	short-circuit, internal paste, new style? true

on the console with this, which will work even after our HTML gets
stripped with the new-style clipboard API.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I74b14a4415fa026cf24909323d23f760997bd392
2024-01-19 08:24:57 +01:00
Miklos Vajna
141e1ce7d0 cool#8023 Remove HTML marker in unit-copy-paste
This really just passed by accident in the past:

	Clipboard with 19 entries:
		[0] - size 5689 type: 'application/x-openoffice-embed-source-xml;windows_formatname="Star Embed Source (XML)"'
		[1] - size 159 type: 'application/x-openoffice-objectdescriptor-xml;windows_formatname="Star Object Descriptor (XML)";classname="47BBB4CB-CE4C-4E80-a591-42d9ae74950f";typename="Collabora OfficeDev 23.05 Spreadsheet";displayname="file:///tmp/user/docs/jexG9292sB0PuaWL/UnitCopyPaste1d0fdba5_empty.ods";viewaspect="1";width="6783";height="2712";posx="0";posy="0"'
		[2] - size 388 type: 'application/x-openoffice-gdimetafile;windows_formatname="GDIMetaFile"'
		[3] - size 1812 type: 'application/x-openoffice-emf;windows_formatname="Image EMF"'
		[4] - size 2222 type: 'application/x-openoffice-wmf;windows_formatname="Image WMF"'
		[5] - size 1073 type: 'image/png'
		[6] - size 79158 type: 'application/x-openoffice-bitmap;windows_formatname="Bitmap"'
		[7] - size 79158 type: 'image/bmp'
		[8] - size 1493 type: 'text/html'
		[9] - size 0 type: '    </tr>'
		[10] - size 0 type: '           <td align="left"><br></td>'
		[11] - size 0 type: '</table>'
		[12] - size 49 type: 'application/x-openoffice-sylk;windows_formatname="Sylk"'
		[13] - size 98 type: 'application/x-openoffice-link;windows_formatname="Link"'
		[14] - size 246 type: 'application/x-openoffice-dif;windows_formatname="DIF"'
		[15] - size 6 type: 'text/plain;charset=utf-8'
		[16] - size 6 type: 'application/x-libreoffice-tsvc'
		[17] - size 977 type: 'text/rtf'
		[18] - size 977 type: 'text/richtext'

Remove the marker, then sizes will match again.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I1edea3d3a64b9a54cc1c0a0cea703ae66c2aba82
2024-01-19 08:24:57 +01:00
Miklos Vajna
da4a376d90 cool#8023 wsd, ClientSession: extend HTML clipboard marker removal
Tested with an extended version of unit-copy-paste, which will appear in
the next commit.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: Ib15b7918fe678c594e2c345cfca27ba2f1c8b516
2024-01-19 08:24:57 +01:00
Miklos Vajna
819dd9c682 cool#8023 wsd, ClientSession: add new style clipboard marker to our HTML output
The HTML we produce on copy has to go via a sanitize process on paste
once we start using the new clipboard API at
<https://developer.mozilla.org/en-US/docs/Web/API/Clipboard/read>.

The trouble is that at least Chrome simply strips away all <meta> HTML
tags, we can no longer recognize our own HTML output, preventing us from
doing a better internal paste.

Fix this by switching to a markup with survives the cleanup: a <div>
around the <html>...</html> fragment.

This just introduces the new markup, doesn't replace the old markup yet.

Signed-off-by: Miklos Vajna <vmiklos@collabora.com>
Change-Id: I75b00d00064ce452a57185c62f4d99a6d052d867
2024-01-19 08:24:57 +01:00
Henry Castro
8a64290b3a browser: css: fix focus outline dialog container
Change-Id: Iae53fe60aadd17259cf2855c116b5ccbe036402b
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-18 21:37:46 +01:00
Henry Castro
d24190e5b4 browser: simplifiy close feedback
Change-Id: I9230c8f673c636e79614c20f4feb4bb8d355e280
Signed-off-by: Henry Castro <hcastro@collabora.com>
2024-01-18 21:37:46 +01:00
Andras Timar
9863ea3a42 Bump version to 23.05.7.4
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Iacbdaa6db4ae40b0ae8abe30e4657848e2c4ff34
2024-01-18 21:33:36 +01:00
Matthaiks
e8aeb84d0f Translated using Weblate (Polish)
Currently translated at 100.0% (573 of 573 strings)

Co-authored-by: Matthaiks <kitynska@gmail.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/pl/
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I8c0671f96d086fb642e69ae3cb9033a24cd74855
2024-01-18 21:26:42 +01:00
Andras Timar
c1d920c55a Translated using Weblate (Hungarian)
Currently translated at 100.0% (573 of 573 strings)

Co-authored-by: Andras Timar <andras.timar@collabora.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/hu/
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I5ef51373b50ab9aad00ceec15ebe855fcbde2bea
2024-01-18 21:26:42 +01:00
gallegonovato
2610b3a34c Translated using Weblate (Spanish)
Currently translated at 100.0% (467 of 467 strings)

Translated using Weblate (Spanish)

Currently translated at 100.0% (573 of 573 strings)

Co-authored-by: gallegonovato <fran-carro@hotmail.es>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/help/es/
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/es/
Translation: Collabora Online/Help
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: I243e150b28d073042b9292ecd835d6901b24b677
2024-01-18 21:26:42 +01:00
Lily Logua
dd697da7d1 Translated using Weblate (German)
Currently translated at 97.9% (561 of 573 strings)

Co-authored-by: Lily Logua <lily.logua@collabora.com>
Translate-URL: https://hosted.weblate.org/projects/collabora-online/ui/de/
Translation: Collabora Online/UI
Signed-off-by: Andras Timar <andras.timar@collabora.com>
Change-Id: Ibf984fe7847f061b6af8d04c50e6f8cc617c263a
2024-01-18 21:26:42 +01:00
Michael Meeks
f477e17d5e ChildSession - dump much more internal state.
Change-Id: I1441d88968040b6852bf6338e8a4dfcdf8e308f5
Signed-off-by: Michael Meeks <michael.meeks@collabora.com>
2024-01-18 20:18:56 +00:00
Ashod Nakashian
765447caac wsd: buy url substitution
Change-Id: I38d2988680f5b383a2ada5515927631726ba5362
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-01-18 19:25:59 +00:00
Ashod Nakashian
ca05b90d8f wsd: checkfileinfo_override substitution
Change-Id: I6339cb16917e73cfe45e59e42715e5cbc2ae8bb8
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-01-18 19:25:59 +00:00
Ashod Nakashian
77ecca5a54 wsd: branding theme substitution
Change-Id: I05679b894d784e28eebf35bcc0e34ef2fe15d3e5
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-01-18 19:25:59 +00:00
Ashod Nakashian
72ba5ce154 wsd: postmessage substitution
Change-Id: I3b40148f58bab1e39d95d9dc0ee415ebd2450e79
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-01-18 19:25:59 +00:00
Ashod Nakashian
599d03390d wsd: css_variables substitution
Change-Id: I360b3c41fe453fec64ff0880f0e2aa8f627b136c
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-01-18 19:25:59 +00:00
Ashod Nakashian
3113970044 wsd: ui_defaults substitution
Change-Id: I6dc0e9ebf5a6f6dc49aced2671f5ee2453f94f16
Signed-off-by: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
2024-01-18 19:25:59 +00:00