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::XEnumeration> paraEnum = paraEnumAccess->createEnumeration();
uno::Reference<text::XTextRange> const xParagraph(paraEnum->nextElement(),
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)
and so on
Katarina Behrens committed a patch related to this issue.
It has been pushed to "master":
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:
Affected users are encouraged to test the fix and report feedback.
Migrating Whiteboard tags to Keywords: (EasyHack DifficultyInteresting SkillCpp SkillUno TopicCleanup )
Remove LibreOffice Dev List from CC on EasyHacks
(curtailing excessive email to list)