Commit Graph

342 Commits

Author SHA1 Message Date
David Tardon
db6673bb32 fix build error
Change-Id: I1e65f075a0519db86836b3aa09848178796a020b
2017-10-24 18:17:21 +02:00
Pranav Kant
3ebaaebf54 Change CB_DIALOG_INVALIDATE to CB_DIALOG
We can specify whether it is an invalidation or something else in the
payload.

Change-Id: I95c5fc0a0a88b5277eaa93c8d1f9b937bddce7b3
2017-10-02 11:01:39 +05:30
Pranav Kant
9cdaccc0cc lokdialog: Support for rendering floating window dialog widgets
Now gtktiledviewer can show floating window dialog widgets when user
clicks any of such widget in the dialog.

Change-Id: I13d756f236379bc8b2041ed41cb7b502f7fd9b24
2017-10-02 11:01:18 +05:30
Pranav Kant
fb09d4aa2e lokdocview: Remove unnecessary code
Change-Id: I1d744c91f01eb098e9273d2459b63a5444558f39
2017-10-02 11:00:52 +05:30
Pranav Kant
ddac37b94f lokdialog: Queue a redraw on invalidation in gtktiledviewer
Change-Id: I081508674a71c3beb89175e4f8ac3256e6bc6c6a
2017-10-02 10:57:41 +05:30
Pranav Kant
9874cd5efa lokdialog: Dialog invalidation support
For now, just invalidate the whole dialog whenever any of the controls
in the dialog get invalidated.

Since during dialog painting, many such invalidations are triggered,
don't listen to them when we are painting.

Change-Id: Ia8fc12cf9469691d60e91ef770d687e5ff01a7ef
2017-10-02 10:57:15 +05:30
Aditya Dewan
d64a7f4ba8 implementing callback for ruler invalidation
adding commands to fetch and changee ruler state
'.uno:RulerState' and '.uno:RulerStateChange'

Change-Id: I66107039a7ae5893691feb45c8ab2e4aa476ea76
Reviewed-on: https://gerrit.libreoffice.org/40727
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: pranavk <pranavk@collabora.co.uk>
2017-08-17 13:10:30 +02:00
Noel Grandin
c9253818ec loplugin:oncevar
extend oncevar to any POD type

Change-Id: Ia98ee0a67f183e40fb0c38477760124b2c411dc0
Reviewed-on: https://gerrit.libreoffice.org/40564
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-31 08:25:07 +02:00
Caolán McNamara
00657aef09 migrate to boost::gettext
* all .ui files go from <interface> to <interface domain="MODULE"> e.g. vcl
* all .src files go away and the english source strings folded into the .hrc as NC_("context", "source string")
* ResMgr is dropped in favour of std::locale imbued by boost::locale::generator pointed at matching
  MODULE .mo files
* UIConfig translations are folded into the module .mo, so e.g. UIConfig_cui
  goes from l10n target to normal one, so the res/lang.zips of UI files go away
* translation via Translation::get(hrc-define-key, imbued-std::locale)
* python can now be translated with its inbuilt gettext support (we keep the name strings.hrc there
  to keep finding the .hrc file uniform) so magic numbers can go away there
* java and starbasic components can be translated via the pre-existing css.resource.StringResourceWithLocation
  mechanism
* en-US res files go away, their strings are now the .hrc keys in the source code
* remaining .res files are replaced by .mo files
* in .res/.ui-lang-zip files, the old scheme missing translations of strings
  results in inserting the english original so something can be found, now the
  standard fallback of using the english original from the source key is used, so
  partial translations shrink dramatically in size
* extract .hrc strings with hrcex which backs onto
   xgettext -C --add-comments --keyword=NC_:1c,2 --from-code=UTF-8 --no-wrap
* extract .ui strings with uiex which backs onto
   xgettext --add-comments --no-wrap
* qtz for gettext translations is generated at runtime as ascii-ified crc32 of
   content + "|" + msgid
* [API CHANGE] remove deprecated binary .res resouce loader related uno apis
      com::sun::resource::OfficeResourceLoader
      com::sun::resource::XResourceBundleLoader
      com::sun::resource::XResourceBundle
    when translating strings via uno apis
      com.sun.star.resource.StringResourceWithLocation
    can continue to be used

Change-Id: Ia2594a2672b7301d9c3421fdf31b6cfe7f3f8d0a
2017-07-21 08:20:50 +01:00
Noel Grandin
4250b25c6a teach unnecessaryparen loplugin about identifiers
Change-Id: I5710b51e53779c222cec0bf08cd34bda330fec4b
Reviewed-on: https://gerrit.libreoffice.org/39737
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-07-10 09:57:24 +02:00
Noel Grandin
cb37c5f0f3 loplugin:unusedfields in jvmfwk..mysqlc
Change-Id: If9c7a3239fceba9a2db3a5905ccaa7fa9adadb08
Reviewed-on: https://gerrit.libreoffice.org/39099
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-06-23 08:59:20 +02:00
Andrea Gelmini
08c1acee80 Fix typos
Change-Id: Iba6b13871222d591bce49d04990e7c85ff154cce
Reviewed-on: https://gerrit.libreoffice.org/38915
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-06-18 21:10:42 +02:00
Caolán McNamara
805adaae91 Resolves: rhbz#1454693 segv if tiled rendering is interrupted
Change-Id: I1131f246c43806adb8a83f6eeafca2b734851a0e
Reviewed-on: https://gerrit.libreoffice.org/38888
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-06-16 16:42:42 +02:00
Caolán McNamara
e567ede54e Related: rhbz#1444437 check if m_nTimeoutId is valid
Change-Id: I80d850d23ab0e95bb4b105efa5a1ae1e59933a95
2017-06-15 12:45:28 +01:00
Marco Cecchetti
9cc9300bc2 lok: sc: notify cell cursor position to address control in client
A new callback has been introduced for notifying the client:
LOK_CALLBACK_CELL_ADDRESS

Change-Id: I40b38a3cb8fb658c3f00332d56cfcbaf98e13771
Reviewed-on: https://gerrit.libreoffice.org/37357
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-05-11 17:56:09 +02:00
Caolán McNamara
a99707d2c4 Resolves: rhbz#144437 make gnome-documents not crash the whole time
accept that once initted that LibreOffice cannot be deinitted and reinited
(without lots of work), but allow the main loop to quit and restart so LOKs
thread can run and exit successfully, new LOK connections will restart the main
loop.

The buckets of global state continues to be valid the whole time this way

Change-Id: Ide54c0df2ce4065f7c192ae8c2cedfaaa2b58d72
Reviewed-on: https://gerrit.libreoffice.org/37399
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-10 15:28:16 +02:00
Caolán McNamara
c45660df33 rhbz#1444437 gnome-documents finalize may not occur immediately
when LOK Widget is destroyed, it may instead happen during GC of javascript,
like in the in gnome-documents case, but "destroy" will be called promptly. So
close documents and office in destroy, not finalize

Change-Id: I1dd7b828839894cb2d87f5c087194fe458ca22f0
Reviewed-on: https://gerrit.libreoffice.org/37398
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-05-09 09:29:50 +02:00
Andrea Gelmini
98ef3edb8a Fix typos
Change-Id: Id5811d092917c872715559f4508d01e4173d090c
Reviewed-on: https://gerrit.libreoffice.org/35636
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Julien Nabet <serval2412@yahoo.fr>
2017-03-25 11:02:47 +00:00
Noel Grandin
c1877a16b3 loplugin:unusedfields
Change-Id: I8a114bcda99f123d230d61b0d0595bfe657cc3c0
Reviewed-on: https://gerrit.libreoffice.org/34513
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2017-02-22 06:42:19 +00:00
Pranav Kant
b3178e2fce lokdocview: 'comment' signal for comment callbacks
Change-Id: I82040893added83ff13395db3917b230ef6b01d5
2017-01-27 21:57:01 +05:30
Pranav Kant
3616f875b0 lokdocview: Separate gobject property for turning off comments
Pass --enable-tiled-annotations to gtktiledviewer on command line
to turn comments on again, by default they are turned off now.

Change-Id: I40e93ab683ec9538e088ae9aa83cda2eaaf9939e
Reviewed-on: https://gerrit.libreoffice.org/33622
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-01-27 16:13:04 +00:00
Pranav Kant
5f5073a845 lok: Implement new callbacks for comment notifications
Change-Id: I298183b295c68c4a39cb1f6fffe4b89b4eaee0f3
Reviewed-on: https://gerrit.libreoffice.org/33469
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-01-27 11:50:02 +00:00
Pranav Kant
0f0164d647 lokdocview: Turn off annotations rendering here
Change-Id: Ia1ee4f54a05ab3daca62a78fe335e731e4cfc02d
Reviewed-on: https://gerrit.libreoffice.org/33465
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-01-27 10:48:56 +00:00
Noel Grandin
c5df32e5cb loplugin: unnecessary destructor jvmfwk..lotuswordpro
Change-Id: Iaa4f9b178ab265342255066af7fff09f5b33ab37
Reviewed-on: https://gerrit.libreoffice.org/33496
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
2017-01-24 15:56:31 +00:00
Pranav Kant
5128e503ba lokdocview: Handle keypad enter
Change-Id: Ia892c346d4a3c0a5439c7977963cc502d287e6f7
Reviewed-on: https://gerrit.libreoffice.org/33445
Reviewed-by: pranavk <pranavk@collabora.co.uk>
Tested-by: pranavk <pranavk@collabora.co.uk>
2017-01-23 07:00:23 +00:00
Stephan Bergmann
7267e2b50d New loplugin:externvar: libreofficekit
Change-Id: Ib2a19249e1dd8d187b1fdc5559a9b4b9c2825e8c
2017-01-09 15:42:20 +01:00
Pranav Kant
de6e3d1e87 lokdocview: Handle insert key
Change-Id: Idb5ad17a3a94b9a6fba1113a759207c59acfb7bd
2017-01-06 14:33:36 +05:30
Muhammet Kara
8885343a33 Fix inefficient usage of string::find() in condition (CWE597)
string::compare() will be faster when string::find's result is
compared with 0, because it will not scan the whole string.

Change-Id: I78596a6d796fe9779f88b7c7b91da09aa27b7035
Reviewed-on: https://gerrit.libreoffice.org/32430
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
2017-01-02 10:39:04 +00:00
Noel Grandin
6320a0f210 revert string::find changes
this reverts

    commit 610f596515
    fix "cppcheck:stlIfStrFind"

and

    commit 5c1bb338ef
    cppcheck:stlIfStrFind

which are deficient in one way or another, the original logic, while
inefficient, is still most accurate

Change-Id: I4907d2569c9c2976533f8ac9f4b8b45eb1807b72
2016-10-24 11:30:14 +02:00
Noel Grandin
610f596515 fix "cppcheck:stlIfStrFind"
in commit 5c1bb338ef, compare does not do
a startswith

Change-Id: If518b3f6880848a5b5463c09fb73974d972010fd
2016-10-24 10:56:08 +02:00
Julien Nabet
5c1bb338ef cppcheck:stlIfStrFind
Change-Id: Ic3c1b37b0c2cf9995e0bd1017cdbaed427fb296c
Reviewed-on: https://gerrit.libreoffice.org/30185
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
2016-10-24 06:11:08 +00:00
Marco Cecchetti
21327496cb LOK: handle "EMPTY" invalid tile msg with part number in payload
What's new:
1) RectangleAndPart handles "EMPTY" payloads
2) LOK_CALLBACK_INVALIDATE_TILES msg type with "EMPTY" payload are
handled in CallbackFlushHandler::queue
3) gtktiledviewer handles "EMPTY" LOK_CALLBACK_INVALIDATE_TILES msg
even if the part number is included in the payload

Change-Id: I21f4a71ec875d24f4bbd100e4aacf8437d745ae4
2016-10-14 14:16:24 +02:00
Stephan Bergmann
1dac51334b Handle loplugin:fpcomparison false positives by whitelist
Change-Id: I58e2beb0695a27922856bd8f8988d9e4508aceb6
2016-10-10 13:10:48 +02:00
Eike Rathke
2135eae2a9 let approxEqual() not scale too early for large representable integer values
And since this is now too much code for inline move implementation to math.cxx
Which again made it necessary to give libreofficekit lokdocview.cxx its own
implementation that doesn't even claim to build against sal ...

Change-Id: I0f80be9d9172ee20693b9babde715206f2c3d8c1
Reviewed-on: https://gerrit.libreoffice.org/29428
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
2016-10-01 22:55:57 +00:00
Miklos Vajna
d5263c2c56 LOK: conditionally include part number in invalidation payload
Since desktop/ code queues, compresses and only emits callbacks on idle,
it's possible that two invalidations are in the queue, and there was a
setPart() call between them. In this case it's impossible to tell what
part the invalidation was sent for.

Fix this by conditionally including the part number in the invalidation
payload. It's off by default, a new feature flag is added to request
this behavior.

gtktiledviewer enables this feature flag by default, though just to show
the part number in the debug output. Android doesn't enable it.

Change-Id: I73e6def848c0eb61d64e71026002c7a0e750aab4
2016-09-29 12:53:02 +02:00
Miklos Vajna
d778828745 lok::Document::getCommandValues: expose sw redline author colors
These colors are used in the tiles, so it's a good idea if the client
can use matching colors for cursors and selections. But to be able to do
that, we need an API to expose these colors.

Change-Id: Ia688c07e6c300fecdf8dc428d5a3f000d1857387
2016-09-21 19:32:01 +02:00
Miklos Vajna
28447258fb lokdocview: guard against int overflow
If a too large rectangle is parsed, the width or the height may be
larger than std::numeric_limits<int>::max(), in that case just set
width/height to that max value, instead of allowing an overflow.

Change-Id: Ic01319b01a3f9286501c346ea765868be57466a1
2016-09-20 20:38:51 +02:00
Miklos Vajna
dc00592b4e lok::Document: rename getViews() to getViewsCount()
As this only returns the number of views, not the actual views. Since
it's a rename, it's just an API (but not an ABI) change.

Change-Id: Ib4f0ea56a90e5ae9c80ee1781aa2f29aff4259e7
2016-09-16 12:36:28 +02:00
Marco Cecchetti
b7b62d4a59 gtktiledviewer - Calc fix: selection handlers were not removed
Change-Id: I2b4ad4dbf281458d0994eff176a2f62e20fb603b
2016-09-12 11:04:25 +02:00
Miklos Vajna
127a34ef2c lokdocview: handle empty LOK_CALLBACK_DOCUMENT_SIZE_CHANGED payload
Calc omits the document size in the payload in several cases, and
online.git handles that, so handle it in lokdocview as well for now,
instead of fixing up all the sc code to always emit the doc size in the
payload.

Change-Id: Ib2cca1770d2a160e32540e3a3158eb00bf13207b
2016-08-31 13:33:47 +02:00
Tor Lillqvist
8f96ab602a Emit notification to a LibreOfficeKit client also when a redline is modified
Work in progress, not all modifications to a redline record cause
notifications yet.

Change-Id: I01614cd6ede9576e9cc329889fef86342567325f
2016-08-29 11:02:58 +03:00
Caolán McNamara
3ad3365c4f coverity#1354270 Uninitialized scalar field
Change-Id: I770e02a6f7ef09c50cf93982dd88dfdb1a163bea
2016-08-28 13:38:24 +01:00
Miklos Vajna
0bc553f3ef sw lok: add callbacks for redline table insertion / removal
An alternative would be to follow the Manage Changes dialog approach and
subscribe to the SFX_HINT_DOCCHANGED notification in SwDocShell, cache
the old redline table and find out the differences to the current one,
but that way sound much more complex without benefits.

Change-Id: I20a45285b88255ccea9d6646c0b5288ac1c91879
2016-08-19 16:21:32 +02:00
Caolán McNamara
951ceab401 coverity#1371131 Dereference after null check
Change-Id: I292ac0b59af2ed8897367d56ddb01bf4606a7693
2016-08-18 21:08:40 +01:00
Miklos Vajna
f2afe318ce gtktiledviewer: specify author name when calling initializeForRendering()
Open two views, and type into both of them when a Writer doc with
redlining enabled is open: the manage changes dialog now shows how the
correct author is used when creating the redline items.

Change-Id: I48fb90301bfcc04b06d5be5544324ca76fe7b3d7
2016-08-18 11:37:59 +02:00
Miklos Vajna
a141cba766 gtktiledviewer: expose undo/redo info in a repair document dialog
This shows the full undo and redo stack, with all the metadata available
via the LOK API.

Also fix SfxUndoManager::GetRedoActionsInfo(), so it's easy to show the
undo/redo stack in linear time; and fix a use-after-free in lokdocview.

Change-Id: I66625ed453efa61b5738d99d7d1ad8f468908240
Reviewed-on: https://gerrit.libreoffice.org/27913
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-08-05 19:08:09 +00:00
Miklos Vajna
57c8915376 lokdocview: draw a lock inside the lock indicator
Hopefully less confusing, the crossed out rectangle is also used inside
the tiles for deleted comments, and the two are independent.

Change-Id: Id06fbf6ec1b21dfbab1c126c3c432f91cf51430c
Reviewed-on: https://gerrit.libreoffice.org/27503
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-25 08:41:10 +00:00
Miklos Vajna
897189cfc6 sw: add new LOK_CALLBACK_VIEW_LOCK callback
When we're after SdrBeginTextEdit(), but before SdrEndTextEdit(), and
have multiple views, then only the active view paints the edited text,
the other views look like the shape has no text at all.

Add a new callback that exposes the position and size of the rectangle
where the shape text will be painted after text edit ended, so clients
can draw some kind of locking indicator there. This way the rendered
result can differ in the "shape has no text" and the "shape text is
edited in an other view" cases.

Change-Id: I6096479a8a05c2547d15222e6d997b848af02945
Reviewed-on: https://gerrit.libreoffice.org/27441
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-22 15:13:07 +00:00
Miklos Vajna
3c425926d4 lokdocview: still allow view selections/cursors from other Writer views
Writer pages are exposed as parts, but it still makes sense showing
selections/cursors from other parts in that case.

Change-Id: Ic76d93291bde2d959c149cf2ef5eba7ed33a45e8
Reviewed-on: https://gerrit.libreoffice.org/27321
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-19 15:15:27 +00:00
Miklos Vajna
1ba00c2173 lokdocview: handle part number in view selections/cursors
This way we show view selections/cursors from other views only in case
the part number matches. Anything else looks buggy in Calc/Impress.

Change-Id: If3ecbfc4b05350606730319b1a570afc15fd9d0a
Reviewed-on: https://gerrit.libreoffice.org/27315
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
2016-07-19 12:29:59 +00:00