Commit Graph

69 Commits

Author SHA1 Message Date
47a2d7642d fdo#81356: convert Fraction to boost::rational<long> - wip
* Added rational util functions used by Fraction class not
  available in the boost::rational class.
* Replaced usage of Fraction by boost::rational<long>
* Removed code that relies on:
  1. fraction.IsValid() -- rational only allow valid values, ie
     denominator() != 0
  2. rational.denominator() == 0 -- always false
  3. rational.denominator() < 0 -- always false but implementation
     detail: http://www.boost.org/doc/libs/release/libs/rational/rational.html#Internal%20representation
* Simplified code that relies on:
  1. rational.denominator() != 0 -- always true
* BUGS EXIST because Fraction allows the creation of invalid values but
  boost::rational throws the exception boost::bad_rational

Change-Id: I84970a4956afb3f91ac0c8f726547466319420f9
Reviewed-on: https://gerrit.libreoffice.org/11551
Reviewed-by: David Tardon <dtardon@redhat.com>
Tested-by: David Tardon <dtardon@redhat.com>
2014-10-09 11:33:33 +00:00
b85c779595 android: use JNI direct memory allocator from Fennec
Change-Id: I95a9ab54222150a1f9cde30df820f3cd6915f641
2014-09-24 20:43:01 +02:00
18c052d6d6 LOKit: add "destroy" and "saveAs" to android JNI
Change-Id: I08542b736e49cb9262323e9fe6188b1976d47935
2014-09-22 22:40:07 +02:00
8da923dfa6 reduce code duplication in LOK init.cxx
Change-Id: I65335a2d0fb6e1ff46e3302463fbcf396fbea215
2014-08-13 09:27:47 +02:00
81f1c25927 LOKit android: add support for setPartMode and getPartName
Change-Id: Idd8bd4d4b148e88c7badd06fefb7cfcfc24ec9ea
2014-08-10 23:00:43 +02:00
bb493b75c3 JNI: getErrorNative should be getError now
Change-Id: If448e748f40cd8a41977129c576f6c5eac7b5727
2014-08-03 22:42:18 +02:00
dd418d8ca2 LOK documentLoad needs SolarMutex protection too.
We probably need to do this for most of LOK now that
we use soffice_main.

Change-Id: I77be7865511c083679cf2f68b0e5df106506fd70
2014-07-31 12:31:43 +02:00
3c115cd047 Use SolarMutexGuard instead of pairs of Acquire/ReleaseSolarMutex
Change-Id: I7ff41dd932fd9860dff944b3bf8ff5bdc230ae5d
2014-07-31 12:31:36 +02:00
af58bb8335 Protect setPartMode and ensure we actually show the new mode.
Change-Id: I3642702c5bf268f3c9ab04162166078052804270
2014-07-30 12:44:04 +02:00
6872ecdbc7 LOK: add setPartMode.
This API seems to be simplest in the long run where we'll want to be
able to select between rendering slides/notes/both/embedded objects,
and maybe even adding the option of switching between continuous
and single page mode in writer (although I have no idea how hard
getting a single page mode out of writer would be).

Change-Id: I5bdfdb61854c37281c6992c8f3ed1c50c8aa0919
2014-07-30 12:44:01 +02:00
6548361109 LOK: Add getPartName.
By default (i.e. for writer) we can just return an empty string,
and we only actually need to implement ITiledRenderable's
getPartName for components that actually support it (i.e. calc/impress).

Change-Id: I8b381e5d7a8000638b02f763b4bea8ef0226f8e0
2014-07-30 12:44:01 +02:00
b7742fd8b8 Add getPart(s) to lokandroid too.
I.e. make lokandroid match
4d15212ef8de89a71387c00bdeb7d9a41409e467
2014-07-13 08:06:58 +02:00
01f43039aa LOK: use solar mutex for setPart.
Needed e.g. for changing slides in impress.

Change-Id: I2f5de40d4efbacde910e27225768979a98ff1c0a
2014-07-12 05:19:15 +02:00
d27a140534 LOK: some logging for tiled rendering.
Change-Id: I5779eec97507b1996cda89174a6e6c55cdd57baf
2014-07-12 05:19:15 +02:00
4d15212ef8 Add get/setPart to ITiledRenderable, and implement for sw/sc.
Change-Id: Iec3d6374f029149cadf8fb9c9b16fec90146c31e
2014-07-12 05:19:13 +02:00
390f842de1 Check whether Command Args are already set up before doing so.
Could already be set up e.g. if a client application is using UNO
separately, in addition to LOK.

Change-Id: I50c3230b6f2456360273902a308c303576baac10
2014-07-11 11:43:49 +01:00
a3ccf3eab5 lok JNI: no "handle" in funcs & don't wrap some native funcs
Change-Id: If783fecd80a0de05e94c76e23572b567d151bb06
2014-07-03 10:51:56 +02:00
3a25b45122 WaE: couple of android / LibreOfficeKit bits.
Change-Id: I2ee864977d8bb266861af95fb64eb5c0852acee8
2014-07-02 12:41:03 +01:00
c5777b4edd android lok: fix paintTile JNI method
Change-Id: Ife12b8bc49d722ae614b7de253bb2061bea5bb7f
2014-07-02 11:14:17 +02:00
e50ef195bc New loplugin:stringconcat
Change-Id: Id7c517fb37bc28797c45fc0dde83e866f2aa4aac
2014-07-01 15:45:52 +02:00
55fb9149d8 lok: It is expected that we point directly to the program/ directory.
Change-Id: I54329e8dc914ac2698c441c02dfc9da03b56614f
2014-07-01 12:43:08 +02:00
ca61fdcac9 libreofficekit JNI for Android
Change-Id: Ia905c20fb4ee9b126d65fd3c8e3c1f54649abe1a
2014-07-01 09:12:14 +02:00
c1d64ca9e4 lok: Correct sofficerc path for bootstrap.
Change-Id: I229958c0f2c6f8905926c95cabd45fa58aed3da1
2014-06-30 14:48:04 +02:00
ae9babde80 'pMap' may be used uninitialized in this function.
Change-Id: I4085801a773626824ddc5bc4fbca62240fcc171c
2014-06-30 14:48:01 +02:00
0a5e6614bd LOK: tiled rendering / svp includes are Linux only too for now.
Change-Id: Iacd8554698f309f79208fd8390800ae2c5fd8085
2014-06-25 14:41:45 +01:00
e5fb98294a LOK: Tiled Rendering only useable on Linux.
Change-Id: I90daddddb08c26c594109ecf926cb4ea64308770
2014-06-25 14:33:26 +01:00
3545b78755 Use full sofficerc for LOK.
Otherwise we get segfaults in cppu::idefaultConstructElements when exiting,
in addition to complaints of:
ignoring GError "Operation not supported" for <***RECURSION DETECTED***/log.txt>

Change-Id: If2f56873f50ba957288d1e5591db967d248ee7a4
2014-06-25 13:04:33 +01:00
cd96b0498d Use ITiledRenderable for LIBLOK.
Means that no changes should be required here once calc/impress/draw
support tiled rendering.

Change-Id: I0987d94303f39ba37e29b9ae7b2276e82dc0ccbf
2014-06-25 13:04:32 +01:00
837631c6cf LIBLOK: implement getDocumentType, make doctypes unique.
Change-Id: I6cf810af55284cb6ddd9e0bfd879fd19508d127a
2014-06-25 13:04:32 +01:00
2eff3574d5 Get rid of outdated comments.
We can now set the colourspace as desired, and we return the rowstride too.

Change-Id: Idf1e55a67b9e9ab58e82d7ed0be2813b682ec2ff
2014-06-25 13:04:30 +01:00
67d7bad694 Use external buffer for LibLO tiled rendering.
Means we can get rid of hackily storing a reference to the last
buffer we created.

Change-Id: I8092a7d87bc391301f75651a59b37fbd73ac64fd
2014-06-25 13:04:30 +01:00
04d5b861f8 Upgrade LibLO tiled rendering to RGBA.
This is the expected format for gtk+ pixbufs which is currently
the primary target. We could potentially allow the user to choose
the format via LibLO -- but we want to eventually allow passing
in a buffer (rather than passing out an LO owned buffer) anyway, so
should add that then.

Change-Id: I8427925a94366917fa82fb8ea28e7dbb3fa1840d
2014-06-25 13:04:29 +01:00
fd5f324b09 Implement document size retrieval for LibLO.
Change-Id: Ibd69f8e766fd421b05d2305f967179a969bc5b56
2014-06-25 13:04:29 +01:00
41911db36e Add rowstride to tiled rendering via LibLO.
The buffer width could be larger than the desired rendering
width, hence we need to give the client access to the rowstride.

Change-Id: Ic63c1f455c89960164e076ed2528d43e64e81a40
2014-06-25 13:04:28 +01:00
0434043aed Return a bitmap buffer for tiled rendering from LibLO.
We still need some way of managing the buffers properly rather
than just keeping a static reference to the last buffer
that was rendered.

Change-Id: I17940c758948aa9418f4e0216ecd253d128cd04f
2014-06-25 13:04:28 +01:00
d2382e3f3d Add tiled rendering via liblibreoffice.
We still need to add functions for getting dimensions of documents
etc. for this to be truly useful, this is also only usable for writer
documents for now.

Change-Id: I07812c9b72caca71dfd509705af48c1d355cb2f8
2014-06-25 13:04:28 +01:00
707a648eb3 LOK: kill saveAsWithOptions.
The saveAsWithOptions/saveAs split existed for reasons of historical
API compatibility. Since we're breaking the API currently we can
now get a clean start, and get rid of the redundant saveAs, and
make saveAsWithOptions the standard saveAs function.

Change-Id: Ia3e2294a8604cab08e95b07544c9d10d42dd1152
2014-06-23 12:24:36 +01:00
f73e4594d3 LOK: kill double initialize.
Change-Id: I4d3dd913faea8b9f4a0bd3c13af37d097ced9888
2014-06-18 12:07:16 +01:00
8ba3116a8f LOK: Split into instance and class.
Change-Id: I2b6f33eaf12343c7da1328a932eb703bb4e4ef6f
2014-06-17 16:58:57 +01:00
4ed5bacc86 liblok: set the size for the correct structure.
Change-Id: Id79d76893bfc931334afd59b05ab96a31e441e02
2014-06-12 14:07:23 +01:00
cd76b9996c Rename C api of LibreOfficeKit.
However for the sake of ABI compatibility we can't change
liblibreoffice_hook.

Change-Id: I0e921efeeab40ef1b53a67c0e7a89d4c75ced831
2014-06-11 13:44:55 +01:00
9a1b2970ed Move liblibreoffice into LibreOfficeKit.
Change-Id: Ib2754a77be470faaa6f9b27644a1d8dd082ed2b8
2014-06-11 13:44:55 +01:00
699e97ebc4 Don't forget to dispose the component here.
Otherwise, none of the associated SfxViewFrame, SfxBaseController,
SfxObjectShell, SfxMedium etc would get destroyed which would ultimately
lead to the .~lock.foo file not being deleted upon exit.

But for this to work, the client code has to make sure that its
LibreOfficeDocument instance gets destroyed when it finishes its thing.

Change-Id: Id45eda526c1496712e4314a947e994eba5c3fa68
2014-05-29 20:35:05 -04:00
306b29a62f libLO: add extension map for draw's formats
Change-Id: Ie447f334e3fca606323870f0ce21e85d4fc0978f
2014-04-28 17:39:13 +02:00
f5051821bc Clean up function declarations and some unused functions
Change-Id: Ie35d71a03d2f89cd72836db21fac8746a9e85b09
2014-04-13 23:26:48 +02:00
fa4c74f4d5 liblo: fix check of xcomponent
Change-Id: I8a05a067681767518c688eb836bbe676bed05996
2014-04-12 12:58:50 +02:00
55e39c72d6 liblo: new saveAsWithOptions function
To not break API compatibility of libLO, add a new saveAsWithOptions
function and revert the old saveAs to initial state.

Change-Id: If245c0261a932b6ed5d65e20cb1b6d8bd1c50ce6
2014-04-08 18:11:34 +02:00
98668cd581 liblo: We need to provide LibreOffice with fake command line args too.
Change-Id: I34f364e63f814921bfe88af7cdf4ff4cdf6745fa
2014-04-08 18:11:34 +02:00
7f63706ad6 liblo: extend doc_saveAs with filterOptions
Change-Id: I720f2819955b6f26ea7161493cccb07f873f2a51
2014-04-08 13:15:55 +02:00
66800ce1b5 liblo: use MediaDescriptor / clean-up
Change-Id: If70519066081d8e2c8ed24771369d4afef336896
2014-04-08 13:15:54 +02:00