summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-02-28 14:40:08 +0100
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2016-02-28 14:42:27 +0100
commit984f0d604de6b6f30ea7e427f3b464e4173e17b2 (patch)
treea6cf3c57969caf609a83bfd9ad39481dcd4a4933
parent98f3b0e091f47fd8eeadd8b8acede2da06fd02b8 (diff)
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
-rw-r--r--sc/README5
-rw-r--r--sc/source/ui/inc/gridwin.hxx3
-rw-r--r--sc/source/ui/view/gridwin.cxx33
-rw-r--r--sc/source/ui/view/gridwin_dbgutil.cxx21
4 files changed, 20 insertions, 42 deletions
diff --git a/sc/README b/sc/README
index ad14ece023b0..7c3bcfe1d539 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 ad99349fd947..6e4f83ba10b2 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 4aa26d0ce8eb..e1274fe5f333 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 d6faad8ca9cd..b891ff90d3c5 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()
{