Issue 14354 - insertString() does not select text in cells
Summary: insertString() does not select text in cells
Status: ACCEPTED
Alias: None
Product: Calc
Classification: Application
Component: code (show other issues)
Version: OOo 1.1 Beta2
Hardware: PC Windows 2000
: P3 Trivial (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-05-12 11:28 UTC by schulten
Modified: 2017-05-20 11:13 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description schulten 2003-05-12 11:28:42 UTC
I chose high priority, for this is an absolutely essential interface that 
should work completely.

After inserting a string into a cell text using insertString(aCursor, "some 
string", true) the inserted text is not selected by the cursor.

Example, oText is a *spreadsheet cell text*, which can be retrieved in the 
helper below.

Sub ManipulateText(oText as Variant)
	Dim clause1 as String, clause2 as String
	clause1 = "When Mr. Bilbo Baggins of Bag End announced that he would " 
+ _
		"shortly be celebrating his eleventy-first birthday,"
	clause2 = " there was much talk and excitement in Hobbiton"
	oText.setString(clause1 + clause2)
	
	oCursor = oText.createTextCursor()
	oCursor.gotoStart(false) 			'false: nicht markieren
	oCursor.goRight(len(clause1) - 1, false) 	'ans Ende von clause1

	oText.insertString(oCursor, _
		" with a party of special magnificence", true) 'true: markieren
'--------------------------------------------------------^^^^^ 
' the above use of true has no effect, no selection is made

	oCursor.setPropertyValue("CharWeight", _
		com.sun.star.awt.FontWeight.BOLD)	
'-------------------------------------------^^^^ hence bold is not applied
End Sub

Sub UseSpreadsheetDocument
	Dim noProps()
	oServiceManager = getProcessServiceManager() 'fest eingebaut
	oDesktop = oServiceManager.createInstance("com.sun.star.frame.Desktop")
	oDoc = oDesktop.loadComponentFromURL("private:factory/scalc", _
		"_blank", 0, noProps())
	oSheets = oDoc.getSheets()
	oSheet = oSheets.getByIndex(0)
	oCell = oSheet.getCellByPosition(0, 0)
	'oCell.setPropertyValue("IsTextWrapped", true)
	ManipulateText(oCell)
End Sub
Comment 1 frank 2003-05-12 15:10:13 UTC
Hi Joerg,

please have a look at the code.

Frank
Comment 2 joerg.skottke 2003-05-13 09:15:36 UTC
Andreas, this one is for you, i think...
Comment 3 ab 2003-05-13 10:34:38 UTC
-> Jörg: No, that is (most probably) an API/implementation problem in 
calc. In general it's only a Basic problem if for example the API 
independend part of a Basic program does not run or if the API only 
fails if accessed from Basic.
Comment 4 niklas.nebel 2003-05-16 18:23:10 UTC
The bAbsorb parameter of insertString doesn't control selecting the
text. It selects if the new text replaces the content of the text
range or is appended.

The IDL documentation doesn't say anything specifically whether the
new text is to be selected in the text range object. In a text
document, it is selected. Christian, you added the CollapseToEnd call
to SvxUnoTextBase::insertString, I guess for XML import. To have the
same behavior as in Writer, we should see if this is still necessary.
Comment 5 clippka 2003-05-19 10:04:53 UTC
will have a look at this
Comment 6 frank 2003-10-28 08:25:14 UTC
nothing for ms_interop., so no blocking of 21783
Comment 7 Marcus 2017-05-20 11:13:16 UTC
Reset assigne to the default "issues@openoffice.apache.org".