This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch AOO50X
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit 52f0336fc585060e007097d038bb9582a7115033
Author: Jean-Michel COSTE <[email protected]>
AuthorDate: Tue Oct 20 14:52:48 2026 +0200

    Capitalise.py: avoid error with multiple selections (#494)
    
    (cherry picked from commit 72adfe535722e5f3e3a3d41f73bce3536aa50c62)
---
 main/scripting/examples/python/Capitalise.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/main/scripting/examples/python/Capitalise.py 
b/main/scripting/examples/python/Capitalise.py
index 81198284cc..c51b08a687 100644
--- a/main/scripting/examples/python/Capitalise.py
+++ b/main/scripting/examples/python/Capitalise.py
@@ -55,7 +55,7 @@ def capitalisePython( ):
             xTextRange = xIndexAccess.getByIndex(i);
             #print "string: " + xTextRange.getString();
             theString = xTextRange.getString();
-            if len(theString)==0 :
+            if len(theString)==0 and count==1: # Prevents an error if there 
are multiple selections.
                 # sadly we can have a selection where nothing is selected
                 # in this case we get the XWordCursor and make a selection!
                 xText = xTextRange.getText();

Reply via email to