Files
odfstudio/sd
Armin Le Grand (collabora) c61e129c66 SmartArt: BackGroundFill and ForeGroundLine
Diagrams can have BGF (BackGroundFill) and also FGL (Fore
GroundLine). BGF is already represented by BGS
(BackGroundShape) and im/exported. It's definition is not
associated with a shape in oox at all, but part of
data.xml of the Diagram definition.

They also can have a LineStyle definition, also in data.xml
which is in XML-Tag 'whole'. This was never imported until
now at all - just missing. This is also not associated
with a shape. I implemented im/export for oox also adding
this to BGShape. This is FGL.
NOTE: For ODF there was no change needed since the BGS
is im/exported as XShape with all attributes set, thanks
to the SplitModel idea.

Unfortunately FGL is *in front of* all Diagram geometry,
what the 'whole' tag slightly hints at. Hard to see by any
evtl defined LineStyle overlapping the Diagram geometry,
if you take a detailed look.

There are two basic ways to solve that:
(a) Add FGL to a 2nd shape at the end of the Diagram
    geometry
(b) Add to BGShape, but get visualization right by using
    Primitives or ViewContact functionality.

Both have pros and cons:

(a) has the problem that a SubSelection will only
select one of these, so in UI only BGF or FGL are
editable - while in MSO when the Diagram is selected
both can be edited.

(b) has the problem that the BGShape is displayed in
the Background, including LineStyle settings.

(b) can be solved by

(1) using ViewContacts involved in visualisation of the
Group hosing the Diagram. The Primitives are fetsched
from these, so if needed manipulating these is possible.

(2) using the Primitives from BGShape visualisation to
filter these. That could be done with a
PrimitiveProcessor, but is a lot of work. Also would
evtl. need some tooling for every Primitive derived
from GroupPrimitive2D to get that cloned/changed.

(3) Manipulate Primitive-creation for BGShape as needed.
This is difficult since this is a CustomShape itself
and thus that whole mechanism that creates the geometry
for the customShape would have to be manipulated. What
makes it more complicated.

After some experimenting I decided to use (b1). This
involves a ViewContactOfDiagram that is used when the
SdrObjGroup hosts a Diagram. It checks if manipulation
is needed and modifies/adds ViewContacts to the Group
as needed. To do this without risk, it uses local
clones of SdrObjects for the BGShape with changed
ItermSets (FillStyle/LineStyle deactivated). Also
needed is refreshes of VCOfGroup and for changes of
BGShape. Luckily I had added all that to VCs already
when I implemented these and can use it here.

Forgot and added: Of course UnGroup has tro react on
the situatzion with BGShape and remove/change/create
objects as needed, plus UNDOs.
The complicated part are the UNDOs due to some need
to be created *before* doing the action in the core,
some *after*.

Had to adapt UnitTest testSmartartRotation2:
Adapted sp[4] to sp[3] since disconnectFromSdrObjGroup
does now remove a BGObject if no Line/FillStyle is
used at all, which is correct.
This was the 1st (empty) shape in ungrouped
representation, so tested info moved to sp[3]

Signed-off-by: Armin Le Grand (collabora) <Armin.LeGrand@collabora.com>
Change-Id: I13d0b9b913336155164e6543529a8fb3b0bb8f9e
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/2959
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Armin Le Grand <armin.legrand@collabora.com>
(cherry picked from commit c7b67f7d71323dab66c2d4df9519bd2f1091697e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/206024
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
2026-06-05 12:43:28 +02:00
..
2026-06-05 12:42:59 +02:00
2026-06-01 20:44:45 +02:00
…
…
…
…
2026-06-01 20:44:45 +02:00

LibreOffice Impress / Draw Application

The core directory for the impress/draw applications.

Think of impress as a hack on top of draw.

sd module contains impress/draw specific code, non-shared UI and part of ppt and pptx filter, few other filters too.

the slideshow UI lives here as well, the slideshow engine is in slideshow module though (including the 3D transitions engine slideshow/source/engine/opengl).

the most used filters are ODF's odp, binary ppt and OOXML's pptx. their locations are listed below:

  • odp import and export filters are in xmloff module (mostly xmloff/source/draw)

  • ppt import is in sd/source/filter/ppt (big shared chunks are also in svx)

  • ppt export is in sd/source/filter/eppt (big shared chunks are also in svx)

  • pptx import is in oox/source/ppt (and uses a lot of oox/source/drawingml and oox/source/*)

  • pptx export is in sd/source/filter/eppt (mostly in pptx-* source files) and shared part is in oox/source/export

PPTX Export / Import Filters

PPTX export filter is split into 2 parts. Impress related part is in sd/source/filter/eppt/pptx-* and the other part is in oox/source/export/ because it contains mostly code related to DrawingML, which is shared with writer and calc ooxml export.

The export filter was written in 2009 IIRC and was not much extended feature-wise lately.

Presenter Console

The main screen uses a hardware-accelerated canvas (e.g. cairo canvas), while the entire secondary screen uses a VCL-canvas that is created in sd::framework::FullScreenPane::CreateCanvas().

The secondary screen contains 3 Panes which each have 2 XWindows for the border area & the actual content, and each content Pane is backed by a sd::presenter::PresenterCanvas that wraps the FullScreenPane's canvas and does clipping.

Future Works

Add custom shapes export (see below). enhance text output, we don't write text style for indentation levels now, need to export a:lvl1pPr, a:lvl2pPr, ... elements.

PPTX import was written by Sun/Oracle and then extended in LibreOffice a lot during bug fixing. It is located in oox/source/ppt and oox/source/drawingml. The areas with most bugs (at least until today) were shape placeholders and text style inheritance.