Seite 1 von 1

Writer: Position.X

Verfasst: Mo 11. Apr 2011, 11:27
von jona99
Ich habe LibreOffice 3.3.2 auf WinXPSP3 installiert.
Seiten-Margin sind alle auf 2cm eingestellt.

Makro im Dokument abspeichern (Standard.Module1).
Cursor in Writer auf den Anfang des Dokuments stellen.
Aufruf mit Extras->Makros-Makro ausführen->...

Der untenstehende Code liefert: x=616 y=0
(mit und ohne auskommentierte Zeilen)

Ich würde aber x=0 erwarten.
Weiss jemand warum ?

Danke

Code: Alles auswählen

option explicit
sub test
    dim doc
    dim vc
    doc = thiscomponent
    vc  = doc.currentcontroller.viewcursor
    'doc.getCurrentController.getFrame.getContainerWindow.tofront
    'doc.getCurrentController.getFrame.getContainerWindow.setFocus
    msgbox "x=" & vc.Position.X & " y=" & vc.Position.y
end sub 

Re: Writer: Position.X

Verfasst: Mo 11. Apr 2011, 12:15
von devdol
Hallo Jona99,

Dein Makro liefert bei mir in einem leeren Writer-Dokument die erwartungsgemäßen "x=0 y=0" tatsächlich immerhin unter Linux.
Auch wenn ich nichts näheres zu den Ursachen sagen kann, weist das vielleicht darauf hin, daß diese nicht im Makro selbst zu suchen sind.

Getestete Softwareumgebungen:
1) LibreOffice 3.3.2 (Build 202) auf Debian Linux -> "x=0 y=0"
2) LibreOffice 3.3.0 (OOO330m19) auf Windows 7 64bit -> "x=1397 y=0"
3) LibreOffice 3.3.2 (OOO330m19 (Build:202), tag libreoffice-3.3.2.2) auf Windows 7 64bit -> "x=1397 y=0"

Re: Writer: Position.X

Verfasst: Mo 11. Apr 2011, 15:31
von jona99
Ich bin schon froh, dass es nicht an meinem PC liegt.
Also eher ein Windows-Problem.

Re: Writer: Position.X

Verfasst: Di 12. Apr 2011, 08:10
von jona99
Zusammenfassung:

Correct Result: x=0 y=0
OOo 2.3.0, WinXP SP3
LibreOffice 3.3.2 (Build 202), Debian Linux

Wrong Result: x!=0 y=0
OOo 3.2.0, WinXP SP3 -> "x=616 y=0"
Ooo 3.3.0, WinXP SP3 -> "x=616 y=0"
LibreOffice 3.3.0 (OOO330m19), Windows 7 64bit -> "x=1397 y=0"
LibreOffice 3.3.2 (OOO330m19 (Build:202), tag libreoffice-3.3.2.2), Windows 7 64bit -> "x=1397 y=0"