diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx index 885582758b39..4a17fc480ca7 100644 --- a/sd/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx @@ -3088,6 +3088,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"index\": 0") >= 0); CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"hash\"")); CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"initVisible\"")); + CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"bounds\"")); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"bitmap\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"content\": { \"type\": \"%IMAGETYPE%\", \"checksum\": \"%IMAGECHECKSUM%\"}") >= 0); @@ -3103,6 +3104,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"MasterPage\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"index\": 0") >= 0); + CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"bounds\"")); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"bitmap\"") >= 0); debugWriteImageToFile(1, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); @@ -3117,6 +3119,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"MasterPage\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"index\": 1") >= 0); + CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"bounds\"")); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"bitmap\"") >= 0); debugWriteImageToFile(2, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); @@ -3132,6 +3135,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"index\": 0") >= 0); CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"initVisible\"")); + CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"bounds\"")); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"bitmap\"") >= 0); debugWriteImageToFile(3, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); @@ -3163,6 +3167,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"index\": 2") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"initVisible\": true") >= 0); + CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"bounds\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"animated\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"bitmap\"") >= 0); @@ -3179,6 +3184,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"index\": 3") >= 0); CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"initVisible\"")); + CPPUNIT_ASSERT_EQUAL(-1, rJsonMsg.indexOf(u"\"bounds\"")); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"bitmap\"") >= 0); debugWriteImageToFile(6, pBuffer, nViewWidth, nViewHeight, rJsonMsg.toUtf8().getStr()); @@ -3194,6 +3200,7 @@ CPPUNIT_TEST_FIXTURE(SdTiledRenderingTest, testSlideshowLayeredRendering_Animati CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"group\": \"DrawPage\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"index\": 4") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"initVisible\": false") >= 0); + CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"bounds\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"animated\"") >= 0); CPPUNIT_ASSERT(rJsonMsg.indexOf(u"\"type\": \"bitmap\"") >= 0); diff --git a/sd/source/ui/tools/SlideshowLayerRenderer.cxx b/sd/source/ui/tools/SlideshowLayerRenderer.cxx index 3516e901d020..ffa36854c55f 100644 --- a/sd/source/ui/tools/SlideshowLayerRenderer.cxx +++ b/sd/source/ui/tools/SlideshowLayerRenderer.cxx @@ -334,6 +334,16 @@ static void writeContentNode(::tools::JsonWriter& aJsonWriter) aJsonWriter.put("checksum", "%IMAGECHECKSUM%"); } +static void writeBoundingBox(::tools::JsonWriter& aJsonWriter, SdrObject* pObject) +{ + auto aContentNode = aJsonWriter.startNode("bounds"); + ::tools::Rectangle aRect = pObject->GetCurrentBoundRect(); + aJsonWriter.put("x", aRect.getX()); + aJsonWriter.put("y", aRect.getY()); + aJsonWriter.put("width", aRect.GetWidth()); + aJsonWriter.put("height", aRect.GetHeight()); +} + void SlideshowLayerRenderer::writeJSON(OString& rJsonMsg) { ::tools::JsonWriter aJsonWriter; @@ -354,6 +364,7 @@ void SlideshowLayerRenderer::writeJSON(OString& rJsonMsg) aJsonWriter.put("initVisible", maRenderState.isObjectInitiallyVisible(pObject)); aJsonWriter.put("type", "bitmap"); writeContentNode(aJsonWriter); + writeBoundingBox(aJsonWriter, pObject); } } else