Hi Regina,

On Sat, May 11, 2013 at 03:15:43PM +0200, Regina Henschel wrote:
> Hi,
> 
> Look at the character background icon in the text section of the sidebar.
> It has the command .uno:CharacterBackgroundPattern
> 
> 1. Why has this command been introduced? There exists already .uno:Backcolor

The slot/command was there since 2002
http://hg.services.openoffice.org/OOO340/rev/8dc02b58193f (at least in
that file)

I also see that for the Font Color the sidebar uses ".uno:Color", while
the toolbar has ".uno:FontColor".

> 2. Where is a description of this command? Recording a macro you can
> see, that is has a lot of properties, not only the color.

You can find slot definitions in sfx2 based modules inside the sdi
folder. In opengrok, put in "Full search" CharacterBackgroundPattern,
and in "File path" put sdi:

http://opengrok.adfinis-sygroup.org/source/search?q=CharacterBackgroundPattern&defs=&refs=&path=sdi&hist=&project=aoo-trunk
there you have the slot definition:
http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/svx/sdi/svx.sdi#12044

It is a property slot:

SvxBrushItem CharacterBackgroundPattern SID_ATTR_BRUSH_CHAR

The slot definitions have the following pattern:

TYPE  UnoCommandName  SlotID 

In this case, the type of the SfxPoolItem is a SvxBrushItem:

item SvxBrush SvxBrushItem;

where SvxBrush is a struct:

struct SvxBrush
{
    BOOL        Transparent     MID_GRAPHIC_TRANSPARENT;
    INT32       BackColor       MID_BACK_COLOR;
    String      URL             MID_GRAPHIC_URL;
    String      Filtername      MID_GRAPHIC_FILTER;
    INT16       Position        MID_GRAPHIC_POSITION;
};

http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/svx/sdi/svxitems.sdi#430

In the struct, the members follow a pattern similar to the slot
definition (Type   Name_used_in_UNO   Internal_Numeric_ID).

When macro-recorded, the struct members are placed in a sequence of
css.beans.PropertyValue's, using the pattern

"<property slot name|method slot argument name>.Member"

as css.beans.PropertyValue.Name, like this:

"CharacterBackgroundPattern.Transparent"
"CharacterBackgroundPattern.BackColor"
"CharacterBackgroundPattern.URL"
"CharacterBackgroundPattern.Filtername"
"CharacterBackgroundPattern.Position"

You can see an example of the SvxBrushItem used as an argument of
a method slot here
http://opengrok.adfinis-sygroup.org/source/xref/aoo-trunk/main/svx/source/gallery2/galbrws2.cxx#398

407    css::uno::Sequence< css::beans::PropertyValue > aArgs( 6 );
408    aArgs[0].Name = C2U( "Background.Transparent" );
409    aArgs[0].Value <<= sal_Int32( 0 ); // 0 - 100
410    aArgs[1].Name = C2U( "Background.BackColor" );
411    aArgs[1].Value <<= sal_Int32( - 1 );
412    aArgs[2].Name = C2U( "Background.URL" );
413    aArgs[2].Value <<= aURL;
414    aArgs[3].Name = C2U( "Background.Filtername" ); // FIXME should be 
FilterName
415    aArgs[3].Value <<= aFilterName;
416    aArgs[4].Name = C2U( "Background.Position" );
417    aArgs[4].Value <<= css::style::GraphicLocation_TILED;
418    aArgs[5].Name = C2U( "Position" );
419    aArgs[5].Value <<= nPos;

The slot is

SfxVoidItem BackgroundImage SID_GALLERY_BG_BRUSH
(SvxBrushItem Background SID_GALLERY_BG_BRUSH,
 SfxUInt16Item Position SID_GALLERY_BG_POS)

[0-4] is the SvxBrushItem, the prefix in the PropertyValue name is
"Background." because Background is the name of the argument; [5] is the
SfxUInt16Item.

The UNO sequence is transformed back to a SfxPoolItem in TransformParameters
http://opengrok.adfinis-sygroup.org/source/search?q=&defs=TransformParameters&refs=&path=sfx2&hist=&project=aoo-trunk

As seen, slot definitions can be property slots, or method slots.
Method slots take arguments, see the description here
http://wiki.openoffice.org/wiki/Framework/Article/Implementation_of_the_Dispatch_API_In_SFX2

--------

Back to this case, I've no idea why the sidebar uses a SvxBrushItem,
this items allows to set a background color or a background graphic, but
AFAIK background graphic is implemented for paragraph, not for (a set
of) characters in a paragraph (Format - Character - Background offers
only color).

> 3. The icon in the sidebar behaves different from the corresponding
> icon in the 'Formatting' toolbar. Especially it does not remember
> the last color and it has no 'can' modus. Is that intended?

There is a bug pointing to the incongruent behaviour of the color
related toolbar icons across the different modules
https://issues.apache.org/ooo/show_bug.cgi?id=10864

To this incongruence, it has to be added that now the toolbar item popup
a floating window, while the items in sidebar do it different.


Regards
-- 
Ariel Constenla-Haile
La Plata, Argentina

Attachment: pgpg7pNOLe8Pa.pgp
Description: PGP signature

Reply via email to