sc/Library_sc.mk | 1 + sc/inc/column.hxx | 1 + sc/inc/columniterator.hxx | 24 ++++++++++++++++++++++++ sc/source/core/data/columniterator.cxx | 16 ++++++++++++++++ sc/source/core/data/documen8.cxx | 19 +++++++++---------- 5 files changed, 51 insertions(+), 10 deletions(-)
New commits: commit a98be149da54e3f7479a37ecb68791e56d7b64f4 Author: Kohei Yoshida <[email protected]> Date: Wed Mar 13 16:43:48 2013 -0400 Add skeleton files for the new iterator for column cells' text widths. To be implemented soon. Change-Id: Ifa72245f89635ac604c233197891fb67c8d99915 diff --git a/sc/Library_sc.mk b/sc/Library_sc.mk index b72deec..0295e74 100644 --- a/sc/Library_sc.mk +++ b/sc/Library_sc.mk @@ -104,6 +104,7 @@ $(eval $(call gb_Library_add_exception_objects,sc,\ sc/source/core/data/column \ sc/source/core/data/column2 \ sc/source/core/data/column3 \ + sc/source/core/data/columniterator \ sc/source/core/data/compressedarray \ sc/source/core/data/colorscale \ sc/source/core/data/conditio \ diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx index 0fbd743..acaede3 100644 --- a/sc/inc/column.hxx +++ b/sc/inc/column.hxx @@ -94,6 +94,7 @@ class ScColumn ScAttrArray* pAttrArray; ScDocument* pDocument; +friend class ScColumnTextWidthIterator; friend class ScDocument; // for FillInfo friend class ScDocumentIterator; friend class ScValueIterator; diff --git a/sc/inc/columniterator.hxx b/sc/inc/columniterator.hxx new file mode 100644 index 0000000..b8f8f59 --- /dev/null +++ b/sc/inc/columniterator.hxx @@ -0,0 +1,24 @@ +/* -*- 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/. + */ + +#ifndef __SC_COLUMNITERATOR_HXX__ +#define __SC_COLUMNITERATOR_HXX__ + +class ScColumn; + +class ScColumnTextWidthIterator +{ + ScColumn& mrCol; +public: + ScColumnTextWidthIterator(ScColumn& rCol); +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sc/source/core/data/columniterator.cxx b/sc/source/core/data/columniterator.cxx new file mode 100644 index 0000000..289c194 --- /dev/null +++ b/sc/source/core/data/columniterator.cxx @@ -0,0 +1,16 @@ +/* -*- 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 "columniterator.hxx" +#include "column.hxx" + +ScColumnTextWidthIterator::ScColumnTextWidthIterator(ScColumn& rCol) : + mrCol(rCol) {} + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ commit 46b2a3d0806eefdc4e68b9bede13320ba837da40 Author: Kohei Yoshida <[email protected]> Date: Wed Mar 13 16:37:20 2013 -0400 Some renaming of local variables... Change-Id: I27b5512d90eba0c0235d11d1b4f1c9cafc4bcce6 diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 6b50d12..bceb8c8 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -545,8 +545,8 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers if (!ValidTab(aScope.Tab()) || aScope.Tab() >= static_cast<SCTAB>(maTabs.size()) || !maTabs[aScope.Tab()]) aScope.setTab(0); - ScTable* pTable = maTabs[aScope.Tab()]; - ScStyleSheet* pStyle = (ScStyleSheet*)aScope.getStylePool()->Find(pTable->aPageStyle, SFX_STYLE_FAMILY_PAGE); + ScTable* pTab = maTabs[aScope.Tab()]; + ScStyleSheet* pStyle = (ScStyleSheet*)aScope.getStylePool()->Find(pTab->aPageStyle, SFX_STYLE_FAMILY_PAGE); OSL_ENSURE( pStyle, "Missing StyleSheet :-/" ); if (!pStyle || getScaleValue(*pStyle, ATTR_PAGE_SCALETOPAGES) == 0) @@ -561,9 +561,8 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers Fraction aZoomFract(nZoom, 100); // Start at specified cell position (nCol, nRow, nTab). - ScColumn* pColumn = &pTable->aCol[aScope.Col()]; - boost::scoped_ptr<ScColumnIterator> pColIter( - new ScColumnIterator(pColumn, aScope.Row(), MAXROW)); + ScColumn* pCol = &pTab->aCol[aScope.Col()]; + boost::scoped_ptr<ScColumnIterator> pColIter(new ScColumnIterator(pCol, aScope.Row(), MAXROW)); OutputDevice* pDev = NULL; sal_uInt16 nRestart = 0; @@ -582,7 +581,7 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers // Calculate text width for this cell. double nPPTX = 0.0; double nPPTY = 0.0; - if ( !pDev ) + if (!pDev) { pDev = GetPrinter(); aScope.setOldMapMode(pDev->GetMapMode()); @@ -636,9 +635,9 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers { if ( bNewTab ) { - pTable = maTabs[aScope.Tab()]; + pTab = maTabs[aScope.Tab()]; pStyle = (ScStyleSheet*)aScope.getStylePool()->Find( - pTable->aPageStyle, SFX_STYLE_FAMILY_PAGE); + pTab->aPageStyle, SFX_STYLE_FAMILY_PAGE); if ( pStyle ) { @@ -661,8 +660,8 @@ bool ScDocument::IdleCalcTextWidth() // true = demnaechst wieder vers if ( nZoom > 0 ) { - pColumn = &pTable->aCol[aScope.Col()]; - pColIter.reset(new ScColumnIterator(pColumn, aScope.Row(), MAXROW)); + pCol = &pTab->aCol[aScope.Col()]; + pColIter.reset(new ScColumnIterator(pCol, aScope.Row(), MAXROW)); } else aScope.incTab(); // Move to the next sheet as the current one has scale-to-pages set. _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
