Issue 2449 - Cannot get CharCaseMap from a textrange
Summary: Cannot get CharCaseMap from a textrange
Status: CLOSED IRREPRODUCIBLE
Alias: None
Product: App Dev
Classification: Unclassified
Component: api (show other issues)
Version: 3.3.0 or older (OOo)
Hardware: Other Other OS
: P3 Trivial
Target Milestone: ---
Assignee: ooo
QA Contact: issues@api
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2001-12-05 18:38 UTC by ingenstans
Modified: 2013-02-24 21:07 UTC (History)
1 user (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 ingenstans 2001-12-05 18:38:36 UTC
It looks as if the property CharCaseMap is write-only at the moment.
I can set a word to lowercase 
with code like: 

oCursor.CharCaseMap=com.sun.star.style.CaseMap.LOWERCASE 

but 
if I try to examine the state of this property, it breaks:

dim sCase as 
short
...
sCase=oCursor.CharCaseMap

gives an error, as 
does

oCursor.CharCaseMap=com.sun.star.style.CaseMap.LOWERCASE
msgbox "Case= " + 
oCursor.GetPropertyState("CharCaseMap")

Both say that the property is missing, 
although I have just set it.
Comment 1 ingenstans 2001-12-06 10:27:23 UTC
It turns out that there is a way to do 
this:

vCursor.getPropertyValue("CharCaseMap") returns the property 
which,
according to the API documentation, should be returned by 

vCursor.CharCaseMap(). I think the documentation should be changed.
Comment 2 ooo 2001-12-17 09:34:47 UTC
for a OpenOffice.org/Writer version 641c document: this works:

oCursor = ThisComponent.getText().createTextCursor()
' msgoCursor = ThisComponent.getText().createTextCursor()
oCursor.CharCaseMap=com.sun.star.style.CaseMap.LOWERCASE
msgbox "Case= " + oCursor.GetPropertyState("CharCaseMap")box
oCursor.dbg_supportedinterfaces
print oCursor.GetPropertyState( "CharCaseMap" ) 

this works too:
oCoCursor = ThisComponent.getText().createTextCursor()
oCursor.CharCaseMap=com.sun.star.style.CaseMap.LOWERCASE
msgbox "Case= " + oCursor.GetPropertyState("CharCaseMap")ursor =
ThisComponent.getText().createTextCursor()
' msgbox oCursor.dbg_supportedinterfaces
print oCursor.getPropertyState( "CharCaseMap" ) 

so does this:

oCursor = ThisComponent.getText().createTextCursor()
' msgbox oCursor.dbg_supportedinterfaces
print oCursor.getPropertyValue( "CharCaseMap" ) 

and this:

oCursor = ThisComponent.getText().createTextCursor()
' msgbox oCursor.dbg_supportedinterfaces
print oCursor.CharCaseMap

and finally this works too:

ThisComponent.getText().createTextCursor()
oCursor.CharCaseMap=com.sun.star.style.CaseMap.LOWERCASE
msgbox "Case= " + oCursor.GetPropertyState("CharCaseMap")
In YOUR first example, there seems to be a problem with the "dim sCase
as short" you might report this to the scripting project at OOo, but
that was obvioisly not your problem here.

And we most definitely do not document a buggy behaviour.  Both ways
should work and both ways do work. 
Comment 3 ooo 2003-01-10 10:23:19 UTC
no further comments?  => closing