https://bugs.documentfoundation.org/show_bug.cgi?id=137664

Neil Roberts <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |[email protected]

--- Comment #8 from Neil Roberts <[email protected]> ---
It looks like whenever you access slide.Background LibreOffice creates a new
background object with a copy of the values from the slide. Modifying it only
affects the copy and not the original slide’s background. If you want the
changes to actually take affect you have set the Background property with the
modified background object like this:

Sub Main
    Dim doc as Object
    doc = ThisComponent
    Dim slide as Object
    slide = doc.getDrawPages().getByIndex(0)

    Print slide.Background.FillBitmapMode
    Dim bg as Object
    bg = slide.Background
    bg.FillBitmapMode = com.sun.star.drawing.BitmapMode.STRETCH
    slide.Background = bg
    Print slide.Background.FillBitmapMode 
End Sub

I’m not sure if this should be considered a bug or whether it’s an intentional
design of the API.

On the other hand when you call slide.MasterPage.Background it looks like it
does return the page’s original background object. See
SdMasterPage::getBackground. I wonder if this is a mistake because in that
function if IsImpressDocument is false it will instead create a new background.
It seems to sometimes create a new object and sometimes return the original
one.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to