Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Getting involved with LibreOffice Online and An...

Miklos V
November 12, 2016
400

Getting involved with LibreOffice Online and Android

DevTalks Jr 2016 (http://www.devtalks.ro/bucharest/devtalks-jr/), Bucharest

Miklos V

November 12, 2016
Tweet

Transcript

  1. Getting involved with LibreOffice Online and Android By Miklos Vajna

    Senior Software Engineer at Collabora Productivity 2016-11-12 @CollaboraOffice www.CollaboraOffice.com
  2. 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
  3. 4 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna

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

    LibreOffice platforms • Windows • macOS • Linux • Pseudo-platforms: • Android • Online
  5. 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
  6. 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
  7. 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
  8. 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)
  9. 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. →
  10. 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
  11. 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 !
  12. 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
  13. 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)
  14. 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);
  15. 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.
  16. 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
  17. 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)
  18. 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)
  19. 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)
  20. 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
  21. 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
  22. 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
  23. 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
  24. 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
  25. 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
  26. 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
  27. 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.
  28. 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
  29. 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
  30. 40 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna

    own/nextCloud extension • View and restore previous versions:
  31. 41 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna

    Collaborative editing • Lots of fun new interactions under development
  32. 42 / 43 DevTalks Junior 2016, Bucharest | Miklos Vajna

    Document repair • A global undo/redo • Solves editing conflicts
  33. 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