[Libreoffice] How to set fillcolor and linecolor to a SdrObject?

Regina Henschel rb.henschel at t-online.de
Tue Aug 2 15:23:16 PDT 2011


Hi all,

ODF1.2 defines 15 standard symbols for charts. As earlier mentioned, I 
try to implement the missing ones. But there are some problems with the 
symbols "horizontal-bar" and "vertical-bar".

The implementation of the current symbols in 
/calc/chart2/source/view/main/ShapeFactory.cxx in method 
createPolyPolygon_Symbol draws the symbols in a way, that the given size 
in parameter rSize is completely used. Moreover, this method is called 
with a square in rSize in all default cases.

I have tried now this way for a "horizontal-bar": Draw a rectangle, 
which is 1/5 of the given height. With this attempt I get correct 
symbols in the chart itself and in the legend. But the preview in the 
data series dialog or in the data point dialog paints my 
"horizontal-bar" and my "vertical-bar" as square. And in the list in the 
pop-up menu my bars are shifted.

As far as I see, the graphics to be used in the dialog are generated in 
components/cui/source/tapages/tpline.cxx. My idea is now to insert a 
100% transparent square into the temporary page pPage and mark that 
object together with my symbols for generating the bitmaps.

For inserting an additional object, I have used

         SdrObject *pInvisibleSquare=pSymbolList->GetObj(0);
         pInvisibleSquare=pInvisibleSquare->Clone();
         pPage->NbcInsertObject(pInvisibleSquare);

in IMPL_LINK( SvxLineTabPage, MenuCreateHdl_Impl, MenuButton *, pButton )

after line 1540 and

    pView->MarkAll();
instead of
    pView->MarkObj(pObj,pPageView);
in line 1552 seems to work too.

But I do not know how to make the object transparent. Especially, I do 
not know how to use these "itempool"-thing. In Basic I would have 
assigned a value to the property. But in C++ I'm totally lost. Do you 
can point me to a guide or lead me to a solution?

Kind regards
Regina




More information about the LibreOffice mailing list