OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

ctrl-shift-delete OpenOffice2.0 Writter

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer
View previous topic :: View next topic  
Author Message
mikebaxter281
Newbie
Newbie


Joined: 22 Nov 2005
Posts: 3

PostPosted: Tue Nov 22, 2005 12:15 pm    Post subject: ctrl-shift-delete OpenOffice2.0 Writter Reply with quote

Greetings all-

ctrl-shift-delete in 2.0 Writter seems to always delete 2 sentances, or 2 periods rather than one. When I am in the middle of a sentance, I hit ctrl-shift-delete and it deletes the current sentence and the previous one. I expected that it would just delete just the current one.

This problem is true in Windows XP, or Linux version 2.0.0-1.

I've Googled this and haven't seen much on it, so I'm guessing I'm just missing something. I tried to configure the shortcut keys (Tools-Customize), but to no avail.

Debian, stock 2.6.12 kernel, i686.

Thanks in advance for any help on this one.
Back to top
View user's profile Send private message
billyboy
Super User
Super User


Joined: 08 Sep 2005
Posts: 504
Location: Belfast, Northern Ireland

PostPosted: Tue Nov 22, 2005 2:11 pm    Post subject: Reply with quote

Using OOo 2.0 and Win XP, Ctrl+Del deletes everything from the cursor position to the end of a word. Ctrl+Shift+Del deletes everything from the cursor position to the end of a sentence.
It doesn't (or shouldn't) delete anything previous to the cursor.
Are you sure you haven't altered things in Customise?
_________________
OOo-DEV 3.4 -Seamonkey, Firefox & Thunderbird trunk - Win Vista HB
==============================================
Creation
Answers
Back to top
View user's profile Send private message
mikebaxter281
Newbie
Newbie


Joined: 22 Nov 2005
Posts: 3

PostPosted: Tue Nov 22, 2005 2:45 pm    Post subject: ctrl-shift-backspace Reply with quote

OK, I'm changing my tune a little bit. ctrl-shift-delete does work properly. It is ctrl-shift-backspace that doesn't in accordance to my previous posting.

I'm sure I haven't messed anything up in Customize. There are full sentence delete events that you can trigger by of the keyboard. One delets everything to the right of the cursor (ctrl-shift-delete), which works fine. The other is supposed to delete everything to the left of the cursor (ctrl-shift-backspace). This second event displays the problematic behavior.

Mike
Back to top
View user's profile Send private message
billyboy
Super User
Super User


Joined: 08 Sep 2005
Posts: 504
Location: Belfast, Northern Ireland

PostPosted: Tue Nov 22, 2005 3:18 pm    Post subject: Reply with quote

You're right. The Ctrl+Shift+Backspace key combination deletes more than it should. Time to do a bug search.
_________________
OOo-DEV 3.4 -Seamonkey, Firefox & Thunderbird trunk - Win Vista HB
==============================================
Creation
Answers
Back to top
View user's profile Send private message
patb
General User
General User


Joined: 01 Aug 2004
Posts: 32
Location: Canberra, Aus.

PostPosted: Sun Apr 02, 2006 5:05 pm    Post subject: Reply with quote

This problem still occurs in OOo ver 2.0.2. Also, the Writer functions "To previous sentence" and "Select to previous sentence" both take the cursor to the beginning, not the end, of the previous sentence. If that was the intention, it seems strange. It makes problems for writing macros for manipulation of the current sentence eg to delete the sentence or set sentence case. In contrast, triple clicking faithfully selects the one sentence, but I am not aware of any underlying Writer function which will achieve the same thing. I would appreciate any suggestions on a simple macro command which will select the current sentence. Cheers, Pat.
Back to top
View user's profile Send private message
patb
General User
General User


Joined: 01 Aug 2004
Posts: 32
Location: Canberra, Aus.

PostPosted: Sat Apr 15, 2006 3:35 pm    Post subject: Ctrl+Shift+Backspace Reply with quote

Since I have not seen any solution to this apparent bug, the following macro might be of use in Writer. It could be bound to the Ctrl+Shift+Backspace key combination.

Cheers, Pat.
Code:
sub DeleteSentence
'msgbox "OOo bug recognising start of current sentence makes life difficult"
   dim document, dispatcher, cursor As Object
     dim seln, preseln as string
     dim loops, endBitLen as integer
   dim args1(1) as new com.sun.star.beans.PropertyValue
   args1(0).Name = "Count"
   args1(0).Value = 1
   args1(1).Name = "Select"
   args1(1).Value = False
   document   = ThisComponent.CurrentController.Frame
   dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
   cursor = ThisComponent.currentcontroller.getViewCursor()
   cursor.collapsetoStart() 'get into first sentence if there is a seln
   dispatcher.executeDispatch(document, ".uno:GoToNextSentence", "", 0, Array())
   dispatcher.executeDispatch(document, ".uno:WordLeftSel", "", 0, Array()) 'avoid last punct mark
   seln=cursor.getString()
   endBitLen=len(seln)
   cursor.collapsetoStart() 'get into our sentence
   dispatcher.executeDispatch(document, ".uno:GotoPrevSentenceSel", "", 0, Array())
   seln=cursor.getString() 'probably have >1 sentence due to bug
   cursor.collapsetoEnd() 'not to start because of bug
   if len(seln)<1 then 'seln too short. end doc? empty doc?
      goto Finish
   end if
   do while loops<5 and len(seln)>0
      if asc(seln)=32 then 'omit leading spaces
         seln=mid(seln,2)
      endif
      if (instr(seln,"."))>0 then
         seln=mid(seln,(instr(seln,".")+1)
      endif
      if (instr(seln,"?"))>0 then
         seln=mid(seln,(instr(seln,"?")+1)
      endif
      if (instr(seln,"!"))>0 then
         seln=mid(seln,(instr(seln,"!")+1)
      endif
      loops=loops+1
   loop
   cursor.goLeft(len(seln), False)
   cursor.goRight(len(seln)+endBitLen, True)
' The whole sentence is now selected. 
   dispatcher.executeDispatch(document, ".uno:Delete", "", 0, Array())
 Finish:
end sub
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Writer All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group