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

TextBoxes in LibreOffice Writer

Bb2fd3b5456ad0012799b2045f4cd212?s=47 Miklos V
January 31, 2015
120

TextBoxes in LibreOffice Writer

Bb2fd3b5456ad0012799b2045f4cd212?s=128

Miklos V

January 31, 2015
Tweet

Transcript

  1. TextBoxes in LibreOffice Writer Miklos Vajna 2015­01­31

  2. 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
  3. Complex shapes with complex content

  4. 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
  5. 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
  6. 6 / 19 FOSDEM 2015, Brussels | Miklos Vajna Result

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

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

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

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

    #5 • Table of Contents inside a pentagon:
  11. How is this implemented?

  12. 12 / 19 FOSDEM 2015, Brussels | Miklos Vajna Situation

    in 4.3 • Getting rid of the VML fallback:
  13. 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.)
  14. 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
  15. 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
  16. 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
  17. 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:
  18. 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
  19. 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