Date: prev next · Thread: first prev next last
2018 Archives by date, by thread · List index


Mir gelingt es nicht, in LO Draw (5.3 - 5.4, openSUSE, Windows 10) einen nutzerdefinierten GluePoint für Verbinder korrekt zu setzen. Ich bitte darum, das zu testen. Vielleicht ist es ein Problem vor der Tastatur oder bei LO.

Der folgende Code funktioniert in AOO (3.. bis 4.1.4).

Das Makro erzeugt ein neues Draw-Dokument und versucht, StartGluePoints mittig in Rechtecke zu setzen. Stattdessen starten die Verbinder jeweils an der rechten unteren Ecke. Bei AOO starten sie brav in der Mitte.

Sub DrawConnector()
  Dim oDoc, oPage, oRect(2), oConn, oGlue
  Dim oSize As New com.sun.star.awt.Size
  Dim oPos As New com.sun.star.awt.Point
  Dim i%

oDoc = StarDesktop.loadComponentFromUrl("private:factory/sdraw", "_blank", 0, Array())

  oPage = oDoc.DrawPages.getByIndex(0)
  oSize.Width = 1500
  oSize.Height = 1000
  For i = 0 To 2
    oRect(i) = oDoc.createInstance("com.sun.star.drawing.RectangleShape")
    oPage.add(oRect(i))
    oRect(i).Size = oSize
  Next
  For i = 0 To 2
    oPos.X = (i + 1) * 4000
    oPos.Y = 2000 + ((i + 1) Mod 3) * 2000
    oRect(i).Position = oPos
    oConn = oDoc.createInstance("com.sun.star.drawing.ConnectorShape")
    oPage.add(oConn)
    oConn.StartShape = oRect(i)
    oConn.EndShape = oRect((i + 1) Mod 3)
    oConn.EdgeKind = com.sun.star.drawing.ConnectorType.STANDARD

    oGlue = CreateUnoStruct("com.sun.star.drawing.GluePoint2")
    oGlue.IsRelative = False
    oGlue.Escape = com.sun.star.drawing.EscapeDirection.SMART
    oGlue.PositionAlignment = com.sun.star.drawing.Alignment.CENTER
    oGlue.IsUserDefined = True
    oGlue.Position.X = oRect(i).Position.X + 750
    oGlue.Position.Y = oRect(i).Position.Y + 500
    oConn.StartGluePointIndex = oRect(i).GluePoints.insert(oGlue)
  Next
End Sub

Schöne Grüße
Volker

--
Liste abmelden mit E-Mail an: users+unsubscribe@de.libreoffice.org
Probleme? https://de.libreoffice.org/hilfe-kontakt/mailing-listen/abmeldung-liste/
Tipps zu Listenmails: https://wiki.documentfoundation.org/Netiquette/de
Listenarchiv: https://listarchives.libreoffice.org/de/users/
Alle E-Mails an diese Liste werden unlöschbar öffentlich archiviert

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.