https://bugs.freedesktop.org/show_bug.cgi?id=66405

Mike Kaganski <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #11 from Mike Kaganski <[email protected]> ---
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

-- 
You are receiving this mail because:
You are the assignee for the bug.
_______________________________________________
Libreoffice-bugs mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

Reply via email to