To comment on the following update, log in, then open the issue:
http://www.openoffice.org/issues/show_bug.cgi?id=51187
                  Issue #:|51187
                  Summary:|invalid work of macro changing case
                Component:|Word processor
                  Version:|OOo 2.0 Beta
                 Platform:|All
                      URL:|
               OS/Version:|All
                   Status:|UNCONFIRMED
        Status whiteboard:|
                 Keywords:|
               Resolution:|
               Issue type:|DEFECT
                 Priority:|P3
             Subcomponent:|editing
              Assigned to:|mru
              Reported by:|ckruk





------- Additional comments from [EMAIL PROTECTED] Fri Jun 24 06:38:55 -0700 
2005 -------
Macro changing the case of the letters works bad in some circumstances. Valid
sequence is:

xyz -> Xyz -> XYZ -> xyz 

meanwhile that macro stops when the string ends by Z, Ą, Ć, Ę, Ł, Ń, Ó, Ś, Ź, Ż
(capital Z and some Polish capitals):

ABCDEFGHIJKLMNOPQRSTUVWXYZ
AĄ
CĆ
EĘ
LŁ
NŃ
OÓ
SŚ
ZŹ
ZŻ

so you can't go from ``XYZ'' to ``xyz'' etc. 

It works also bad when the string ends by point:

Abc.

in that case you can't go from ``Abc.'' to ``ABC.'' -- it jumps immediately to
``abc.''. 


REM *** Changing the case of the letters ***

Sub big_case_cHanger
REM Andrew Brown
Dim oDocument, oDesktop as Object
Dim oText, alpha, omega as Object
Dim oVCursor, mySelection As Object
Dim snot, drool as string
oDesktop = createUnoService("com.sun.star.frame.Desktop")
oDocument= oDesktop.getCurrentComponent()
oText = oDocument.Text
oVCursor = oDocument.currentcontroller.getViewCursor()
snot=oVCursor.getString()
alpha=oVCursor.getStart()
omega=oVCursor.getEnd()
If len(snot)>0 Then
        mySelection = oText.createTextCursorByRange(alpha)
        mySelection.goToRange(omega,true)
        mySelection.CharCaseMap=0
        Else
                mySelection = oText.createTextCursorByRange(oVCursor.getstart())
                mySelection.gotoStartOfWord(false)
                mySelection.gotoEndOfWord(true)
                mySelection.CharCaseMap=0
End If
drool=mySelection.getString()
If (asc(LTrim(drool)) > 90) then
        mySelection.setString(UCase(left(drool,1))+LCase(mid(drool,2)))
        Elseif asc(right(RTrim(drool),1)) < 90 then
                myselection.setstring(LCase(drool))
        Else 
                mySelection.setString(UCase(drool))
End If
End Sub

---------------------------------------------------------------------
Please do not reply to this automatically generated notification from
Issue Tracker. Please log onto the website and enter your comments.
http://qa.openoffice.org/issue_handling/project_issues.html#notification

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to