Unit test for text rotation inside textbox

serdar tunc serdarot5 at gmail.com
Wed Dec 13 22:17:37 UTC 2017


Hello

I am working on bug tdf#104290
https://bugs.documentfoundation.org/show_bug.cgi?id=104290
I've sended a patch for fix and i need to send unit test. I've couldnt
found unit test for text rotation inside textbox. I've just found one
property named "TextRotation" and i've tried it but i get error called
UnknownPropertyException. I did search opengrok but i couldnt found
anything else.

This is my unit test:

void ScFiltersTest::testTdf104290XLSX()
{
    ScDocShellRef xDocSh = loadDoc("tdf104290.", FORMAT_XLSX);
    CPPUNIT_ASSERT_MESSAGE("Failed to load tdf104290 .xlsx", xDocSh.is());
    uno::Reference< drawing::XDrawPagesSupplier > xDoc(
        xDocSh->GetModel(), uno::UNO_QUERY_THROW );
    uno::Reference< drawing::XDrawPage > xPage(
        xDoc->getDrawPages()->getByIndex(0), uno::UNO_QUERY_THROW );
    uno::Reference< drawing::XShape > xShape(
        xPage->getByIndex(0), uno::UNO_QUERY_THROW );
    CPPUNIT_ASSERT_MESSAGE( "failed to load shape", xShape.is() );
    uno::Reference< beans::XPropertySet > xShapeProperties(
        xShape, uno::UNO_QUERY );
    sal_Int32 nTextRotate = 0;
    xShapeProperties->getPropertyValue("TextRotation") >>= nTextRotate;
    CPPUNIT_ASSERT(nTextRotate == 0);
    xDocSh->DoClose();
}

Is there any example unit test for text rotation inside textbox or
somebody knows property name of text rotation inside textbox? Thank
you very much


More information about the LibreOffice mailing list