Fix warning C4312 when building with MSVC without -Wv:18
Discovered by https://gerrit.libreoffice.org/c/core/+/163717
Like these:
C:/lo/core/oox/qa/unit/testscene3d.cxx(1): warning C4828: The file contains a character starting at offset 0x21ac that is illegal in the current source character set (codepage 65001).
Change-Id: Id1f69b2644ecb5302e15603dd5353a34757e76dd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/163782
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
diff --git a/oox/qa/unit/testscene3d.cxx b/oox/qa/unit/testscene3d.cxx
index 27987089..6ca9e33 100644
--- a/oox/qa/unit/testscene3d.cxx
+++ b/oox/qa/unit/testscene3d.cxx
@@ -164,8 +164,8 @@ CPPUNIT_TEST_FIXTURE(TestScene3d, test_obliqueTopRight)
// MS Office applies the shape rotation after the camera rotations in case of oblique preset
// camera types. That needs to be converted to the 'first shape rotation' specification of ODF.
// That conversion results in angles not available in the UI of LibreOffice, but LO can
// render them. The shape has got these rotation in the UI of MS Office: 60° shape ,
// 50° on x-axis, 10° on y-axis and 40° on z-axis.
// render them. The shape has got these rotation in the UI of MS Office: 60° shape ,
// 50° on x-axis, 10° on y-axis and 40° on z-axis.
loadFromFile(u"Scene3d_obliqueTopRight.pptx");
uno::Reference<drawing::XShape> xShape(getShape(0, 0)); // shape 0 on page 0
@@ -184,7 +184,7 @@ CPPUNIT_TEST_FIXTURE(TestScene3d, test_obliqueTopRight)
// Should be an oblique projection with non default skew values
aExtrusionPropMap.getValue(u"Skew"_ustr) >>= aParaPair;
CPPUNIT_ASSERT_DOUBLES_EQUAL(30.0, aParaPair.First.Value.get<double>(), 1E-14);
// -135° from preset camera type, minus 60° shape rotation
// -135° from preset camera type, minus 60° shape rotation
CPPUNIT_ASSERT_DOUBLES_EQUAL(-195.0, aParaPair.Second.Value.get<double>(), 1E-14);
// Because of the needed conversions the resulting angles are very different from
diff --git a/oox/source/drawingml/scene3dhelper.cxx b/oox/source/drawingml/scene3dhelper.cxx
index b72ca4a..ac7f0fd 100644
--- a/oox/source/drawingml/scene3dhelper.cxx
+++ b/oox/source/drawingml/scene3dhelper.cxx
@@ -356,7 +356,7 @@ void Scene3DHelper::addProjectionGeometryToMap(
{
double fFov = (*p3DProperties).mfFieldOfVision.value();
fFov = std::clamp(fFov, 0.5, 179.5);
// 15976 = 25000 * tan(32.5°) as in legacy. Better ideas to calculate the distance are
// 15976 = 25000 * tan(32.5°) as in legacy. Better ideas to calculate the distance are
// welcome.
aViewPoint.PositionZ = 15976.0 / tan(basegfx::deg2rad(fFov / 2.0));
}