Date: prev next · Thread: first prev next last
2017 Archives by date, by thread · List index


On 13.12.2017 23:17, serdar tunc wrote:
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

so usually this would be the "TextWritingMode" property of the shape,
with value css::text::WritingMode2::TB_LR probably ... but in your
document it's not, i tried it.

if i paste this shape into a new sheet and save it i get:

        <draw:enhanced-geometry draw:mirror-horizontal="false"
draw:mirror-vertical="false" draw:text-areas="0 0 ?f3 ?f2"
draw:text-rotate-angle="-270" svg:viewBox="0 0 0 0"
draw:type="ooxml-rect" draw:enhanced-path="M 0 0 L ?f3 0 ?f3 ?f2 0 ?f2 Z N">

apparently  draw:text-rotate-angle="-270"  is what effects the rotation,
no idea where to get that in the API, there must be something "generic"
in com/sun/star/drawing/Enhanced...

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.