All pastes #3992044 Raw Edit

Miscellany

public unlisted text v1 · immutable
#3992044 ·published 2018-03-05 15:09 UTC
rendered paste body
sub JoinParas
  Dim oCurrentController As Variant
  Dim oViewCursor As Variant
  Dim oText As Variant
  Dim oObj1 As Variant
  Dim oObj2 As Boolean
  Dim oObj3 As Boolean
  Dim sString As String

  oCurrentController = ThisComponent.getCurrentController()
  oViewCursor = oCurrentController.getViewCursor()
  oText = oViewCursor.getText()
  
  oObj1 = oText.createTextCursorByRange(oViewCursor)
  oObj1.gotoEndOfParagraph(False)
  oObj1.goLeft(1, True)
  
  sString = oObj1.getString()
  oObj1.collapseToEnd()
  oObj1.gotoEndOfParagraph(False)
  oViewCursor.gotoRange(oObj1, False)
	document   = oCurrentController.Frame
	dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")	  
  if sString = "。" then

	rem ----------------------------------------------------------------------
	dispatcher.executeDispatch(document, ".uno:Delete", "", 0, Array())
  else
  	dispatcher.executeDispatch(document, ".uno:GoToNextPara", "", 0, Array())
  end if


end sub