[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - svx/CppunitTest_svx_unit.mk svx/qa svx/source
Regina Henschel (via logerrit)
logerrit at kemper.freedesktop.org
Wed Mar 17 20:10:12 UTC 2021
svx/CppunitTest_svx_unit.mk | 1
svx/qa/unit/customshapes.cxx | 37 ++++++++++++++++++++++++++
svx/qa/unit/data/tdf141021_ExtrusionNorth.odp |binary
svx/source/toolbars/extrusionbar.cxx | 2 -
4 files changed, 39 insertions(+), 1 deletion(-)
New commits:
commit 8eb4bf3b4d94413cb6f10fecc878829f5d1995ec
Author: Regina Henschel <rb.henschel at t-online.de>
AuthorDate: Sun Mar 14 16:26:22 2021 +0100
Commit: Xisco Fauli <xiscofauli at libreoffice.org>
CommitDate: Wed Mar 17 21:09:35 2021 +0100
tdf#141021 Correct sign in Origin in Extrusion North
This is about customs shapes in 3D mode using direction floater.
Shapes, which were created with older versions, keep their values until
the direction is newly assigned. So the change will not automatically
change existing documents.
Change-Id: Ib1ce511de0f524bf59279fb4e976f66ed65bc080
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112474
Tested-by: Jenkins
Reviewed-by: Regina Henschel <rb.henschel at t-online.de>
(cherry picked from commit fa8d00560bbfededec7f2c328f04eb2b369c00e2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112617
Reviewed-by: Xisco Fauli <xiscofauli at libreoffice.org>
diff --git a/svx/CppunitTest_svx_unit.mk b/svx/CppunitTest_svx_unit.mk
index 892490265261..598d788392b4 100644
--- a/svx/CppunitTest_svx_unit.mk
+++ b/svx/CppunitTest_svx_unit.mk
@@ -39,6 +39,7 @@ $(eval $(call gb_CppunitTest_use_libraries,svx_unit, \
editeng \
sal \
sfx \
+ svl \
svxcore \
svx \
tl \
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index e3a5e0ac92a3..db7808a16f2f 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -18,9 +18,16 @@
#include <basegfx/polygon/b2dpolypolygon.hxx>
#include <basegfx/polygon/b2dpolygon.hxx>
#include <basegfx/point/b2dpoint.hxx>
+#include <sfx2/request.hxx>
+#include <sfx2/viewfrm.hxx>
+#include <sfx2/viewsh.hxx>
+#include <svl/intitem.hxx>
#include <svx/EnhancedCustomShape2d.hxx>
+#include <svx/extrusionbar.hxx>
#include <svx/svdoashp.hxx>
#include <svx/svdopath.hxx>
+#include <svx/svdview.hxx>
+#include <svx/svxids.hrc>
#include <svx/unoapi.hxx>
#include <unotools/mediadescriptor.hxx>
#include <unotools/tempfile.hxx>
@@ -117,6 +124,36 @@ void lcl_AssertRectEqualWithTolerance(const OString& sInfo, const tools::Rectang
std::abs(rExpected.GetHeight() - rActual.GetHeight()) <= nTolerance);
}
+CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf141021ExtrusionNorth)
+{
+ // tdf#141021 Setting extrusion direction in projection method 'perspective' to
+ // 'Extrusion North' had used a wrong origin for the ViewPoint and thus the
+ // side faces were wrong calculated.
+
+ // Load document and get shape. It is a custom shape in 3D mode.
+ OUString aURL = m_directories.getURLFromSrc(sDataDirectory) + "tdf141021_ExtrusionNorth.odp";
+ mxComponent = loadFromDesktop(aURL, "com.sun.star.comp.presentation.PresentationDocument");
+ CPPUNIT_ASSERT_MESSAGE("Could not load document", mxComponent.is());
+ uno::Reference<drawing::XShape> xShape(getShape(0));
+ SdrObjCustomShape& rSdrCustomShape(
+ static_cast<SdrObjCustomShape&>(*GetSdrObjectFromXShape(xShape)));
+
+ // Mark Object
+ SfxViewShell* pViewShell = SfxViewShell::Current();
+ SdrView* pSdrView = pViewShell->GetDrawView();
+ pSdrView->MarkObj(&rSdrCustomShape, pSdrView->GetSdrPageView());
+
+ // Set direction
+ SfxRequest aReq(pViewShell->GetViewFrame(), SID_EXTRUSION_DIRECTION);
+ SfxInt32Item aItem(SID_EXTRUSION_DIRECTION, 90);
+ aReq.AppendItem(aItem);
+ svx::ExtrusionBar::execute(pSdrView, aReq, SfxViewFrame::Current()->GetBindings());
+
+ // Verify height. Without the fix in place the height would 4001.
+ tools::Rectangle aBoundRect(rSdrCustomShape.GetCurrentBoundRect());
+ CPPUNIT_ASSERT_EQUAL(tools::Long(5895), aBoundRect.GetHeight());
+}
+
CPPUNIT_TEST_FIXTURE(CustomshapesTest, testResizeRotatedShape)
{
// tdf#138945 Setting width or height for a rotated or sheared shape in the Position&Size dialog
diff --git a/svx/qa/unit/data/tdf141021_ExtrusionNorth.odp b/svx/qa/unit/data/tdf141021_ExtrusionNorth.odp
new file mode 100644
index 000000000000..559b2c0d58e0
Binary files /dev/null and b/svx/qa/unit/data/tdf141021_ExtrusionNorth.odp differ
diff --git a/svx/source/toolbars/extrusionbar.cxx b/svx/source/toolbars/extrusionbar.cxx
index 5297f304b7bf..cffcaa3836fa 100644
--- a/svx/source/toolbars/extrusionbar.cxx
+++ b/svx/source/toolbars/extrusionbar.cxx
@@ -197,7 +197,7 @@ static void impl_execute( SfxRequest const & rReq, SdrCustomShapeGeometryItem& r
aViewPoint.PositionX = 0;
aViewPoint.PositionY = 3472;
fOriginX = 0;
- fOriginY = -0.50;
+ fOriginY = 0.50;
break;
case 45:
aViewPoint.PositionX = -3472;
More information about the Libreoffice-commits
mailing list