No proper way to run SCI_GETTEXT

Bug #646064 reported by masmullin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scintilla Cocoa
New
Undecided
Unassigned

Bug Description

setStringProperty is not the way to use SCI_GETTEXT.

I've solved this in my mpatch directory via adding the following to ScintillaView

@interface
- (void) setCharProperty: (int) property parameter: (long) parameter value: (char*) value;

@implementation
/**
 * Specialized property setter setting char* out parameters
 */

- (void) setCharProperty: (int) property parameter: (long) parameter value: (char*) value
{
  mBackend->WndProc(property, parameter, (sptr_t) value);
}

Revision history for this message
Mike Lischke (mike-lischke) wrote :

What is wrong with setStringProperty? Do you work with char* pointers in your application instead NSString? Note: for SCI_SETTEXT there is a special method

- (void) setString: (NSString*) aString

Revision history for this message
masmullin (masmullin) wrote :

Hi Mike

here is how I use the setCharProperty
http://bazaar.launchpad.net/~masmullin/codeassistor/trunk/annotate/head%3A/src/ui/MyEditorCommon.xc

first: upon further review, my usage of the prefix "set" is incorrect. This is a getter function. Sorry about the confusion

second: The usage of SCI_GETTEXT/SCI_GETLINE/etc(int length, char *text) is to get Scintilla to fill the c-style string (char* text) with document text, set/getStringProperty do not do this. setReferenceProperty uses a const void* for value, thus preventing it's usage for GETLINE/GETTEXT. [ScintillaView string] does work for GETTEXT, but not for GETLINE et.al

third: while yes I use char* (because CodeAssistor is xplatform), the issue is that Scintilla internals use char*

fourth: why the SETSAVEPOINT in [ScintillaView string]?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.