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

TextBoxes in LibreOffice Writer

Miklos V
January 31, 2015
150

TextBoxes in LibreOffice Writer

Miklos V

January 31, 2015
Tweet

Transcript

  1. 2 / 19 FOSDEM 2015, Brussels | 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 Sep 2013
  2. 4 / 19 FOSDEM 2015, Brussels | Miklos Vajna Complex

    shape • Anything that is more than a plain rectangle: • Callouts • Rectangles with special corners • Pentagons • SdrObjCustomShape internally
  3. 5 / 19 FOSDEM 2015, Brussels | Miklos Vajna Complex

    content • Anything that is more advanced than editengine • Table in the shape text • As-character charts • Tracked changes • Writer fields
  4. 6 / 19 FOSDEM 2015, Brussels | Miklos Vajna Result

    #1 • Chart inside a left arrow callout:
  5. 7 / 19 FOSDEM 2015, Brussels | Miklos Vajna Result

    #2 • Tracked changes inside a cloud callout:
  6. 8 / 19 FOSDEM 2015, Brussels | Miklos Vajna Result

    #3 • Tracked changes inside a fixed cloud callout:
  7. 9 / 19 FOSDEM 2015, Brussels | Miklos Vajna Result

    #4 • SmartArt inside a snip diagonal corner rectangle:
  8. 10 / 19 FOSDEM 2015, Brussels | Miklos Vajna Result

    #5 • Table of Contents inside a pentagon:
  9. 12 / 19 FOSDEM 2015, Brussels | Miklos Vajna Situation

    in 4.3 • Getting rid of the VML fallback:
  10. 13 / 19 FOSDEM 2015, Brussels | Miklos Vajna Document

    model • SdrObject (svx) ↔ TextFrame (sw) • Both have an SwFrmFmt • So far unused RES_CNTNT ("content") property in the SdrObject's SwFrmFmt • Pairing them if both the draw and the fly format point to the same content • Properties of the TextFrame are generated (position, size, etc.)
  11. 14 / 19 FOSDEM 2015, Brussels | Miklos Vajna UNO

    API • Hides the detail that the TextFrame and the SdrObject are in fact two objects. • When the draw shape has TextBox attached, the editeng text is unused. • A new optional boolean property to see who provides the text. • Everything else is fully transparent. • In contrast with the previous sw vs svx API differences
  12. 15 / 19 FOSDEM 2015, Brussels | Miklos Vajna Layout

    • “Put TextFrame into an SdrObj as a TextBox” design → not much to be done • Positioning of as-character anchored shapes having TextBoxes is still a challenge • See SwFlyCntPortion::SetBase() • Be careful about layout modifying doc model
  13. 16 / 19 FOSDEM 2015, Brussels | Miklos Vajna Filters

    • #1 use case: improve Word (and in particular DOCX) compatibility • But now we got much more, e.g. multi-column text could be added easily that's not available in Word, either • DOCX import now avoids setting service name from original to css.text.TextFrame in case shape has shape text • ODF had implicit support already • Except: tables, in extension namespace for now
  14. 17 / 19 FOSDEM 2015, Brussels | Miklos Vajna User

    interface • Just do the right thing: • Moving, resizing, deletion, copy&paste, … • Context menu to add/remove TextBox:
  15. 18 / 19 FOSDEM 2015, Brussels | Miklos Vajna Thanks

    • Collabora is an open source consulting company • What we do and share with the community has to be paid by someone • CloudOn sponsored this work
  16. 19 / 19 FOSDEM 2015, Brussels | Miklos Vajna Summary

    • Writer Textboxes allow complex shapes with complex content • Available in LibreOffice 4.4 • Improves DOCX experience of out the box • Optionally available in every other document • One more long-standing problem solved • Thanks for listening! :-) • Slides: http://vmiklos.hu/odp