sw/qa/extras/snaptogrid/data/shapeSnappedToGrid.fodt | 14 - sw/qa/extras/snaptogrid/snaptogrid.cxx | 211 ++++++++++++++++++- 2 files changed, 208 insertions(+), 17 deletions(-)
New commits: commit e881945c2307b9aa44fff250ad38c075c785683b Author: Tamás Zolnai <[email protected]> AuthorDate: Mon Oct 6 14:37:05 2025 +0200 Commit: Tamás Zolnai <[email protected]> CommitDate: Mon Oct 6 14:37:05 2025 +0200 testFoldShapeWithResize Change-Id: I5d210cd8b290d0689b507aa528ee802b99a899f9 diff --git a/sw/qa/extras/snaptogrid/snaptogrid.cxx b/sw/qa/extras/snaptogrid/snaptogrid.cxx index c2b6da84163c..1d6227b7de2c 100644 --- a/sw/qa/extras/snaptogrid/snaptogrid.cxx +++ b/sw/qa/extras/snaptogrid/snaptogrid.cxx @@ -262,110 +262,153 @@ CPPUNIT_TEST_FIXTURE(SwSnapToGridTest, testResizeShapeOnGrid) // Drag & resize the shape to the right and then resize it back { - const Point& rDragPoint = pObject->GetLastBoundRect().RightCenter(); - resizeShape(pObject, rDragPoint, nMove, 0); + Point aDragPoint = pObject->GetLastBoundRect().RightCenter(); + resizeShape(pObject, aDragPoint, nMove, 0); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height); - const Point& rDragPointNew = pObject->GetLastBoundRect().RightCenter(); - resizeShape(pObject, rDragPointNew, -nMove, 0); + Point aDragPointNew = pObject->GetLastBoundRect().RightCenter(); + resizeShape(pObject, aDragPointNew, -nMove, 0); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } // Drag & resize the shape to the right and then resize it back { - const Point& rDragPoint = pObject->GetLastBoundRect().LeftCenter(); - resizeShape(pObject, rDragPoint, -nMove, 0); + Point aDragPoint = pObject->GetLastBoundRect().LeftCenter(); + resizeShape(pObject, aDragPoint, -nMove, 0); checkShapePosition(pObject, aStartPosition.X - nGridSize, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height); - const Point& rDragPointNew = pObject->GetLastBoundRect().LeftCenter(); - resizeShape(pObject, rDragPointNew, nMove, 0); + Point aDragPointNew = pObject->GetLastBoundRect().LeftCenter(); + resizeShape(pObject, aDragPointNew, nMove, 0); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } // Drag & resize the shape downward and then resize it back { - const Point& rDragPoint = pObject->GetLastBoundRect().BottomCenter(); - resizeShape(pObject, rDragPoint, 0, nMove); + Point aDragPoint = pObject->GetLastBoundRect().BottomCenter(); + resizeShape(pObject, aDragPoint, 0, nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height + nGridSize); - const Point& rDragPointNew = pObject->GetLastBoundRect().BottomCenter(); - resizeShape(pObject, rDragPointNew, 0, -nMove); + Point aDragPointNew = pObject->GetLastBoundRect().BottomCenter(); + resizeShape(pObject, aDragPointNew, 0, -nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } // Drag & resize the shape upward and then resize it back { - const Point& rDragPoint = pObject->GetLastBoundRect().TopCenter(); - resizeShape(pObject, rDragPoint, 0, -nMove); + Point aDragPoint = pObject->GetLastBoundRect().TopCenter(); + resizeShape(pObject, aDragPoint, 0, -nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y - nGridSize); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height + nGridSize); - const Point& rDragPointNew = pObject->GetLastBoundRect().TopCenter(); - resizeShape(pObject, rDragPointNew, 0, nMove); + Point aDragPointNew = pObject->GetLastBoundRect().TopCenter(); + resizeShape(pObject, aDragPointNew, 0, nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } // Drag & resize the shape to the right and upward and then resize it back { - const Point& rDragPoint = pObject->GetLastBoundRect().TopRight(); - resizeShape(pObject, rDragPoint, nMove, -nMove); + Point aDragPoint = pObject->GetLastBoundRect().TopRight(); + resizeShape(pObject, aDragPoint, nMove, -nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y - nGridSize); checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height + nGridSize); - const Point& rDragPointNew = pObject->GetLastBoundRect().TopRight(); - resizeShape(pObject, rDragPointNew, -nMove, nMove); + Point aDragPointNew = pObject->GetLastBoundRect().TopRight(); + resizeShape(pObject, aDragPointNew, -nMove, nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } // Drag & resize the shape to the right and downward and then resize it back { - const Point& rDragPoint = pObject->GetLastBoundRect().BottomRight(); - resizeShape(pObject, rDragPoint, nMove, nMove); + Point aDragPoint = pObject->GetLastBoundRect().BottomRight(); + resizeShape(pObject, aDragPoint, nMove, nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height + nGridSize); - const Point& rDragPointNew = pObject->GetLastBoundRect().BottomRight(); - resizeShape(pObject, rDragPointNew, -nMove, -nMove); + Point aDragPointNew = pObject->GetLastBoundRect().BottomRight(); + resizeShape(pObject, aDragPointNew, -nMove, -nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } // Drag & resize the shape to the left and upward and then resize it back { - const Point& rDragPoint = pObject->GetLastBoundRect().TopLeft(); - resizeShape(pObject, rDragPoint, -nMove, -nMove); + Point aDragPoint = pObject->GetLastBoundRect().TopLeft(); + resizeShape(pObject, aDragPoint, -nMove, -nMove); checkShapePosition(pObject, aStartPosition.X - nGridSize, aStartPosition.Y - nGridSize); checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height + nGridSize); - const Point& rDragPointNew = pObject->GetLastBoundRect().TopLeft(); - resizeShape(pObject, rDragPointNew, nMove, nMove); + Point aDragPointNew = pObject->GetLastBoundRect().TopLeft(); + resizeShape(pObject, aDragPointNew, nMove, nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } // Drag & resize the shape to the left and downward and then resize it back { - const Point& rDragPoint = pObject->GetLastBoundRect().BottomLeft(); - resizeShape(pObject, rDragPoint, -nMove, nMove); + Point aDragPoint = pObject->GetLastBoundRect().BottomLeft(); + resizeShape(pObject, aDragPoint, -nMove, nMove); checkShapePosition(pObject, aStartPosition.X - nGridSize, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height + nGridSize); - const Point& rDragPointNew = pObject->GetLastBoundRect().BottomLeft(); - resizeShape(pObject, rDragPointNew, nMove, -nMove); + Point aDragPointNew = pObject->GetLastBoundRect().BottomLeft(); + resizeShape(pObject, aDragPointNew, nMove, -nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } } +CPPUNIT_TEST_FIXTURE(SwSnapToGridTest, testFoldShapeWithResize) +{ + // Apply grid options + const sal_Int32 nGridSize = 1016; + applyGridOptions(true, nGridSize, nGridSize, 0, 0); + + // Load a document with a single shape + createSwDoc("shapeSnappedToGrid.fodt"); + + // Check original position / size of the shape (it's on the grid) + const awt::Point aStartPosition{ 1016, 1016 }; + const awt::Size aStartSize{ 1016, 1016 }; + SdrObject* pObject = getShapeObject(0); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + + const tools::Long nMove = nGridSize; + + // Fold the shape into a "line" with dragging its right side onto its left side + Point aDragPoint = pObject->GetLastBoundRect().RightCenter(); + resizeShape(pObject, aDragPoint, -nMove, 0); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, 2, aStartSize.Height); + + // Continue dragging its right side, until its right side becomes its left side + aDragPoint = pObject->GetLastBoundRect().RightCenter(); + resizeShape(pObject, aDragPoint, -nMove, 0); + checkShapePosition(pObject, aStartPosition.X - nGridSize, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + + // Fold the shape into a "point" with dragging its top-left corner onto its bottom-right corner + aDragPoint = pObject->GetLastBoundRect().TopLeft(); + resizeShape(pObject, aDragPoint, nMove, nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y + nGridSize); + checkShapeSize(pObject, 2, 2); + + // Continue dragging its top-left corner, until its top-left corner becomes its bottom-right corner + aDragPoint = pObject->GetLastBoundRect().TopLeft(); + resizeShape(pObject, aDragPoint, nMove, nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y + nGridSize); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ \ No newline at end of file +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 0e600d7c46ac9f60135283c6f651892948303b5e Author: Tamás Zolnai <[email protected]> AuthorDate: Mon Oct 6 10:46:24 2025 +0200 Commit: Tamás Zolnai <[email protected]> CommitDate: Mon Oct 6 11:28:14 2025 +0200 testResizeShapeOnGrid Change-Id: Ia7189944a3805d0f1c30e04db3efd9a8331400c9 diff --git a/sw/qa/extras/snaptogrid/snaptogrid.cxx b/sw/qa/extras/snaptogrid/snaptogrid.cxx index f79f704c6f67..c2b6da84163c 100644 --- a/sw/qa/extras/snaptogrid/snaptogrid.cxx +++ b/sw/qa/extras/snaptogrid/snaptogrid.cxx @@ -37,6 +37,8 @@ protected: SdrObject* getShapeObject(const size_t objectIndex); void moveShape(const SdrObject* pObject, const tools::Long nMoveX, const tools::Long nMoveY); + void resizeShape(const SdrObject* pObject, const Point& rDragPoint, const tools::Long nMoveX, + const tools::Long nMoveY); void checkShapeSize(SdrObject* pObject, const sal_Int32 nWidth, const sal_Int32 nHeight); void checkShapePosition(SdrObject* pObject, const sal_Int32 nX, const sal_Int32 nY); @@ -82,7 +84,7 @@ void SwSnapToGridTest::moveShape(const SdrObject* pObject, const tools::Long nMo const tools::Long nMoveYTwips = o3tl::toTwips(nMoveY, o3tl::Length::mm100); const tools::Rectangle& rBoundRect = pObject->GetLastBoundRect(); - Point ptFrom(rBoundRect.Center().X(), rBoundRect.Center().Y()); + Point ptFrom(rBoundRect.Center()); Point ptTo(rBoundRect.Center().X() + nMoveXTwips, rBoundRect.Center().Y() + nMoveYTwips); vcl::Window& rEditWin = getSwDocShell()->GetView()->GetEditWin(); @@ -99,6 +101,31 @@ void SwSnapToGridTest::moveShape(const SdrObject* pObject, const tools::Long nMo Scheduler::ProcessEventsToIdle(); } +void SwSnapToGridTest::resizeShape(const SdrObject* pObject, const Point& rDragPoint, + const tools::Long nMoveX, const tools::Long nMoveY) +{ + CPPUNIT_ASSERT(pObject); + + const tools::Long nMoveXTwips = o3tl::toTwips(nMoveX, o3tl::Length::mm100); + const tools::Long nMoveYTwips = o3tl::toTwips(nMoveY, o3tl::Length::mm100); + + Point ptFrom(rDragPoint); + Point ptTo(rDragPoint.X() + nMoveXTwips, rDragPoint.Y() + nMoveYTwips); + + vcl::Window& rEditWin = getSwDocShell()->GetView()->GetEditWin(); + Point aFrom = rEditWin.LogicToPixel(ptFrom); + Point aTo = rEditWin.LogicToPixel(ptTo); + + MouseEvent aClickEvent(aFrom, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT); + rEditWin.MouseButtonDown(aClickEvent); + MouseEvent aClickEvent2(aTo, 0, MouseEventModifiers::SIMPLEMOVE, MOUSE_LEFT); + rEditWin.MouseMove(aClickEvent2); + rEditWin.MouseMove(aClickEvent2); + MouseEvent aClickEvent3(aTo, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT); + rEditWin.MouseButtonUp(aClickEvent3); + Scheduler::ProcessEventsToIdle(); +} + void SwSnapToGridTest::checkShapeSize(SdrObject* pObject, const sal_Int32 nWidth, const sal_Int32 nHeight) { @@ -141,30 +168,28 @@ CPPUNIT_TEST_FIXTURE(SwSnapToGridTest, testMoveShapeOnGrid) checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + const tools::Long nMove = nGridSize - 10; + // Move the shape one grid position to the right { - const tools::Long nMove = nGridSize - 10; moveShape(pObject, nMove, 0); checkShapePosition(pObject, aStartPosition.X + nGridSize, aStartPosition.Y); } // Move the shape one grid position down { - const tools::Long nMove = nGridSize + 10; moveShape(pObject, 0, nMove); checkShapePosition(pObject, aStartPosition.X + nGridSize, aStartPosition.Y + nGridSize); } // Move the shape one grid position to the left { - const tools::Long nMove = nGridSize; moveShape(pObject, -nMove, 0); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y + nGridSize); } // Move the shape one grid position up { - const tools::Long nMove = nGridSize / 2 + 10; moveShape(pObject, 0, -nMove); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); } @@ -217,6 +242,129 @@ CPPUNIT_TEST_FIXTURE(SwSnapToGridTest, testTryToMoveShape) checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); } +CPPUNIT_TEST_FIXTURE(SwSnapToGridTest, testResizeShapeOnGrid) +{ + // Apply grid options + const sal_Int32 nGridSize = 1016; + applyGridOptions(true, nGridSize, nGridSize, 0, 0); + + // Load a document with a single shape + createSwDoc("shapeSnappedToGrid.fodt"); + + // Check original position / size of the shape (it's on the grid) + const awt::Point aStartPosition{ 1016, 1016 }; + const awt::Size aStartSize{ 1016, 1016 }; + SdrObject* pObject = getShapeObject(0); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + + const tools::Long nMove = nGridSize - 20; + + // Drag & resize the shape to the right and then resize it back + { + const Point& rDragPoint = pObject->GetLastBoundRect().RightCenter(); + resizeShape(pObject, rDragPoint, nMove, 0); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height); + + const Point& rDragPointNew = pObject->GetLastBoundRect().RightCenter(); + resizeShape(pObject, rDragPointNew, -nMove, 0); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + } + + // Drag & resize the shape to the right and then resize it back + { + const Point& rDragPoint = pObject->GetLastBoundRect().LeftCenter(); + resizeShape(pObject, rDragPoint, -nMove, 0); + checkShapePosition(pObject, aStartPosition.X - nGridSize, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height); + + const Point& rDragPointNew = pObject->GetLastBoundRect().LeftCenter(); + resizeShape(pObject, rDragPointNew, nMove, 0); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + } + + // Drag & resize the shape downward and then resize it back + { + const Point& rDragPoint = pObject->GetLastBoundRect().BottomCenter(); + resizeShape(pObject, rDragPoint, 0, nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height + nGridSize); + + const Point& rDragPointNew = pObject->GetLastBoundRect().BottomCenter(); + resizeShape(pObject, rDragPointNew, 0, -nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + } + + // Drag & resize the shape upward and then resize it back + { + const Point& rDragPoint = pObject->GetLastBoundRect().TopCenter(); + resizeShape(pObject, rDragPoint, 0, -nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y - nGridSize); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height + nGridSize); + + const Point& rDragPointNew = pObject->GetLastBoundRect().TopCenter(); + resizeShape(pObject, rDragPointNew, 0, nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + } + + // Drag & resize the shape to the right and upward and then resize it back + { + const Point& rDragPoint = pObject->GetLastBoundRect().TopRight(); + resizeShape(pObject, rDragPoint, nMove, -nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y - nGridSize); + checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height + nGridSize); + + const Point& rDragPointNew = pObject->GetLastBoundRect().TopRight(); + resizeShape(pObject, rDragPointNew, -nMove, nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + } + + // Drag & resize the shape to the right and downward and then resize it back + { + const Point& rDragPoint = pObject->GetLastBoundRect().BottomRight(); + resizeShape(pObject, rDragPoint, nMove, nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height + nGridSize); + + const Point& rDragPointNew = pObject->GetLastBoundRect().BottomRight(); + resizeShape(pObject, rDragPointNew, -nMove, -nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + } + + // Drag & resize the shape to the left and upward and then resize it back + { + const Point& rDragPoint = pObject->GetLastBoundRect().TopLeft(); + resizeShape(pObject, rDragPoint, -nMove, -nMove); + checkShapePosition(pObject, aStartPosition.X - nGridSize, aStartPosition.Y - nGridSize); + checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height + nGridSize); + + const Point& rDragPointNew = pObject->GetLastBoundRect().TopLeft(); + resizeShape(pObject, rDragPointNew, nMove, nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + } + + // Drag & resize the shape to the left and downward and then resize it back + { + const Point& rDragPoint = pObject->GetLastBoundRect().BottomLeft(); + resizeShape(pObject, rDragPoint, -nMove, nMove); + checkShapePosition(pObject, aStartPosition.X - nGridSize, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width + nGridSize, aStartSize.Height + nGridSize); + + const Point& rDragPointNew = pObject->GetLastBoundRect().BottomLeft(); + resizeShape(pObject, rDragPointNew, nMove, -nMove); + checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); + checkShapeSize(pObject, aStartSize.Width, aStartSize.Height); + } +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); commit 85ba2c97383a3bbaaea801afcc9f26a163892e67 Author: Tamás Zolnai <[email protected]> AuthorDate: Mon Oct 6 10:11:27 2025 +0200 Commit: Tamás Zolnai <[email protected]> CommitDate: Mon Oct 6 10:11:27 2025 +0200 Update test document Change-Id: I5e58a38ab5f01d43ffbabcd2f4423b404a8e8d97 diff --git a/sw/qa/extras/snaptogrid/data/snapToGridShape.fodt b/sw/qa/extras/snaptogrid/data/shapeSnappedToGrid.fodt similarity index 98% rename from sw/qa/extras/snaptogrid/data/snapToGridShape.fodt rename to sw/qa/extras/snaptogrid/data/shapeSnappedToGrid.fodt index bb58bd14c821..0b222bb4052c 100644 --- a/sw/qa/extras/snaptogrid/data/snapToGridShape.fodt +++ b/sw/qa/extras/snaptogrid/data/shapeSnappedToGrid.fodt @@ -1,13 +1,13 @@ <?xml version="1.0" encoding="UTF-8"?> <office:document xmlns:css3t="http://www.w3.org/TR/css3-text/" xmlns:grddl="http://www.w3.org/2003/g/data-view#" xmlns:xhtml="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xforms="http://www.w3.org/2002/xforms" xmlns:dom="http://www.w3.org/2001/xml-events" xmlns:script="urn:oasis:names:tc:opendocument:xmlns:script:1.0" xmlns:form="urn:oasis:names:tc:opendocument:xmlns:form:1.0" xmlns:math="http://www.w3.org/1998/Math/MathML" xmlns:office="urn:oasis:names:tc:opendocument:xmlns:office:1.0" xmlns:ooo="http://openoffice.org/2004/office" xmlns:fo="urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" xmlns:config="urn:oasis:names:tc:opendocument:xmlns:config:1.0" xmlns:ooow="http://openoffice.org/2004/writer" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:drawooo="http://openoffice.org/2010/draw" xmlns:oooc="http://openoffice.org/2004/calc" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:c alcext="urn:org:documentfoundation:names:experimental:calc:xmlns:calcext:1.0" xmlns:style="urn:oasis:names:tc:opendocument:xmlns:style:1.0" xmlns:text="urn:oasis:names:tc:opendocument:xmlns:text:1.0" xmlns:of="urn:oasis:names:tc:opendocument:xmlns:of:1.2" xmlns:tableooo="http://openoffice.org/2009/table" xmlns:draw="urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" xmlns:dr3d="urn:oasis:names:tc:opendocument:xmlns:dr3d:1.0" xmlns:rpt="http://openoffice.org/2005/report" xmlns:formx="urn:openoffice:names:experimental:ooxml-odf-interop:xmlns:form:1.0" xmlns:svg="urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" xmlns:chart="urn:oasis:names:tc:opendocument:xmlns:chart:1.0" xmlns:officeooo="http://openoffice.org/2009/office" xmlns:table="urn:oasis:names:tc:opendocument:xmlns:table:1.0" xmlns:field="urn:openoffice:names:experimental:ooo-ms-interop:xmlns:field:1.0" xmlns:number="urn:oasis:names:tc:opendocument:xmlns:datastyle:1.0" xmlns:meta="urn:oasis:names:tc:opendocument:xmlns: meta:1.0" xmlns:loext="urn:org:documentfoundation:names:experimental:office:xmlns:loext:1.0" office:version="1.4" office:mimetype="application/vnd.oasis.opendocument.text"> - <office:meta><meta:creation-date>2025-10-02T13:59:47.055516525</meta:creation-date><dc:date>2025-10-03T15:33:13.627427844</dc:date><meta:editing-duration>PT1M38S</meta:editing-duration><meta:editing-cycles>2</meta:editing-cycles><meta:generator>LibreOfficeDev/26.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/c1e6c1258715316678fac4b7c1286aeb410cc05f</meta:generator><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="0" meta:word-count="0" meta:character-count="0" meta:non-whitespace-character-count="0"/></office:meta> + <office:meta><meta:creation-date>2025-10-02T13:59:47.055516525</meta:creation-date><dc:date>2025-10-06T10:09:26.839057523</dc:date><meta:editing-duration>PT1M46S</meta:editing-duration><meta:editing-cycles>3</meta:editing-cycles><meta:generator>LibreOfficeDev/26.2.0.0.alpha0$Linux_X86_64 LibreOffice_project/c1e6c1258715316678fac4b7c1286aeb410cc05f</meta:generator><meta:document-statistic meta:table-count="0" meta:image-count="0" meta:object-count="0" meta:page-count="1" meta:paragraph-count="0" meta:word-count="0" meta:character-count="0" meta:non-whitespace-character-count="0"/></office:meta> <office:settings> <config:config-item-set config:name="ooo:view-settings"> <config:config-item config:name="ViewAreaTop" config:type="long">0</config:config-item> <config:config-item config:name="ViewAreaLeft" config:type="long">0</config:config-item> <config:config-item config:name="ViewAreaWidth" config:type="long">30496</config:config-item> - <config:config-item config:name="ViewAreaHeight" config:type="long">12321</config:config-item> + <config:config-item config:name="ViewAreaHeight" config:type="long">12289</config:config-item> <config:config-item config:name="ShowRedlineChanges" config:type="boolean">true</config:config-item> <config:config-item config:name="InBrowseMode" config:type="boolean">false</config:config-item> <config:config-item-map-indexed config:name="Views"> @@ -18,12 +18,12 @@ <config:config-item config:name="VisibleLeft" config:type="long">0</config:config-item> <config:config-item config:name="VisibleTop" config:type="long">0</config:config-item> <config:config-item config:name="VisibleRight" config:type="long">30494</config:config-item> - <config:config-item config:name="VisibleBottom" config:type="long">12319</config:config-item> + <config:config-item config:name="VisibleBottom" config:type="long">12287</config:config-item> <config:config-item config:name="ZoomType" config:type="short">0</config:config-item> <config:config-item config:name="ViewLayoutColumns" config:type="short">1</config:config-item> <config:config-item config:name="ViewLayoutBookMode" config:type="boolean">false</config:config-item> <config:config-item config:name="ZoomFactor" config:type="short">160</config:config-item> - <config:config-item config:name="IsSelectedFrame" config:type="boolean">false</config:config-item> + <config:config-item config:name="IsSelectedFrame" config:type="boolean">true</config:config-item> <config:config-item config:name="KeepRatio" config:type="boolean">false</config:config-item> <config:config-item config:name="WindowState" config:type="string">0,28,1806,875;5;0,28,1921,903;</config:config-item> <config:config-item config:name="AnchoredTextOverflowLegacy" config:type="boolean">false</config:config-item> @@ -150,7 +150,7 @@ <config:config-item config:name="UseOldPrinterMetrics" config:type="boolean">false</config:config-item> <config:config-item config:name="RedlineProtectionKey" config:type="base64Binary"/> <config:config-item config:name="TabsRelativeToIndent" config:type="boolean">true</config:config-item> - <config:config-item config:name="Rsid" config:type="int">234371</config:config-item> + <config:config-item config:name="Rsid" config:type="int">238525</config:config-item> <config:config-item config:name="UpdateFromTemplate" config:type="boolean">true</config:config-item> <config:config-item config:name="ProtectForm" config:type="boolean">false</config:config-item> <config:config-item config:name="MsWordCompMinLineHeightByFly" config:type="boolean">false</config:config-item> @@ -169,7 +169,7 @@ <office:styles> <style:default-style style:family="graphic"> <style:graphic-properties svg:stroke-color="#3465a4" draw:fill-color="#729fcf" fo:wrap-option="no-wrap" draw:shadow-offset-x="0.1181in" draw:shadow-offset-y="0.1181in" draw:start-line-spacing-horizontal="0.1114in" draw:start-line-spacing-vertical="0.1114in" draw:end-line-spacing-horizontal="0.1114in" draw:end-line-spacing-vertical="0.1114in" style:writing-mode="lr-tb" style:flow-with-text="false"/> - <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" loext:tab-stop-distance="0in" style:font-independent-line-spacing="false"> + <style:paragraph-properties style:text-autospace="ideograph-alpha" style:line-break="strict" loext:tab-stop-distance="0in" style:writing-mode="lr-tb" style:font-independent-line-spacing="false"> <style:tab-stops/> </style:paragraph-properties> <style:text-properties style:use-window-font-color="true" loext:opacity="0%" style:font-name="Liberation Serif" fo:font-size="12pt" fo:language="en" fo:country="US" style:letter-kerning="true" style:font-name-asian="Noto Sans" style:font-size-asian="10.5pt" style:language-asian="zh" style:country-asian="CN" style:font-name-complex="Noto Sans" style:font-size-complex="12pt" style:language-complex="hi" style:country-complex="IN"/> @@ -302,7 +302,7 @@ <text:sequence-decl text:display-outline-level="0" text:name="Drawing"/> <text:sequence-decl text:display-outline-level="0" text:name="Figure"/> </text:sequence-decls> - <text:p text:style-name="Standard"><draw:custom-shape text:anchor-type="paragraph" draw:z-index="0" draw:name="Shape 1" draw:style-name="gr1" svg:width="0.4004in" svg:height="0.4004in" svg:x="1.6in" svg:y="0.4in"> + <text:p text:style-name="Standard"><draw:custom-shape text:anchor-type="paragraph" draw:z-index="0" draw:name="Shape 1" draw:style-name="gr1" svg:width="0.4004in" svg:height="0.4004in" svg:x="0.4in" svg:y="0.4in"> <text:p/> <draw:enhanced-geometry svg:viewBox="0 0 21600 21600" draw:type="rectangle" draw:enhanced-path="M 0 0 L 21600 0 21600 21600 0 21600 0 0 Z N"/> </draw:custom-shape></text:p> diff --git a/sw/qa/extras/snaptogrid/snaptogrid.cxx b/sw/qa/extras/snaptogrid/snaptogrid.cxx index 5778f4f8dd53..f79f704c6f67 100644 --- a/sw/qa/extras/snaptogrid/snaptogrid.cxx +++ b/sw/qa/extras/snaptogrid/snaptogrid.cxx @@ -132,10 +132,10 @@ CPPUNIT_TEST_FIXTURE(SwSnapToGridTest, testMoveShapeOnGrid) applyGridOptions(true, nGridSize, nGridSize, 0, 0); // Load a document with a single shape - createSwDoc("snapToGridShape.fodt"); + createSwDoc("shapeSnappedToGrid.fodt"); // Check original position / size of the shape (it's on the grid) - const awt::Point aStartPosition{ 4064, 1016 }; + const awt::Point aStartPosition{ 1016, 1016 }; const awt::Size aStartSize{ 1016, 1016 }; SdrObject* pObject = getShapeObject(0); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y); @@ -179,10 +179,10 @@ CPPUNIT_TEST_FIXTURE(SwSnapToGridTest, testTryToMoveShape) applyGridOptions(true, nGridSize, nGridSize, 0, 0); // Load a document with a single shape - createSwDoc("snapToGridShape.fodt"); + createSwDoc("shapeSnappedToGrid.fodt"); // Check original position / size of the shape (it's on the grid) - const awt::Point aStartPosition{ 4064, 1016 }; + const awt::Point aStartPosition{ 1016, 1016 }; const awt::Size aStartSize{ 1016, 1016 }; SdrObject* pObject = getShapeObject(0); checkShapePosition(pObject, aStartPosition.X, aStartPosition.Y);
