|
List Info
Thread: strange value of (ItemEvent).Selected
|
|
| strange value of (ItemEvent).Selected |

|
2007-04-09 17:59:28 |
Hi,
Using an ItemListener, I wanted to know if the action that
triggered the
listener was a selection or anything else. I don't find
another way that
to find the value of oEvt.Selected returned when it's not a
selection
and to verify that value.
The value returned is 65535. All is working fine now, but I
wonder why
THAT value ?
Does someone know something about that ?
Here's the code of the CspListBoxListener::itemStateChanged
method :
------------------------------------------------------------
-----------
void CspListBoxListener::itemStateChanged( const
awt::ItemEvent& oEvt )
throw ( RuntimeException )
{
//For an unknown reason, 65535 seems to be the value for a
deselection
if(oEvt.Selected != 65535){
getDialog()->getAddonImpl()->setSelectedCsp(oEvt.Selec
ted);
((SolverDialog*)getDialog())->updateButtonsState(oEvt.Sel
ected);
}
}
------------------------------------------------------------
------------
Thanks,
Mikael
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: strange value of
(ItemEvent).Selected |

|
2007-04-09 21:39:59 |
As a signed value, this would be "-1", which might
mean that nothing was
selected...
just a guess.
Mikael De Bie wrote:
> Hi,
>
> Using an ItemListener, I wanted to know if the action
that triggered the
> listener was a selection or anything else. I don't find
another way that
> to find the value of oEvt.Selected returned when it's
not a selection
> and to verify that value.
>
> The value returned is 65535. All is working fine now,
but I wonder why
> THAT value ?
>
> Does someone know something about that ?
>
> Here's the code of the
CspListBoxListener::itemStateChanged method :
>
>
------------------------------------------------------------
-----------
> void CspListBoxListener::itemStateChanged( const
awt::ItemEvent& oEvt )
> throw ( RuntimeException )
> {
> //For an unknown reason, 65535 seems to be the value
for a deselection
> if(oEvt.Selected != 65535){
>
getDialog()->getAddonImpl()->setSelectedCsp(oEvt.Selec
ted);
>
((SolverDialog*)getDialog())->updateButtonsState(oEvt.Sel
ected);
> }
> }
>
------------------------------------------------------------
------------
>
>
> Thanks,
>
> Mikael
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
> For additional commands, e-mail: dev-help api.openoffice.org
>
>
--
Andrew Pitonyak
My Macro Document: http://www.pi
tonyak.org/AndrewMacro.odt
My Book: http://w
ww.hentzenwerke.com/catalog/oome.htm
Info: http://www.pitonyak.or
g/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: strange value of
(ItemEvent).Selected |

|
2007-04-09 22:19:54 |
On Mon, 2007-04-09 at 22:39 -0400, Andrew Douglas Pitonyak
wrote:
> As a signed value, this would be "-1", which
might mean that nothing was
> selected...
That's what I've guessed too, but the value I get is always
65535.
That's why I'm wondering about that...
if someone knows another way to know if the action listened
is a
selection or anything else, let me know...
cheers
Mikael
> Mikael De Bie wrote:
> > Hi,
> >
> > Using an ItemListener, I want to know if the
action that triggers the
> > listener is a selection or anything else. I don't
find another way that
> > to find the value of oEvt.Selected returned when
it's not a selection
> > and to verify that value.
> >
> > The value returned is 65535. All is working fine
now, but I wonder why
> > THAT value ?
> >
> > Does someone know something about that ?
> >
> > Here's the code of the
CspListBoxListener::itemStateChanged method :
> >
> >
------------------------------------------------------------
-----------
> > void CspListBoxListener::itemStateChanged( const
awt::ItemEvent& oEvt )
> > throw ( RuntimeException )
> > {
> > //For an unknown reason, 65535 seems to be the
value for a deselection
> > if(oEvt.Selected != 65535){
> >
getDialog()->getAddonImpl()->setSelectedCsp(oEvt.Selec
ted);
> >
((SolverDialog*)getDialog())->updateButtonsState(oEvt.Sel
ected);
> > }
> > }
> >
------------------------------------------------------------
------------
> >
> >
> > Thanks,
> >
> > Mikael
> >
> >
------------------------------------------------------------
---------
> > To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
> > For additional commands, e-mail: dev-help api.openoffice.org
> >
> >
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: strange value of
(ItemEvent).Selected |

|
2007-04-10 03:37:16 |
Mikael De Bie wrote:
> On Mon, 2007-04-09 at 22:39 -0400, Andrew Douglas
Pitonyak wrote:
>> As a signed value, this would be "-1",
which might mean that nothing was
>> selected...
>
> That's what I've guessed too, but the value I get is
always 65535.
> That's why I'm wondering about that...
>
> if someone knows another way to know if the action
listened is a
> selection or anything else, let me know...
This smells like a bug where some internal C/C++ unsigned
short 65535
(corresponding to signed short -1, presumably a special
internal value
representing "nothing selected") is converted into
a UNO long in a wrong
way. You should file an issue.
-Stephan
> cheers
>
> Mikael
>
>
>> Mikael De Bie wrote:
>>> Hi,
>>>
>>> Using an ItemListener, I want to know if the
action that triggers the
>>> listener is a selection or anything else. I
don't find another way that
>>> to find the value of oEvt.Selected returned
when it's not a selection
>>> and to verify that value.
>>>
>>> The value returned is 65535. All is working
fine now, but I wonder why
>>> THAT value ?
>>>
>>> Does someone know something about that ?
>>>
>>> Here's the code of the
CspListBoxListener::itemStateChanged method :
>>>
>>>
------------------------------------------------------------
-----------
>>> void CspListBoxListener::itemStateChanged(
const awt::ItemEvent& oEvt )
>>> throw ( RuntimeException )
>>> {
>>> //For an unknown reason, 65535 seems to be the
value for a deselection
>>> if(oEvt.Selected != 65535){
>>>
getDialog()->getAddonImpl()->setSelectedCsp(oEvt.Selec
ted);
>>>
((SolverDialog*)getDialog())->updateButtonsState(oEvt.Sel
ected);
>>> }
>>> }
>>>
------------------------------------------------------------
------------
>>>
>>>
>>> Thanks,
>>>
>>> Mikael
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: strange value of
(ItemEvent).Selected |

|
2007-04-10 07:46:53 |
Is this a 64 bit version, or the standard build?
Stephan Bergmann wrote:
> Mikael De Bie wrote:
>> On Mon, 2007-04-09 at 22:39 -0400, Andrew Douglas
Pitonyak wrote:
>>> As a signed value, this would be
"-1", which might mean that nothing
>>> was selected...
>>
>> That's what I've guessed too, but the value I get
is always 65535.
>> That's why I'm wondering about that...
>>
>> if someone knows another way to know if the action
listened is a
>> selection or anything else, let me know...
>
> This smells like a bug where some internal C/C++
unsigned short 65535
> (corresponding to signed short -1, presumably a special
internal value
> representing "nothing selected") is converted
into a UNO long in a
> wrong way. You should file an issue.
>
> -Stephan
>
>> cheers
>>
>> Mikael
>>
>>
>>> Mikael De Bie wrote:
>>>> Hi,
>>>>
>>>> Using an ItemListener, I want to know if
the action that triggers the
>>>> listener is a selection or anything else. I
don't find another way
>>>> that
>>>> to find the value of oEvt.Selected returned
when it's not a selection
>>>> and to verify that value.
>>>>
>>>> The value returned is 65535. All is working
fine now, but I wonder why
>>>> THAT value ?
>>>>
>>>> Does someone know something about that ?
>>>>
>>>> Here's the code of the
CspListBoxListener::itemStateChanged method :
>>>>
>>>>
------------------------------------------------------------
-----------
>>>>
>>>> void CspListBoxListener::itemStateChanged(
const awt::ItemEvent&
>>>> oEvt )
>>>> throw ( RuntimeException )
>>>> {
>>>> //For an unknown reason, 65535 seems to be
the value for a deselection
>>>> if(oEvt.Selected != 65535){
>>>>
getDialog()->getAddonImpl()->setSelectedCsp(oEvt.Selec
ted);
>>>>
>>>>
((SolverDialog*)getDialog())->updateButtonsState(oEvt.Sel
ected);
>>>> }
>>>> }
>>>>
------------------------------------------------------------
------------
>>>>
>>>>
>>>>
>>>> Thanks,
>>>>
>>>> Mikael
>
>
------------------------------------------------------------
---------
> To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
> For additional commands, e-mail: dev-help api.openoffice.org
>
--
Andrew Pitonyak
My Macro Document: http://www.pi
tonyak.org/AndrewMacro.odt
My Book: http://w
ww.hentzenwerke.com/catalog/oome.htm
Info: http://www.pitonyak.or
g/oo.php
See Also: http://documentation.openoffice.org/HOW_TO/index.html
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
| Re: strange value of
(ItemEvent).Selected |

|
2007-04-10 08:52:31 |
On Tue, 2007-04-10 at 08:46 -0400, Andrew Douglas Pitonyak
wrote:
> Is this a 64 bit version, or the standard build?
>
It's a 32 bit version, I've downloaded the sources from
SRC680_m190 a
few months ago.
> Stephan Bergmann wrote:
> > Mikael De Bie wrote:
> >> On Mon, 2007-04-09 at 22:39 -0400, Andrew
Douglas Pitonyak wrote:
> >>> As a signed value, this would be
"-1", which might mean that nothing
> >>> was selected...
> >>
> >> That's what I've guessed too, but the value I
get is always 65535.
> >> That's why I'm wondering about that...
> >>
> >> if someone knows another way to know if the
action listened is a
> >> selection or anything else, let me know...
> >
> > This smells like a bug where some internal C/C++
unsigned short 65535
> > (corresponding to signed short -1, presumably a
special internal value
> > representing "nothing selected") is
converted into a UNO long in a
> > wrong way. You should file an issue.
> >
> > -Stephan
> >
> >> cheers
> >>
> >> Mikael
> >>
> >>
> >>> Mikael De Bie wrote:
> >>>> Hi,
> >>>>
> >>>> Using an ItemListener, I want to know
if the action that triggers the
> >>>> listener is a selection or anything
else. I don't find another way
> >>>> that
> >>>> to find the value of oEvt.Selected
returned when it's not a selection
> >>>> and to verify that value.
> >>>>
> >>>> The value returned is 65535. All is
working fine now, but I wonder why
> >>>> THAT value ?
> >>>>
> >>>> Does someone know something about that
?
> >>>>
> >>>> Here's the code of the
CspListBoxListener::itemStateChanged method :
> >>>>
> >>>>
------------------------------------------------------------
-----------
> >>>>
> >>>> void
CspListBoxListener::itemStateChanged( const
awt::ItemEvent&
> >>>> oEvt )
> >>>> throw ( RuntimeException )
> >>>> {
> >>>> //For an unknown reason, 65535 seems
to be the value for a deselection
> >>>> if(oEvt.Selected != 65535){
> >>>>
getDialog()->getAddonImpl()->setSelectedCsp(oEvt.Selec
ted);
> >>>>
> >>>>
((SolverDialog*)getDialog())->updateButtonsState(oEvt.Sel
ected);
> >>>> }
> >>>> }
> >>>>
------------------------------------------------------------
------------
> >>>>
> >>>>
> >>>>
> >>>> Thanks,
> >>>>
> >>>> Mikael
> >
> >
------------------------------------------------------------
---------
> > To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
> > For additional commands, e-mail: dev-help api.openoffice.org
> >
>
------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribe api.openoffice.org
For additional commands, e-mail: dev-help api.openoffice.org
|
|
[1-6]
|
|