Slide 1

Slide 1 text

Getting involved with LibreOffice Online and Android By Miklos Vajna Senior Software Engineer at Collabora Productivity 2016-11-12 @CollaboraOffice www.CollaboraOffice.com

Slide 2

Slide 2 text

2 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna About Miklos ● From Hungary ● More blurb: http://vmiklos.hu/ ● Google Summer of Code 2010/2011 ● Rewrite of the Writer RTF import/export ● Writer developer since Feb 2012 ● Contractor at Collabora since Sept 2013

Slide 3

Slide 3 text

LibreOffice

Slide 4

Slide 4 text

4 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna ● StarOffice, then ● OpenOffice.org, then ● LibreOffice LibreOffice origins

Slide 5

Slide 5 text

5 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna LibreOffice platforms ● Windows ● macOS ● Linux ● Pseudo-platforms: ● Android ● Online

Slide 6

Slide 6 text

6 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Open Document Format (ODF) ● Set of Open file formats for office applications ● Developed in an open process by multiple non-profits and commercial vendors ● Chosen by the UK, Germany, Belgium, and others as their official format for document interchange

Slide 7

Slide 7 text

7 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Writer

Slide 8

Slide 8 text

8 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Calc

Slide 9

Slide 9 text

9 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Impress

Slide 10

Slide 10 text

10 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Other LibreOffice applications ● Draw, Math, Base, etc. ● Many other components in LibreOffice ● Large number of advanced and expert features ● Good to build on top of basic skills with Writer, Calc, and Impress ● Also see several excellent videos on YouTube

Slide 11

Slide 11 text

11 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna The Document Foundation ● The Document Foundation (TDF) is a German non-profit that supports, organizes, & deals with all of the legal & financial details for LibreOffice ● There are multiple projects organized under TDF

Slide 12

Slide 12 text

12 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Document Liberation Project ● TDF's newest project is a set of libraries to read/write a large number of file formats ● Very useful for LibreOffice users who need to import old or proprietary files ● Bundling libraries together encourages reuse in other FOSS projects (Inkscape, Scribus, Calligra)

Slide 13

Slide 13 text

Getting involved with LibreOffice: Easy Hacks

Slide 14

Slide 14 text

14 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Easy Hacks: the message ● Easy (to create & to hack on) ● Significant They make a real impact in the project ● You can do them There is nothing to stop you hacking today ● Lets look at some from easy hard. →

Slide 15

Slide 15 text

15 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Easy: translating German comments ● Admittedly much easier if you are a German git clone git://anongit.freedesktop.org/libreoffice/core ● Beautiful tool tool help out with this: bin/find­german­comments cppuhelper # random directory cppuhelper/source/propshlp.cxx:706: Ueber alle Listener iterieren und Events senden cppuhelper/source/propshlp.cxx:763: Ueber alle Listener iterieren und Events senden ● Only two (identical) strings detected – to clean an entire module

Slide 16

Slide 16 text

16 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Significant: translating German comments ● It makes things significantly easier for non-Germans ● We removed or translated ~20k lines of these so far ● We still have 32k to go: done mostly by newcomers 3.3 3.4 3.5 3.6 4.0 0 10 000 20 000 30 000 40 000 50 000 60 000 Detected lines of German comment With thanks to (recent translators): Philipp Weissenbacher Philipp Riemer Samuel Mehrbrodt Enrico Weigelt Lennard Wasserthal Albert Thuswaldner Oliver Günther Markus Maier Peter Baumgarten and many more !

Slide 17

Slide 17 text

17 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Easy: Tools Macros ergonomics → ● We have a lot of similar ergonomic sillies in the code ● Fixing them cannot be terribly hard ● But it requires some easy hacking ● basctl/source/basicide/macrodlg.cxx ● Tree doesn't remember it's previous expansion

Slide 18

Slide 18 text

18 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Significant: Tools Macros ergonomics → ● Those using macros regularly will be very happy. ● Others will find / use macros more easily ● Lots of potential extension wins ● UX-advise interaction, improved macro editing design ● Every little thing adds up cf. ● UI Design for programmers (Joel on Software)

Slide 19

Slide 19 text

19 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Easy: Fixing SvStream operators ● Load up: tools/inc/tools/stream.hxx ● SvStream& operator<<( sal_Int16 nInt16 ); ● SvStream& operator<<( sal_Int32 nInt32 ); ● Replace with: ● 'void WriteInt16(sal_Int16 nInt)' style methods ● Update all calling code & remove operator overload: ­ Strm() << c; + Strm().WriteInt32(c);

Slide 20

Slide 20 text

20 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Misc. Easy: Removing obsolete junk ● Lots of nasties around the code to clean: ● GtkYieldMutex evilness #ifdef HORRIBLE_OBSOLETE_YIELDMUTEX_IMPL – kill all of that – add a configure.in check for a recentish gtk+ version to our baseline ● Write out: vcl/source/fontsubset/list.cxx ● Yet another random list implementation.

Slide 21

Slide 21 text

21 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Easy: Using git ● Git can sound scary – but it's not so bad ● One off setup your of name / E-mail (we like real ones) ● Checkout the code ● Edit a file you like ● Commit ● Push for review, we use Gerrit

Slide 22

Slide 22 text

22 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Create your own Easy Hacks ● Head to bugzilla: ● https://bugs.documentfoundation.org/enter_bug.cgi?pr oduct=LibreOffice ● Set summary and component ● Description: ● A clear set of code pointers ● Enough detail to jump immediately into the code / task ● Ie. do the leg-work, a good EasyHack takes time to file (and the reporter is the mentor)

Slide 23

Slide 23 text

LibreOffice for Android

Slide 24

Slide 24 text

24 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Cross-compiling, single .so ● Need to decide what will be run on the machine building LO (build) and on the target platform (host) ● Need a single liblo-native-code.so, due to stupid Android linker limitation (128 libs) ● Need to bypass all unit tests ● Mostly done by Tor Lillqvist back in the SUSE times ● Need to decide what will be run on the machine building LO (build) and on the target platform (host) ● Need a single liblo-native-code.so, due to stupid Android linker limitation (128 libs) ● Need to bypass all unit tests ● Mostly done by Tor Lillqvist back in the SUSE times (via tml)

Slide 25

Slide 25 text

25 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Tiled rendering ● Idea: render many 256x256px tiles ● Instead of using UNO to render a single huge bitmap ● Used by Firefox for Android successfully ● Initially for Writer ● Mostly by Jan Holesovsky (Collabora)

Slide 26

Slide 26 text

26 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Tiled rendering on Android (via LOCon 2014) ● We use a subset of Fennec ● Firefox for Android ● Via LibreOfficeKit ● The tiled rendering API is currently declared unstable ● C + C++ wrapper + JNI ● Initially by Tomaž Vajngerl (Collabora) ● Thanks to Smoose

Slide 27

Slide 27 text

27 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Tiled editing ● If we have a viewer, why not allow editing, too? ● Needs input handling and lifecycle management for tiles ● Firefox renders webpages ● Javascript → they need to update rendered webpages as well

Slide 28

Slide 28 text

28 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna gtktiledviewer ● Android wants a whole .apk each time ● See also the mentioned single .so ● Development not productive ● Let's sort out core + sample LOK client via GTK ● Real 256x256px tiles there by me

Slide 29

Slide 29 text

29 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Basic editing framework, selections ● Kindly sponsored by TDF ● Since doing all the heavy-lifting for free did not happen for quite some time ● Not a product, but enough that the rest can be done as usual development ● Selections, as that requires a working overlay ● Blinking text, as that requires re-rendering

Slide 30

Slide 30 text

30 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Keyboard and mouse/touch ● Keyboard: Unicode + control characters ● Need to map backspace to e.g. .uno:SwBackspace ● Requires a fully working SfxDispatcher ● Mouse/touch ● Tap somewhere → blinking cursor appears ● Long push → selects words

Slide 31

Slide 31 text

31 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Easy hacks ● Support for flat ODF ● Find what services are missing and enable them ● Support for styles ● LOK API is there ● Support copying of text ● LOK API is again ready to use ● Feedback about save ● Error reporting, when it is complete

Slide 32

Slide 32 text

32 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Writer Android Demo

Slide 33

Slide 33 text

LibreOffice Online

Slide 34

Slide 34 text

34 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Building block ● Provides a rendering / editing engine ● Integrates with an existing file sharing / synchronization solution ● Integrates with existing user management ● Typically a VM / docker instance

Slide 35

Slide 35 text

35 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Current Version 1.0.5 ● High fidelity, WYSIWYG rendering ● Document Support: ● DOC, DOCX, PPT, PPTX, XLS, XLSX + ODF. ● Import/View Visio, Publisher, + 100 more ● Document Collaboration: ● Shared Editing, Collaborative edit on the way.

Slide 36

Slide 36 text

36 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Why online? ● On-premise – control of your data ● On-premise – control of your CPU & network ● Bonus features ● A reduced feature-set sphere – can win. – light editing use-cases to match competition ● Document Formats – less relevant: – “in the cloud” ● Server / Certification / Revenue model

Slide 37

Slide 37 text

37 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Collabora Online Development Edition ● Grab the latest Docker image and/or Virtual Machine pieces ● http://collaboraoffice.com/code ● A simple own/nextCloud extension ● No core changes required, easy to deploy ● Extension implements the WOPI protocol ● Unifies authentication and file-access ● Re-use awesome own/nextCloud authentication and storage options – effortlessly

Slide 38

Slide 38 text

38 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna What it looks like

Slide 39

Slide 39 text

39 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Architecture

Slide 40

Slide 40 text

40 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna own/nextCloud extension ● View and restore previous versions:

Slide 41

Slide 41 text

41 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Collaborative editing ● Lots of fun new interactions under development

Slide 42

Slide 42 text

42 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Document repair ● A global undo/redo ● Solves editing conflicts

Slide 43

Slide 43 text

43 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna Summary ● It’s easy to contribute to LibreOffice: ● EasyHacks: desktop version ● Android layer builds on top of LOK API ● Online (loleaflet, loolwsd) builds on top of core ● Thanks for listening! :-) ● Slides: http://vmiklos.hu/odp