Copy&paste of a plot on an empty worksheet or on a worksheet without active layount doesn't work
Steps to reproduce:
- create a worksheet and a plot
- copy the plot
- create another worksheet
- paste the plot
- observe the broken result
The plot is properly pasted and retransformed on a worksheet having already some plots, though.
The call-stack for when it's working with an already existing plot on the worksheet and with an active layout on it:
#0 AxisPrivate::retransform (this=0x144dd60) at /home/alex/Projekte/labplot/src/backend/worksheet/plots/cartesian/Axis.cpp:1003
#1 0x0000000000673904 in WorksheetElementContainer::retransform (this=0x1d11ae0) at /home/alex/Projekte/labplot/src/backend/worksheet/WorksheetElementContainer.cpp:127
#2 0x00000000006dc00c in CartesianPlotPrivate::retransform (this=0x14dce70) at /home/alex/Projekte/labplot/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:3637
#3 0x00000000006eb0e5 in CartesianPlotSetRectCmd::redo (this=0x216d5e0) at /home/alex/Projekte/labplot/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:985
#4 0x0000000000517f89 in AbstractAspect::exec (this=0x1d11ae0, cmd=0x216d5e0) at /home/alex/Projekte/labplot/src/backend/core/AbstractAspect.cpp:942
#5 0x00000000006c60da in CartesianPlot::setRect (this=0x1d11ae0, rect=...) at /home/alex/Projekte/labplot/src/backend/worksheet/plots/cartesian/CartesianPlot.cpp:1001
#6 0x00000000006639b9 in WorksheetPrivate::setContainerRect (this=this@entry=0x1421fe0, elem=0x1d11ae0, x=x@entry=50, y=y@entry=50, h=h@entry=425, w=w@entry=900, undoable=undoable@entry=false) at /home/alex/Projekte/labplot/src/backend/worksheet/Worksheet.cpp:1553
#7 0x000000000066663f in WorksheetPrivate::updateLayout (this=0x1421fe0, undoable=undoable@entry=false) at /home/alex/Projekte/labplot/src/backend/worksheet/Worksheet.cpp:1509
#8 0x000000000066dfc7 in Worksheet::handleAspectAdded (this=0x13611c0, aspect=0x1fd8a40) at /home/alex/Projekte/labplot/src/backend/worksheet/Worksheet.cpp:285
#9 0x00007fffecbeb1c7 in ?? () from /usr/lib64/libQt5Core.so.5\n
#10 0x00000000008428f1 in AbstractAspect::aspectAdded (this=<optimized out>, _t1=<optimized out>) at /home/alex/Projekte/labplot/build-debug/src/labplot2lib_autogen/RMX4C6EZO6/moc_AbstractAspect.cpp:363
#11 0x0000000000520079 in AspectChildRemoveCmd::undo (this=0x20b8450) at /home/alex/Projekte/labplot/src/backend/core/aspectcommands.h:70
#12 AspectChildAddCmd::redo (this=0x20b8450) at /home/alex/Projekte/labplot/src/backend/core/aspectcommands.h:95
#13 0x00007fffee63f426 in QUndoStack::push(QUndoCommand*) () from /usr/lib64/libQt5Widgets.so.5
#14 0x0000000000517f4e in AbstractAspect::exec (this=0x13611c0, cmd=0x20b8450) at /home/alex/Projekte/labplot/src/backend/core/AbstractAspect.cpp:933
#15 0x000000000051c29c in AbstractAspect::addChild (this=this@entry=0x13611c0, child=child@entry=0x1fd8a40) at /home/alex/Projekte/labplot/src/backend/core/AbstractAspect.cpp:478
#16 0x000000000051c923 in AbstractAspect::paste (this=0x13611c0, duplicate=<optimized out>) at /home/alex/Projekte/labplot/src/backend/core/AbstractAspect.cpp:756
The call-stack for pasting on an empty worksheet:
#0 AxisPrivate::retransform (this=0x21b1800) at /home/alex/Projekte/labplot/src/backend/worksheet/plots/cartesian/Axis.cpp:1003
#1 0x0000000000673904 in WorksheetElementContainer::retransform (this=0x160d920) at /home/alex/Projekte/labplot/src/backend/worksheet/WorksheetElementContainer.cpp:127
#2 0x0000000000552b3c in Project::retransformElements (aspect=aspect@entry=0x160d920) at /home/alex/Projekte/labplot/src/backend/core/Project.cpp:767
#3 0x000000000051c949 in AbstractAspect::paste (this=0x19a93b0, duplicate=<optimized out>) at /home/alex/Projekte/labplot/src/backend/core/AbstractAspect.cpp:766
We get the same broken result when pasting on a worksheet without any active layout, doesn't matter how many plots it has.
Edited by Alexander Semke