sd/source/ui/view/drviews1.cxx |    9 +++++++++
 1 file changed, 9 insertions(+)

New commits:
commit b86706a4514c4e686bc68deab2a8772308a5ddca
Author:     Mohit Marathe <[email protected]>
AuthorDate: Wed Dec 17 16:39:14 2025 +0530
Commit:     Mohit Marathe <[email protected]>
CommitDate: Wed Dec 17 14:15:51 2025 +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]>

diff --git a/sd/source/ui/view/drviews1.cxx b/sd/source/ui/view/drviews1.cxx
index c768ff4d10fd..430c54dedb65 100644
--- a/sd/source/ui/view/drviews1.cxx
+++ b/sd/source/ui/view/drviews1.cxx
@@ -1054,11 +1054,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();

Reply via email to