diff options
author | Jaskaran <jvsg1303@gmail.com> | 2016-02-28 06:55:25 +0530 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2016-02-28 14:42:27 +0100 |
commit | 98f3b0e091f47fd8eeadd8b8acede2da06fd02b8 (patch) | |
tree | f1c4d15d79a41ccbd2fdc04d6b00a6fa97d66f2b | |
parent | 1eb60d6e68105fa7ab078cb276f00b6c58989923 (diff) |
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
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 28 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin_dbgutil.cxx | 29 |
3 files changed, 57 insertions, 2 deletions
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 728f3edba35b..ad99349fd947 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 1191c664d8c4..4aa26d0ce8eb 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 a6d884d2aeb3..d6faad8ca9cd 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(); |