Date: prev next · Thread: first prev next last
2019 Archives by date, by thread · List 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

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.