There's lot of duplicated code in sd (unit) tests, such as: uno::Reference<text::XText> xText = uno::Reference<text::XTextRange>(xShape, uno::UNO_QUERY)->getText(); CPPUNIT_ASSERT_MESSAGE( "not a text shape", xText.is() ); uno::Reference<container::XEnumerationAccess> paraEnumAccess; paraEnumAccess.set(xText, uno::UNO_QUERY); uno::Reference<container::XEnumeration> paraEnum = paraEnumAccess->createEnumeration(); uno::Reference<text::XTextRange> const xParagraph(paraEnum->nextElement(), uno::UNO_QUERY_THROW); uno::Reference< beans::XPropertySet > xPropSet( xParagraph, uno::UNO_QUERY_THROW ); Such code is copy'n'pasted all over the place, whenever it is used. It'd be useful to reduce that copy'n'pasta and make some convenience functions out of this frequently used code, such as: getSlide(document, N ) getShape( slide, N) getParagraph(shape, N) getRun(paragraph, N) and so on
Katarina Behrens committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=927019f5d253a12d285f68a5f0240548d2048def tdf#94272: Reduce copy'n'pasta code in sd unit tests It will be available in 5.1.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting SkillCpp SkillUno TopicCleanup ) [NinjaEdit]
Remove LibreOffice Dev List from CC on EasyHacks (curtailing excessive email to list) [NinjaEdit]