sc/README | 5 +++++ sc/source/ui/inc/gridwin.hxx | 1 + sc/source/ui/view/gridwin.cxx | 5 ++++- sc/source/ui/view/gridwin_dbgutil.cxx | 26 +++++++++++++++++++++++++- 4 files changed, 35 insertions(+), 2 deletions(-)
New commits: commit 984f0d604de6b6f30ea7e427f3b464e4173e17b2 Author: Markus Mohrhard <markus.mohrh...@googlemail.com> Date: Sun Feb 28 14:40:08 2016 +0100 move the cell property dump code into dbgutil builds We now allow with a CTRL+SHIFT+F9 to dump the cell properties as a xml file. Change-Id: I730e7009bbe95d3105541a9afbd2c8a19c992600 diff --git a/sc/README b/sc/README index ad14ece..7c3bcfe 100644 --- a/sc/README +++ b/sc/README @@ -9,3 +9,8 @@ Dumps the column width of the first 20 columns. === CTRL+SHIFT+F11 === Dumps the graphic objects and their position and size in pixel. + +=== CTRL+SHIFT+F9 === + +Dumps the SfxItemSet representing the cell properties of the +current cell as a xml file. diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index ad99349..6e4f83ba 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -439,8 +439,9 @@ protected: void ImpDestroyOverlayObjects(); private: -//void dumpCellProperties(); <-- Uncomment this once you put it in DBG_UTIL + #ifdef DBG_UTIL + void dumpCellProperties(); void dumpColumnInformationPixel(); void dumpColumnInformationHmm(); void dumpGraphicInformation(); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 4aa26d0..e1274fe 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -142,9 +142,6 @@ #include <memory> #include <vector> -/*remove this include below as soon as you move the dumpCellProperties() out of here*/ - #include <svl/poolitem.hxx> - #include <libxml/xmlwriter.h> using namespace css; using namespace css::uno; @@ -3500,32 +3497,6 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt) } } -//void dumpCellProperties() <-- Just the function call should remain -//{ This function is already present in gridwin_dbgutils.cxx - ScDocument* pDoc= pViewData->GetDocument(); - - SCTAB nTab =pViewData->GetTabNo(); - SCCOL nCol=pViewData->GetCurY(); - SCROW nRow=pViewData->GetCurY(); - const ScPatternAttr* pPatternAttr = pDoc->GetPattern(nCol,nRow,nTab); - - OStringBuffer aBuffer("dump.xml"); - xmlTextWriterPtr writer; - - /*Function below first converts the Buffer passed into string - *and then this string becomes the name for the file. This - *method is used instead of directly passing a string for the - *convinience of anyone working on this code in future. - */ - writer = xmlNewTextWriterFilename( aBuffer.makeStringAndClear().getStr(), 0 ); - - xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); - - pPatternAttr->GetItemSet().dumpAsXml(writer); - - xmlTextWriterEndDocument( writer ); - xmlFreeTextWriter (writer); -//} #ifdef DBG_UTIL if (rKeyCode.IsMod1() && rKeyCode.IsShift()) @@ -3542,6 +3513,10 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt) { dumpColumnInformationHmm(); } + else if (rKeyCode.GetCode() == KEY_F9) + { + dumpCellProperties(); + } } #endif diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx index d6faad8..b891ff9 100644 --- a/sc/source/ui/view/gridwin_dbgutil.cxx +++ b/sc/source/ui/view/gridwin_dbgutil.cxx @@ -63,20 +63,17 @@ void ScGridWindow::dumpColumnInformationHmm() } } -/*void dumpCellProperties() <--Uncomment this Once you move it into DBG_UTIL -{ - ScDocument* pDoc= pViewData->GetDocument(); +void ScGridWindow::dumpCellProperties() +{ + ScDocument* pDoc = pViewData->GetDocument(); - SCTAB nTab =pViewData->GetTabNo(); - SCCOL nCol=pViewData->GetCurY(); - SCROW nRow=pViewData->GetCurY(); + SCTAB nTab = pViewData->GetTabNo(); + SCCOL nCol = pViewData->GetCurY(); + SCROW nRow = pViewData->GetCurY(); const ScPatternAttr* pPatternAttr = pDoc->GetPattern(nCol,nRow,nTab); - OStringBuffer aBuffer("dump.xml"); - xmlTextWriterPtr writer; - - - writer = xmlNewTextWriterFilename( aBuffer.makeStringAndClear().getStr(), 0 ); + OString aOutputFile("dump.xml"); + xmlTextWriterPtr writer = xmlNewTextWriterFilename( aOutputFile.getStr(), 0 ); xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); @@ -84,7 +81,7 @@ void ScGridWindow::dumpColumnInformationHmm() xmlTextWriterEndDocument( writer ); xmlFreeTextWriter (writer); -}*/ +} void ScGridWindow::dumpGraphicInformation() { commit 98f3b0e091f47fd8eeadd8b8acede2da06fd02b8 Author: Jaskaran <jvsg1...@gmail.com> Date: Sun Feb 28 06:55:25 2016 +0530 tdf#97667 Added a dump method for SfxItemSet in gridwin.cxx This is the first part of solving the task at tdf#97667. The goal is to dump SfxItemSet where our cell properties are stored.Improved it after inputs from moggi.Also I've commented out a few lines in gridwin_dbgutils.cxx That were causing build to fail on jenkins.Once the dump function is moved to the DBG_UTIL Change-Id: I502eaa985b3bf8d296e301d96e42f13d6fd53da5 diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 728f3ed..ad99349 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -439,7 +439,7 @@ protected: void ImpDestroyOverlayObjects(); private: - +//void dumpCellProperties(); <-- Uncomment this once you put it in DBG_UTIL #ifdef DBG_UTIL void dumpColumnInformationPixel(); void dumpColumnInformationHmm(); diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 1191c66..4aa26d0 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -142,6 +142,9 @@ #include <memory> #include <vector> +/*remove this include below as soon as you move the dumpCellProperties() out of here*/ + #include <svl/poolitem.hxx> + #include <libxml/xmlwriter.h> using namespace css; using namespace css::uno; @@ -3497,7 +3500,32 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt) } } +//void dumpCellProperties() <-- Just the function call should remain +//{ This function is already present in gridwin_dbgutils.cxx + ScDocument* pDoc= pViewData->GetDocument(); + SCTAB nTab =pViewData->GetTabNo(); + SCCOL nCol=pViewData->GetCurY(); + SCROW nRow=pViewData->GetCurY(); + const ScPatternAttr* pPatternAttr = pDoc->GetPattern(nCol,nRow,nTab); + + OStringBuffer aBuffer("dump.xml"); + xmlTextWriterPtr writer; + + /*Function below first converts the Buffer passed into string + *and then this string becomes the name for the file. This + *method is used instead of directly passing a string for the + *convinience of anyone working on this code in future. + */ + writer = xmlNewTextWriterFilename( aBuffer.makeStringAndClear().getStr(), 0 ); + + xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); + + pPatternAttr->GetItemSet().dumpAsXml(writer); + + xmlTextWriterEndDocument( writer ); + xmlFreeTextWriter (writer); +//} #ifdef DBG_UTIL if (rKeyCode.IsMod1() && rKeyCode.IsShift()) diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx index a6d884d..d6faad8 100644 --- a/sc/source/ui/view/gridwin_dbgutil.cxx +++ b/sc/source/ui/view/gridwin_dbgutil.cxx @@ -11,7 +11,11 @@ #include "gridwin.hxx" #include <svx/svdpage.hxx> - +#include <libxml/xmlwriter.h> +#include <viewdata.hxx> +#include "document.hxx" +#include "patattr.hxx" +#include <svl/poolitem.hxx> #include "userdat.hxx" namespace { @@ -59,6 +63,29 @@ void ScGridWindow::dumpColumnInformationHmm() } } +/*void dumpCellProperties() <--Uncomment this Once you move it into DBG_UTIL +{ + ScDocument* pDoc= pViewData->GetDocument(); + + SCTAB nTab =pViewData->GetTabNo(); + SCCOL nCol=pViewData->GetCurY(); + SCROW nRow=pViewData->GetCurY(); + const ScPatternAttr* pPatternAttr = pDoc->GetPattern(nCol,nRow,nTab); + + OStringBuffer aBuffer("dump.xml"); + xmlTextWriterPtr writer; + + + writer = xmlNewTextWriterFilename( aBuffer.makeStringAndClear().getStr(), 0 ); + + xmlTextWriterStartDocument( writer, NULL, NULL, NULL ); + + pPatternAttr->GetItemSet().dumpAsXml(writer); + + xmlTextWriterEndDocument( writer ); + xmlFreeTextWriter (writer); +}*/ + void ScGridWindow::dumpGraphicInformation() { ScDocument* pDoc = pViewData->GetDocument(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits