summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2020-02-28 18:09:34 +0100
committerRegina Henschel <rb.henschel@t-online.de>2020-02-29 13:10:24 +0100
commit946eb391028284ca1b0b9927891a8e21c1c478f9 (patch)
treef7d296a3db9ff2dfb0e0ce3b7ff41cf2236e7b3f /sd
parentdb7df91ea05f9093955583f165e32e218364fec3 (diff)
tdf#130988 add y-axis up<->down in create 3D obj
Creating the matrix aLatheMat uses a coordinate system with y-axis pointing up, but aPolyPoly2D and ctor of E3dLatheObj uses y-axis pointing down. Converting was missing. The error was inherited from OOo2. Change-Id: Id5b2f769b8f940bd0028d0386d7ce8b80bf17b97 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89730 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/unit/data/tdf130988_3D_create_lathe.odgbin0 -> 8874 bytes
-rw-r--r--sd/qa/unit/misc-tests.cxx26
2 files changed, 26 insertions, 0 deletions
diff --git a/sd/qa/unit/data/tdf130988_3D_create_lathe.odg b/sd/qa/unit/data/tdf130988_3D_create_lathe.odg
new file mode 100644
index 000000000000..e2b37ef60235
--- /dev/null
+++ b/sd/qa/unit/data/tdf130988_3D_create_lathe.odg
Binary files differ
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 852cdc03ece6..6871b2d432e3 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -55,6 +55,8 @@
#include <vcl/keycodes.hxx>
#include <svx/svdoashp.hxx>
#include <tools/gen.hxx>
+#include <svx/view3d.hxx>
+#include <svx/scene3d.hxx>
using namespace ::com::sun::star;
@@ -78,6 +80,7 @@ public:
void testTdf119956();
void testTdf120527();
void testTdf98839_ShearVFlipH();
+ void testTdf130988();
CPPUNIT_TEST_SUITE(SdMiscTest);
CPPUNIT_TEST(testTdf96206);
@@ -96,6 +99,7 @@ public:
CPPUNIT_TEST(testTdf119956);
CPPUNIT_TEST(testTdf120527);
CPPUNIT_TEST(testTdf98839_ShearVFlipH);
+ CPPUNIT_TEST(testTdf130988);
CPPUNIT_TEST_SUITE_END();
virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -802,6 +806,28 @@ void SdMiscTest::testTdf98839_ShearVFlipH()
xDocShRef->DoClose();
}
+void SdMiscTest::testTdf130988()
+{
+ const OUString sURL("sd/qa/unit/data/tdf130988_3D_create_lathe.odg");
+ sd::DrawDocShellRef xDocShRef = Load(m_directories.getURLFromSrc(sURL), ODG);
+
+ //emulate command .uno:ConvertInto3DLathe
+ sd::ViewShell* pViewShell = xDocShRef->GetViewShell();
+ E3dView* pView = dynamic_cast<E3dView*>(pViewShell->GetView());
+ pView->MarkNextObj();
+ pView->ConvertMarkedObjTo3D(false, basegfx::B2DPoint(8000.0, -3000.0), basegfx::B2DPoint(3000.0, -8000.0));
+ E3dScene* pObj = dynamic_cast<E3dScene*>(pView->GetMarkedObjectByIndex(0));
+ CPPUNIT_ASSERT(pObj);
+
+ // Error was, that the created 3D object had a wrong path. Instead examining
+ // the path directly, I use the scene distance, because that is easier. The
+ // scene distance is calculated from the object while creating.
+ const double fDistance = pObj->GetDistance();
+ CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("D3DSceneDistance", 7071.0, fDistance, 0.5);
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest);
CPPUNIT_PLUGIN_IMPLEMENT();