Bug 97667 - add xml dump methods for calc pool items
Summary: add xml dump methods for calc pool items
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium normal
Assignee: Felipe Lema
URL:
Whiteboard: target:5.2.0 target:7.3.0
Keywords: difficultyMedium, easyHack, skillCpp
Depends on:
Blocks:
 
Reported: 2016-02-08 23:32 UTC by Markus Mohrhard
Modified: 2022-04-26 17:23 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Markus Mohrhard 2016-02-08 23:32:26 UTC
We have a way to dump our complex attribute storage inside of SfxItemSet (a container for different properties) and the many subclasses of SfxPoolItem. This is currently mainly used by writer but we should add that also for calc.

This task involves two parts:
1.) Adding a way to dump the cell properties similar to the dump* calls in ScGridWindow::KeyInput. Instead of these functions place it outside of the DBG_UTIL part to make it available in normal builds (I might move it to dbgutil builds later)
The position of the current cell can be gotten through ScGridWindow::pViewData, ScViewData::GetTabNo, ScViewData::GetCurX, ScViewData::GetCurY.

The SfxItemSet for dumping through ScDocument::GetPattern and ScPatternAttr::GetItemSet.

2.) Add dumpAsXml methods to the SfxPoolItem subclasses inside of sc/inc/attrib.hxx
Comment 1 Robinson Tryon (qubit) 2016-02-18 14:52:35 UTC Comment hidden (obsolete)
Comment 2 Commit Notification 2016-02-28 13:44:31 UTC
Jaskaran committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=98f3b0e091f47fd8eeadd8b8acede2da06fd02b8

tdf#97667 Added a dump method for SfxItemSet in gridwin.cxx

It will be available in 5.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 3 Markus Mohrhard 2016-04-18 07:59:02 UTC
Only part 1 is implemented.
Comment 4 blendergeek 2017-05-06 19:57:07 UTC
I am going to attempt to complete part 2.

If I understand correctly, I need to implement a dumpAsXML method to every subclass of SfxPoolItem in sc/inc/attrib.hxx

And these dumpAsXML methods will call the dump method in SfxItemSet referenced in Comment 2.
Comment 5 Abhishek 2020-02-02 14:28:39 UTC
Hi there. I have added "virtual void dumpAsXml(xmlTextWriterPtr pWriter) const override;" line to each subclass of SfxPoolItem. Is this enough to submit the patch?
Comment 6 Buovjaga 2020-02-02 21:49:33 UTC Comment hidden (obsolete)
Comment 7 Buovjaga 2020-02-02 21:50:06 UTC Comment hidden (obsolete)
Comment 8 Abhishek 2020-02-12 16:23:13 UTC
Sorry for the delay. I submitted my patch on gerrit. but I am having trouble understanding the build error please help.
Thanks!
Comment 9 Abhishek 2020-02-12 16:23:52 UTC Comment hidden (obsolete)
Comment 10 Buovjaga 2020-02-12 18:33:25 UTC
The patch:
https://gerrit.libreoffice.org/c/core/+/88475
Comment 11 Felipe Lema 2021-03-28 06:45:17 UTC
I will pick up where @Abhishek left of (implementing part 2)
Comment 12 Felipe Lema 2021-04-02 02:47:02 UTC
patch here:

https://gerrit.libreoffice.org/c/core/+/113497

I don't know where the unit tests (or regressions) for this kind of things are so I can add them for the methods I added.

I don't mind adding them myself to that same patch
Comment 13 Commit Notification 2021-11-03 12:34:03 UTC
Felipe Lema committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8b1318324e574e510adb0c39fd744de360dd19b3

tdf#97667 Add XML Dump methods for Calc Pool Items

It will be available in 7.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 14 Roman Kuznetsov 2022-04-03 16:50:34 UTC
Can we close this one as FIXED? Markus? Felipe?
Comment 15 Felipe Lema 2022-04-26 14:55:27 UTC
I'm ok with closing this. Some feature may be missing, but if that's the case, we can open a separate bug