Need help for unit test with rotated shape in Calc

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

my proposed fix for tdf#119191 in https://gerrit.libreoffice.org/#/c/84216/ will also fix, that the command .uno:FitCellSize does not work on cell anchored custom shapes, in case they are transformed. So I'm trying to write a unit test for it. The command is new [1] and has no unit test at all, so I have no template to look how it can be done. [1] https://cgit.freedesktop.org/libreoffice/core/commit/?id=073b4eadd2a9a00b915c664df90b15d5b2d709c0

The feature is done by the method ScDrawView::FitToCellSize(). So I tried to get a ScDrawView, but without success. The following attempt does not work, xDocSh->GetBestViewShell(false) returns a nullptr.

    ScDocShellRef xDocSh = loadDoc("tdf119191_FitToCellSize.", FORMAT_ODS);
    ScTabViewShell* pViewShell = xDocSh->GetBestViewShell(false);
    ScDrawView* pDrawView = pViewShell->GetScDrawView();

So I tried to do the same as in ScCopyPasteTest::testCopyPasteXLS() to get a ScTabViewShell. But in that attempt the line xController->attachFrame( xTargetFrame ); gives an assertion.

Any idea, how I can apply FitToCellSize() to a shape in a unit test?

Kind regards
Regina
_______________________________________________
LibreOffice mailing list
LibreOffice@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/libreoffice




[Index of Archives]     [LARTC]     [Bugtraq]     [Yosemite Forum]     [Photo]

  Powered by Linux