summaryrefslogtreecommitdiff
path: root/sd/qa/unit/misc-tests.cxx
diff options
context:
space:
mode:
authorRegina Henschel <rb.henschel@t-online.de>2020-04-19 18:22:11 +0200
committerRegina Henschel <rb.henschel@t-online.de>2020-04-25 14:49:30 +0200
commiteb2d669af61b8808d5819b16157c59d3c6c3e03b (patch)
tree504c6c46494d41d85c6ac73387b47ce305895f7b /sd/qa/unit/misc-tests.cxx
parent10dba26804cc0c14f74069c26112e75dacf3865b (diff)
tdf#129898 Use layer DrawnInSlideshow in edit mode
If 'Mouse pointer as pen' is set in slideshow settings, painting in slideshow becomes persistent. A layer DrawnInSlideshow is created for that purpose during slideshow. But that layer was not known to the view from where the slideshow was started. Generating a layer had been done regardless whether such layer already exists or not. That had produced several layers with identical name. That may not happen, because layers are identified by name. Change-Id: I2ba9bad5babe5a1bba3d1fc69d028d9037d2bd47 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92502 Tested-by: Jenkins Reviewed-by: Regina Henschel <rb.henschel@t-online.de>
Diffstat (limited to 'sd/qa/unit/misc-tests.cxx')
-rw-r--r--sd/qa/unit/misc-tests.cxx25
1 files changed, 25 insertions, 0 deletions
diff --git a/sd/qa/unit/misc-tests.cxx b/sd/qa/unit/misc-tests.cxx
index 3e23752aa477..53707a5676a2 100644
--- a/sd/qa/unit/misc-tests.cxx
+++ b/sd/qa/unit/misc-tests.cxx
@@ -82,6 +82,7 @@ public:
void testTdf98839_ShearVFlipH();
void testTdf130988();
void testTdf131033();
+ void testTdf129898LayerDrawnInSlideshow();
CPPUNIT_TEST_SUITE(SdMiscTest);
CPPUNIT_TEST(testTdf96206);
@@ -102,6 +103,7 @@ public:
CPPUNIT_TEST(testTdf98839_ShearVFlipH);
CPPUNIT_TEST(testTdf130988);
CPPUNIT_TEST(testTdf131033);
+ CPPUNIT_TEST(testTdf129898LayerDrawnInSlideshow);
CPPUNIT_TEST_SUITE_END();
virtual void registerNamespaces(xmlXPathContextPtr& pXmlXPathCtx) override
@@ -854,6 +856,29 @@ void SdMiscTest::testTdf131033()
xDocShRef->DoClose();
}
+void SdMiscTest::testTdf129898LayerDrawnInSlideshow()
+{
+ // Versions LO 6.2 to 6.4 have produced files, where the layer DrawnInSlideshow has
+ // got visible=false and printable=false attributes. Those files should be repaired now.
+ const OUString sURL = "sd/qa/unit/data/tdf129898_faulty_DrawnInSlideshow.odp";
+ sd::DrawDocShellRef xDocShRef = Load(m_directories.getURLFromSrc(sURL), ODP);
+ CPPUNIT_ASSERT_MESSAGE("Failed to load file.", xDocShRef.is());
+
+ // Verify model
+ const OUString sName = "DrawnInSlideshow";
+ SdrLayerAdmin& rLayerAdmin = xDocShRef->GetDoc()->GetLayerAdmin();
+ SdrLayer* pLayer = rLayerAdmin.GetLayer(sName);
+ CPPUNIT_ASSERT_MESSAGE("No layer DrawnInSlideshow", pLayer);
+ CPPUNIT_ASSERT(pLayer->IsVisibleODF() && pLayer->IsPrintableODF());
+
+ // Verify view
+ sd::DrawViewShell* pViewShell = static_cast<sd::DrawViewShell*>(xDocShRef->GetViewShell());
+ SdrPageView* pPageView = pViewShell->GetView()->GetSdrPageView();
+ CPPUNIT_ASSERT(pPageView->IsLayerVisible(sName) && pPageView->IsLayerPrintable(sName));
+
+ xDocShRef->DoClose();
+}
+
CPPUNIT_TEST_SUITE_REGISTRATION(SdMiscTest);
CPPUNIT_PLUGIN_IMPLEMENT();