diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2016-11-12 17:00:45 -0500 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2016-11-12 17:21:53 -0500 |
commit | 5a8fce7c5607ede6675effe410cbe29e343b6885 (patch) | |
tree | 1b4181a02faa5b614acfa89682cafcdec44b9118 /sc | |
parent | d38459355e3e845ad8db3c515536267923afe3ec (diff) |
Ctrl-Shift-F8 to dump the column storage where the cursor is.
Enabled only in dbgutil build.
Change-Id: I0cd095fb56893122a26b2da6882fca15e516d193
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/calcmacros.hxx | 9 | ||||
-rw-r--r-- | sc/inc/column.hxx | 2 | ||||
-rw-r--r-- | sc/inc/document.hxx | 2 | ||||
-rw-r--r-- | sc/inc/table.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/document.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/table1.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/sharedformula.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/gridwin.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/view/gridwin_dbgutil.cxx | 11 |
11 files changed, 32 insertions, 9 deletions
diff --git a/sc/inc/calcmacros.hxx b/sc/inc/calcmacros.hxx index 8810247d2bb9..d2fc1da94b15 100644 --- a/sc/inc/calcmacros.hxx +++ b/sc/inc/calcmacros.hxx @@ -15,7 +15,14 @@ #define DEBUG_FORMULA_COMPILER 0 #define DEBUG_AREA_BROADCASTER 0 -#if DEBUG_PIVOT_TABLE || DEBUG_COLUMN_STORAGE || DEBUG_FORMULA_COMPILER || DEBUG_AREA_BROADCASTER +#define DUMP_COLUMN_STORAGE 0 + +#ifdef DBG_UTIL +#undef DUMP_COLUMN_STORAGE +#define DUMP_COLUMN_STORAGE 1 +#endif + +#if DEBUG_PIVOT_TABLE || DUMP_COLUMN_STORAGE || DEBUG_COLUMN_STORAGE || DEBUG_FORMULA_COMPILER || DEBUG_AREA_BROADCASTER #include <iostream> #include <string> #include <cstdio> diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 8a1a370f3d75..22aaf6aea055 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -662,7 +662,7 @@ public: void SwapNonEmpty( sc::TableValues& rValues, sc::StartListeningContext& rStartCxt, sc::EndListeningContext& rEndCxt ); -#if DEBUG_COLUMN_STORAGE +#if DUMP_COLUMN_STORAGE void DumpFormulaGroups() const; #endif diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx index 6caaa5264837..8b4612636ee2 100644 --- a/sc/inc/document.hxx +++ b/sc/inc/document.hxx @@ -2280,7 +2280,7 @@ public: const SvtBroadcaster* GetBroadcaster( const ScAddress& rPos ) const; void DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, const ScAddress& rTopPos, SCROW nLength ); -#if DEBUG_COLUMN_STORAGE +#if DUMP_COLUMN_STORAGE SC_DLLPUBLIC void DumpFormulaGroups( SCTAB nTab, SCCOL nCol ) const; #endif diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx index 0221fd9e9cb3..70c42c84e4b3 100644 --- a/sc/inc/table.hxx +++ b/sc/inc/table.hxx @@ -965,7 +965,7 @@ public: void finalizeOutlineImport(); -#if DEBUG_COLUMN_STORAGE +#if DUMP_COLUMN_STORAGE void DumpFormulaGroups( SCCOL nCol ) const; #endif diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index b3f12f9baab5..1d63bf6a3ca2 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -1563,7 +1563,7 @@ void ScColumn::CellStorageModified() #endif } -#if DEBUG_COLUMN_STORAGE +#if DUMP_COLUMN_STORAGE namespace { diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 3bf5e8af9c37..31163572393e 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2447,7 +2447,7 @@ void ScDocument::DeleteBroadcasters( sc::ColumnBlockPosition& rBlockPos, const S pTab->DeleteBroadcasters(rBlockPos, rTopPos.Col(), rTopPos.Row(), rTopPos.Row()+nLength-1); } -#if DEBUG_COLUMN_STORAGE +#if DUMP_COLUMN_STORAGE void ScDocument::DumpFormulaGroups( SCTAB nTab, SCCOL nCol ) const { const ScTable* pTab = FetchTable(nTab); diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index bf227d3aa5ea..9df67e8ccd2b 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -2265,7 +2265,7 @@ void ScTable::SetFormulaResults( aCol[nCol].SetFormulaResults(nRow, pResults, nLen); } -#if DEBUG_COLUMN_STORAGE +#if DUMP_COLUMN_STORAGE void ScTable::DumpFormulaGroups( SCCOL nCol ) const { if (!ValidCol(nCol)) diff --git a/sc/source/core/tool/sharedformula.cxx b/sc/source/core/tool/sharedformula.cxx index 92c1cda2d0cb..0a13d1527547 100644 --- a/sc/source/core/tool/sharedformula.cxx +++ b/sc/source/core/tool/sharedformula.cxx @@ -82,7 +82,7 @@ void SharedFormulaUtil::splitFormulaCellGroup(const CellStoreType::position_type // Apply the lower group object to the lower cells. #if DEBUG_COLUMN_STORAGE - if (xGroup2->mpTopCell->aPos.Row() + xGroup2->mnLength > aPos.first->position + aPos.first->size) + if (xGroup2->mpTopCell->aPos.Row() + size_t(xGroup2->mnLength) > aPos.first->position + aPos.first->size) { cerr << "ScColumn::SplitFormulaCellGroup: Shared formula region goes beyond the formula block. Not good." << endl; cerr.flush(); @@ -294,7 +294,7 @@ void SharedFormulaUtil::unshareFormulaCell(const CellStoreType::position_type& a xGroup2->mbInvariant = xGroup->mbInvariant; xGroup2->mpCode = xGroup->mpCode->Clone(); #if DEBUG_COLUMN_STORAGE - if (xGroup2->mpTopCell->aPos.Row() + xGroup2->mnLength > it->position + it->size) + if (xGroup2->mpTopCell->aPos.Row() + size_t(xGroup2->mnLength) > it->position + it->size) { cerr << "ScColumn::UnshareFormulaCell: Shared formula region goes beyond the formula block. Not good." << endl; cerr.flush(); diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx index 25e66e08c434..709b3881c47a 100644 --- a/sc/source/ui/inc/gridwin.hxx +++ b/sc/source/ui/inc/gridwin.hxx @@ -447,6 +447,7 @@ private: void dumpColumnInformationPixel(); void dumpColumnInformationHmm(); void dumpGraphicInformation(); + void dumpColumnCellStorage(); #endif }; diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index ce36e1310d66..3fd29334baaa 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -3273,6 +3273,10 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt) { dumpCellProperties(); } + else if (rKeyCode.GetCode() == KEY_F8) + { + dumpColumnCellStorage(); + } } #endif diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx index 42762835f100..afd385b9b299 100644 --- a/sc/source/ui/view/gridwin_dbgutil.cxx +++ b/sc/source/ui/view/gridwin_dbgutil.cxx @@ -112,4 +112,15 @@ void ScGridWindow::dumpGraphicInformation() } } +void ScGridWindow::dumpColumnCellStorage() +{ + // Get the current cursor position. + ScAddress aCurPos = pViewData->GetCurPos(); + ScDocument* pDoc = pViewData->GetDocument(); + + // TODO : Perhaps we should dump the whole structure, not just the formula + // groups. + pDoc->DumpFormulaGroups(aCurPos.Tab(), aCurPos.Col()); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |