[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - librelogo/source

2013-06-25 Thread László Németh
 librelogo/source/LibreLogo/LibreLogo.py |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a4c9b22fffcc976339971431deff5241429ae066
Author: László Németh nem...@numbertext.org
Date:   Wed Jun 26 02:00:51 2013 +0200

fdo#66180 librelogo: clockwise HEADING

Change-Id: I1154b29119fd3fbb30d50246e94b3906bea24220

diff --git a/librelogo/source/LibreLogo/LibreLogo.py 
b/librelogo/source/LibreLogo/LibreLogo.py
index 2231646..bf925c8 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -722,7 +722,7 @@ def turnright(deg):
 def heading(deg = -1, go = False):
 turtle = __getshape__(__TURTLE__)
 if deg == -1:
-return turtle.RotateAngle / 100
+return -turtle.RotateAngle / 100 + 360
 else:
 if deg == u'any':
 turtle.RotateAngle = random.random() * 36000
@@ -739,7 +739,7 @@ def heading(deg = -1, go = False):
 if go and n  0:
 __go__(__TURTLE__, -n, False, a)
 else:
-turtle.RotateAngle = deg * 100
+turtle.RotateAngle = -deg * 100
 
 def rotate(shapename, deg):
 shape = __getshape__(shapename)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - librelogo/source

2013-05-02 Thread László Németh
 librelogo/source/LibreLogo/LibreLogo.py |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

New commits:
commit ac747088247fef5dca0acf417973bdf89128fcb1
Author: László Németh nem...@numbertext.org
Date:   Tue Apr 30 12:30:00 2013 +0200

fdo#64082 logo: fix hide/showturtle

Change-Id: I1aa1152940697f6390155871c0128519211abddd
Reviewed-on: https://gerrit.libreoffice.org/3696
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/librelogo/source/LibreLogo/LibreLogo.py 
b/librelogo/source/LibreLogo/LibreLogo.py
index 2fa250d..2231646 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -456,7 +456,7 @@ def __initialize__():
 _.doc.CurrentController.select(shape)
 shape.FillColor, transparence = __splitcolor__(_.areacolor)
 shape.LineColor, shape.LineTransparence = __splitcolor__(_.pencolor)
-else:
+elif shape.Visible:
 _.areacolor = shape.FillColor + (int(255.0 * 
shape.FillTransparence/100)  24)
 _.pencolor = shape.LineColor + (int(255.0 * 
shape.LineTransparence/100)  24)
 if shape.LineWidth != round((1 + _.pen * 2) * __PT_TO_TWIP__ / 
__MM10_TO_TWIP__) and shape.LineWidth != round(__LINEWIDTH__ / 
__MM10_TO_TWIP__):
@@ -513,7 +513,7 @@ def __visible__(shape, visible = -1): # for OOo 3.2 
compatibility
 
 def hideturtle():
 turtle = __getshape__(__TURTLE__)
-if turtle:
+if turtle and turtle.Visible:
 z = turtle.getPosition()
 z = __Point__(z.X + turtle.BoundRect.Width / 2.0, z.Y + 
turtle.BoundRect.Height / 2.0)
 turtle.PolyPolygon = __TURTLESHAPE__[1]
@@ -524,7 +524,7 @@ def hideturtle():
 
 def showturtle():
 turtle = __getshape__(__TURTLE__)
-if turtle:
+if turtle and not turtle.Visible:
 if not turtle.Parent:
 _.drawpage.add(turtle)
 z = turtle.getPosition()
@@ -532,12 +532,12 @@ def showturtle():
 turtle.PolyPolygon, turtle.RotateAngle = __TURTLESHAPE__[0], r
 z = __Point__(z.X - turtle.BoundRect.Width / 2.0, z.Y - 
turtle.BoundRect.Height / 2.0) 
 turtle.setPosition(z)
+__visible__(turtle, True)
 pencolor(_.pencolor)
 fillcolor(_.areacolor)
 pensize(_.pensize/__PT_TO_TWIP__)
-__visible__(turtle, True)
 _.doc.CurrentController.select(__getshape__(__TURTLE__))
-else:
+elif not turtle:
 __initialize__()
 
 def left(arg=None):
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - librelogo/source

2013-02-23 Thread László Németh
 librelogo/source/ChangeLog  |   23 
 librelogo/source/LibreLogo/LibreLogo.py |  158 ++--
 2 files changed, 136 insertions(+), 45 deletions(-)

New commits:
commit 8c34c877ff812d332299b61f846d869b52e2e42e
Author: László Németh nem...@numbertext.org
Date:   Sun Feb 24 04:06:43 2013 +0100

fdo#61376 librelogo: fix missing Asian and CTL support, etc.

Change-Id: If2d15d7b299d0b05e9fd3171d51c1f0e947ef561
Reviewed-on: https://gerrit.libreoffice.org/2355
Reviewed-by: Andras Timar ati...@suse.com
Tested-by: Andras Timar ati...@suse.com

diff --git a/librelogo/source/ChangeLog b/librelogo/source/ChangeLog
index f5112b3..6fb47c3 100644
--- a/librelogo/source/ChangeLog
+++ b/librelogo/source/ChangeLog
@@ -1,3 +1,26 @@
+2012-02-24 László Németh:
+* fix Asian and CTL language support. Language recognition depends from the
+  UI language of LibreOffice and the language(s) of the document.
+* fix turtle shape, the problem with the old arrow-like turtle shape
+  reported by teachers and other users of turtle graphics
+* better consistency with the UI based position and rotation settings of 
the
+  turtle: now Drawing Object toolbar supports also the pen color, fill
+  color and transparency, also line width settings of the turtle.
+* real dotted line works with rectangles, also with rounded corners
+* restore original cursor position and selection at the end of the running
+  (problem reported by Viktória Lakó)
+* fix 'sleep' (resulted by the new default non-integer division of Python 
3,
+  reported by Prof. Gilvan Vilarim)
+* fix 1-character length variable name/casing problem (reported by
+  Prof. Gilvan Vilarim)
+* fix false leading and ending function name recognition
+* support 'translation' of the selected text
+* fix bad line width settings after command 'home'
+* fix dot shape of dotted lines (remove its 0 width 'tail') by minimal dot
+  size of dotted lines: 1pt, and shorter 'tail' size
+* fix size of the rounded corners of the rectangle shape
+* rotation doesn't modify the size of the selection frame of the turtle
+
 2012-12-26 László Németh:
 * fix turtle position and rotation at repeated hideturtle/showturtle
 * add new languages, fix Czech and Brazilian Portuguese for
diff --git a/librelogo/source/LibreLogo/LibreLogo.py 
b/librelogo/source/LibreLogo/LibreLogo.py
index f797758..2fa250d 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -24,7 +24,6 @@ if vnd.sun.star.pathname in urebootstrap:
 else:
 __lngpath__ = 
unohelper.fileUrlToSystemPath(re.sub(program/(fundamental.ini|fundamentalrc)$,
 , urebootstrap))
 __lngpath__ = __lngpath__ + share/Scripts/python/LibreLogo/.replace(/, 
os.sep)
-
 __translang__ = 
am|ca|cs|de|dk|el|en|eo|es|et|fr|hu|it|ja|nl|no|pl|pt|ru|se|sl # FIXME 
supported languages for language guessing, expand this list, according to the 
localizations
 __lng__ = {}
 __docs__ = {}
@@ -122,6 +121,7 @@ from com.sun.star.awt import Size as __Size__
 from com.sun.star.awt import WindowDescriptor as __WinDesc__
 from com.sun.star.awt.WindowClass import MODALTOP as __MODALTOP__
 from com.sun.star.awt.VclWindowPeerAttribute import OK as __OK__ 
+from com.sun.star.awt.VclWindowPeerAttribute import OK_CANCEL as __OK_CANCEL__ 
 from com.sun.star.awt.VclWindowPeerAttribute import YES_NO_CANCEL as 
__YES_NO_CANCEL__ # OK_CANCEL, YES_NO, RETRY_CANCEL, DEF_OK, DEF_CANCEL, 
DEF_RETRY, DEF_YES, DEF_NO
 from com.sun.star.awt.PushButtonType import OK as __Button_OK__
 from com.sun.star.awt.PushButtonType import CANCEL as __Button_CANCEL__
@@ -133,6 +133,10 @@ def __getprop__(name, value):
 p, p.Name, p.Value = __property__(), name, value
 return p
 
+__uilocale__ = 
uno.getComponentContext().ServiceManager.createInstance(com.sun.star.configuration.ConfigurationProvider).\
+
createInstanceWithArguments(com.sun.star.configuration.ConfigurationAccess,\
+(__getprop__(nodepath, 
/org.openoffice.Setup/L10N),)).getByName(ooLocale) + '-' # handle missing 
Country of locale 'eo'
+
 def __l12n__(lng):
 try:
 return __lng__[lng]
@@ -145,17 +149,16 @@ def __l12n__(lng):
 return None
 
 # dot for dotted line (implemented as an array of dot-headed arrows, because 
PostScript dot isn't supported by Writer)
+def __gendots__(n):
+return [__Point__(round(sin(360.0/n * i * pi/180.0) * 600), 
round(cos(360.0/n * i * pi/180) * 600)) for i in range(n)]
 __bezierdot__ = __Bezier__()
-__dots__ = []
-for i in range(32):
-__dots__ += [__Point__(round(sin(360.0/32 * i * pi/180.0) * 1000), 
round(cos(360.0/32 * i * pi/180) * 1000))]
-__bezierdot__.Coordinates = (tuple(__dots__),)
+__bezierdot__.Coordinates = (tuple(__gendots__(32)),)
 __bezierdot__.Flags = ((0,) * 32,)
 
 # turtle shape
-__TURTLESHAPE__ = [((__Point__(-60, 0), __Point__(0, -100), __Point__(60, 0)), 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - librelogo/source

2013-02-07 Thread László Németh
 librelogo/source/LibreLogo/LibreLogo.py |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0dea073b03de7a40414150e8b0ca0814ca106ede
Author: László Németh nem...@numbertext.org
Date:   Thu Feb 7 10:53:35 2013 +0100

fdo#60406 librelogo: fix name conflict in procedure handling

Change-Id: I05efe58e38b7c2183ecc733b6db45ec6fa04cab7
Reviewed-on: https://gerrit.libreoffice.org/2024
Reviewed-by: Miklos Vajna vmik...@suse.cz
Tested-by: Miklos Vajna vmik...@suse.cz

diff --git a/librelogo/source/LibreLogo/LibreLogo.py 
b/librelogo/source/LibreLogo/LibreLogo.py
index 3dc6140..f797758 100644
--- a/librelogo/source/LibreLogo/LibreLogo.py
+++ b/librelogo/source/LibreLogo/LibreLogo.py
@@ -1368,7 +1368,7 @@ def __compil__(s):
 # add line breaks before procedure calls
 procedures = set(subnames) - set(functions)
 if len(procedures)  0:
-s = re.sub(r(?!__def__)(?![-+=*/])(?!%s)(?:^|[ \t]+)( % 
)(?!.join(functions) + |.join(procedures) + ), r\n\1, s)
+s = re.sub(r(?!__def__)(?![-+=*/])(?!%s)(?:^|[ \t]+)( % 
)(?!.join(functions) + |.join(procedures) + )(?!\w), r\n\1, s)
 
 # compile native Logo
 for i in __comp__[_.lng]:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits