Created attachment 81749 [details] word document for testing Problem description: When you open a word-document with a formula - LO adds spaces (to sides and bottom usually) to the formula object. It shifts all the lines a little bit down and breaks the paragraph style. Steps to reproduce: 1. Open test-1.docx in MS Word 2. Open test-1.docx in LO 3. See that the formula object has spaces it shouldn't have Current behavior: Adds spaces to formula object when importing. Expected behavior: No spaces should be added Operating System: Windows 7 Version: 4.0.4.2 release
Created attachment 81750 [details] Look quickly what is the problem
Hi Sergey, Thank you for the report and screen print. This looks (partly) the same as bug 64989 . Could you pls check if that is the case? Regards, Cor
(In reply to comment #2) > This looks (partly) the same as bug 64989 . Could you pls check if that is > the case? It looks a bit different for me: 1. mine - about spacing around a formula object; 64989 - about adding new lines 2. mine - importing ".doc"; 64989 - saving .odt to .doc Well, I can't tell if the same code is responsible for these 2 bugs.
Thanks for your bug reporter and answer Sergey. I can reproduce this behavior using Mac OSX 10.8.4 with LibreOffice 4.1.0.1 RC. Kind regards, Joren
This is Bug 65067. See also discussion in its dup Bug 65169.
(In reply to comment #5) > This is Bug 65067. See also discussion in its dup Bug 65169. But not only horizonal! There is also a space at the bottom.
(In reply to comment #6) Sergey! My comment was intended not to question someone's priority and importance. It was mainly targeted towards developers who decide to fix this. Any bug report goal is primarily to get fixed! And I provide information with regard of relevant discussion about impact and related problems. Besides, dupes show importance of a problem - they inform developers, that a lot of users suffer from it. Still, anyway, I haven't marked your report as dup, as you see, and I simply add the abovementioned related bug to See Also.
(In reply to comment #7) Don't worry, wouldn't be a problem if it was even marked as a dup. I agree with you. I just made a note - "not only horizonal".
This comment by no means doesn't pretend to be a "solution" to this bug; rather, it is a kludge for those who need to have their work done while this bug is being fixed. You may use the following macro to remove all spacing around all formulas in a document at once: Sub SetMathBorder On Error Resume Next ' Prevents deleted objects from causing errors. oCurrentController = ThisComponent.getCurrentController() oTextDocument = oCurrentController.Model oEmbeddedObjects = oTextDocument.EmbeddedObjects nEndIndex = oEmbeddedObjects.Count-1 for nIndex=0 to nEndIndex oMathObject = oEmbeddedObjects.getByIndex(nIndex) oModel = oMathObject.Model if (not isNull(oModel)) then if(not isEmpty(oModel)) then ' if oModel.supportsService("com.sun.star.formula.FormulaProperties") then if oMathObject.CLSID = "078B7ABA-54FC-457F-8551-6147e776a997" then oMathObject.LeftMargin = 0 oMathObject.RightMargin = 0 oMathObject.TopMargin = 0 oMathObject.BottomMargin = 0 oModel.LeftMargin = 0 oModel.RightMargin = 0 oModel.TopMargin = 0 oModel.BottomMargin = 0 ' Update oXCOEO = oMathObject.ExtendedControlOverEmbeddedObject oXCOEO.Update() endif ' if formula endif ' if not empty endif ' if not null next nIndex ThisComponent.Reformat() ' Updates all elements in the document End Sub The macro removes both spacing accessible by Object->Wrap, and menu Format->Spacing->Category->Borders inside formula. Also, this will make formulas to "regenerate", i.e. stop showing cached image (this may be considered good or bad, depending on the correctness of formulas import). Thanks to: LO Documentation team and their LibreOffice Math Guide & http://api.libreoffice.org; AOO Wiki @ http://wiki.openoffice.org/wiki/Documentation/FAQ/Formula/How_do_I_change_the_spacing_around_my_formula%3f.
(In reply to comment #9) Great! I think this code might help someone even after the bug is fixed.
While I stated that this is similar to Bug 65067, this is quite different, though has much in common: this one is about wrong positioning of objects imported from another format (thus, distorting the document, making it look different than the original), while the mentioned issue is about defaults used to create new formulas in LO. This one should not be fixed by changing some defaults in a program or template; rather, the styles in the imported document (or even properties of individual objects, if they are different in different formulas in the original) should be set appropriately. The import code seems to simply skip the spacing properties of formula objects, so it may be a (DOC(X) and RTF) filter issue? Miklos, could you please take a look at this, and maybe advise on who should be notified on this? Thank you. And below is a slightly fixed version of the Basic macro posted above. The former code has one problem: if the document contain MathType objects not converted to Math, and MathType is installed, it will complain that "Too many windows are open". This is caused by string oModel = oMathObject.Model that, although returns null for non-LO objects, seems to trigger creating a (hidden?) window by MathType. (By the way, is there a way to force free the resources allocated by this?) The new version avoids this problem by checking GUID before dereferencing Model. Thus, the alternative method of testing model for support of service com.sun.star.formula.FormulaProperties is impossible here. Sub SetMathBorder On Error Resume Next ' Prevents deleted objects from causing errors. dim oEmbObject as Object for each oEmbObject in ThisComponent.getEmbeddedObjects() if oEmbObject.CLSID = "078B7ABA-54FC-457F-8551-6147e776a997" then ' Formula! dim oModel oModel = oEmbObject.Model if (not isNull(oModel)) then if (not isEmpty(oModel)) then with oEmbObject .LeftMargin = 0 .RightMargin = 0 .TopMargin = 0 .BottomMargin = 0 end with with oModel .LeftMargin = 0 .RightMargin = 0 .TopMargin = 0 .BottomMargin = 0 end with ' Update oEmbObject.ExtendedControlOverEmbeddedObject.Update() end if ' if not empty end if ' if not null end if ' if formula next ' oMathObject ThisComponent.Reformat() ' Updates all elements in the document End Sub
** 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 (4.4.1 or later) 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 your help! -- The LibreOffice QA Team This NEW Message was generated on: 2015-04-01
Reproduced. 3.5 already has extra space around the formula, even though the formula is invisible. Win 7 Pro 64-bit Version: 5.0.0.0.alpha0+ (x64) Build ID: 211c12b9c64facd1c12f637a5229bd6a6feb032a TinderBox: Win-x86_64@42, Branch:master, Time: 2015-04-18_01:51:17 Locale: fi_FI Ubuntu 14.10 64-bit LibreOffice 3.5.0rc3 Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
** 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.1.5 or 5.2.1 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-20160920
A patch sent for review: https://gerrit.libreoffice.org/32334
Mike Kaganski committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=c2a20af2c12bf75e7378a3a9dbc50a4dddabdebc tdf#66405: imported formulas should have all margins set to 0 It will be available in 5.4.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Hello Mike, Is this bug fixed? If so, could you please close it as RESOLVED FIXED?