https://bugs.documentfoundation.org/show_bug.cgi?id=94272

            Bug ID: 94272
           Summary: Reduce copy'n'pasta code in Impress unit tests (sd/qa)
           Product: LibreOffice
           Version: 5.1.0.0.alpha0+ Master
          Hardware: Other
                OS: All
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Impress
          Assignee: [email protected]
          Reporter: [email protected]

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

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to