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

TextBoxes in LibreOffice Writer

Miklos V
January 31, 2015
140

TextBoxes in LibreOffice Writer

Miklos V

January 31, 2015
Tweet

Transcript

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

    View Slide

  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

    View Slide

  3. Complex shapes with
    complex content

    View Slide

  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

    View Slide

  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

    View Slide

  6. 6 / 19
    FOSDEM 2015, Brussels | Miklos Vajna
    Result #1

    Chart inside a left arrow callout:

    View Slide

  7. 7 / 19
    FOSDEM 2015, Brussels | Miklos Vajna
    Result #2

    Tracked changes inside a cloud callout:

    View Slide

  8. 8 / 19
    FOSDEM 2015, Brussels | Miklos Vajna
    Result #3

    Tracked changes inside a fixed cloud
    callout:

    View Slide

  9. 9 / 19
    FOSDEM 2015, Brussels | Miklos Vajna
    Result #4

    SmartArt inside a snip diagonal corner
    rectangle:

    View Slide

  10. 10 / 19
    FOSDEM 2015, Brussels | Miklos Vajna
    Result #5

    Table of Contents inside a pentagon:

    View Slide

  11. How is this
    implemented?

    View Slide

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

    Getting rid of the VML fallback:

    View Slide

  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.)

    View Slide

  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

    View Slide

  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

    View Slide

  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

    View Slide

  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:

    View Slide

  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

    View Slide

  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

    View Slide