The '- 1's had been like that ever since
cbd8e4d144 "added VisibleArea and MapUnit
properties" but caused the following problem, suggesting that they may have been
an off-by-one error right from the start:
Opening an .odt Writer doc with an embedded (via "Insert - Object - OLE
Object... - Create new - LibreOffice 5.3 Presentation") Impress doc for which
the .odt's content.xml records
<draw:frame ... svg:width="5.5508in" svg:height="3.9366in" ...>
causes XMLTextFrameContext_Impl::Create
(xmloff/source/text/XMLTextFrameContext.cxx) to create a size (in 100th mm?) of
14099x9999, which is converted to 7993x5669 twips, which are then passed to an
SwFormatFrameSize ctor (sw/source/core/layout/atrfrm.cxx).
However, double-clicking into the Writer doc's Impress area (to make the Impress
doc editable) and then clicking back into the outer Writer doc's area (to put
the Impress doc back into non-editing mode) causes the Writer doc to be
considered modified (e.g., the "Save" icon gets a small green "plus" overlay)
due to the call to SfxObjectShell::SetModified at
> SfxObjectShell::SetModified(bool) (this=0x21293a0, bModifiedP=true) at sfx2/source/doc/objmisc.cxx:314
> SwDocShell::SetModified(bool) (this=0x21293a0, bSet=true) at sw/source/uibase/app/docsh2.cxx:1243
> SwDocShell::Ole2ModifiedHdl(bool) (this=0x21293a0, bNewStatus=true) at sw/source/uibase/app/docsh.cxx:1093
> SwDocShell::LinkStubOle2ModifiedHdl(void*, bool) (instance=0x21293a0, data=true) at sw/source/uibase/app/docsh.cxx:1090
> Link<bool, void>::Call(bool) const (this=0xa32c0c8, data=true) at include/tools/link.hxx:84
> sw::DocumentStateManager::SetModified() (this=0x82e77f0) at sw/source/core/doc/DocumentStateManager.cxx:48
> SwDoc::SetAttr(SfxItemSet const&, SwFormat&) (this=0xa32c050, rSet=SfxItemSet of pool 0x21dbd60 with parent 0x0 and Which ranges: [(88, 88)] = {...}, rFormat=...) at sw/source/core/doc/docfmt.cxx:492
> SwDoc::SetAttr(SfxPoolItem const&, SwFormat&) (this=0xa32c050, rAttr=..., rFormat=...) at sw/source/core/doc/docfmt.cxx:468
> SwFlyFrame::ChgSize(Size const&) (this=0xa14ae10, aNewSize=Size = {...}) at sw/source/core/layout/fly.cxx:1993
> SwFEShell::RequestObjectResize(SwRect const&, com::sun::star::uno::Reference<com::sun::star::embed::XEmbeddedObject> const&) (this=0x83fc880, rRect=SwRect = {...}, xObj=uno::Reference to (OCommonEmbeddedObject *) 0x7fff745f7530) at sw/source/core/frmedt/fefly1.cxx:1334
> SwOleClient::ViewChanged() (this=0x4a15a10) at sw/source/uibase/uiview/swcli.cxx:151
> SfxInPlaceClient::Invalidate() (this=0x4a15a10) at sfx2/source/view/ipclient.cxx:812
> SfxInPlaceClient::SetObjAreaAndScale(Rectangle const&, Fraction const&, Fraction const&) (this=0x4a15a10, rArea=Rectangle = {...}, rScaleWidth=Fraction containing std::unique_ptr<Fraction::Impl> containing 0x1d47a40, rScaleHeight=Fraction containing std::unique_ptr<Fraction::Impl> containing 0x8c0d910) at sfx2/source/view/ipclient.cxx:785
> SwWrtShell::CalcAndSetScale(svt::EmbeddedObjectRef&, SwRect const*, SwRect const*, bool) (this=0x83fc880, xObj=..., pFlyPrtRect=0x0, pFlyFrameRect=0x0, bNoTextFramePrtAreaChanged=false) at sw/source/uibase/wrtsh/wrtsh1.cxx:825
> SwWrtShell::LaunchOLEObj(long) (this=0x83fc880, nVerb=0) at sw/source/uibase/wrtsh/wrtsh1.cxx:591
> SwEditWin::MouseButtonDown(MouseEvent const&) (this=0x490b2e0, _rMEvt=...) at sw/source/uibase/docvw/edtwin.cxx:3366
> ImplHandleMouseEvent(VclPtr<vcl::Window> const&, MouseNotifyEvent, bool, long, long, unsigned long, unsigned short, MouseEventModifiers) (xWindow=..., nSVEvent=MouseNotifyEvent::MOUSEBUTTONDOWN, bMouseLeave=false, nX=750, nY=341, nMsgTime=32828148, nCode=1, nMode=(MouseEventModifiers::SIMPLECLICK | MouseEventModifiers::SELECT)) at vcl/source/window/winproc.cxx:698
> ImplHandleSalMouseButtonDown(vcl::Window*, SalMouseEvent*) (pWindow=0x19d19a0, pEvent=0x7fffffffc928) at vcl/source/window/winproc.cxx:1999
> ImplWindowFrameProc(vcl::Window*, SalEvent, void const*) (_pWindow=0x19d19a0, nEvent=SalEvent::MouseButtonDown, pEvent=0x7fffffffc928) at vcl/source/window/winproc.cxx:2329
> SalFrame::CallCallback(SalEvent, void const*) const (this=0x1996820, nEvent=SalEvent::MouseButtonDown, pEvent=0x7fffffffc928) at vcl/inc/salframe.hxx:280
> GtkSalFrame::CallCallbackExc(SalEvent, void const*) const (this=0x1996820, nEvent=SalEvent::MouseButtonDown, pEvent=0x7fffffffc928) at vcl/unx/gtk3/gtk3gtkframe.cxx:4219
> GtkSalFrame::signalButton(_GtkWidget*, _GdkEventButton*, void*) (pEvent=0x16403d0, frame=0x1996820) at vcl/unx/gtk3/gtk3gtkframe.cxx:2615
> <emit signal ??? on instance ???> (instance=instance@entry=0x16f0e20, signal_id=<optimized out>, detail=detail@entry=0) at gsignal.c:3441
> gtk_widget_event_internal (widget=0x16f0e20, event=0x16403d0) at gtkwidget.c:7731
> propagate_event (topmost=<optimized out>, event=<optimized out>, widget=0x16f0e20) at gtkmain.c:2545
> propagate_event (widget=<optimized out>, event=0x16403d0, captured=<optimized out>, topmost=0x0) at gtkmain.c:2647
> gtk_main_do_event (event=0x16403d0) at gtkmain.c:1878
> _gdk_event_emit (event=event@entry=0x16403d0) at gdkevents.c:73
> gdk_event_source_dispatch (source=<optimized out>, callback=<optimized out>, user_data=<optimized out>) at gdkeventsource.c:367
> g_main_context_dispatch (context=0x63a520) at gmain.c:3154
> g_main_context_dispatch (context=context@entry=0x63a520) at gmain.c:3769
> g_main_context_iterate (context=context@entry=0x63a520, block=block@entry=0, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3840
> g_main_context_iteration (context=0x63a520, may_block=0) at gmain.c:3901
> GtkData::Yield(bool, bool) (this=0x73e260, bWait=false, bHandleAllCurrentEvents=false) at vcl/unx/gtk3/gtk3gtkdata.cxx:479
> GtkInstance::DoYield(bool, bool, unsigned long) (this=0x73e3c0, bWait=false, bHandleAllCurrentEvents=false, nReleased=0) at vcl/unx/gtk3/../gtk/gtkinst.cxx:423
> ImplYield(bool, bool, unsigned long) (i_bWait=false, i_bAllEvents=false, nReleased=0) at vcl/source/app/svapp.cxx:504
> Application::Yield() () at vcl/source/app/svapp.cxx:551
> Application::Execute() () at vcl/source/app/svapp.cxx:468
> desktop::Desktop::DoExecute() () at desktop/source/app/app.cxx:1367
> desktop::Desktop::Main() (this=0x7fffffffe1e8) at desktop/source/app/app.cxx:1694
> ImplSVMain() () at vcl/source/app/svmain.cxx:185
> SVMain() () at vcl/source/app/svmain.cxx:223
> soffice_main() () at desktop/source/app/sofficemain.cxx:165
> sal_main () at desktop/source/app/main.c:48
> main (argc=1, argv=0x7fffffffe528) at desktop/source/app/main.c:47
because OCommonEmbeddedObject::getVisualAreaSize
(embeddedobj/source/commonembedding/visobj.cxx, called from
SwOleClient::ViewChanged, sw/source/uibase/uiview/swcli.cxx, ultimately
returning the value 14098x9998 calculated in
SdXImpressDocument::setPropertyValue, converted to twips) reports a size of
7993x5668 twips instead.
Change-Id: I8056b99b036970e308a89937b95c57996a8e7c79
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/OGLTrans).
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.
FUTURE work: 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.