[Libreoffice-commits] core.git: 33 commits - configure.ac download.lst mdds/UnpackedTarball_mdds.mk mdds/wundef.patch sc/inc sc/qa sc/source
Kohei Yoshida
kohei.yoshida at gmail.com
Thu May 9 10:35:37 PDT 2013
configure.ac | 4
download.lst | 2
mdds/UnpackedTarball_mdds.mk | 1
mdds/wundef.patch | 42 ---
sc/inc/brdcst.hxx | 7
sc/inc/cell.hxx | 38 --
sc/inc/column.hxx | 19 +
sc/inc/document.hxx | 3
sc/inc/global.hxx | 1
sc/inc/mtvblockfunc.hxx | 35 ++
sc/inc/table.hxx | 3
sc/qa/unit/ucalc.cxx | 217 ++++++++++++++++
sc/source/core/data/autonamecache.cxx | 1
sc/source/core/data/cell.cxx | 52 ---
sc/source/core/data/cellvalue.cxx | 6
sc/source/core/data/column.cxx | 128 ++-------
sc/source/core/data/column2.cxx | 208 +++++----------
sc/source/core/data/column3.cxx | 327 +++++++------------------
sc/source/core/data/conditio.cxx | 2
sc/source/core/data/dociter.cxx | 6
sc/source/core/data/documen4.cxx | 2
sc/source/core/data/documen7.cxx | 7
sc/source/core/data/document.cxx | 16 +
sc/source/core/data/documentimport.cxx | 2
sc/source/core/data/dpfilteredcache.cxx | 2
sc/source/core/data/fillinfo.cxx | 7
sc/source/core/data/formulacell.cxx | 4
sc/source/core/data/segmenttree.cxx | 2
sc/source/core/data/table1.cxx | 20 +
sc/source/core/data/table3.cxx | 13
sc/source/core/data/table4.cxx | 2
sc/source/core/data/table5.cxx | 4
sc/source/core/data/table6.cxx | 23 -
sc/source/core/tool/addinlis.cxx | 2
sc/source/core/tool/adiasync.cxx | 2
sc/source/core/tool/brdcst.cxx | 14 -
sc/source/core/tool/chartlis.cxx | 2
sc/source/core/tool/ddelink.cxx | 2
sc/source/core/tool/interpr1.cxx | 25 -
sc/source/core/tool/interpr4.cxx | 1
sc/source/core/tool/lookupcache.cxx | 2
sc/source/core/tool/token.cxx | 2
sc/source/filter/dif/difexp.cxx | 1
sc/source/filter/excel/colrowst.cxx | 4
sc/source/filter/excel/xetable.cxx | 1
sc/source/filter/html/htmlexp.cxx | 3
sc/source/filter/oox/pagesettings.cxx | 65 ++--
sc/source/filter/rtf/rtfexp.cxx | 1
sc/source/filter/xml/XMLStylesExportHelper.cxx | 2
sc/source/filter/xml/xmlcelli.cxx | 3
sc/source/ui/docshell/dbdocimp.cxx | 1
sc/source/ui/docshell/docsh.cxx | 8
sc/source/ui/docshell/docsh8.cxx | 14 -
sc/source/ui/docshell/impex.cxx | 2
sc/source/ui/docshell/servobj.cxx | 2
sc/source/ui/unoobj/cellsuno.cxx | 44 +--
sc/source/ui/unoobj/chart2uno.cxx | 5
sc/source/ui/view/spelleng.cxx | 2
58 files changed, 620 insertions(+), 796 deletions(-)
New commits:
commit c239706d2946a4bb696eb067c64e6b7e415f042a
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Thu May 9 12:44:48 2013 -0400
Go back to the old way of detecting headers.
Change-Id: Iabad8f0a3936fa30d4ba68a717a79e4e0b497991
diff --git a/configure.ac b/configure.ac
index e138a45..e84f928 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8082,8 +8082,6 @@ if test "$with_system_mdds" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_MDDS=YES
- PKG_CHECK_MODULES(MDDS, mdds >= 0.8.0)
-
dnl ===================================================================
dnl Determine which hash container mdds shall use
dnl ===================================================================
@@ -8095,6 +8093,16 @@ if test "$with_system_mdds" = "yes"; then
MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
AC_MSG_RESULT([boost::unordered_map])
fi
+
+ AC_LANG_PUSH([C++])
+ save_CPPFLAGS="$CPPFLAGS"
+ CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
+ AC_CHECK_HEADER(mdds/multi_type_vector.hpp, [],
+ [AC_MSG_ERROR(mdds/multi_type_vector.hpp not found. Install mdds >= 0.8.0)], [])
+ AC_CHECK_TYPE(mdds::multi_type_vector<int>::iterator, [],
+ [AC_MSG_ERROR(mdds/multi_type_matrix.hpp does not define multi_type_vector::iterator. Install mdds >= 0.8.0)], [#include <mdds/multi_type_vector.hpp>])
+ CPPFLAGS="$save_CPPFLAGS"
+ AC_LANG_POP([C++])
else
AC_MSG_RESULT([internal])
BUILD_TYPE="$BUILD_TYPE MDDS"
commit af86f7b26f2fafbb0fdfe24682b4700a51334d18
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Thu May 9 11:52:55 2013 -0400
Remove a patch that's no longer needed.
Change-Id: Ie309848f80606432752b60fbdf34e7597308d800
diff --git a/mdds/UnpackedTarball_mdds.mk b/mdds/UnpackedTarball_mdds.mk
index 9764878..b33bc1b 100644
--- a/mdds/UnpackedTarball_mdds.mk
+++ b/mdds/UnpackedTarball_mdds.mk
@@ -17,7 +17,6 @@ $(eval $(call gb_UnpackedTarball_add_patches,mdds,\
mdds/mdds_0.6.0.patch \
mdds/0001-Workaround-for-gcc-bug.patch \
mdds/mdds_0.7.0_unreachable_warning.patch.1 \
- mdds/wundef.patch \
))
# vim: set noet sw=4 ts=4:
diff --git a/mdds/wundef.patch b/mdds/wundef.patch
deleted file mode 100644
index 628f3dd..0000000
--- a/mdds/wundef.patch
+++ /dev/null
@@ -1,42 +0,0 @@
---- misc/mdds_0.6.0/include/mdds/segment_tree.hpp
-+++ misc/build/mdds_0.6.0/include/mdds/segment_tree.hpp
-@@ -285,7 +285,7 @@ public:
- }
- };
-
--#if UNIT_TEST
-+#ifdef UNIT_TEST
- struct node_printer : public ::std::unary_function<const node*, void>
- {
- void operator() (const node* p) const
---- misc/mdds_0.6.0/include/mdds/multi_type_vector_def.inl
-+++ misc/build/mdds_0.6.0/include/mdds/multi_type_vector_def.inl
-@@ -29,7 +29,7 @@
-
- #include <stdexcept>
-
--#if UNIT_TEST
-+#ifdef UNIT_TEST
- #include <iostream>
- using std::cout;
- using std::endl;
---- misc/mdds_0.6.0/include/mdds/mixed_type_matrix_flag_storage.hpp
-+++ misc/build/mdds_0.6.0/include/mdds/mixed_type_matrix_flag_storage.hpp
-@@ -25,7 +25,7 @@
- *
- ************************************************************************/
-
--#if UNIT_TEST
-+#ifdef UNIT_TEST
- #include <iostream>
- #endif
-
-@@ -74,7 +74,7 @@ public:
- // Flag is stored at this position. Remove it.
- m_flags.erase(itr);
- }
--#if UNIT_TEST
-+#ifdef UNIT_TEST
- void dump() const
- {
- using namespace std;
commit 338a6cb6c548764ed5e4dad0ca26eb3ff8d387ab
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Thu May 9 11:32:28 2013 -0400
Update mdds to 0.8.0.
Change-Id: I5dcf3b14993ac4d699e884c4981af668277a41df
diff --git a/configure.ac b/configure.ac
index b16ba33..e138a45 100644
--- a/configure.ac
+++ b/configure.ac
@@ -8082,6 +8082,8 @@ if test "$with_system_mdds" = "yes"; then
AC_MSG_RESULT([external])
SYSTEM_MDDS=YES
+ PKG_CHECK_MODULES(MDDS, mdds >= 0.8.0)
+
dnl ===================================================================
dnl Determine which hash container mdds shall use
dnl ===================================================================
@@ -8093,16 +8095,6 @@ if test "$with_system_mdds" = "yes"; then
MDDS_CPPFLAGS="-DMDDS_HASH_CONTAINER_BOOST"
AC_MSG_RESULT([boost::unordered_map])
fi
-
- AC_LANG_PUSH([C++])
- save_CPPFLAGS="$CPPFLAGS"
- CPPFLAGS="$CPPFLAGS $MDDS_CPPFLAGS"
- AC_CHECK_HEADER(mdds/multi_type_vector.hpp, [],
- [AC_MSG_ERROR(mdds/multi_type_vector.hpp not found. Install mdds >= 0.7.0)], [])
- AC_CHECK_TYPE(mdds::multi_type_vector<int>::iterator, [],
- [AC_MSG_ERROR(mdds/multi_type_matrix.hpp does not define multi_type_vector::iterator. Install mdds >= 0.7.0)], [#include <mdds/multi_type_vector.hpp>])
- CPPFLAGS="$save_CPPFLAGS"
- AC_LANG_POP([C++])
else
AC_MSG_RESULT([internal])
BUILD_TYPE="$BUILD_TYPE MDDS"
diff --git a/download.lst b/download.lst
index 4ba7b08..6cfcfe5 100644
--- a/download.lst
+++ b/download.lst
@@ -63,7 +63,7 @@ export LIBXML_TARBALL := 7740a8ec23878a2f50120e1faa2730f2-libxml2-2.7.6.tar.gz
export LIBXSLT_TARBALL := e61d0364a30146aaa3001296f853b2b9-libxslt-1.1.26.tar.gz
export LPSOLVE_TARBALL := 26b3e95ddf3d9c077c480ea45874b3b8-lp_solve_5.5.tar.gz
export MARIADB_TARBALL := 05f84c95b610c21c5fd510d10debcabf-mariadb-native-client-1.0.0.tar.bz2
-export MDDS_TARBALL := 096fbb818177a7575511c1fd9d4bf7dd-mdds_0.7.1.tar.bz2
+export MDDS_TARBALL := b0bba8c768f3d92608a07149039510e5-mdds_0.8.0.tar.bz2
export MYSQLCPPCONN_TARBALL := 0981bda6548a8c8233ffce2b6e4b2a23-mysql-connector-c++-1.1.0.tar.gz
export MYTHES_TARBALL := 46e92b68e31e858512b680b3b61dc4c1-mythes-1.2.3.tar.gz
export NEON_TARBALL := ff369e69ef0f0143beb5626164e87ae2-neon-0.29.5.tar.gz
commit 7e44f6b6ad386572b7f017a7a66bcd68d586a329
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Thu May 9 10:20:39 2013 -0400
ScHint doesn't need to store broadcaster pointer. Let's not.
Change-Id: I86f9b44c87f3a730902d12505252e4b7e0a24fe4
diff --git a/sc/inc/brdcst.hxx b/sc/inc/brdcst.hxx
index 069f032..beef774 100644
--- a/sc/inc/brdcst.hxx
+++ b/sc/inc/brdcst.hxx
@@ -33,15 +33,11 @@ class SvtBroadcaster;
class ScHint : public SfxSimpleHint
{
-private:
ScAddress aAddress;
- SvtBroadcaster* mpBroadcaster;
public:
TYPEINFO();
- ScHint( sal_uLong n, const ScAddress& a, SvtBroadcaster* p );
- SvtBroadcaster* GetBroadcaster() const;
- void SetBroadcaster( SvtBroadcaster* p );
+ ScHint( sal_uLong n, const ScAddress& a );
const ScAddress& GetAddress() const { return aAddress; }
ScAddress& GetAddress() { return aAddress; }
void SetAddress( const ScAddress& rAdr ) { aAddress = rAdr; }
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index af373d6..a4371f2 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1138,7 +1138,7 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
SCSIZE nNewCount = maItems.size();
bool bCountChanged = false;
ScAddress aAdr( nCol, 0, nTab );
- ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL)
+ ScHint aHint(SC_HINT_DATACHANGED, aAdr); // only areas (ScBaseCell* == NULL)
ScAddress& rAddress = aHint.GetAddress();
// for sparse occupation use single broadcasts, not ranges
bool bSingleBroadcasts = (((maItems.back().nRow - maItems[i].nRow) /
@@ -1725,7 +1725,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
}
// Broadcast changes
ScAddress aAdr( nCol, 0, nTab );
- ScHint aHint(SC_HINT_DATACHANGED, aAdr, NULL); // areas only
+ ScHint aHint(SC_HINT_DATACHANGED, aAdr); // areas only
ScAddress& rAddress = aHint.GetAddress();
// must iterate backwards, because indexes of following cells become invalid
@@ -2104,7 +2104,7 @@ void ScColumn::SetDirty( const ScRange& rRange )
pDocument->SetAutoCalc( false ); // no multiple recalculation
SCROW nRow2 = rRange.aEnd.Row();
ScAddress aPos( nCol, 0, nTab );
- ScHint aHint( SC_HINT_DATACHANGED, aPos, NULL );
+ ScHint aHint(SC_HINT_DATACHANGED, aPos);
SCROW nRow;
SCSIZE nIndex;
Search( rRange.aStart.Row(), nIndex );
@@ -2116,7 +2116,6 @@ void ScColumn::SetDirty( const ScRange& rRange )
else
{
aHint.GetAddress().SetRow( nRow );
- aHint.SetBroadcaster(GetBroadcaster(nRow));
pDocument->Broadcast( aHint );
}
nIndex++;
@@ -2133,7 +2132,7 @@ void ScColumn::SetTableOpDirty( const ScRange& rRange )
pDocument->SetAutoCalc( false ); // no multiple recalculation
SCROW nRow2 = rRange.aEnd.Row();
ScAddress aPos( nCol, 0, nTab );
- ScHint aHint( SC_HINT_TABLEOPDIRTY, aPos, NULL );
+ ScHint aHint(SC_HINT_TABLEOPDIRTY, aPos);
SCROW nRow;
SCSIZE nIndex;
Search( rRange.aStart.Row(), nIndex );
@@ -2145,7 +2144,6 @@ void ScColumn::SetTableOpDirty( const ScRange& rRange )
else
{
aHint.GetAddress().SetRow( nRow );
- aHint.SetBroadcaster(GetBroadcaster(nRow));
pDocument->Broadcast( aHint );
}
nIndex++;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index e36312b..8e8ad31 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -82,7 +82,7 @@ void ScColumn::Insert( SCROW nRow, ScBaseCell* pNewCell )
((ScFormulaCell*)pNewCell)->SetDirty();
else
pDocument->Broadcast(
- ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab)));
}
}
}
@@ -123,7 +123,7 @@ void ScColumn::Delete( SCROW nRow )
pCell->Delete();
pDocument->Broadcast(
- ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab)));
CellStorageModified();
}
@@ -139,7 +139,7 @@ void ScColumn::DeleteAtIndex( SCSIZE nIndex )
pCell->Delete();
pDocument->Broadcast(
- ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab)));
maTextWidths.set_empty(nRow, nRow);
maScriptTypes.set_empty(nRow, nRow);
@@ -220,7 +220,7 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
maScriptTypes.resize(MAXROWCOUNT);
ScAddress aAdr( nCol, 0, nTab );
- ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL)
+ ScHint aHint(SC_HINT_DATACHANGED, aAdr); // only areas (ScBaseCell* == NULL)
ScAddress& rAddress = aHint.GetAddress();
// for sparse occupation use single broadcasts, not ranges
bool bSingleBroadcasts = (((maItems.back().nRow - maItems[i].nRow) /
@@ -485,11 +485,10 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag)
pAttrArray->DeleteHardAttr( nStartRow, nEndRow );
// Broadcast the changes.
- ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, 0, nTab), NULL);
+ ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, 0, nTab));
for (SCROW i = nStartRow; i <= nEndRow; ++i)
{
aHint.GetAddress().SetRow(i);
- aHint.SetBroadcaster(GetBroadcaster(i));
pDocument->Broadcast(aHint);
}
}
@@ -1068,8 +1067,8 @@ void ScColumn::BroadcastInArea( SCROW nRow1, SCROW nRow2 )
if ( pCell->GetCellType() == CELLTYPE_FORMULA )
((ScFormulaCell*)pCell)->SetDirty();
else
- pDocument->Broadcast( ScHint( SC_HINT_DATACHANGED,
- ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+ pDocument->Broadcast( ScHint(SC_HINT_DATACHANGED,
+ ScAddress(nCol, nRow, nTab)));
nIndex++;
}
}
@@ -1324,8 +1323,8 @@ bool ScColumn::SetString( SCROW nRow, SCTAB nTabP, const String& rString,
((ScFormulaCell*)pNewCell)->SetDirty();
}
else
- pDocument->Broadcast( ScHint( SC_HINT_DATACHANGED,
- ScAddress(nCol, nRow, nTabP), GetBroadcaster(nRow)));
+ pDocument->Broadcast(
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTabP)));
}
else
{
diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx
index 1af78e0..3a1d635 100644
--- a/sc/source/core/data/documen7.cxx
+++ b/sc/source/core/data/documen7.cxx
@@ -73,7 +73,7 @@ void ScDocument::Broadcast( const ScHint& rHint )
{
ScBulkBroadcast aBulkBroadcast( pBASM); // scoped bulk broadcast
bool bIsBroadcasted = false;
- SvtBroadcaster* pBC = rHint.GetBroadcaster();
+ SvtBroadcaster* pBC = GetBroadcaster(rHint.GetAddress());
if ( pBC )
{
pBC->Broadcast( rHint );
@@ -445,7 +445,7 @@ void ScDocument::TrackFormulas( sal_uLong nHintId )
do
{
pBC = GetBroadcaster(pTrack->aPos);
- ScHint aHint(nHintId, pTrack->aPos, pBC);
+ ScHint aHint(nHintId, pTrack->aPos);
if (pBC)
pBC->Broadcast( aHint );
pBASM->AreaBroadcast( aHint );
diff --git a/sc/source/core/data/table5.cxx b/sc/source/core/data/table5.cxx
index 852c2c0..f24c56c 100644
--- a/sc/source/core/data/table5.cxx
+++ b/sc/source/core/data/table5.cxx
@@ -1166,7 +1166,7 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p
switch ( pCell->GetCellType() )
{
case CELLTYPE_VALUE :
- pDocument->Broadcast(ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nCol, nRow)));
+ pDocument->Broadcast(ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab)));
break;
case CELLTYPE_FORMULA :
((ScFormulaCell*)pCell)->SetDirty();
@@ -1209,7 +1209,7 @@ void ScTable::InvalidateTextWidth( const ScAddress* pAdrFrom, const ScAddress* p
{
case CELLTYPE_VALUE :
pDocument->Broadcast(
- ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nCol, nRow)));
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab)));
break;
case CELLTYPE_FORMULA :
((ScFormulaCell*)pCell)->SetDirty();
diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx
index bc7d467a..fa945c0 100644
--- a/sc/source/core/tool/addinlis.cxx
+++ b/sc/source/core/tool/addinlis.cxx
@@ -115,7 +115,7 @@ void SAL_CALL ScAddInListener::modified( const ::com::sun::star::sheet::ResultEv
// notify document of changes
- Broadcast( ScHint( SC_HINT_DATACHANGED, ScAddress(), NULL ) );
+ Broadcast( ScHint(SC_HINT_DATACHANGED, ScAddress()) );
for ( ScAddInDocs::iterator it = pDocs->begin(); it != pDocs->end(); ++it )
{
diff --git a/sc/source/core/tool/adiasync.cxx b/sc/source/core/tool/adiasync.cxx
index 5a8af9b..f5e5edb 100644
--- a/sc/source/core/tool/adiasync.cxx
+++ b/sc/source/core/tool/adiasync.cxx
@@ -122,7 +122,7 @@ void ScAddInAsync::CallBack( sal_uLong nHandleP, void* pData )
return;
}
p->bValid = sal_True;
- p->Broadcast( ScHint( SC_HINT_DATACHANGED, ScAddress(), NULL ) );
+ p->Broadcast( ScHint(SC_HINT_DATACHANGED, ScAddress()) );
for ( ScAddInDocs::iterator it = p->pDocs->begin(); it != p->pDocs->end(); ++it )
{
diff --git a/sc/source/core/tool/brdcst.cxx b/sc/source/core/tool/brdcst.cxx
index e860026..dba508b 100644
--- a/sc/source/core/tool/brdcst.cxx
+++ b/sc/source/core/tool/brdcst.cxx
@@ -19,17 +19,7 @@
#include "brdcst.hxx"
-ScHint::ScHint( sal_uLong n, const ScAddress& a, SvtBroadcaster* p ) :
- SfxSimpleHint(n), aAddress(a), mpBroadcaster(p) {}
-
-SvtBroadcaster* ScHint::GetBroadcaster() const
-{
- return mpBroadcaster;
-}
-
-void ScHint::SetBroadcaster( SvtBroadcaster* p )
-{
- mpBroadcaster = p;
-}
+ScHint::ScHint( sal_uLong n, const ScAddress& a ) :
+ SfxSimpleHint(n), aAddress(a) {}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx
index 5ffbe27..d579eaa 100644
--- a/sc/source/core/tool/ddelink.cxx
+++ b/sc/source/core/tool/ddelink.cxx
@@ -199,7 +199,7 @@ sfx2::SvBaseLink::UpdateResult ScDdeLink::DataChanged(
if (HasListeners())
{
- Broadcast( ScHint( SC_HINT_DATACHANGED, ScAddress(), NULL ) );
+ Broadcast(ScHint(SC_HINT_DATACHANGED, ScAddress()));
pDoc->TrackFormulas(); // muss sofort passieren
pDoc->StartTrackTimer();
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index bc71e3b..d7003c9 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -476,7 +476,7 @@ sal_Bool ScDocShell::LoadXML( SfxMedium* pLoadMedium, const ::com::sun::star::un
else
{
// still need to recalc volatile formula cells.
- aDocument.Broadcast( ScHint(SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS, NULL) );
+ aDocument.Broadcast(ScHint(SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS));
}
aDocument.SetXMLFromWrapper( false );
@@ -2759,7 +2759,7 @@ void ScDocShell::SetDocumentModified( sal_Bool bIsModified /* = sal_True */ )
{
// #i115009# broadcast BCA_BRDCST_ALWAYS, so a component can read recalculated results
// of RecalcModeAlways formulas (like OFFSET) after modifying cells
- aDocument.Broadcast( ScHint(SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS, NULL) );
+ aDocument.Broadcast(ScHint(SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS));
aDocument.InvalidateTableArea(); // #i105279# needed here
aDocument.BroadcastUno( SfxSimpleHint( SFX_HINT_DATACHANGED ) );
@@ -2779,7 +2779,7 @@ void ScDocShell::SetDocumentModified( sal_Bool bIsModified /* = sal_True */ )
aDocument.InvalidateStyleSheetUsage();
aDocument.InvalidateTableArea();
aDocument.InvalidateLastTableOpParams();
- aDocument.Broadcast( ScHint(SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS, NULL) );
+ aDocument.Broadcast(ScHint(SC_HINT_DATACHANGED, BCA_BRDCST_ALWAYS));
if ( aDocument.IsForcedFormulaPending() && aDocument.GetAutoCalc() )
aDocument.CalcFormulaTree( sal_True );
PostDataChanged();
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 69b95aa..c6363a4 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2650,7 +2650,7 @@ void ScChart2DataSequence::RebuildDataCache()
if (!m_bExtDataRebuildQueued)
{
m_aDataArray.clear();
- m_pDocument->BroadcastUno(ScHint(SC_HINT_DATACHANGED, ScAddress(), NULL));
+ m_pDocument->BroadcastUno(ScHint(SC_HINT_DATACHANGED, ScAddress()));
m_bExtDataRebuildQueued = true;
m_bGotDataChangedHint = true;
}
commit c6d4a39832357b9e836c0c9903d2286bcf1a69d2
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 16:36:45 2013 -0400
Test more broadcaster relocation scenarios.
Change-Id: Ib34b86cfe6b96134dadf5f8da6dcd14ec0adb9d6
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index d123a6c..940b41e 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1547,29 +1547,38 @@ bool broadcasterShifted(const ScDocument& rDoc, const ScAddress& rFrom, const Sc
return true;
}
-bool checkRelativeRefToken(ScDocument& rDoc, const ScAddress& rPos, SCsCOL nRelCol, SCsROW nRelRow)
+ScToken* getSingleRefToken(ScDocument& rDoc, const ScAddress& rPos)
{
ScFormulaCell* pFC = rDoc.GetFormulaCell(rPos);
if (!pFC)
{
cerr << "Formula cell expected, but not found." << endl;
- return false;
+ return NULL;
}
ScTokenArray* pTokens = pFC->GetCode();
if (!pTokens)
{
cerr << "Token array is not present." << endl;
- return false;
+ return NULL;
}
ScToken* pToken = static_cast<ScToken*>(pTokens->First());
if (!pToken || pToken->GetType() != formula::svSingleRef)
{
cerr << "Not a single reference token." << endl;
- return false;
+ return NULL;
}
+ return pToken;
+}
+
+bool checkRelativeRefToken(ScDocument& rDoc, const ScAddress& rPos, SCsCOL nRelCol, SCsROW nRelRow)
+{
+ ScToken* pToken = getSingleRefToken(rDoc, rPos);
+ if (!pToken)
+ return false;
+
ScSingleRefData& rRef = pToken->GetSingleRef();
if (!rRef.IsColRel() || rRef.nRelCol != nRelCol)
{
@@ -1586,6 +1595,22 @@ bool checkRelativeRefToken(ScDocument& rDoc, const ScAddress& rPos, SCsCOL nRelC
return true;
}
+bool checkDeletedRefToken(ScDocument& rDoc, const ScAddress& rPos)
+{
+ ScToken* pToken = getSingleRefToken(rDoc, rPos);
+ if (!pToken)
+ return false;
+
+ ScSingleRefData& rRef = pToken->GetSingleRef();
+ if (!rRef.IsDeleted())
+ {
+ cerr << "Deleted reference is expected, but it's still a valid reference." << endl;
+ return false;
+ }
+
+ return true;
+}
+
}
void Test::testCellBroadcaster()
@@ -1661,6 +1686,52 @@ void Test::testCellBroadcaster()
CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
broadcasterShifted(*m_pDoc, ScAddress(0,2,0), ScAddress(0,0,0)));
+ // Clear everything again
+ clearRange(m_pDoc, ScRange(0,0,0,10,100,0));
+
+ // B1:B3 depends on A1:A3
+ m_pDoc->SetString(ScAddress(1,0,0), "=A1");
+ m_pDoc->SetString(ScAddress(1,1,0), "=A2");
+ m_pDoc->SetString(ScAddress(1,2,0), "=A3");
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check in B1 failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(1,0,0), -1, 0));
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check in B2 failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(1,1,0), -1, 0));
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check in B3 failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(1,2,0), -1, 0));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist in A1.", m_pDoc->GetBroadcaster(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist in A2.", m_pDoc->GetBroadcaster(ScAddress(0,1,0)));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist in A3.", m_pDoc->GetBroadcaster(ScAddress(0,2,0)));
+
+ // Insert Rows at row 2, down 5 rows.
+ m_pDoc->InsertRow(0, 0, 0, 0, 1, 5);
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist in A1.", m_pDoc->GetBroadcaster(ScAddress(0,0,0)));
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check in B1 failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(1,0,0), -1, 0));
+
+ // Broadcasters in A2 and A3 should shift down by 5 rows.
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
+ broadcasterShifted(*m_pDoc, ScAddress(0,1,0), ScAddress(0,6,0)));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
+ broadcasterShifted(*m_pDoc, ScAddress(0,2,0), ScAddress(0,7,0)));
+
+ // B2 and B3 should reference shifted cells.
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check in B2 failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(1,1,0), -1, 5));
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check in B2 failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(1,2,0), -1, 5));
+
+ // Delete cells with broadcasters.
+ m_pDoc->DeleteRow(0, 0, 0, 0, 4, 6);
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should NOT exist in A7.", !m_pDoc->GetBroadcaster(ScAddress(0,6,0)));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should NOT exist in A8.", !m_pDoc->GetBroadcaster(ScAddress(0,7,0)));
+
+ // References in B2 and B3 should be invalid.
+ CPPUNIT_ASSERT_MESSAGE("Deleted reference check in B2 failed.",
+ checkDeletedRefToken(*m_pDoc, ScAddress(1,1,0)));
+ CPPUNIT_ASSERT_MESSAGE("Deleted reference check in B3 failed.",
+ checkDeletedRefToken(*m_pDoc, ScAddress(1,2,0)));
+
m_pDoc->DeleteTab(0);
}
commit 6cac65cc6e89f4f36dbcca3682f08b7b5ed5b750
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 16:04:50 2013 -0400
Simplify this a bit.
By taking advantage of 1) cell array being std::vector, and 2) broadcasters
are no longer stored with cells.
Change-Id: I9ba1d3004e62d7bb7810d8fed0c4e8fd17605d0f
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 97b361e..af373d6 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1194,29 +1194,14 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
if (bCountChanged)
{
- SCSIZE nDelCount = maItems.size() - nNewCount;
- ScBaseCell** ppDelCells = new ScBaseCell*[nDelCount];
- SCROW* pDelRows = new SCROW[nDelCount];
- for (i = 0; i < nDelCount; i++)
- {
- ppDelCells[i] = maItems[nNewCount+i].pCell;
- pDelRows[i] = maItems[nNewCount+i].nRow;
- }
- maItems.resize( nNewCount );
-
- for (i = 0; i < nDelCount; i++)
- {
- SCROW nDelRow = pDelRows[i];
- SvtBroadcaster* pBC = GetBroadcaster(nDelRow);
- if (pBC)
- {
- MoveListeners( *pBC, pDelRows[i] - nSize );
- ppDelCells[i]->Delete();
- }
- }
-
- delete [] pDelRows;
- delete [] ppDelCells;
+ // Some cells in the lower part of the cell array have been pushed out
+ // beyond MAXROW. Delete them.
+ std::vector<ColEntry>::iterator itBeg = maItems.begin();
+ std::advance(itBeg, nNewCount);
+ for (std::vector<ColEntry>::iterator it = itBeg; it != maItems.end(); ++it)
+ it->pCell->Delete();
+
+ maItems.erase(itBeg, maItems.end());
}
pDocument->SetAutoCalc( bOldAutoCalc );
commit c264a7e7176da645698c770ac50a76ce5b632efa
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 15:43:36 2013 -0400
This is not necessary either.
Change-Id: I9651d58209afd1dd9a77d859db0925b586c3c8ab
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 1ffa949..97b361e 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1211,7 +1211,6 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
if (pBC)
{
MoveListeners( *pBC, pDelRows[i] - nSize );
- maBroadcasters.set_empty(nDelRow, nDelRow);
ppDelCells[i]->Delete();
}
}
commit d3a3db0e5fd5693b14caf53e50eb564912980722
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 15:15:15 2013 -0400
No need to check for broadcaster's presence here.
The old code did because it would then have to create a ScNoteCell to
optionally store the broadcaster. That's no longer the case.
Change-Id: I5e031270e0ed77425b2be192a1705c64c6fa8f45
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index e9ecd31..e36312b 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -328,10 +328,9 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
for ( SCSIZE nIdx = nStartIndex; nIdx <= nEndIndex; ++nIdx )
{
- SCROW nRow = maItems[nIdx].nRow;
- if (((nDelFlag & IDF_CONTENTS) == IDF_CONTENTS) && maBroadcasters.is_empty(nRow))
+ if (((nDelFlag & IDF_CONTENTS) == IDF_CONTENTS))
{
- // all content is deleted and cell does not contain broadcaster
+ // all content is to be deleted.
ScBaseCell* pOldCell = maItems[ nIdx ].pCell;
if (pOldCell->GetCellType() == CELLTYPE_FORMULA)
commit beb1db61eeb9dd15bacc4941c2c9fcd91f6df9b6
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 14:51:16 2013 -0400
Script types are unsigned char now.
Change-Id: I744d66da3abd18753550692b931c6a1a52b83401
diff --git a/sc/source/core/data/documentimport.cxx b/sc/source/core/data/documentimport.cxx
index e0df2a2..bb638af 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -115,7 +115,7 @@ void ScDocumentImport::finalize()
for (; itCell != itCellEnd; ++itCell)
{
itWidthPos = rCol.maTextWidths.set<unsigned short>(itWidthPos, itCell->nRow, TEXTWIDTH_DIRTY);
- itScriptPos = rCol.maScriptTypes.set<unsigned short>(itScriptPos, itCell->nRow, SC_SCRIPTTYPE_UNKNOWN);
+ itScriptPos = rCol.maScriptTypes.set<unsigned char>(itScriptPos, itCell->nRow, SC_SCRIPTTYPE_UNKNOWN);
}
}
}
commit 4259df774a5785b3af7bbc92dee42ecc753b12e4
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 14:31:54 2013 -0400
Set page style name to the sheet directly via ScDocument, not UNO API.
This alone saves about 20 or more seconds during import of large xlsx
document.
Change-Id: I267236afbd0284f56d4fd079042a71936db0c3e3
diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx
index 2123056..00b5d5a 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -31,6 +31,7 @@
#include <com/sun/star/text/XTextCursor.hpp>
#include <rtl/strbuf.hxx>
#include <rtl/ustrbuf.hxx>
+#include <sax/tools/converter.hxx>
#include "oox/core/xmlfilterbase.hxx"
#include "oox/helper/attributelist.hxx"
#include "oox/helper/graphichelper.hxx"
@@ -40,7 +41,7 @@
#include "excelhandlers.hxx"
#include "stylesbuffer.hxx"
#include "unitconverter.hxx"
-#include <sax/tools/converter.hxx>
+#include "document.hxx"
namespace oox {
namespace xls {
@@ -329,8 +330,9 @@ void PageSettings::finalizeImport()
PropertySet aStyleProps( xStyle );
getPageSettingsConverter().writePageSettingsProperties( aStyleProps, maModel, getSheetType() );
- PropertySet aSheetProps( getSheet() );
- aSheetProps.setProperty( PROP_PageStyle, aStyleName );
+ // Set page style name to the sheet.
+ SCTAB nTab = getSheetIndex();
+ getScDocument().SetPageStyle(nTab, aStyleName);
}
void PageSettings::importPictureData( const Relations& rRelations, const OUString& rRelId )
commit 1f083d2d288c74ffb2ae6395d163828b2a9ce4d9
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 14:26:32 2013 -0400
Remove using namespace statements that may cause naming clashes.
Change-Id: Ibf695f7ddaac8fa44e1d6d4ed69aea37743d1c9b
diff --git a/sc/source/filter/oox/pagesettings.cxx b/sc/source/filter/oox/pagesettings.cxx
index 5cf3172..2123056 100644
--- a/sc/source/filter/oox/pagesettings.cxx
+++ b/sc/source/filter/oox/pagesettings.cxx
@@ -48,12 +48,7 @@ namespace xls {
// ============================================================================
using namespace ::com::sun::star;
-using namespace ::com::sun::star::awt;
-using namespace ::com::sun::star::container;
using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::sheet;
-using namespace ::com::sun::star::style;
-using namespace ::com::sun::star::text;
using namespace ::com::sun::star::uno;
using ::oox::core::Relations;
@@ -323,14 +318,14 @@ void PageSettings::setFitToPagesMode( bool bFitToPages )
void PageSettings::finalizeImport()
{
OUStringBuffer aStyleNameBuffer( "PageStyle_" );
- Reference< XNamed > xSheetName( getSheet(), UNO_QUERY );
+ Reference<container::XNamed> xSheetName(getSheet(), UNO_QUERY);
if( xSheetName.is() )
aStyleNameBuffer.append( xSheetName->getName() );
else
aStyleNameBuffer.append( static_cast< sal_Int32 >( getSheetIndex() + 1 ) );
OUString aStyleName = aStyleNameBuffer.makeStringAndClear();
- Reference< XStyle > xStyle = createStyleObject( aStyleName, true );
+ Reference<style::XStyle> xStyle = createStyleObject(aStyleName, true);
PropertySet aStyleProps( xStyle );
getPageSettingsConverter().writePageSettingsProperties( aStyleProps, maModel, getSheetType() );
@@ -360,16 +355,16 @@ enum HFPortionId
struct HFPortionInfo
{
- Reference< XText > mxText; /// XText interface of this portion.
- Reference< XTextCursor > mxStart; /// Start position of current text range for formatting.
- Reference< XTextCursor > mxEnd; /// End position of current text range for formatting.
+ Reference<text::XText> mxText; /// XText interface of this portion.
+ Reference<text::XTextCursor> mxStart; /// Start position of current text range for formatting.
+ Reference<text::XTextCursor> mxEnd; /// End position of current text range for formatting.
double mfTotalHeight; /// Sum of heights of previous lines in points.
double mfCurrHeight; /// Height of the current text line in points.
- bool initialize( const Reference< XText >& rxText );
+ bool initialize( const Reference<text::XText>& rxText );
};
-bool HFPortionInfo::initialize( const Reference< XText >& rxText )
+bool HFPortionInfo::initialize( const Reference<text::XText>& rxText )
{
mfTotalHeight = mfCurrHeight = 0.0;
mxText = rxText;
@@ -393,16 +388,16 @@ public:
/** Parses the passed string and creates the header/footer contents.
@returns The total height of the converted header or footer in points. */
double parse(
- const Reference< XHeaderFooterContent >& rxContext,
+ const Reference<sheet::XHeaderFooterContent>& rxContext,
const OUString& rData );
private:
/** Returns the current edit engine text object. */
inline HFPortionInfo& getPortion() { return maPortions[ meCurrPortion ]; }
/** Returns the start cursor of the current text range. */
- inline const Reference< XTextCursor >& getStartPos() { return getPortion().mxStart; }
+ inline const Reference<text::XTextCursor>& getStartPos() { return getPortion().mxStart; }
/** Returns the end cursor of the current text range. */
- inline const Reference< XTextCursor >& getEndPos() { return getPortion().mxEnd; }
+ inline const Reference<text::XTextCursor>& getEndPos() { return getPortion().mxEnd; }
/** Returns the current line height of the specified portion. */
double getCurrHeight( HFPortionId ePortion ) const;
@@ -422,9 +417,9 @@ private:
void appendLineBreak();
/** Creates a text field from the passed service name. */
- Reference< XTextContent > createField( const OUString& rServiceName ) const;
+ Reference<text::XTextContent> createField( const OUString& rServiceName ) const;
/** Appends the passed text field. */
- void appendField( const Reference< XTextContent >& rxContent );
+ void appendField( const Reference<text::XTextContent>& rxContent );
/** Sets the passed font name if it is valid. */
void convertFontName( const OUString& rStyle );
@@ -498,7 +493,7 @@ HeaderFooterParser::HeaderFooterParser( const WorkbookHelper& rHelper ) :
{
}
-double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxContext, const OUString& rData )
+double HeaderFooterParser::parse( const Reference<sheet::XHeaderFooterContent>& rxContext, const OUString& rData )
{
if( !rxContext.is() || rData.isEmpty() ||
!maPortions[ HF_LEFT ].initialize( rxContext->getLeftText() ) ||
@@ -576,7 +571,7 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
case 'F': // file name
{
- Reference< XTextContent > xContent = createField( maFileNameService );
+ Reference<text::XTextContent> xContent = createField( maFileNameService );
PropertySet aPropSet( xContent );
aPropSet.setProperty( PROP_FileFormat, ::com::sun::star::text::FilenameDisplayFormat::NAME_AND_EXT );
appendField( xContent );
@@ -585,7 +580,7 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
case 'Z': // file path (without file name), OOXML, BIFF12, and BIFF8 only
if( (getFilterType() == FILTER_OOXML) || ((getFilterType() == FILTER_BIFF) && (getBiff() == BIFF8)) )
{
- Reference< XTextContent > xContent = createField( maFileNameService );
+ Reference<text::XTextContent> xContent = createField( maFileNameService );
PropertySet aPropSet( xContent );
// FilenameDisplayFormat::PATH not supported by Calc
aPropSet.setProperty( PROP_FileFormat, ::com::sun::star::text::FilenameDisplayFormat::FULL );
@@ -598,7 +593,7 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
break;
case 'D': // date
{
- Reference< XTextContent > xContent = createField( maDateTimeService );
+ Reference<text::XTextContent> xContent = createField( maDateTimeService );
PropertySet aPropSet( xContent );
aPropSet.setProperty( PROP_IsDate, true );
appendField( xContent );
@@ -606,7 +601,7 @@ double HeaderFooterParser::parse( const Reference< XHeaderFooterContent >& rxCon
break;
case 'T': // time
{
- Reference< XTextContent > xContent = createField( maDateTimeService );
+ Reference<text::XTextContent> xContent = createField( maDateTimeService );
PropertySet aPropSet( xContent );
aPropSet.setProperty( PROP_IsDate, false );
appendField( xContent );
@@ -772,7 +767,7 @@ void HeaderFooterParser::updateCurrHeight()
void HeaderFooterParser::setAttributes()
{
- Reference< XTextRange > xRange( getStartPos(), UNO_QUERY );
+ Reference<text::XTextRange> xRange( getStartPos(), UNO_QUERY );
getEndPos()->gotoRange( xRange, sal_False );
getEndPos()->gotoEnd( sal_True );
if( !getEndPos()->isCollapsed() )
@@ -804,9 +799,9 @@ void HeaderFooterParser::appendLineBreak()
getPortion().mfCurrHeight = 0;
}
-Reference< XTextContent > HeaderFooterParser::createField( const OUString& rServiceName ) const
+Reference<text::XTextContent> HeaderFooterParser::createField( const OUString& rServiceName ) const
{
- Reference< XTextContent > xContent;
+ Reference<text::XTextContent> xContent;
try
{
xContent.set( getBaseFilter().getModelFactory()->createInstance( rServiceName ), UNO_QUERY_THROW );
@@ -820,12 +815,12 @@ Reference< XTextContent > HeaderFooterParser::createField( const OUString& rServ
return xContent;
}
-void HeaderFooterParser::appendField( const Reference< XTextContent >& rxContent )
+void HeaderFooterParser::appendField( const Reference<text::XTextContent>& rxContent )
{
getEndPos()->gotoEnd( sal_False );
try
{
- Reference< XTextRange > xRange( getEndPos(), UNO_QUERY_THROW );
+ Reference<text::XTextRange> xRange( getEndPos(), UNO_QUERY_THROW );
getPortion().mxText->insertTextContent( xRange, rxContent, sal_False );
updateCurrHeight();
}
@@ -1043,18 +1038,18 @@ void PageSettingsConverter::writePageSettingsProperties(
// paper size
if( !rModel.mbValidSettings )
{
- Size aSize;
+ awt::Size aSize;
bool bValid = false;
if( (0 < rModel.mnPaperSize) && (rModel.mnPaperSize < static_cast< sal_Int32 >( STATIC_ARRAY_SIZE( spPaperSizeTable ) )) )
{
const ApiPaperSize& rPaperSize = spPaperSizeTable[ rModel.mnPaperSize ];
- aSize = Size( rPaperSize.mnWidth, rPaperSize.mnHeight );
+ aSize = awt::Size( rPaperSize.mnWidth, rPaperSize.mnHeight );
bValid = true;
}
if( rModel.mnPaperWidth > 0 && rModel.mnPaperHeight > 0 )
{
- aSize = Size( rModel.mnPaperWidth, rModel.mnPaperHeight );
+ aSize = awt::Size( rModel.mnPaperWidth, rModel.mnPaperHeight );
bValid = true;
}
@@ -1153,7 +1148,7 @@ sal_Int32 PageSettingsConverter::writeHeaderFooter(
sal_Int32 nHeight = 0;
if( !rContent.isEmpty() )
{
- Reference< XHeaderFooterContent > xHFContent( rPropSet.getAnyProperty( nPropId ), UNO_QUERY );
+ Reference<sheet::XHeaderFooterContent> xHFContent(rPropSet.getAnyProperty(nPropId), UNO_QUERY);
if( xHFContent.is() )
{
double fTotalHeight = mxHFParser->parse( xHFContent, rContent );
commit 4e8206b40d960509606d4e19012da296ab71aee8
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 00:08:14 2013 -0400
Change of plan. ScColumn::DeleteRange() will NOT broadcast. Ever.
Change-Id: I610cafaab2d29d0260ebeacdd9b2bf75722a95f2
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 9290e3a..e9ecd31 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -435,9 +435,6 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
(*aIt)->Delete();
}
}
-
- // TODO: Broadcasting is temporarily removed from this method. Add it back
- // once the broadcaster refactoring is finished.
}
commit cc7ec4b3066d47e632ebb0478259a060d030373a
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Wed May 8 00:06:08 2013 -0400
The same thing applies in reverse direction.
Change-Id: I3f5863d79ad948461d63dbc9addc8ca01e1b275e
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index ffb2c47..d123a6c 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1653,8 +1653,13 @@ void Test::testCellBroadcaster()
// While column A is still empty, move column A down 2 cells. This should
// move the broadcaster from A1 to A3.
m_pDoc->InsertRow(0, 0, 0, 0, 0, 2);
- pBC = m_pDoc->GetBroadcaster(ScAddress(0,2,0));
- CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist in A3.", pBC);
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
+ broadcasterShifted(*m_pDoc, ScAddress(0,0,0), ScAddress(0,2,0)));
+
+ // Move it back while column A is still empty.
+ m_pDoc->DeleteRow(0, 0, 0, 0, 0, 2);
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
+ broadcasterShifted(*m_pDoc, ScAddress(0,2,0), ScAddress(0,0,0)));
m_pDoc->DeleteTab(0);
}
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 1c36346..9290e3a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -164,8 +164,13 @@ void ScColumn::FreeAll()
void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
{
+ SCROW nEndRow = nStartRow + nSize - 1;
+
pAttrArray->DeleteRow( nStartRow, nSize );
+ maBroadcasters.erase(nStartRow, nEndRow);
+ maBroadcasters.resize(MAXROWCOUNT);
+
if ( maItems.empty() )
return ;
@@ -178,12 +183,10 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
pDocument->SetAutoCalc( false ); // Avoid calculating it multiple times
bool bFound = false;
- SCROW nEndRow = nStartRow + nSize - 1;
SCSIZE nStartIndex = 0;
SCSIZE nEndIndex = 0;
SCSIZE i;
- maBroadcasters.set_empty(nStartRow, nEndRow);
for ( i = nFirstIndex; i < maItems.size() && maItems[i].nRow <= nEndRow; i++ )
{
@@ -215,8 +218,6 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
maTextWidths.resize(MAXROWCOUNT);
maScriptTypes.erase(nStartRow, nEndRow);
maScriptTypes.resize(MAXROWCOUNT);
- maBroadcasters.erase(nStartRow, nEndRow);
- maBroadcasters.resize(MAXROWCOUNT);
ScAddress aAdr( nCol, 0, nTab );
ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL)
commit c929a78a453e3b06fd99b213fee8587dfdd68e3e
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 7 23:58:49 2013 -0400
Fix another broadcaster bug and a test code to catch it.
Broadcasters are now independent of cell storage. We need to move them
even when the cell array is empty.
Change-Id: Ib26e544ad6e3842fa722d989c994c19d7c1b3005
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 9941815..ffb2c47 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1643,6 +1643,19 @@ void Test::testCellBroadcaster()
pBC = m_pDoc->GetBroadcaster(ScAddress(1,2,0));
CPPUNIT_ASSERT_MESSAGE("Broadcaster in B3 should have been removed.", !pBC);
+ // Clear everything and start over.
+ clearRange(m_pDoc, ScRange(0,0,0,10,100,0));
+
+ m_pDoc->SetString(ScAddress(1,0,0), "=A1"); // B1 depends on A1.
+ pBC = m_pDoc->GetBroadcaster(ScAddress(0,0,0));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist in A1.", pBC);
+
+ // While column A is still empty, move column A down 2 cells. This should
+ // move the broadcaster from A1 to A3.
+ m_pDoc->InsertRow(0, 0, 0, 0, 0, 2);
+ pBC = m_pDoc->GetBroadcaster(ScAddress(0,2,0));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist in A3.", pBC);
+
m_pDoc->DeleteTab(0);
}
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 297fd66..1ffa949 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1121,7 +1121,8 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
{
pAttrArray->InsertRow( nStartRow, nSize );
- //! Search
+ maBroadcasters.insert_empty(nStartRow, nSize);
+ maBroadcasters.resize(MAXROWCOUNT);
if ( maItems.empty() )
return;
@@ -1225,8 +1226,6 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
maTextWidths.resize(MAXROWCOUNT);
maScriptTypes.insert_empty(nStartRow, nSize);
maScriptTypes.resize(MAXROWCOUNT);
- maBroadcasters.insert_empty(nStartRow, nSize);
- maBroadcasters.resize(MAXROWCOUNT);
CellStorageModified();
}
commit cd80616ef96bce7b4180d31c9b37ea17fe7efae0
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 7 23:40:08 2013 -0400
Test to ensure that removing a listening formula cell remove the broadcaster.
Change-Id: Iae816c68ffed30fda0115ac0f5ac2800ceed5e58
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 8aba718..9941815 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1635,6 +1635,14 @@ void Test::testCellBroadcaster()
CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
broadcasterShifted(*m_pDoc, ScAddress(0,2,0), ScAddress(1,2,0)));
+ // Delete formula in C2, which should remove the broadcaster in B3.
+ pBC = m_pDoc->GetBroadcaster(ScAddress(1,2,0));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster in B3 should still exist.", pBC);
+ clearRange(m_pDoc, ScAddress(2,0,0));
+ CPPUNIT_ASSERT_EQUAL(CELLTYPE_NONE, m_pDoc->GetCellType(ScAddress(2,0,0))); // C2 should be empty.
+ pBC = m_pDoc->GetBroadcaster(ScAddress(1,2,0));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster in B3 should have been removed.", !pBC);
+
m_pDoc->DeleteTab(0);
}
commit 667a112815225d65e126898add254a0903ecd34f
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Tue May 7 23:23:18 2013 -0400
More test and more fix wrt broadcaster rework.
Much of the fix went into mdds actually.
Change-Id: Ia27b0bde31081a5a28fb4afb80960777bd4fdd4f
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 27fa863..8aba718 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -1527,6 +1527,67 @@ void Test::testFormulaDepTracking2()
m_pDoc->DeleteTab(0);
}
+namespace {
+
+bool broadcasterShifted(const ScDocument& rDoc, const ScAddress& rFrom, const ScAddress& rTo)
+{
+ const SvtBroadcaster* pBC = rDoc.GetBroadcaster(rFrom);
+ if (pBC)
+ {
+ cerr << "Broadcaster shouldn't be here." << endl;
+ return false;
+ }
+
+ pBC = rDoc.GetBroadcaster(rTo);
+ if (!pBC)
+ {
+ cerr << "Broadcaster should be here." << endl;
+ return false;
+ }
+ return true;
+}
+
+bool checkRelativeRefToken(ScDocument& rDoc, const ScAddress& rPos, SCsCOL nRelCol, SCsROW nRelRow)
+{
+ ScFormulaCell* pFC = rDoc.GetFormulaCell(rPos);
+ if (!pFC)
+ {
+ cerr << "Formula cell expected, but not found." << endl;
+ return false;
+ }
+
+ ScTokenArray* pTokens = pFC->GetCode();
+ if (!pTokens)
+ {
+ cerr << "Token array is not present." << endl;
+ return false;
+ }
+
+ ScToken* pToken = static_cast<ScToken*>(pTokens->First());
+ if (!pToken || pToken->GetType() != formula::svSingleRef)
+ {
+ cerr << "Not a single reference token." << endl;
+ return false;
+ }
+
+ ScSingleRefData& rRef = pToken->GetSingleRef();
+ if (!rRef.IsColRel() || rRef.nRelCol != nRelCol)
+ {
+ cerr << "Unexpected relative column address." << endl;
+ return false;
+ }
+
+ if (!rRef.IsRowRel() || rRef.nRelRow != nRelRow)
+ {
+ cerr << "Unexpected relative row address." << endl;
+ return false;
+ }
+
+ return true;
+}
+
+}
+
void Test::testCellBroadcaster()
{
CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, "foo"));
@@ -1546,28 +1607,35 @@ void Test::testCellBroadcaster()
// Move column A down 5 cells. Make sure B1 now references A6, not A1.
m_pDoc->InsertRow(0, 0, 0, 0, 0, 5);
- ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
- CPPUNIT_ASSERT_MESSAGE("Expected a formula cell.", pFC);
- ScTokenArray* pTokens = pFC->GetCode();
- ScToken* pToken = static_cast<ScToken*>(pTokens->First());
- CPPUNIT_ASSERT_MESSAGE("Reference token not found.", pToken && pToken->GetType() == formula::svSingleRef);
- ScSingleRefData& rRef = pToken->GetSingleRef();
- CPPUNIT_ASSERT_EQUAL(static_cast<SCsCOL>(-1), rRef.nRelCol);
- CPPUNIT_ASSERT_EQUAL(static_cast<SCsROW>(5), rRef.nRelRow);
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(1,0,0), -1, 5));
// Make sure the broadcaster has also moved.
- pBC = m_pDoc->GetBroadcaster(ScAddress(0,0,0));
- CPPUNIT_ASSERT_MESSAGE("Broadcaster shouldn't exist at A1.", !pBC);
- pBC = m_pDoc->GetBroadcaster(ScAddress(0,5,0));
- CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist at A6.", pBC);
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
+ broadcasterShifted(*m_pDoc, ScAddress(0,0,0), ScAddress(0,5,0)));
// Set new value to A6 and make sure B1 gets updated.
m_pDoc->SetValue(ScAddress(0,5,0), 45.6);
val = m_pDoc->GetValue(ScAddress(1,0,0));
CPPUNIT_ASSERT_EQUAL(45.6, val);
+ // Move column A up 3 cells, and make sure B1 now references A3, not A6.
+ m_pDoc->DeleteRow(0, 0, 0, 0, 0, 3);
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(1,0,0), -1, 2));
+
+ // The broadcaster should also have been relocated from A6 to A3.
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
+ broadcasterShifted(*m_pDoc, ScAddress(0,5,0), ScAddress(0,2,0)));
+
+ // Insert cells over A1:A10 and shift cells to right.
+ m_pDoc->InsertCol(ScRange(0, 0, 0, 0, 10, 0));
+ CPPUNIT_ASSERT_MESSAGE("Relative reference check failed.",
+ checkRelativeRefToken(*m_pDoc, ScAddress(2,0,0), -1, 2));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster relocation failed.",
+ broadcasterShifted(*m_pDoc, ScAddress(0,2,0), ScAddress(1,2,0)));
+
m_pDoc->DeleteTab(0);
- CPPUNIT_ASSERT_MESSAGE("good, all test passed.", false);
}
void Test::testFuncParam()
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 55fe296..297fd66 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1687,6 +1687,9 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
{
pAttrArray->MoveTo(nStartRow, nEndRow, *rCol.pAttrArray);
+ // Move the broadcasters to the destination column.
+ maBroadcasters.transfer(nStartRow, nEndRow, rCol.maBroadcasters, nStartRow);
+
if (maItems.empty())
// No cells to move.
return;
@@ -1702,10 +1705,17 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
aRows.push_back( nRow);
rCol.Insert( nRow, maItems[i].pCell);
}
+
SCSIZE nStopPos = i;
if (nStartPos < nStopPos)
{
- // Create list of ranges of cell entry positions
+ // At least one cell gets copied to the destination column.
+ maTextWidths.set_empty(nStartRow, nEndRow);
+ maScriptTypes.set_empty(nStartRow, nEndRow);
+
+ CellStorageModified();
+
+ // Create list of ranges of cell entry positions.
typedef ::std::pair<SCSIZE,SCSIZE> PosPair;
typedef ::std::vector<PosPair> EntryPosPairs;
EntryPosPairs aEntries;
@@ -1736,7 +1746,6 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
ScAddress& rAddress = aHint.GetAddress();
// must iterate backwards, because indexes of following cells become invalid
- bool bErased = false;
for (EntryPosPairs::reverse_iterator it( aEntries.rbegin());
it != aEntries.rend(); ++it)
{
@@ -1749,14 +1758,6 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
}
// Erase the slots containing pointers to the dummy cell instance.
maItems.erase(maItems.begin() + nStartPos, maItems.begin() + nStopPos);
- bErased = true;
- }
-
- if (bErased)
- {
- maTextWidths.set_empty(nStartRow, nEndRow);
- maScriptTypes.set_empty(nStartRow, nEndRow);
- CellStorageModified();
}
}
}
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index d9eb7f8..1c36346 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -215,6 +215,8 @@ void ScColumn::DeleteRow( SCROW nStartRow, SCSIZE nSize )
maTextWidths.resize(MAXROWCOUNT);
maScriptTypes.erase(nStartRow, nEndRow);
maScriptTypes.resize(MAXROWCOUNT);
+ maBroadcasters.erase(nStartRow, nEndRow);
+ maBroadcasters.resize(MAXROWCOUNT);
ScAddress aAdr( nCol, 0, nTab );
ScHint aHint( SC_HINT_DATACHANGED, aAdr, NULL ); // only areas (ScBaseCell* == NULL)
commit 0f18a3a4bb3a4998867995f4ca8b87dacbb2ca40
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Mon May 6 12:14:04 2013 -0400
Start writing unit test for broadcaster storage. Found & fixed one bug.
Change-Id: Ibc00f3fb4eb188b036b4f3ae70e45cb9c7385fe8
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 3c79fa3..e594ba2 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -473,6 +473,7 @@ public:
void SetNumberFormat( SCROW nRow, sal_uInt32 nNumberFormat );
SvtBroadcaster* GetBroadcaster( SCROW nRow );
+ const SvtBroadcaster* GetBroadcaster( SCROW nRow ) const;
private:
void DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDelFlag );
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 79a0626..adca7d5 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1950,6 +1950,9 @@ public:
const double* FetchDoubleArray(
sc::FormulaGroupContext& rCxt, const ScAddress& rPos, SCROW nLength ) const;
+ SvtBroadcaster* GetBroadcaster( const ScAddress& rPos );
+ const SvtBroadcaster* GetBroadcaster( const ScAddress& rPos ) const;
+
private: // CLOOK-Impl-methods
/**
@@ -1967,8 +1970,6 @@ private: // CLOOK-Impl-methods
ScDocument* mpDoc;
};
- SvtBroadcaster* GetBroadcaster( const ScAddress& rPos );
-
bool TableExists( SCTAB nTab ) const;
void MergeNumberFormatter(ScDocument* pSrcDoc);
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index c7b3498..c581228 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -832,6 +832,7 @@ public:
ScRefCellValue GetRefCellValue( SCCOL nCol, SCROW nRow );
SvtBroadcaster* GetBroadcaster( SCCOL nCol, SCROW nRow );
+ const SvtBroadcaster* GetBroadcaster( SCCOL nCol, SCROW nRow ) const;
/** Replace behaves differently to the Search; adjust the rCol and rRow accordingly.
diff --git a/sc/qa/unit/ucalc.cxx b/sc/qa/unit/ucalc.cxx
index 3fcc260..27fa863 100644
--- a/sc/qa/unit/ucalc.cxx
+++ b/sc/qa/unit/ucalc.cxx
@@ -50,6 +50,7 @@
#include "types.hxx"
#include "conditio.hxx"
#include "globstr.hrc"
+#include "tokenarray.hxx"
#include "formula/IFunctionDescription.hxx"
@@ -119,6 +120,13 @@ public:
* Another test for formula dependency tracking, inspired by fdo#56278.
*/
void testFormulaDepTracking2();
+
+ /**
+ * More direct test for cell broadcaster management, used to track formula
+ * dependencies.
+ */
+ void testCellBroadcaster();
+
void testFuncParam();
void testNamedRange();
void testCSV();
@@ -267,6 +275,7 @@ public:
CPPUNIT_TEST(testVolatileFunc);
CPPUNIT_TEST(testFormulaDepTracking);
CPPUNIT_TEST(testFormulaDepTracking2);
+ CPPUNIT_TEST(testCellBroadcaster);
CPPUNIT_TEST(testFuncParam);
CPPUNIT_TEST(testNamedRange);
CPPUNIT_TEST(testCSV);
@@ -1518,6 +1527,49 @@ void Test::testFormulaDepTracking2()
m_pDoc->DeleteTab(0);
}
+void Test::testCellBroadcaster()
+{
+ CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (0, "foo"));
+
+ AutoCalcSwitch aACSwitch(m_pDoc, true); // turn on auto calculation.
+ m_pDoc->SetString(ScAddress(1,0,0), "=A1"); // B1 depends on A1.
+ double val = m_pDoc->GetValue(ScAddress(1,0,0)); // A1 is empty, so the result should be 0.
+ CPPUNIT_ASSERT_EQUAL(0.0, val);
+
+ const SvtBroadcaster* pBC = m_pDoc->GetBroadcaster(ScAddress(0,0,0));
+ CPPUNIT_ASSERT_MESSAGE("Cell A1 should have a broadcaster.", pBC);
+
+ // Change the value of A1 and make sure that B1 follows.
+ m_pDoc->SetValue(ScAddress(0,0,0), 1.23);
+ val = m_pDoc->GetValue(ScAddress(1,0,0));
+ CPPUNIT_ASSERT_EQUAL(1.23, val);
+
+ // Move column A down 5 cells. Make sure B1 now references A6, not A1.
+ m_pDoc->InsertRow(0, 0, 0, 0, 0, 5);
+ ScFormulaCell* pFC = m_pDoc->GetFormulaCell(ScAddress(1,0,0));
+ CPPUNIT_ASSERT_MESSAGE("Expected a formula cell.", pFC);
+ ScTokenArray* pTokens = pFC->GetCode();
+ ScToken* pToken = static_cast<ScToken*>(pTokens->First());
+ CPPUNIT_ASSERT_MESSAGE("Reference token not found.", pToken && pToken->GetType() == formula::svSingleRef);
+ ScSingleRefData& rRef = pToken->GetSingleRef();
+ CPPUNIT_ASSERT_EQUAL(static_cast<SCsCOL>(-1), rRef.nRelCol);
+ CPPUNIT_ASSERT_EQUAL(static_cast<SCsROW>(5), rRef.nRelRow);
+
+ // Make sure the broadcaster has also moved.
+ pBC = m_pDoc->GetBroadcaster(ScAddress(0,0,0));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster shouldn't exist at A1.", !pBC);
+ pBC = m_pDoc->GetBroadcaster(ScAddress(0,5,0));
+ CPPUNIT_ASSERT_MESSAGE("Broadcaster should exist at A6.", pBC);
+
+ // Set new value to A6 and make sure B1 gets updated.
+ m_pDoc->SetValue(ScAddress(0,5,0), 45.6);
+ val = m_pDoc->GetValue(ScAddress(1,0,0));
+ CPPUNIT_ASSERT_EQUAL(45.6, val);
+
+ m_pDoc->DeleteTab(0);
+ CPPUNIT_ASSERT_MESSAGE("good, all test passed.", false);
+}
+
void Test::testFuncParam()
{
OUString aTabName("foo");
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 6f4aff8..55fe296 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1225,6 +1225,8 @@ void ScColumn::InsertRow( SCROW nStartRow, SCSIZE nSize )
maTextWidths.resize(MAXROWCOUNT);
maScriptTypes.insert_empty(nStartRow, nSize);
maScriptTypes.resize(MAXROWCOUNT);
+ maBroadcasters.insert_empty(nStartRow, nSize);
+ maBroadcasters.resize(MAXROWCOUNT);
CellStorageModified();
}
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 40fcf2c..9fcf5aa 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1513,6 +1513,11 @@ SvtBroadcaster* ScColumn::GetBroadcaster(SCROW nRow)
return maBroadcasters.get<SvtBroadcaster*>(nRow);
}
+const SvtBroadcaster* ScColumn::GetBroadcaster(SCROW nRow) const
+{
+ return maBroadcasters.get<SvtBroadcaster*>(nRow);
+}
+
unsigned short ScColumn::GetTextWidth(SCROW nRow) const
{
return maTextWidths.get<unsigned short>(nRow);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 7a26719..8da6a51 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2210,6 +2210,14 @@ SvtBroadcaster* ScDocument::GetBroadcaster( const ScAddress& rPos )
return maTabs[rPos.Tab()]->GetBroadcaster(rPos.Col(), rPos.Row());
}
+const SvtBroadcaster* ScDocument::GetBroadcaster( const ScAddress& rPos ) const
+{
+ if (!TableExists(rPos.Tab()))
+ return NULL;
+
+ return maTabs[rPos.Tab()]->GetBroadcaster(rPos.Col(), rPos.Row());
+}
+
bool ScDocument::TableExists( SCTAB nTab ) const
{
return ValidTab(nTab) && static_cast<size_t>(nTab) < maTabs.size() && maTabs[nTab];
diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 37278d6..57315b7 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2168,6 +2168,14 @@ SvtBroadcaster* ScTable::GetBroadcaster( SCCOL nCol, SCROW nRow )
return aCol[nCol].GetBroadcaster(nRow);
}
+const SvtBroadcaster* ScTable::GetBroadcaster( SCCOL nCol, SCROW nRow ) const
+{
+ if (!ValidColRow(nCol, nRow))
+ return NULL;
+
+ return aCol[nCol].GetBroadcaster(nRow);
+}
+
void ScTable::DeleteConditionalFormat( sal_uLong nIndex )
{
mpCondFormatList->erase(nIndex);
commit 6cbca6fc0ceee4370a962d67db362f3e22270e18
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Mon May 6 10:27:55 2013 -0400
Adjust for API change in mdds 0.8.0.
The return value of search_tree() in flat_segment_tree has changed.
Change-Id: I51d8676bd0621bd43b3f8a8f6be4bf4056d45904
diff --git a/sc/source/core/data/dpfilteredcache.cxx b/sc/source/core/data/dpfilteredcache.cxx
index 47adbbe..51bf571 100644
--- a/sc/source/core/data/dpfilteredcache.cxx
+++ b/sc/source/core/data/dpfilteredcache.cxx
@@ -172,7 +172,7 @@ void ScDPFilteredCache::fillTable(
{
if (nRow > nEndSegment)
{
- if (!maShowByFilter.search_tree(nRow, bShow, NULL, &nEndSegment))
+ if (!maShowByFilter.search_tree(nRow, bShow, NULL, &nEndSegment).second)
{
OSL_FAIL("Tree search failed!");
continue;
diff --git a/sc/source/core/data/segmenttree.cxx b/sc/source/core/data/segmenttree.cxx
index e74b0fd..b02f164 100644
--- a/sc/source/core/data/segmenttree.cxx
+++ b/sc/source/core/data/segmenttree.cxx
@@ -159,7 +159,7 @@ bool ScFlatSegmentsImpl<_ValueType, _ExtValueType>::getRangeData(SCCOLROW nPos,
if (!maSegments.is_tree_valid())
maSegments.build_tree();
- if (!maSegments.search_tree(nPos, nValue, &nPos1, &nPos2))
+ if (!maSegments.search_tree(nPos, nValue, &nPos1, &nPos2).second)
return false;
rData.mnPos1 = nPos1;
diff --git a/sc/source/filter/excel/colrowst.cxx b/sc/source/filter/excel/colrowst.cxx
index 53aa04b..bc43a1e 100644
--- a/sc/source/filter/excel/colrowst.cxx
+++ b/sc/source/filter/excel/colrowst.cxx
@@ -208,7 +208,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab )
if (GetColFlag(nCol, EXC_COLROW_USED))
{
sal_uInt16 nTmp;
- if (maColWidths.search_tree(nCol, nTmp))
+ if (maColWidths.search_tree(nCol, nTmp).second)
nWidth = nTmp;
}
@@ -258,7 +258,7 @@ void XclImpColRowSettings::Convert( SCTAB nScTab )
for (SCROW i = nPrevRow; i <= nRow - 1; ++i)
{
SCROW nLast;
- if (!maRowHeights.search_tree(i, nHeight, NULL, &nLast))
+ if (!maRowHeights.search_tree(i, nHeight, NULL, &nLast).second)
{
// search failed for some reason
return;
diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx
index b791e81..9020d38 100644
--- a/sc/source/filter/xml/XMLStylesExportHelper.cxx
+++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx
@@ -1280,7 +1280,7 @@ sal_Int32 ScRowStyles::GetStyleNameIndex(const sal_Int32 nTable, const sal_Int32
r.build_tree();
sal_Int32 nStyle;
sal_Int32 nStart, nEnd;
- if (r.search_tree(nField, nStyle, &nStart, &nEnd))
+ if (r.search_tree(nField, nStyle, &nStart, &nEnd).second)
{
// Cache this value for better performance.
maCache.mnTable = nTable;
commit b1c4f952223aa208067636936a7fbc00c51eeb14
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 22:24:31 2013 -0400
With the removal of CELLTYPE_NOTE, IsBlank() is now always false.
Let's remove this.
Change-Id: Ica92ea41e104a3f0e97b717ff2e4e115682ce33f
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index ef7c2f7..909c89d 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -65,10 +65,6 @@ public:
inline CellType GetCellType() const { return (CellType)eCellType; }
- /** Returns true, if the cell is empty (neither value nor formula nor cell note).
- Returns false for formula cells returning nothing, use HasEmptyData() for that. */
- bool IsBlank() const;
-
/** ScFormulaCell with formula::svEmptyCell result, or ScNoteCell (may have been
created due to reference to empty cell). */
bool HasEmptyData() const;
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index b5c8d33..6ccc80a 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -106,11 +106,6 @@ void ScBaseCell::Delete()
}
}
-bool ScBaseCell::IsBlank() const
-{
- return false;
-}
-
bool ScBaseCell::HasEmptyData() const
{
switch ( eCellType )
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index e20521a..6f4aff8 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1089,8 +1089,7 @@ bool ScColumn::TestInsertCol( SCROW nStartRow, SCROW nEndRow) const
bool bTest = true;
if ( !maItems.empty() )
for (SCSIZE i=0; (i<maItems.size()) && bTest; i++)
- bTest = (maItems[i].nRow < nStartRow) || (maItems[i].nRow > nEndRow)
- || maItems[i].pCell->IsBlank();
+ bTest = (maItems[i].nRow < nStartRow) || (maItems[i].nRow > nEndRow);
// AttrArray only looks for merged cells
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index db9a3e8..40fcf2c 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1113,19 +1113,7 @@ bool ScColumn::IsEmptyData() const
bool ScColumn::IsEmptyVisData() const
{
- if ( maItems.empty() )
- return true;
- else
- {
- bool bVisData = false;
- SCSIZE i;
- for (i=0; i<maItems.size() && !bVisData; i++)
- {
- if(!maItems[i].pCell->IsBlank())
- bVisData = true;
- }
- return !bVisData;
- }
+ return maItems.empty();
}
SCSIZE ScColumn::VisibleCount( SCROW nStartRow, SCROW nEndRow ) const
@@ -1148,22 +1136,10 @@ SCSIZE ScColumn::VisibleCount( SCROW nStartRow, SCROW nEndRow ) const
SCROW ScColumn::GetLastVisDataPos() const
{
- SCROW nRet = 0;
- if ( !maItems.empty() )
- {
- SCSIZE i;
- bool bFound = false;
- for (i=maItems.size(); i>0 && !bFound; )
- {
- --i;
- if(!maItems[i].pCell->IsBlank())
- {
- bFound = true;
- nRet = maItems[i].nRow;
- }
- }
- }
- return nRet;
+ if (maItems.empty())
+ return 0;
+
+ return maItems.back().nRow;
}
SCROW ScColumn::GetFirstVisDataPos() const
@@ -1184,12 +1160,11 @@ SCROW ScColumn::GetFirstVisDataPos() const
bool ScColumn::HasVisibleDataAt(SCROW nRow) const
{
- SCSIZE nIndex;
- if (Search(nRow, nIndex))
- if (!maItems[nIndex].pCell->IsBlank())
- return true;
+ std::vector<ColEntry>::const_iterator it = Search(nRow);
+ if (it == maItems.end())
+ return false;
- return false;
+ return it->nRow == nRow;
}
bool ScColumn::IsEmptyAttr() const
@@ -1210,15 +1185,12 @@ bool ScColumn::IsEmptyBlock(SCROW nStartRow, SCROW nEndRow) const
if ( maItems.empty() )
return true;
- SCSIZE nIndex;
- Search( nStartRow, nIndex );
- while ( nIndex < maItems.size() && maItems[nIndex].nRow <= nEndRow )
- {
- if ( !maItems[nIndex].pCell->IsBlank() ) // found a cell
- return false; // not empty
- ++nIndex;
- }
- return true; // no cell found
+ std::vector<ColEntry>::const_iterator it = Search(nStartRow);
+ if (it == maItems.end())
+ // All non-empty cells are before nStartRow.
+ return true;
+
+ return (it->nRow > nEndRow);
}
SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirection eDir ) const
@@ -1236,7 +1208,7 @@ SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirecti
i--;
if ( maItems[i].nRow < nStartRow )
break;
- bFound = maItems[i].nRow <= nEndRow && !maItems[i].pCell->IsBlank();
+ bFound = maItems[i].nRow <= nEndRow;
}
if (bFound)
nLines = static_cast<SCSIZE>(nEndRow - maItems[i].nRow);
@@ -1250,7 +1222,7 @@ SCSIZE ScColumn::GetEmptyLinesInBlock( SCROW nStartRow, SCROW nEndRow, ScDirecti
{
if ( maItems[i].nRow > nEndRow )
break;
- bFound = maItems[i].nRow >= nStartRow && !maItems[i].pCell->IsBlank();
+ bFound = maItems[i].nRow >= nStartRow;
i++;
}
if (bFound)
@@ -1348,7 +1320,7 @@ SCROW ScColumn::FindNextVisibleRowWithContent(SCROW nRow, bool bForward) const
SCSIZE nIndex;
bool bThere = Search( nRow, nIndex );
- if( bThere && !maItems[nIndex].pCell->IsBlank())
+ if (bThere)
return nRow;
else if((bThere ? nIndex+1 : nIndex) >= maItems.size())
return MAXROW;
@@ -1380,7 +1352,7 @@ SCROW ScColumn::FindNextVisibleRowWithContent(SCROW nRow, bool bForward) const
SCSIZE nIndex;
bool bThere = Search( nRow, nIndex );
- if(bThere && !maItems[nIndex].pCell->IsBlank())
+ if (bThere)
return nRow;
else if(nIndex == 0)
return 0;
@@ -1761,8 +1733,6 @@ void ScColumn::FindDataAreaPos(SCROW& rRow, bool bDown) const
// check if we are in a data area
SCSIZE nIndex;
bool bThere = Search(rRow, nIndex);
- if (bThere && maItems[nIndex].pCell->IsBlank())
- bThere = false;
size_t nLastIndex = maItems.size() - 1;
if (bThere)
@@ -1770,8 +1740,6 @@ void ScColumn::FindDataAreaPos(SCROW& rRow, bool bDown) const
SCROW nNextRow = FindNextVisibleRow(rRow, bDown);
SCSIZE nNewIndex;
bool bNextThere = Search(nNextRow, nNewIndex);
- if(bNextThere && maItems[nNewIndex].pCell->IsBlank())
- bNextThere = false;
if(bNextThere)
{
@@ -1781,7 +1749,7 @@ void ScColumn::FindDataAreaPos(SCROW& rRow, bool bDown) const
{
nNextRow = FindNextVisibleRow(nLastRow, bDown);
bNextThere = Search(nNextRow, nNewIndex);
- if(!bNextThere || maItems[nNewIndex].pCell->IsBlank())
+ if (!bNextThere)
bNextThere = false;
else
nLastRow = nNextRow;
@@ -1808,8 +1776,7 @@ bool ScColumn::HasDataAt(SCROW nRow) const
SCSIZE nIndex;
if (Search(nRow, nIndex))
- if (!maItems[nIndex].pCell->IsBlank())
- return true;
+ return true;
return false;
commit 2cf33119ab461befc7226cc532593a5435ab3167
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 20:23:53 2013 -0400
Add this back. This was removed by accident.
Change-Id: I9efa8dad078ca4f0bf1d338a5aab72ff7e65980f
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index a668a2c..d1ef841f 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -377,6 +377,10 @@ short ScTable::CompareCell( sal_uInt16 nSort,
short nRes = 0;
CellType eType1 = CELLTYPE_NONE, eType2 = CELLTYPE_NONE;
+ if (pCell1)
+ eType1 = pCell1->GetCellType();
+ if (pCell2)
+ eType2 = pCell2->GetCellType();
if (pCell1)
{
commit 62f119b5d1c786203448c3a208fd2a2ffd26b835
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 18:51:23 2013 -0400
We need to broadcast here...
With this, all unit tests pass, for now.
Change-Id: I151d4425e7d82d1598fae32460dcb94c8b1d74f7
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 8983fa1..d9eb7f8 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -75,6 +75,15 @@ void ScColumn::Insert( SCROW nRow, ScBaseCell* pNewCell )
CellType eCellType = pNewCell->GetCellType();
if (eCellType == CELLTYPE_FORMULA)
static_cast<ScFormulaCell*>(pNewCell)->StartListeningTo(pDocument);
+
+ if (!pDocument->IsCalcingAfterLoad())
+ {
+ if ( eCellType == CELLTYPE_FORMULA )
+ ((ScFormulaCell*)pNewCell)->SetDirty();
+ else
+ pDocument->Broadcast(
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+ }
}
}
commit f34620b40b94d8021637c86ceb651ec881515397
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 18:05:25 2013 -0400
I should first check whether a broadcaster exists at this position.
Change-Id: I014e2054dda4103bb90b84db3bf20c5efd5dabab
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 3301e00..db9a3e8 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1874,8 +1874,12 @@ void ScColumn::FindUsed( SCROW nStartRow, SCROW nEndRow, bool* pUsed ) const
void ScColumn::StartListening( SvtListener& rLst, SCROW nRow )
{
- SvtBroadcaster* pBC = new SvtBroadcaster;
- maBroadcasters.set(nRow, pBC);
+ SvtBroadcaster* pBC = GetBroadcaster(nRow);
+ if (!pBC)
+ {
+ pBC = new SvtBroadcaster;
+ maBroadcasters.set(nRow, pBC);
+ }
rLst.StartListening(*pBC);
}
commit 24c5c1185d5908b47605782f44a9e3c5fe1814ac
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 16:39:10 2013 -0400
Remove SC_HINT_DYING. We don't do anything specific for this hint.
Use SC_HINT_DATACHANGED instead, and do broadcast *after* the cell is
removed from the cell array, to avoid the dying cell from being used
during recalculation after the broadcast.
Change-Id: I8eb31eafa50c737ab683ca697657e64e52ae52e7
diff --git a/sc/inc/brdcst.hxx b/sc/inc/brdcst.hxx
index 737e7e8..069f032 100644
--- a/sc/inc/brdcst.hxx
+++ b/sc/inc/brdcst.hxx
@@ -27,7 +27,6 @@
class SvtBroadcaster;
-#define SC_HINT_DYING SFX_HINT_DYING
#define SC_HINT_DATACHANGED SFX_HINT_DATACHANGED
#define SC_HINT_TABLEOPDIRTY SFX_HINT_USER00
#define SC_HINT_CALCALL SFX_HINT_USER01
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 4e061ab..e20521a 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1731,7 +1731,7 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol)
}
// Broadcast changes
ScAddress aAdr( nCol, 0, nTab );
- ScHint aHint( SC_HINT_DYING, aAdr, NULL ); // areas only
+ ScHint aHint(SC_HINT_DATACHANGED, aAdr, NULL); // areas only
ScAddress& rAddress = aHint.GetAddress();
// must iterate backwards, because indexes of following cells become invalid
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index dd22051..8983fa1 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -105,9 +105,6 @@ void ScColumn::Delete( SCROW nRow )
return;
ScBaseCell* pCell = maItems[nIndex].pCell;
- pDocument->Broadcast(
- ScHint(SC_HINT_DYING, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
-
maItems.erase(maItems.begin() + nIndex);
maTextWidths.set_empty(nRow, nRow);
maScriptTypes.set_empty(nRow, nRow);
@@ -116,6 +113,9 @@ void ScColumn::Delete( SCROW nRow )
static_cast<ScFormulaCell*>(pCell)->EndListeningTo(pDocument);
pCell->Delete();
+ pDocument->Broadcast(
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+
CellStorageModified();
}
@@ -124,13 +124,14 @@ void ScColumn::DeleteAtIndex( SCSIZE nIndex )
{
ScBaseCell* pCell = maItems[nIndex].pCell;
SCROW nRow = maItems[nIndex].nRow;
- pDocument->Broadcast(
- ScHint(SC_HINT_DYING, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
maItems.erase(maItems.begin() + nIndex);
if (pCell->GetCellType() == CELLTYPE_FORMULA)
static_cast<ScFormulaCell*>(pCell)->EndListeningTo(pDocument);
pCell->Delete();
+ pDocument->Broadcast(
+ ScHint(SC_HINT_DATACHANGED, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
+
maTextWidths.set_empty(nRow, nRow);
maScriptTypes.set_empty(nRow, nRow);
CellStorageModified();
@@ -304,8 +305,6 @@ void ScColumn::DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDe
"paste cells" operation, which removes the caption objects later in
drawing undo. */
- ScHint aHint( SC_HINT_DYING, ScAddress( nCol, 0, nTab ), 0 );
-
// cache all formula cells, they will be deleted at end of this function
typedef ::std::vector< ScFormulaCell* > FormulaCellVector;
FormulaCellVector aDelCells;
diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index aa36598..cb13563 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1512,7 +1512,7 @@ void ScFormulaCell::Notify( SvtBroadcaster&, const SfxHint& rHint)
{
const ScHint* p = PTR_CAST( ScHint, &rHint );
sal_uLong nHint = (p ? p->GetId() : 0);
- if (nHint & (SC_HINT_DATACHANGED | SC_HINT_DYING | SC_HINT_TABLEOPDIRTY))
+ if (nHint & (SC_HINT_DATACHANGED | SC_HINT_TABLEOPDIRTY))
{
bool bForceTrack = false;
if ( nHint & SC_HINT_TABLEOPDIRTY )
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 0b0f7a1..ed07960 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -213,7 +213,7 @@ uno::Reference< chart::XChartData > ScChartListener::GetUnoSource() const
void ScChartListener::Notify( SvtBroadcaster&, const SfxHint& rHint )
{
const ScHint* p = dynamic_cast<const ScHint*>(&rHint);
- if (p && (p->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)))
+ if (p && (p->GetId() & SC_HINT_DATACHANGED))
SetUpdateQueue();
}
diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx
index 8e93647..235bb04 100644
--- a/sc/source/core/tool/lookupcache.cxx
+++ b/sc/source/core/tool/lookupcache.cxx
@@ -115,7 +115,7 @@ void ScLookupCache::Notify( SvtBroadcaster & /* rBC */ , const SfxHint & rHint
if (!mpDoc->IsInDtorClear())
{
const ScHint* p = PTR_CAST( ScHint, &rHint );
- if (p && (p->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)))
+ if (p && (p->GetId() & SC_HINT_DATACHANGED))
{
mpDoc->RemoveLookupCache( *this);
delete this;
diff --git a/sc/source/ui/docshell/servobj.cxx b/sc/source/ui/docshell/servobj.cxx
index e0eb9db..c5fbfe8 100644
--- a/sc/source/ui/docshell/servobj.cxx
+++ b/sc/source/ui/docshell/servobj.cxx
@@ -228,7 +228,7 @@ void ScServerObject::Notify( SfxBroadcaster& rBC, const SfxHint& rHint )
// must be from Area broadcasters
const ScHint* pScHint = PTR_CAST( ScHint, &rHint );
- if( pScHint && (pScHint->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING)) )
+ if (pScHint && (pScHint->GetId() & SC_HINT_DATACHANGED))
bDataChanged = sal_True;
else if (rHint.ISA(ScAreaChangedHint)) // position of broadcaster changed
{
diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx
index d015522..40c602f 100644
--- a/sc/source/ui/unoobj/cellsuno.cxx
+++ b/sc/source/ui/unoobj/cellsuno.cxx
@@ -2830,7 +2830,7 @@ void SAL_CALL ScCellRangesBase::firePropertiesChangeEvent( const uno::Sequence<
IMPL_LINK( ScCellRangesBase, ValueListenerHdl, SfxHint*, pHint )
{
if ( pDocShell && pHint && pHint->ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint*)pHint)->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING) )
+ (((const SfxSimpleHint*)pHint)->GetId() & SC_HINT_DATACHANGED))
{
// This may be called several times for a single change, if several formulas
// in the range are notified. So only a flag is set that is checked when
diff --git a/sc/source/ui/unoobj/chart2uno.cxx b/sc/source/ui/unoobj/chart2uno.cxx
index 6ce49d2..69b95aa 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2937,7 +2937,7 @@ void ScChart2DataSequence::Notify( SfxBroadcaster& /*rBC*/, const SfxHint& rHint
IMPL_LINK( ScChart2DataSequence, ValueListenerHdl, SfxHint*, pHint )
{
if ( m_pDocument && pHint && pHint->ISA( SfxSimpleHint ) &&
- ((const SfxSimpleHint*)pHint)->GetId() & (SC_HINT_DATACHANGED | SC_HINT_DYING) )
+ ((const SfxSimpleHint*)pHint)->GetId() & SC_HINT_DATACHANGED)
{
// This may be called several times for a single change, if several formulas
// in the range are notified. So only a flag is set that is checked when
commit 3c5cc7d56f6185ea0bf7593a0cd8e73232d97ddb
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 15:46:16 2013 -0400
Broadcast change on cell deletion.
We don't broadcast in DeleteRange() anymore. The callers of DeleteRange()
is now responsible for broadcasting the changes.
Change-Id: I515a4237dc8f56d0f65f96184b4fed99a263e4c9
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 5084c3e..dd22051 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -472,8 +472,19 @@ void ScColumn::DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag)
}
// Delete attributes just now
- if ((nDelFlag & IDF_ATTRIB) == IDF_ATTRIB) pAttrArray->DeleteArea( nStartRow, nEndRow );
- else if ((nDelFlag & IDF_ATTRIB) != 0) pAttrArray->DeleteHardAttr( nStartRow, nEndRow );
+ if ((nDelFlag & IDF_ATTRIB) == IDF_ATTRIB)
+ pAttrArray->DeleteArea( nStartRow, nEndRow );
+ else if ((nDelFlag & IDF_ATTRIB) != 0)
+ pAttrArray->DeleteHardAttr( nStartRow, nEndRow );
+
+ // Broadcast the changes.
+ ScHint aHint(SC_HINT_DATACHANGED, ScAddress(nCol, 0, nTab), NULL);
+ for (SCROW i = nStartRow; i <= nEndRow; ++i)
+ {
+ aHint.GetAddress().SetRow(i);
+ aHint.SetBroadcaster(GetBroadcaster(i));
+ pDocument->Broadcast(aHint);
+ }
}
commit c86014f5c6340a97bcea600ae3bd31d5f54feebb
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 15:25:37 2013 -0400
DeleteRange is only called from within ScColumn, and should be private.
Change-Id: I8c5ddbde9909e5d30d7aead5bb373e3cb726c4e0
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 907074d..3c79fa3 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -230,7 +230,6 @@ public:
bool TestInsertRow( SCSIZE nSize ) const;
void InsertRow( SCROW nStartRow, SCSIZE nSize );
void DeleteRow( SCROW nStartRow, SCSIZE nSize );
- void DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDelFlag );
void DeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag );
void CopyToClip(SCROW nRow1, SCROW nRow2, ScColumn& rColumn, bool bKeepScenarioFlags) const;
void CopyStaticToDocument(SCROW nRow1, SCROW nRow2, ScColumn& rDestCol);
@@ -476,6 +475,8 @@ public:
SvtBroadcaster* GetBroadcaster( SCROW nRow );
private:
+ void DeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 nDelFlag );
+
const ScFormulaCell* FetchFormulaCell( SCROW nRow ) const;
ScBaseCell* CloneCell(SCSIZE nIndex, sal_uInt16 nFlags, ScDocument& rDestDoc, const ScAddress& rDestPos) const;
commit cfc71668da381c3a2304b4de6288a1af82ce0752
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 15:13:27 2013 -0400
A bit of cleanup.
Change-Id: Id7e11540755b727475fb82c872c718fefea26567
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 188932b..4e061ab 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2131,7 +2131,7 @@ void ScColumn::SetDirty( const ScRange& rRange )
else
{
aHint.GetAddress().SetRow( nRow );
- aHint.SetBroadcaster(maBroadcasters.get<SvtBroadcaster*>(nRow));
+ aHint.SetBroadcaster(GetBroadcaster(nRow));
pDocument->Broadcast( aHint );
}
nIndex++;
@@ -2160,7 +2160,7 @@ void ScColumn::SetTableOpDirty( const ScRange& rRange )
else
{
aHint.GetAddress().SetRow( nRow );
- aHint.SetBroadcaster(maBroadcasters.get<SvtBroadcaster*>(nRow));
+ aHint.SetBroadcaster(GetBroadcaster(nRow));
pDocument->Broadcast( aHint );
}
nIndex++;
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 817fca0..3301e00 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1887,14 +1887,12 @@ void ScColumn::MoveListeners( SvtBroadcaster& rSource, SCROW nDestRow )
return;
// See if the destination position already has a broadcaster, if not, create one.
- SvtBroadcaster* pBC = NULL;
- if (maBroadcasters.is_empty(nDestRow))
+ SvtBroadcaster* pBC = GetBroadcaster(nDestRow);
+ if (!pBC)
{
pBC = new SvtBroadcaster;
maBroadcasters.set(nDestRow, pBC);
}
- else
- pBC = maBroadcasters.get<SvtBroadcaster*>(nDestRow);
SvtListenerIter aIter(rSource);
for (SvtListener* pLst = aIter.GoStart(); pLst; pLst = aIter.GoNext())
@@ -1906,7 +1904,7 @@ void ScColumn::MoveListeners( SvtBroadcaster& rSource, SCROW nDestRow )
void ScColumn::EndListening( SvtListener& rLst, SCROW nRow )
{
- SvtBroadcaster* pBC = maBroadcasters.get<SvtBroadcaster*>(nRow);
+ SvtBroadcaster* pBC = GetBroadcaster(nRow);
if (!pBC)
return;
diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 8cd890e..5084c3e 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -125,7 +125,7 @@ void ScColumn::DeleteAtIndex( SCSIZE nIndex )
ScBaseCell* pCell = maItems[nIndex].pCell;
SCROW nRow = maItems[nIndex].nRow;
pDocument->Broadcast(
- ScHint(SC_HINT_DYING, ScAddress(nCol, nRow, nTab), maBroadcasters.get<SvtBroadcaster*>(nRow)));
+ ScHint(SC_HINT_DYING, ScAddress(nCol, nRow, nTab), GetBroadcaster(nRow)));
maItems.erase(maItems.begin() + nIndex);
if (pCell->GetCellType() == CELLTYPE_FORMULA)
static_cast<ScFormulaCell*>(pCell)->EndListeningTo(pDocument);
commit 59f38babd074cc0b835a5d2a1c81af013dba0deb
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date: Fri May 3 15:05:51 2013 -0400
Remove broadcaster from ScBaseCell, remove ScNoteCell and CELLTYPE_NOTE...
and Calc is now officially broken. Let's start fixing this bit by bit...
Change-Id: I383c88245fe1e573666da636c6a8ca8815352ce7
diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 7b7019c..ef7c2f7 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -69,17 +69,6 @@ public:
Returns false for formula cells returning nothing, use HasEmptyData() for that. */
bool IsBlank() const;
- /** Returns true, if the cell contains a broadcaster. */
- inline bool HasBroadcaster() const { return mpBroadcaster != 0; }
- /** Returns the pointer to the cell broadcaster. */
- inline SvtBroadcaster* GetBroadcaster() const { return mpBroadcaster; }
- /** Takes ownership of the passed cell broadcaster. */
- void TakeBroadcaster( SvtBroadcaster* pBroadcaster );
- /** Returns and forgets the own cell broadcaster. Caller takes ownership! */
- SvtBroadcaster* ReleaseBroadcaster();
- /** Deletes the own cell broadcaster. */
- void DeleteBroadcaster();
-
/** ScFormulaCell with formula::svEmptyCell result, or ScNoteCell (may have been
created due to reference to empty cell). */
bool HasEmptyData() const;
@@ -90,33 +79,10 @@ public:
private:
ScBaseCell& operator=( const ScBaseCell& );
-private:
- SvtBroadcaster* mpBroadcaster; /// Broadcaster for changed values. Cell takes ownership!
-
protected:
sal_uInt8 eCellType; // enum CellType - sal_uInt8 spart Speicher
};
-// ============================================================================
-
-class ScNoteCell : public ScBaseCell
-{
-public:
-#ifdef USE_MEMPOOL
- DECL_FIXEDMEMPOOL_NEWDEL( ScNoteCell )
-#endif
-
- /** Cell takes ownership of the passed broadcaster. */
- explicit ScNoteCell( SvtBroadcaster* pBC = 0 );
-
-#if OSL_DEBUG_LEVEL > 0
- ~ScNoteCell();
-#endif
-
-private:
- ScNoteCell( const ScNoteCell& );
-};
-
class ScValueCell : public ScBaseCell
{
public:
diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index ed1392a..907074d 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -119,8 +119,8 @@ struct ColDoubleEntry
class ScColumn
{
// Broadcaster storage container
- typedef mdds::mtv::custom_block_func1<sc::element_type_broadcaster, sc::custom_broadcaster_block> BroadcasterBlkFunc;
- typedef mdds::multi_type_vector<BroadcasterBlkFunc> BroadcasterStoreType;
+ typedef mdds::mtv::custom_block_func1<sc::element_type_broadcaster, sc::custom_broadcaster_block> BCBlkFunc;
+ typedef mdds::multi_type_vector<BCBlkFunc> BCStoreType;
typedef mdds::multi_type_vector<mdds::mtv::element_block_func> TextWidthType;
typedef mdds::multi_type_vector<mdds::mtv::element_block_func> ScriptType;
@@ -133,7 +133,7 @@ class ScColumn
// Script types are stored as unsigned char.
ScriptType maScriptTypes;
- BroadcasterStoreType maBroadcasters;
+ BCStoreType maBroadcasters;
SCCOL nCol;
SCTAB nTab;
@@ -473,6 +473,8 @@ public:
void SetNumberFormat( SCROW nRow, sal_uInt32 nNumberFormat );
+ SvtBroadcaster* GetBroadcaster( SCROW nRow );
+
private:
const ScFormulaCell* FetchFormulaCell( SCROW nRow ) const;
diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 0920dd5e..79a0626 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1967,6 +1967,8 @@ private: // CLOOK-Impl-methods
ScDocument* mpDoc;
};
+ SvtBroadcaster* GetBroadcaster( const ScAddress& rPos );
+
bool TableExists( SCTAB nTab ) const;
void MergeNumberFormatter(ScDocument* pSrcDoc);
diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index 0ef1bd8..f823232 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -286,7 +286,6 @@ enum CellType
CELLTYPE_VALUE,
CELLTYPE_STRING,
CELLTYPE_FORMULA,
- CELLTYPE_NOTE,
CELLTYPE_EDIT,
#if OSL_DEBUG_LEVEL > 0
CELLTYPE_DESTROYED
diff --git a/sc/inc/table.hxx b/sc/inc/table.hxx
index c090f8b..c7b3498 100644
--- a/sc/inc/table.hxx
+++ b/sc/inc/table.hxx
@@ -831,6 +831,8 @@ public:
ScRefCellValue GetRefCellValue( SCCOL nCol, SCROW nRow );
+ SvtBroadcaster* GetBroadcaster( SCCOL nCol, SCROW nRow );
+
/** Replace behaves differently to the Search; adjust the rCol and rRow accordingly.
'Replace' replaces at the 'current' position, but in order to achieve
diff --git a/sc/source/core/data/autonamecache.cxx b/sc/source/core/data/autonamecache.cxx
index 1dca11e..ab03a95 100644
--- a/sc/source/core/data/autonamecache.cxx
+++ b/sc/source/core/data/autonamecache.cxx
@@ -81,7 +81,6 @@ const ScAutoNameAddresses& ScAutoNameCache::GetNameOccurrences( const String& rN
break;
case CELLTYPE_NONE:
case CELLTYPE_VALUE:
- case CELLTYPE_NOTE:
#if OSL_DEBUG_LEVEL > 0
case CELLTYPE_DESTROYED:
#endif
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 0bde4bf..b5c8d33 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -29,26 +29,22 @@
#ifdef USE_MEMPOOL
IMPL_FIXEDMEMPOOL_NEWDEL( ScValueCell )
IMPL_FIXEDMEMPOOL_NEWDEL( ScStringCell )
-IMPL_FIXEDMEMPOOL_NEWDEL( ScNoteCell )
#endif
// ============================================================================
ScBaseCell::ScBaseCell( CellType eNewType ) :
- mpBroadcaster( 0 ),
eCellType( sal::static_int_cast<sal_uInt8>(eNewType) )
{
}
ScBaseCell::ScBaseCell( const ScBaseCell& rCell ) :
- mpBroadcaster( 0 ),
eCellType( rCell.eCellType )
{
}
ScBaseCell::~ScBaseCell()
{
- delete mpBroadcaster;
OSL_ENSURE( eCellType == CELLTYPE_DESTROYED, "BaseCell Destructor" );
}
@@ -66,8 +62,6 @@ ScBaseCell* lclCloneCell( const ScBaseCell& rSrcCell, ScDocument& rDestDoc, cons
return new ScEditCell(static_cast<const ScEditCell&>(rSrcCell), rDestDoc, rDestPos);
case CELLTYPE_FORMULA:
return new ScFormulaCell( static_cast< const ScFormulaCell& >( rSrcCell ), rDestDoc, rDestPos, nCloneFlags );
- case CELLTYPE_NOTE:
- return new ScNoteCell;
default:;
}
OSL_FAIL( "lclCloneCell - unknown cell type" );
@@ -106,9 +100,6 @@ void ScBaseCell::Delete()
case CELLTYPE_FORMULA:
delete (ScFormulaCell*) this;
break;
- case CELLTYPE_NOTE:
- delete (ScNoteCell*) this;
- break;
default:
OSL_FAIL("Attempt to Delete() an unknown CELLTYPE");
break;
@@ -117,36 +108,13 @@ void ScBaseCell::Delete()
bool ScBaseCell::IsBlank() const
{
- if(eCellType == CELLTYPE_NOTE)
- return true;
-
return false;
}
-void ScBaseCell::TakeBroadcaster( SvtBroadcaster* pBroadcaster )
-{
- delete mpBroadcaster;
- mpBroadcaster = pBroadcaster;
-}
-
-SvtBroadcaster* ScBaseCell::ReleaseBroadcaster()
-{
- SvtBroadcaster* pBroadcaster = mpBroadcaster;
- mpBroadcaster = 0;
- return pBroadcaster;
-}
-
-void ScBaseCell::DeleteBroadcaster()
-{
- DELETEZ( mpBroadcaster );
-}
-
bool ScBaseCell::HasEmptyData() const
{
switch ( eCellType )
{
- case CELLTYPE_NOTE :
- return true;
case CELLTYPE_FORMULA :
return ((ScFormulaCell*)this)->IsEmpty();
default:
@@ -201,21 +169,6 @@ OUString ScBaseCell::GetStringData() const
return aStr;
}
-ScNoteCell::ScNoteCell( SvtBroadcaster* pBC ) :
- ScBaseCell( CELLTYPE_NOTE )
-{
- TakeBroadcaster( pBC );
-}
-
-#if OSL_DEBUG_LEVEL > 0
-ScNoteCell::~ScNoteCell()
-{
- eCellType = CELLTYPE_DESTROYED;
-}
-#endif
-
-// ============================================================================
-
ScValueCell::ScValueCell( double fValue ) :
ScBaseCell( CELLTYPE_VALUE ),
mfValue( fValue )
diff --git a/sc/source/core/data/cellvalue.cxx b/sc/source/core/data/cellvalue.cxx
index 588ccfb..17a4262 100644
--- a/sc/source/core/data/cellvalue.cxx
+++ b/sc/source/core/data/cellvalue.cxx
@@ -24,8 +24,6 @@ CellType adjustCellType( CellType eOrig )
{
switch (eOrig)
{
- case CELLTYPE_NOTE:
- return CELLTYPE_NONE;
case CELLTYPE_EDIT:
return CELLTYPE_STRING;
default:
@@ -354,7 +352,7 @@ bool ScCellValue::hasNumeric() const
bool ScCellValue::isEmpty() const
{
- return meType == CELLTYPE_NOTE || meType == CELLTYPE_NONE;
+ return meType == CELLTYPE_NONE;
}
bool ScCellValue::equalsWithoutFormat( const ScCellValue& r ) const
@@ -498,7 +496,7 @@ OUString ScRefCellValue::getString()
bool ScRefCellValue::isEmpty() const
{
- return meType == CELLTYPE_NOTE || meType == CELLTYPE_NONE;
+ return meType == CELLTYPE_NONE;
}
bool ScRefCellValue::hasEmptyValue()
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index c98cc39..188932b 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -843,23 +843,6 @@ void ScColumn::ReserveSize( SCSIZE nSize )
maItems.reserve(nSize);
}
-
-namespace {
-
-/** Moves broadcaster from old cell to new cell if exists, otherwise creates a new note cell. */
-void lclTakeBroadcaster( ScBaseCell*& rpCell, SvtBroadcaster* pBC )
-{
- if( pBC )
- {
- if( rpCell )
- rpCell->TakeBroadcaster( pBC );
- else
- rpCell = new ScNoteCell( pBC );
- }
-}
-
-} // namespace
-
// SwapRow for sorting
void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
{
@@ -907,9 +890,6 @@ void ScColumn::SwapRow(SCROW nRow1, SCROW nRow2)
// simple swap if no formula cells present
if ( !pFmlaCell1 && !pFmlaCell2 )
{
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list