[Libreoffice] [PATCH] Making default tab prefix name configurable in Calc

Albert Thuswaldner albert.thuswaldner at gmail.com
Mon Feb 13 06:52:47 PST 2012


On Mon, Feb 13, 2012 at 12:23, Noel Power <nopower at suse.com> wrote:
> On 09/02/12 14:53, Albert Thuswaldner wrote:

>>> 2) When trying to delete text in the edit box, the last character
>>> sticks (can't be deleted).
>
> well that would seem to be because your code thinks a blank prefix is
> illegal, I believe changing
>
>  -    if ( !ScDocument::ValidTabName( aSheetPrefix ) )
> +    if ( !aSheetPrefix.isEmpty() && !ScDocument::ValidTabName( aSheetPrefix
> ) )
>     {
>         // Revert to last good Prefix
>         pEdit->SetText( maOldPrefixValue );
>     }
>
> will fix that
>

Agggh, your right :)

On Mon, Feb 13, 2012 at 13:11, Noel Power <nopower at suse.com> wrote:
> On 09/02/12 14:53, Albert Thuswaldner wrote:
>
> If it was up to me I would go for the visual bell. Any thoughts on this?
>
> actually thinking about it some more I don't find it unnatural to have the
> whole ( reverted ) prefix selected after entering an illegal character ( I
> think this is a technique used elsewhere anyway ) In addition to providing a
> cue that you have typed something bad this approach has the added advantage
> of solving the cursor problem for you too ;-)
>
> e.g.
>
>         // Revert to last good Prefix
>         Selection aSel( 0,  maOldPrefixValue.getLength() );
>         pEdit->SetText( maOldPrefixValue, aSel );
>
> Not sure what others think about above but if I hear no real negative
> reaction then I'd be inclined to push this
>
> p.s. of course you can use the 'Selection'
>   Selection aSel( maOldPrefixValue.getLength(),
> maOldPrefixValue.getLength() )
>
> to trick SetText to display the cursor at the end. This is a bit hacky, the
> alternative is you will probably need to modify the cursor position
> directly, that is, unless there is some existing public method on Edit (
> which there might be but I didn't see in the myriad of 'Edit' methods )

Yes I vote for pushing this as you suggested. It is a cheap solution
for now, and done elsewhere in the code, so at least we are consistent
then.

Saw the ideas from Markus and Stefan regarding the range name dialog:

https://wiki.documentfoundation.org/Design/Whiteboard/Calc_Range_Names

A mode-less window (i.e balloon) would be an option for a future
improvement. But I guess we leave that for now until we have a
consensus on going down that route.

Noel: can you push the patch with your changes  or do you want me to tweek it?

/Albert


More information about the LibreOffice mailing list