Trouble with SdrMeasureObj (dimension line)

Regina Henschel rb.henschel at
Tue Dec 1 12:25:22 UTC 2020

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 at> 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 

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

I had seen the magic number "8192" in uitest 
sw/qa/uitest/writer_tests7/ 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

Kind regards

More information about the LibreOffice mailing list