[Libreoffice-bugs] [Bug 140711] New: Adjusting Zorder of images causes changes to image index
bugzilla-daemon at bugs.documentfoundation.org
bugzilla-daemon at bugs.documentfoundation.org
Sun Feb 28 11:15:26 UTC 2021
https://bugs.documentfoundation.org/show_bug.cgi?id=140711
Bug ID: 140711
Summary: Adjusting Zorder of images causes changes to image
index
Product: LibreOffice
Version: 6.4.7.2 release
Hardware: x86 (IA32)
OS: Windows (All)
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: BASIC
Assignee: libreoffice-bugs at lists.freedesktop.org
Reporter: davegreenland at yahoo.co.uk
Description:
I have found (every time) if I attempt to alter the Zorder of an image it
alters the index value of other images in the same Calc sheet making it
impossible to reference the correct image. I can reference this by the fact
that my image data is written to a spreadsheet at each image creation.
Position, Index and Zorder are included. If for example I make an image
invisible using this index data it is fine. However, if I should adjust the
Zorder of any other image on the sheet and then attempt to make one invisible,
the wrong image is turned invisible. I have tried to find some correlation in
the offset between data and the altered index and it doesn't seem to make any
sense. This is a major headache.
Steps to Reproduce:
1.Create a series of images on a Calc spreadsheet
2.Note their index numbers
3.Adjust Zorder of an image
4.Add an extra image or two
4.Note index numbers again and compare
Actual Results:
Results in my case are incorrect images going invisible, being in the wrong
place, etc.
Expected Results:
It should have adjusted the Zorder accordingly and left the index numbers as
they were
Reproducible: Always
User Profile Reset: Yes
Additional Info:
Private Sub TLLayOneTile(psStartCell as String)
Dim loCurrentCell as Object
Dim laArgs(3) as New com.sun.star.beans.PropertyValue
Dim loDrawPage as Object
Dim loImage as Object
Dim liCount as Integer
Dim llZ as Long
loCurrentCell = moMapSheet.GetCellRangeByName(psStartCell)
ThisComponent.CurrentController.Select(loCurrentCell)
loDrawPage = ThisComponent.getSheets().getByName("Map").getDrawPage()
laArgs(0).Name = "FileName"
laArgs(0).Value = msTLFullImageURL
laArgs(1).Name = "FilterName"
laArgs(1).Value = "<All formats>"
laArgs(2).Name = "Style"
laArgs(2).Value = "Graphics"
moDispatcher.ExecuteDispatch(moDocument, ".uno:InsertGraphic", "", 0,
laArgs()) 'declared at module level
miGVSqCursorX = UTGetCellCol(psStartCell)
miGVSqCursorY = UTGetCellRow(psStartCell)
miGVUnsavedImageCount = miGVUnsavedImageCount + 1
loImage = loDrawPage.GetByIndex(miGVUnsavedImageCount)
If UTGetLayZOrder(miGVSqCursorX, miGVSqCursorY, "T") = -998 Or
UTGetLayZOrder(miGVSqCursorX, miGVSqCursorY, "T") = -999 Then
llZ = loImage.Zorder
Else
loImage.Zorder = UTGetLayZOrder(miGVSqCursorX, miGVSqCursorY,
"T")
llZ = loImage.Zorder
EndIf
UTLockImagesMoveSize
TLWriteToLayDataSheet miGVSqCursorX, miGVSqCursorY, llZ
UTGetSquareCursorData(miGVSqCursorX, miGVSqCursorY,
miGVSquareDataRoute)
TLControlsHandling 1
End Sub
Private Function UTGetLayZOrder(piCol as Integer, piRow as Integer, psCaller as
String) as Long
Dim liI as Integer
Do
liI = liI + 1
If moLayDataSheet.GetCellByPosition(0, liI).String = "" Then
UTGetLayZOrder = -999 'Flag to show that NO terrains
have been placed yet
Exit Do
EndIf
If moLayDataSheet.GetCellByPosition(0, liI).String =
Trim(Cstr(piCol)) _
And moLayDataSheet.GetCellByPosition(1, liI).String =
Trim(Cstr(piRow)) Then
If psCaller = "T" And
moLayDataSheet.GetCellByPosition(12, liI).String = "" Then
UTGetLayZOrder = -998 'Flag to show that a
terrain has not been placed HERE yet
Exit Do
EndIf
Select Case psCaller
Case "T"
UTGetLayZOrder =
Clng(moLayDataSheet.GetCellByPosition(12, liI).String)
Case "U"
UTGetLayZOrder =
Clng(moLayDataSheet.GetCellByPosition(13, liI).String)
Case "R"
UTGetLayZOrder =
Clng(moLayDataSheet.GetCellByPosition(14, liI).String)
Case "D"
UTGetLayZOrder =
Clng(moLayDataSheet.GetCellByPosition(15, liI).String)
Case "L"
UTGetLayZOrder =
Clng(moLayDataSheet.GetCellByPosition(16, liI).String)
End Select
Exit Do
EndIf
Loop
End Function
--
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210228/d4a2872e/attachment-0001.htm>
More information about the Libreoffice-bugs
mailing list