yunjingtao schrieb:
> hi, Daniel

> I submitted a patch to issue25018. Using some test cases, I checked
> it, and it's ok. Hope you review it, and if possible,give me some
> advice. If there is no problem with it, assign me issues please.

> I have one question and wish you answer it at your convenience.The
> function SfxBindings::QueryState can return SfxItemState, but I don't
> understand what the several state types mean, such as
> SFX_ITEM_SET,SFX_ITEM_DONTCARE and so on, can you explain them for
> me? In this patch the return value is 32,eaque to SFX_ITEM_DEFAULT.

Please do not rely on the item state only, but test the contents of the
item too. See the example for the FID_MERGE_TOGGLE item in the same
file: the test
  " ... >= SFX_ITEM_DEFAULT "
makes sure that the item exists (it has state "DEFAULT" or "SET"), and
that it is possible to use the item returned in the pItem parameter of
the QueryState function (see below for more info about the states). Try
to combine the GetValue() test into the "else if ..."; or even better,
add two helper functions to ScCellShell: "bool IsFullScreen() const" and
"void SetFullScreen( bool bSet )". This would make it more readable.

There are 6 item state constants defined in <svtools/poolitem.hxx>:

#define SFX_ITEM_UNKNOWN        0x0000
for unknown items.

#define SFX_ITEM_DISABLED       0x0001
for disabled items (e.g. gray icons in toolbars).

#define SFX_ITEM_READONLY       0x0002
for read-only items.

#define SFX_ITEM_DONTCARE       0x0010
for items with mixed values in the current context (e.g. different
colors in a range of cells). Therefore the QueryState() function cannot
return an item.

#define SFX_ITEM_DEFAULT        0x0020
for the predefined value of an item defined in the "item pool" (e.g. "no
background color" for a sheet cell). The QueryState() function returns
an item that contains this default value.

#define SFX_ITEM_SET            0x0030
for a changed value (e.g. some color for a sheet cell). The QueryState()
function returns an item with this value.


Only *one* of the states "DONTCARE", "DEFAULT", or "SET" can be set at a
time, but the flags "DISABLED" and "READONLY" may be combined with the
state. Therefore it is possible to make the test ">= SFX_ITEM_DEFAULT"
as you can see in the FID_MERGE_TOGGLE example above.


If you need more issues, please have a look in my issue list:
http://qa.openoffice.org/issues/buglist.cgi?issue_status=UNCONFIRMED&issue_status=NEW&issue_status=STARTED&issue_status=REOPENED&email1=dr&emailtype1=exact&emailassigned_to1=1&email2=&emailtype2=exact&emailreporter2=1&issueidtype=include&issue_id=&changedin=&votes=&chfieldfrom=&chfieldto=&chfieldvalue=&short_desc=&short_desc_type=allwords&long_desc=&long_desc_type=allwords&issue_file_loc=&issue_file_loc_type=fulltext&status_whiteboard=&status_whiteboard_type=fulltext&keywords=&keywords_type=anytokens&field0-0-0=noop&type0-0-0=noop&value0-0-0=&cmdtype=doit&newqueryname=&order=%27%27&Submit+query=Submit+query

Of course I will try to find some issues too... Here are some more User
Interface issues:
http://qa.openoffice.org/issues/show_bug.cgi?id=89173
http://qa.openoffice.org/issues/show_bug.cgi?id=40679
http://qa.openoffice.org/issues/show_bug.cgi?id=91532


DR->NN: please correct me if something with the item stuff is wrong...


Daniel

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to