sd/source/ui/view/drviews1.cxx | 9 +++++++++ 1 file changed, 9 insertions(+)
New commits: commit 17980fd213408341925455d454ec443e4734d8fe Author: Mohit Marathe <[email protected]> AuthorDate: Wed Dec 17 16:39:14 2025 +0530 Commit: Michael Stahl <[email protected]> CommitDate: Tue Jan 13 21:05:21 2026 +0100 sd: change work area when switching to a differently sized page This fixes the weird drag and drop behavior in canvas page where the drop position was modified in `SdrExchangeView::ImpLimitToWorkArea` due to outdated work area. Signed-off-by: Mohit Marathe <[email protected]> Change-Id: I28130119308331d50f1356a830f8bd5427f6cad3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195782 Reviewed-by: Michael Stahl <[email protected]> Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/196825 Tested-by: Jenkins diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx index 0ccfd2f5d50b..7c5756bdb6ca 100644 --- a/sd/source/ui/view/drviews1.cxx +++ b/sd/source/ui/view/drviews1.cxx @@ -1058,11 +1058,20 @@ bool DrawViewShell::SwitchPage(sal_uInt16 nSelectedPage, bool bAllowChangeFocus, { Point aPageOrg(nNewWidth, nNewHeight / 2); Size aViewSize(nNewWidth * 3, nNewHeight * 2); + Point aVisAreaPos; GetDoc()->SetMaxObjSize(aViewSize); InitWindows(aPageOrg, aViewSize, Point(-1, -1), true); + if ( GetDocSh()->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) + { + aVisAreaPos = GetDocSh()->GetVisArea(ASPECT_CONTENT).TopLeft(); + } + if (mpDrawView) + { + mpDrawView->SetWorkArea(::tools::Rectangle(Point() - aVisAreaPos - aPageOrg, aViewSize)); + } // pSelectedPage->SetBackgroundFullSize(true); UpdateScrollBars();
