Bug 37327 - Bad alignment when topMargin of a formula change
Summary: Bad alignment when topMargin of a formula change
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Formula Editor (show other bugs)
Version:
(earliest affected)
3.5.3 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Formula-Editor
  Show dependency treegraph
 
Reported: 2011-05-18 12:37 UTC by Christophe Devalland
Modified: 2017-10-08 22:26 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christophe Devalland 2011-05-18 12:37:07 UTC
With 3.4 version, OOo/LibreOffice can now align formula on baseline (new option MathBaselineAlignment in document settings or option dialog)
But there is a problem with the top margin.
I wrote a macro you can run step by step to see the problem.
You should have the same problem inserting the formula with menu "insert->object->formula" but changing properties with menu is not easy to describe. So try this macro :


sub badAlignment
	param=ThisComponent.createInstance("com.sun.star.document.Settings")
	param.MathBaselineAlignment=true
	obj=ThisComponent.CreateInstance("com.sun.star.text.TextEmbeddedObject")
	obj.CLSID="078B7ABA-54FC-457F-8551-6147e776a997"
    obj.AnchorType=com.sun.star.text.TextContentAnchorType.AS_CHARACTER
    oViewCursor = ThisComponent.getCurrentController().getViewCursor()
	oTextCursor=oViewCursor.Text.createTextCursorByRange(oViewCursor)
	oTextCursor.Text.insertString(oTextCursor,"this formula ...",false)
    oTextCursor.Text.insertTextContent(oTextCursor, obj, true)
   	obj.Model.leftMargin=0
  	obj.Model.rightMargin=0
   	obj.Model.bottomMargin=0
  	obj.Model.topMargin=0
	obj.Model.formula="x ^ {1 over 2}"
	oTextCursor.Text.insertString(oTextCursor," is well aligned, ",false)
   	obj.Model.bottomMargin=100
	oTextCursor.Text.insertString(oTextCursor," still aligned, ",false)
   	obj.Model.topMargin=100
	oTextCursor.Text.insertString(oTextCursor," not aligned anymore ! ",false)
end sub
Comment 1 Björn Michaelsen 2011-12-23 12:04:33 UTC Comment hidden (obsolete)
Comment 2 Christophe Devalland 2012-05-17 13:30:58 UTC
The bug is still here (libO 3.5.3).
Run this macro step by step in a writer blank document to see the problem :

sub badAlignment
    param=ThisComponent.createInstance("com.sun.star.document.Settings")
    param.MathBaselineAlignment=true
    obj=ThisComponent.CreateInstance("com.sun.star.text.TextEmbeddedObject")
    obj.CLSID="078B7ABA-54FC-457F-8551-6147e776a997"
    obj.AnchorType=com.sun.star.text.TextContentAnchorType.AS_CHARACTER
    oViewCursor = ThisComponent.getCurrentController().getViewCursor()
    oTextCursor=oViewCursor.Text.createTextCursorByRange(oViewCursor)
    oTextCursor.Text.insertString(oTextCursor,"this formula ...",false)
    oTextCursor.Text.insertTextContent(oTextCursor, obj, true)
    obj.Model.leftMargin=0
    obj.Model.rightMargin=0
    obj.Model.bottomMargin=0
    obj.Model.topMargin=0
    obj.Model.formula="x ^ {1 over 2}"
    obj.ExtendedControlOverEmbeddedObject.update()
    oTextCursor.Text.insertString(oTextCursor," is well aligned, ",false)
    obj.Model.bottomMargin=100
    oTextCursor.Text.insertString(oTextCursor," still aligned, ",false)
    obj.Model.topMargin=100
    oTextCursor.Text.insertString(oTextCursor," not aligned anymore ! ",false)
end sub
Comment 3 QA Administrators 2015-01-05 17:51:50 UTC Comment hidden (obsolete)
Comment 4 Buovjaga 2015-01-23 16:50:40 UTC
Reproduced using the Step into (F8) through the whole macro in the macro editor.

Win 7 Pro 64-bit Version: 4.5.0.0.alpha0+
Build ID: 07e84cae983c08afdba03018413a19d01abb3006
TinderBox: Win-x86@62-TDF, Branch:MASTER, Time: 2015-01-19_06:15:38
Comment 5 QA Administrators 2016-02-21 08:36:14 UTC Comment hidden (obsolete)
Comment 6 QA Administrators 2017-03-06 15:27:11 UTC
** Please read this message in its entirety before responding **

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present on a currently supported version of LibreOffice 
(5.2.5 or 5.3.0  https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the version of LibreOffice and 
your operating system, and any changes you see in the bug behavior
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave 
a short comment that includes your version of LibreOffice and Operating System

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3)

http://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to "inherited from OOo";
4b. If the bug was not present in 3.3 - add "regression" to keyword


Feel free to come ask questions or to say hello in our QA chat: http://webchat.freenode.net/?channels=libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug-20170306