[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice
Subject: Re: Patch for kspread_editors.cc
From: Ferdinand Gassauer s <gassauer () kde ! org>
Date: 2002-08-26 18:33:01
[Download RAW message or body]
Norbert Andres wrote:
> Thanks for that code.
>
> Please allow a few days for checking this and putting in (if nobody else
> does - unfortunately I have no time for KSpread in the next two days).
> What about this idea: prepending the '=' only if there are just numbers in
> there and an operator which is not at the beginning. If ' is the first
> character don't prepend anything, but remove the ' and pass it on. I will
> check tomorrow (at work) how Excel behaves.
Well I thougth, that in edit mode you migth start with a formula and end up
with a number
Example
=A4-3
remove A4
it would stay a formula, but should automagicaly be transformed in a negativ
number.
So if my code realy works (never wrote c or c++ before), it has to be done
leaving enter or edit mode (Hitting <ENTER> or eventualy other cursor
keys).
>
> Regards
> Norbert
>
> On Monday 26 August 2002 15:36, Ferdinand Gassauer wrote:
>> Norbert Andres wrote:
>> > I'm not sure if I like it. I tested it and have one concern:
>> >
>> > if I wanted to insert just a negative number, e.g. -14, KSpread creates
>> > a formula: =-14. Can you improve it to e.g. remove the "=" if there is
>> > no other operator?
>> >
>> > Regards
>> > Norbert
>> >
>> > On Sunday 25 August 2002 15:12, Ferdinand Gassauer wrote:
>> >> Hi!
>> >> Hope that it is not to late for 1.2
>> >> Please check
>>
>> I wrote a piece of code, but I do not know where to put it
>> it should run on leaving the edit mode.
>>
>> QString t1( m_pEdit->text());
>> if ( t1[0] == '=' )
>> {
>> // check matching pattern - formula with signed values only
>> QRegExp exp("(=)([+-])([0-9]+)");
>> int n = exp.search(t1);
>>
>> if ( n == 1 ) // FIX ME - which value ?
>> {
>> t1 = m_pEdit->text().right(0);
>> if (t1[0] == '+')
>> t1 = m_pEdit->text().right(1);
>>
>> m_pEdit->setText(t1);
>> }
>> }
>>
>> apparently my first reply didn't hit the list
____________________________________
koffice mailing list
koffice@mail.kde.org
To unsubscribe please visit:
http://mail.kde.org/mailman/listinfo/koffice
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic