Re: Trouble with SdrMeasureObj (dimension line)

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

 



Hi Miklos, hi all,

Regina Henschel schrieb am 20-Nov-20 um 11:46:
Hi Miklos,

Miklos Vajna schrieb am 19-Nov-20 um 09:22:
Hi Regina,

On Wed, Nov 18, 2020 at 11:56:01PM +0100, Regina Henschel <rb.henschel@xxxxxxxxxxx> wrote:
Do you know examples for unit tests with "drag create" and for unit tests
with "create default objects"?

I'm not sure we have such tests. But it does not seem too problematic to
create one. Here is how I would start:

Good tip! I see use of a dispatcher in the call stack. That looks promising.

The approach with dispatcher did not work. But after some days and several failed attempts I found a solution to create the default measure line:

   ScTabViewShell* pTabViewShell = pDocSh->GetBestViewShell(false);
   SfxRequest aReq(pTabViewShell->GetViewFrame(), SID_DRAW_MEASURELINE);
   aReq.SetModifier(8192); // Ctrl
   pTabViewShell->ExecDraw(aReq);

I had seen the magic number "8192" in uitest sw/qa/uitest/writer_tests7/tdf130629.py and in Visual Studio. There might be a "speaking" define, I don't know.

The shape is inserted and selected, so that you can manipulate it, changing the anchor for example. When you want to work on the sheet itself, hiding a column for example, you have to deactivate draw shell. That can be done with
   pTabViewShell->SetDrawShell(false);

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