summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-22 08:02:53 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-05-22 18:40:58 +0200
commit503ed2f8e3fdbb4d7583b67b0bafcaccc896a5ae (patch)
treef8b8ca6ff8444b6425072497c33a3256de9933bf /sc
parentca6f5b48e9f529083ec35d866c89221c5a019597 (diff)
extract calc data dump method into own file
Change-Id: Ifed8bb8165189243709078770b8735675fe86dea
Diffstat (limited to 'sc')
-rw-r--r--sc/Library_sc.mk6
-rw-r--r--sc/source/ui/inc/gridwin.hxx6
-rw-r--r--sc/source/ui/view/gridwin.cxx47
-rw-r--r--sc/source/ui/view/gridwin_dbgutil.cxx60
4 files changed, 73 insertions, 46 deletions
diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk
index d2fd5cd345b9..c0644f865917 100644
--- a/sc/Library_sc.mk
+++ b/sc/Library_sc.mk
@@ -664,6 +664,12 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/ui/xmlsource/xmlsourcedlg \
))
+ifneq (,$(gb_ENABLE_DBGUTIL))
+$(eval $(call gb_Library_add_exception_objects,sc,\
+ sc/source/ui/view/gridwin_dbgutil \
+))
+endif
+
$(eval $(call gb_Helper_optional,OPENCL,\
$(call gb_Library_add_exception_objects,sc,\
sc/source/core/opencl/formulagroupcl \
diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index e4bb56aac1f0..ca41b94a93fd 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -438,6 +438,12 @@ protected:
void ImpCreateOverlayObjects();
void ImpDestroyOverlayObjects();
+private:
+
+#ifdef DBG_UTIL
+ void dumpInformation();
+#endif
+
};
#endif
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 8b4c4b08c870..5ff13086bf99 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -52,7 +52,6 @@
#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>
@@ -3392,20 +3391,6 @@ 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
@@ -3526,37 +3511,7 @@ 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)
- {
- 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;
- }
- }
- }
+ dumpInformation();
}
#endif
diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx
new file mode 100644
index 000000000000..fd57e703533d
--- /dev/null
+++ b/sc/source/ui/view/gridwin_dbgutil.cxx
@@ -0,0 +1,60 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "gridwin.hxx"
+#include <svx/svdpage.hxx>
+
+#include "userdat.hxx"
+
+namespace {
+
+std::ostream& operator<<(std::ostream& rStrm, const ScAddress& rAddr)
+{
+ rStrm << "Col: " << rAddr.Col() << ", Row: " << rAddr.Row() << ", Tab: " << rAddr.Tab();
+ return rStrm;
+}
+
+}
+
+void ScGridWindow::dumpInformation()
+{
+ ScDocument* pDoc = pViewData->GetDocument();
+ SCTAB nTab = pViewData->GetTabNo();
+ for (SCCOL nCol = 0; nCol <= 20; ++nCol)
+ {
+ 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;
+ }
+ }
+ }
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */