diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-05-22 07:39:44 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-05-22 18:40:57 +0200 |
commit | 0619ca016b81df61890701670b07d2ce752a72f9 (patch) | |
tree | 538daa75df6aff8ed285cd4647d4ff66de7fbab9 /sc | |
parent | 17ee476e21fd07a82744d667ae2d5aa86fb390df (diff) |
improve data dump for calc
Change-Id: Iab686719efadfbb6b15edb596c3a2176ae8a8f6b
Diffstat (limited to 'sc')
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 40 |
1 files changed, 39 insertions, 1 deletions
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index a30175d2d416..8b4c4b08c870 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -52,6 +52,7 @@ #include <svx/svditer.hxx> #include <svx/svdocapt.hxx> #include <svx/svdpagv.hxx> +#include <svx/svdpage.hxx> #include <com/sun/star/sheet/DataPilotFieldFilter.hpp> #include <com/sun/star/sheet/DataPilotFieldOrientation.hpp> @@ -3391,6 +3392,20 @@ void ScGridWindow::SelectForContextMenu( const Point& rPosPixel, SCsCOL nCellX, } } +#ifdef DBG_UTIL + +namespace { + +std::ostream& operator<<(std::ostream& rStrm, const ScAddress& rAddr) +{ + rStrm << "Col: " << rAddr.Col() << ", Row: " << rAddr.Row() << ", Tab: " << rAddr.Tab(); + return rStrm; +} + +} + +#endif + void ScGridWindow::KeyInput(const KeyEvent& rKEvt) { // Cursor control for ref input dialog @@ -3512,13 +3527,36 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt) if (rKeyCode.IsMod1() && rKeyCode.IsShift() && rKeyCode.GetCode() == KEY_F12) { ScDocument* pDoc = pViewData->GetDocument(); + SCTAB nTab = pViewData->GetTabNo(); for (SCCOL nCol = 0; nCol <= 20; ++nCol) { - SCTAB nTab = pViewData->GetTabNo(); sal_uInt16 nWidth = pDoc->GetColWidth(nCol, nTab, true); long nPixel = LogicToPixel(Point(nWidth, 0), MapMode(MAP_TWIP)).getX(); std::cout << "Column: " << nCol << ", Width: " << nPixel << "px" << std::endl; } + + ScDrawLayer* pDrawLayer = pDoc->GetDrawLayer(); + if (pDrawLayer) + { + sal_uInt16 nPageCount = pDrawLayer->GetPageCount(); + for (sal_uInt16 nPage = 0; nPage < nPageCount; ++nPage) + { + SdrPage* pPage = pDrawLayer->GetPage(nPage); + sal_uInt16 nObjCount = pPage->GetObjCount(); + for (sal_uInt16 nObj = 0; nObj < nObjCount; ++nObj) + { + SdrObject* pObj = pPage->GetObj(nObj); + std::cout << "Graphic Object"; + ScDrawObjData* pObjData = ScDrawLayer::GetObjData(pObj); + if (pObjData) + std::cout << "Start Position: " << pObjData->maStart << ", EndPosition: " << pObjData->maEnd << std::endl; + + const Rectangle& rRect = pObj->GetSnapRect(); + Rectangle aRect = LogicToPixel(rRect, MapMode(pDrawLayer->GetScaleUnit())); + std::cout << "Snap Rectangle (in pixel): " << aRect << std::endl; + } + } + } } #endif |