[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-03-22 Thread Kohei Yoshida
 sc/inc/dpobject.hxx|1 +
 sc/source/core/data/dpobject.cxx   |   12 
 sc/source/core/data/dpsave.cxx |2 +-
 sc/source/ui/docshell/dbdocfun.cxx |3 +++
 sc/source/ui/view/gridwin2.cxx |7 +++
 5 files changed, 20 insertions(+), 5 deletions(-)

New commits:
commit 1d8b583b0676f9c9eed8efd092445908ebea26d9
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 22 22:20:04 2012 -0400

Get correct string value for group item value.

Unlike the old version, the new version no longer stores string value
for non-string items.  We need to call GetFormattedString() for that.

diff --git a/sc/source/core/data/dpsave.cxx b/sc/source/core/data/dpsave.cxx
index e112e6c..5255b72 100644
--- a/sc/source/core/data/dpsave.cxx
+++ b/sc/source/core/data/dpsave.cxx
@@ -1246,7 +1246,7 @@ void 
ScDPSaveData::BuildAllDimensionMembers(ScDPTableData* pData)
 for (size_t j = 0; j  mMemberCount; ++j)
 {
 const ScDPItemData* pMemberData = pData-GetMemberById( nDimIndex, 
rMembers[j] );
-::rtl::OUString aMemName = pMemberData-GetString();
+rtl::OUString aMemName = pData-GetFormattedString(nDimIndex, 
*pMemberData);
 if (iter-GetExistingMemberByName(aMemName))
 // this member instance already exists. nothing to do.
 continue;
commit 7f68157264ec5c474b2a0827d2ee35af20ff0c3d
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 22 22:03:55 2012 -0400

When updating pivot table with groups, we need to clear the table data.

diff --git a/sc/inc/dpobject.hxx b/sc/inc/dpobject.hxx
index 917759d..8c1ed99 100644
--- a/sc/inc/dpobject.hxx
+++ b/sc/inc/dpobject.hxx
@@ -138,6 +138,7 @@ public:
 voidInvalidateData();
 void ClearTableData();
 void ReloadGroupTableData();
+bool HasGroups() const;
 
 voidOutput( const ScAddress rPos );
 ScRange GetNewOutputRange( bool rOverflow );
diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 9da61d1..2f0e510 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -584,6 +584,18 @@ void ScDPObject::ReloadGroupTableData()
 bSettingsChanged = true;
 }
 
+bool ScDPObject::HasGroups() const
+{
+if (!pSaveData)
+return false;
+
+const ScDPDimensionSaveData* pDimData = 
pSaveData-GetExistingDimensionData();
+if (!pDimData)
+return false;
+
+return pDimData-HasGroupDimensions();
+}
+
 void ScDPObject::ClearSource()
 {
 Reference XComponent  xObjectComp( xSource, UNO_QUERY );
diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index c1464b1..afb3513 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -1327,6 +1327,9 @@ bool ScDBDocFunc::DataPilotUpdate( ScDPObject* pOldObj, 
const ScDPObject* pNewOb
 if ( pNewObj == pOldObj  pDestObj-IsImportData() )
 pDestObj-ClearTableData();
 
+if (pDestObj-HasGroups())
+pDestObj-ClearTableData();
+
 pDestObj-InvalidateData(); // before getting the 
new output area
 
 //  make sure the table has a name (not set by dialog)
diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index 0f37c83..bf3402c 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -552,9 +552,8 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
 return;
 
 ScDPObject* pDPObj = pDPData-mpDPObj;
-ScDPObject aNewDPObj(*pDPObj);
-aNewDPObj.BuildAllDimensionMembers();
-ScDPSaveData* pSaveData = aNewDPObj.GetSaveData();
+pDPObj-BuildAllDimensionMembers();
+ScDPSaveData* pSaveData = pDPObj-GetSaveData();
 
 bool bIsDataLayout;
 OUString aDimName = pDPObj-GetDimName(pDPData-mnDim, bIsDataLayout);
@@ -601,7 +600,7 @@ void ScGridWindow::UpdateDPFromFieldPopupMenu()
 pDim-UpdateMemberVisibility(aResult);
 
 ScDBDocFunc aFunc(*pViewData-GetDocShell());
-aFunc.DataPilotUpdate(pDPObj, aNewDPObj, true, false);
+aFunc.DataPilotUpdate(pDPObj, pDPObj, true, false);
 }
 
 void ScGridWindow::UpdateVisibleRange()
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-03-15 Thread Kohei Yoshida
 sc/inc/dpcache.hxx  |   16 
 sc/source/core/data/dpcache.cxx |   31 ++-
 2 files changed, 6 insertions(+), 41 deletions(-)

New commits:
commit 0c1a63b1fbbd9540a724f6918675a5559b19c156
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 15 20:30:52 2012 -0400

No need to trim capacity any more; it's allocated to the exact size.

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 4c93501..928e511 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -756,12 +756,6 @@ public:
 void ScDPCache::PostInit()
 {
 maEmptyRows.build_tree();
-FieldsType::iterator it = maFields.begin(), itEnd = maFields.end();
-for (; it != itEnd; ++it)
-{
-// Trim excess capacity.
-ItemsType(it-maItems).swap(it-maItems);
-}
 }
 
 void ScDPCache::Clear()
commit 9e19cf80c080929c914dc0bfa069f22c8526c3b0
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Thu Mar 15 20:23:10 2012 -0400

We don't need these extra order index array; items are already sorted.

This shaves off extra 5MB of memory with my test document.

diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 6566979..1e26688 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -80,7 +80,10 @@ public:
  */
 boost::scoped_ptrGroupItems mpGroup;
 
-ItemsType maItems; /// Unique values in the field.
+/**
+ * Unique values in the field, stored in ascending order.
+ */
+ItemsType maItems;
 
 /**
  * Original source data represented as indices to the unique value
@@ -89,17 +92,6 @@ public:
  */
 IndexArrayType maData;
 
-/**
- * Ascending order of field items.
- */
-IndexArrayType maGlobalOrder;
-
-/**
- * Ranks of each unique data represented by their index.  It's a
- * reverse mapping of item index to global order index.
- */
-mutable IndexArrayType maIndexOrder;
-
 sal_uLong mnNumFormat;
 
 Field();
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 08b0d25..4c93501 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -376,12 +376,6 @@ void processBuckets(std::vectorBucket aBuckets, 
ScDPCache::Field rField)
 size_t nLen = distance(itBeg, itUniqueEnd);
 rField.maItems.reserve(nLen);
 std::for_each(itBeg, itUniqueEnd, PushBackValue(rField.maItems));
-
-// The items are actually already sorted.  So, just insert a sequence
-// of integers from 0 and up.
-rField.maGlobalOrder.reserve(nLen);
-for (size_t i = 0; i  nLen; ++i)
-rField.maGlobalOrder.push_back(i);
 }
 
 }
@@ -1120,24 +1114,9 @@ void ScDPCache::ClearGroupFields()
 std::for_each(maFields.begin(), maFields.end(), ClearGroupItems());
 }
 
-SCROW ScDPCache::GetOrder(long nDim, SCROW nIndex) const
+SCROW ScDPCache::GetOrder(long /*nDim*/, SCROW nIndex) const
 {
-OSL_ENSURE( nDim =0  nDim  mnColumnCount, 
ScDPTableDataCache::GetOrder : out of bound );
-
-const Field rField = maFields[nDim];
-if (rField.maIndexOrder.size() !=  rField.maGlobalOrder.size())
-{ //not inited
-SCROW nRow  = 0;
-rField.maIndexOrder.resize(rField.maGlobalOrder.size(), 0);
-for (size_t i = 0, n = rField.maGlobalOrder.size(); i  n; ++i)
-{
-nRow = rField.maGlobalOrder[i];
-rField.maIndexOrder[nRow] = i;
-}
-}
-
-OSL_ENSURE(nIndex = 0  sal::static_int_castsal_uInt32(nIndex)  
rField.maIndexOrder.size() , ScDPTableDataCache::GetOrder);
-return rField.maIndexOrder[nIndex];
+return nIndex;
 }
 
 ScDocument* ScDPCache::GetDoc() const
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-03-09 Thread Kohei Yoshida
 sc/inc/dpitemdata.hxx  |4 +---
 sc/source/core/data/dpitemdata.cxx |   27 +++
 2 files changed, 12 insertions(+), 19 deletions(-)

New commits:
commit 1bb7875f275d95a0a764df5d8d6954b7e8841152
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Mar 9 12:37:30 2012 -0500

Correct equality check  disable Dump() for normal build.

diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx
index 4aac20c..3e09d89 100644
--- a/sc/inc/dpitemdata.hxx
+++ b/sc/inc/dpitemdata.hxx
@@ -40,7 +40,7 @@
 
 #include boost/unordered_map.hpp
 
-#define DEBUG_DP_ITEM_DATA 1
+#define DEBUG_DP_ITEM_DATA 0
 
 class ScDocument;
 
diff --git a/sc/source/core/data/dpitemdata.cxx 
b/sc/source/core/data/dpitemdata.cxx
index f0ac5d5..2870a5c 100644
--- a/sc/source/core/data/dpitemdata.cxx
+++ b/sc/source/core/data/dpitemdata.cxx
@@ -186,8 +186,17 @@ bool ScDPItemData::IsCaseInsEqual(const ScDPItemData r) 
const
 if (meType != r.meType)
 return false;
 
-if (meType == Value)
-return rtl::math::approxEqual(mfValue, r.mfValue);
+switch (meType)
+{
+case Value:
+case RangeStart:
+return rtl::math::approxEqual(mfValue, r.mfValue);
+case GroupValue:
+return maGroupValue.mnGroupType == r.maGroupValue.mnGroupType 
+maGroupValue.mnValue == r.maGroupValue.mnValue;
+default:
+;
+}
 
 return ScGlobal::GetpTransliteration()-isEqual(GetString(), 
r.GetString());
 }
commit 5e9d811ab8a1c0481c67e3d4589e0a16fb781120
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Mar 9 12:35:33 2012 -0500

Apparently nobody uses Hash() anymore.

diff --git a/sc/inc/dpitemdata.hxx b/sc/inc/dpitemdata.hxx
index 926ce7a..4aac20c 100644
--- a/sc/inc/dpitemdata.hxx
+++ b/sc/inc/dpitemdata.hxx
@@ -93,8 +93,6 @@ public:
 void SetErrorString(const rtl::OUString rS);
 bool IsCaseInsEqual(const ScDPItemData r) const;
 
-size_t Hash() const;
-
 // exact equality
 bool operator==(const ScDPItemData r) const;
 
diff --git a/sc/source/core/data/dpitemdata.cxx 
b/sc/source/core/data/dpitemdata.cxx
index 8f16a33..f0ac5d5 100644
--- a/sc/source/core/data/dpitemdata.cxx
+++ b/sc/source/core/data/dpitemdata.cxx
@@ -192,20 +192,6 @@ bool ScDPItemData::IsCaseInsEqual(const ScDPItemData r) 
const
 return ScGlobal::GetpTransliteration()-isEqual(GetString(), 
r.GetString());
 }
 
-size_t ScDPItemData::Hash() const
-{
-if (meType == Value)
-return static_castsize_t(rtl::math::approxFloor(mfValue));
-
-// If we do unicode safe case insensitive hash we can drop
-// ScDPItemData::operator== and use ::IsCasInsEqual
-rtl::OUString aStr = GetString();
-if (aStr.isEmpty())
-return 0;
-
-return rtl_ustr_hashCode_WithLength(aStr.getStr(), aStr.getLength());
-}
-
 bool ScDPItemData::operator== (const ScDPItemData r) const
 {
 if (meType != r.meType)
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-03-09 Thread Kohei Yoshida
 sc/inc/dpcache.hxx  |6 +++---
 sc/source/core/data/dpcache.cxx |   29 -
 2 files changed, 15 insertions(+), 20 deletions(-)

New commits:
commit 3a28389d6713bf29e1da2fea07b663fdd9cc3faa
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Mar 9 15:56:30 2012 -0500

Use flat_segment_tree to store the empty row flags.

diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 31d5103..2880c5a 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -41,6 +41,7 @@
 #include boost/noncopyable.hpp
 #include boost/scoped_ptr.hpp
 #include boost/ptr_container/ptr_vector.hpp
+#include mdds/flat_segment_tree.hpp
 
 #include vector
 
@@ -119,7 +120,7 @@ private:
 GroupFieldsType maGroupFields;
 
 LabelsType maLabelNames;// Stores dimension names.
-std::vectorbool maEmptyRows; // Keeps track of empty rows.
+mdds::flat_segment_treeSCROW, bool maEmptyRows;
 
 bool mbDisposing;
 
@@ -150,7 +151,7 @@ public:
 SCROW  GetRowCount() const;
 SCROW  GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) 
const;
 rtl::OUString GetDimensionName(LabelsType::size_type nDim) const;
-bool IsRowEmpty( SCROW nRow ) const;
+bool IsRowEmpty(SCROW nRow) const;
 bool ValidQuery(SCROW nRow, const ScQueryParam rQueryParam) const;
 
 ScDocument* GetDoc() const;
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 9ae41a4..73e1819 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -228,6 +228,7 @@ ScDPCache::Field::Field() {}
 ScDPCache::ScDPCache(ScDocument* pDoc) :
 mpDoc( pDoc ),
 mnColumnCount ( 0 ),
+maEmptyRows(0, MAXROW, true),
 mbDisposing(false)
 {
 }
@@ -341,6 +342,9 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const 
ScRange rRange)
 
 maLabelNames.reserve(mnColumnCount+1);
 
+// Set all rows non-empty first, then only tag empty ones in AddData().
+maEmptyRows.insert_front(nStartRow, nEndRow+1, false);
+
 for (sal_uInt16 nCol = nStartCol; nCol = nEndCol; ++nCol)
 {
 AddLabel(createLabelString(pDoc, nCol, nStartRow, nDocTab));
@@ -352,6 +356,7 @@ bool ScDPCache::InitFromDoc(ScDocument* pDoc, const 
ScRange rRange)
 AddData(nCol - nStartCol, pData.release(), nNumFormat);
 }
 }
+maEmptyRows.build_tree();
 return true;
 }
 
@@ -409,6 +414,7 @@ bool ScDPCache::InitFromDataBase (const 
Referencesdbc::XRowSet xRowSet, const
 
 xRowSet-beforeFirst();
 
+maEmptyRows.build_tree();
 return true;
 }
 catch (const Exception)
@@ -610,9 +616,11 @@ bool ScDPCache::ValidQuery( SCROW nRow, const ScQueryParam 
rParam) const
 return bRet;
 }
 
-bool ScDPCache::IsRowEmpty( SCROW nRow ) const
+bool ScDPCache::IsRowEmpty(SCROW nRow) const
 {
-return maEmptyRows[nRow];
+bool bEmpty = true;
+maEmptyRows.search_tree(nRow, bEmpty);
+return bEmpty;
 }
 
 bool ScDPCache::AddData(long nDim, ScDPItemData* pData, sal_uLong nNumFormat)
@@ -639,14 +647,10 @@ bool ScDPCache::AddData(long nDim, ScDPItemData* pData, 
sal_uLong nNumFormat)
 else
 rField.maData.push_back(rField.maGlobalOrder[nIndex]);
 
-//init empty row tag
 size_t nCurRow = maFields[nDim].maData.size() - 1;
 
-while (maEmptyRows.size() = nCurRow)
-maEmptyRows.push_back(true);
-
-if (!pData-IsEmpty())
-maEmptyRows[nCurRow] = false;
+if (pData-IsEmpty())
+maEmptyRows.insert_back(nCurRow, nCurRow+1, true);
 
 return true;
 }
commit 2877147c477f064c213af53a8f250ce96ad1e5f2
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Fri Mar 9 15:13:36 2012 -0500

IsValid() is superfluous.

diff --git a/sc/inc/dpcache.hxx b/sc/inc/dpcache.hxx
index 661c5cd..31d5103 100644
--- a/sc/inc/dpcache.hxx
+++ b/sc/inc/dpcache.hxx
@@ -151,7 +151,6 @@ public:
 SCROW  GetItemDataId( sal_uInt16 nDim, SCROW nRow, bool bRepeatIfEmpty ) 
const;
 rtl::OUString GetDimensionName(LabelsType::size_type nDim) const;
 bool IsRowEmpty( SCROW nRow ) const;
-bool IsValid() const;
 bool ValidQuery(SCROW nRow, const ScQueryParam rQueryParam) const;
 
 ScDocument* GetDoc() const;
diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index 33a0a25..9ae41a4 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -252,11 +252,6 @@ ScDPCache::~ScDPCache()
 std::for_each(maRefObjects.begin(), maRefObjects.end(), 
ClearObjectSource());
 }
 
-bool ScDPCache::IsValid() const
-{
-return !maFields.empty()  mnColumnCount  0;
-}
-
 namespace {
 
 /**
@@ -622,7 +617,6 @@ bool ScDPCache::IsRowEmpty( SCROW nRow ) const
 
 bool ScDPCache::AddData(long nDim, ScDPItemData* pData, sal_uLong nNumFormat)
 {
-OSL_ENSURE( IsValid(),   IsValid() == false  );
 OSL_ENSURE( nDim  mnColumnCount  nDim =0 , dimension out of bound );
 
 // Wrap this instance with scoped pointer to ensure proper 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-03-01 Thread Markus Mohrhard
 sc/inc/column.hxx  |2 +-
 sc/inc/postit.hxx  |4 ++--
 sc/source/core/data/column.cxx |5 ++---
 sc/source/core/data/postit.cxx |   11 +++
 sc/source/core/data/table2.cxx |6 +++---
 5 files changed, 15 insertions(+), 13 deletions(-)

New commits:
commit 921fb226d2836673c1d3ef0f254708a5c5c0b313
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 01:59:01 2012 +0100

fix crashs in undo/redo realted to note captions

diff --git a/sc/inc/postit.hxx b/sc/inc/postit.hxx
index 16746d6..1b370ce 100644
--- a/sc/inc/postit.hxx
+++ b/sc/inc/postit.hxx
@@ -297,7 +297,7 @@ public:
 bool insert( SCCOL nCol, SCROW nRow, ScPostIt* );
 bool insert( const ScAddress rPos, ScPostIt* );
 
-void erase(SCCOL, SCROW);
+void erase(SCCOL, SCROW, bool bForgetCaption = false);
 void erase(const ScAddress rPos);
 
 /** Returns and forgets the cell note object at the passed cell address. */
@@ -311,7 +311,7 @@ public:
 ScNotes* clone(ScDocument* pDoc, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2, bool bCloneNoteCaption, SCTAB nTab);
 void CopyFromClip(const ScNotes maNotes, ScDocument* pDoc, SCCOL nCol1, 
SCROW nRow1, SCCOL nCol2, SCROW nRow2, SCsCOL nDx, SCsROW nDy, SCTAB nTab, bool 
bCloneCaption);
 
-void erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2);
+void erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool 
bForgetCaption = false);
 
 
 };
diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 8ecacfa..8a0677f 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -1009,11 +1009,14 @@ bool ScNotes::insert(const ScAddress rPos, ScPostIt* 
pPostIt)
 return insert(rPos.Col(), rPos.Row(), pPostIt);
 }
 
-void ScNotes::erase(SCCOL nCol, SCROW nRow)
+void ScNotes::erase(SCCOL nCol, SCROW nRow, bool bForgetCaption)
 {
 iterator itr = maNoteMap.find(std::pairSCCOL, SCROW(nCol, nRow));
 if (itr != maNoteMap.end())
 {
+if (bForgetCaption)
+itr-second-ForgetCaption();
+
 delete itr-second;
 maNoteMap.erase(itr);
 }
@@ -1088,12 +1091,12 @@ void ScNotes::CopyFromClip(const ScNotes rNotes, 
ScDocument* pDoc, SCCOL nCol1,
 if (nCol+nDx = nCol1  nCol+nDx = nCol2  nRow+nDy = nRow1  
nRow+nDy = nRow2)
 {
 erase(nCol+nDx, nRow+nDy);
-insert(nCol+nDx, nRow+nDy, itr-second-Clone( ScAddress(nCol, 
nRow, nTab), *pDoc, ScAddress(nCol, nRow, nTab), bCloneCaption ));
+insert(nCol+nDx, nRow+nDy, itr-second-Clone( ScAddress(nCol, 
nRow, nTab), *pDoc, ScAddress(nCol+nDx, nRow+nDy, nTab), bCloneCaption ));
 }
 }
 }
 
-void ScNotes::erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2)
+void ScNotes::erase(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, bool 
bForgetCaption)
 {
 ScNotes::iterator itr = maNoteMap.begin();
 while(itr != maNoteMap.end())
@@ -1103,7 +1106,7 @@ void ScNotes::erase(SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2)
 ++itr;
 if (nCol = nCol1  nCol = nCol2  nRow = nRow1  nRow = nRow2)
 {
-erase(nCol, nRow);
+erase(nCol, nRow, bForgetCaption);
 }
 }
 }
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 4cc42f6..19fa547 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -537,7 +537,7 @@ void ScTable::DeleteArea(SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2, sal
 }
 
 if (nDelFlag  IDF_NOTE)
-maNotes.erase( nCol1, nRow1, nCol2, nRow2);
+maNotes.erase( nCol1, nRow1, nCol2, nRow2, true );
 
 if (IsStreamValid())
 // TODO: In the future we may want to check if the table has been
@@ -561,7 +561,7 @@ void ScTable::DeleteSelection( sal_uInt16 nDelFlag, const 
ScMarkData rMark )
 {
 ScRange* pRange = aRangeList[i];
 if (nDelFlag  IDF_NOTE  pRange)
-maNotes.erase(pRange-aStart.Col(), pRange-aStart.Row(), 
pRange-aEnd.Col(), pRange-aEnd.Row());
+maNotes.erase(pRange-aStart.Col(), pRange-aStart.Row(), 
pRange-aEnd.Col(), pRange-aEnd.Row(), true);
 }
 
 //
commit 1d1141cd06fcdbadd008744a28674d4b50457923
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 01:09:56 2012 +0100

remove unnecessary parameter

diff --git a/sc/inc/column.hxx b/sc/inc/column.hxx
index 8d715fb..e503005 100644
--- a/sc/inc/column.hxx
+++ b/sc/inc/column.hxx
@@ -194,7 +194,7 @@ public:
 voidDeleteRow( SCROW nStartRow, SCSIZE nSize );
 voidDeleteRange( SCSIZE nStartIndex, SCSIZE nEndIndex, sal_uInt16 
nDelFlag );
 voidDeleteArea(SCROW nStartRow, SCROW nEndRow, sal_uInt16 nDelFlag 
);
-voidCopyToClip(SCROW nRow1, SCROW nRow2, ScColumn rColumn, bool 
bKeepScenarioFlags, bool bCloneNoteCaptions);
+voidCopyToClip(SCROW nRow1, SCROW nRow2, ScColumn 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-03-01 Thread Markus Mohrhard
 sc/inc/document.hxx|   14 ---
 sc/source/core/data/column.cxx |4 +-
 sc/source/core/data/documen5.cxx   |1 
 sc/source/core/data/table2.cxx |1 
 sc/source/filter/excel/excdoc.cxx  |1 
 sc/source/ui/docshell/dbdocimp.cxx |1 
 sc/source/ui/docshell/docsh.cxx|2 +
 sc/source/ui/docshell/docsh8.cxx   |1 
 sc/source/ui/docshell/impex.cxx|1 
 sc/source/ui/unoobj/cellsuno.cxx   |1 
 sc/source/ui/unoobj/docuno.cxx |1 
 sc/source/ui/view/formatsh.cxx |   67 ++---
 12 files changed, 55 insertions(+), 40 deletions(-)

New commits:
commit 26ea23b6b5f1d80df688e4c7e325971709c3c4a6
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Fri Mar 2 03:46:50 2012 +0100

some sal_Bool to bool

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 1ab4940..bc72117 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -181,11 +181,11 @@ void ScFormatShell::GetStyleState( SfxItemSet rSet )
 ScTabViewShell* pTabViewShell   = GetViewData()-GetViewShell();
 SfxStyleSheetBasePool*  pStylePool  = pDoc-GetStyleSheetPool();
 
-sal_Bool bProtected = false;
+bool bProtected = false;
 SCTAB nTabCount = pDoc-GetTableCount();
 for (SCTAB i=0; inTabCount; i++)
 if (pDoc-IsTabProtected(i))// ueberhaupt eine Tabelle 
geschuetzt?
-bProtected = sal_True;
+bProtected = true;
 
 SfxWhichIteraIter(rSet);
 sal_uInt16  nWhich = aIter.FirstWhich();
@@ -240,7 +240,7 @@ void ScFormatShell::GetStyleState( SfxItemSet rSet )
 {
 ISfxTemplateCommon* pDesigner = SFX_APP()-
 
GetCurrentTemplateCommon(pTabViewShell-GetViewFrame()-GetBindings());
-sal_Bool bPage = pDesigner  SFX_STYLE_FAMILY_PAGE == 
pDesigner-GetActualFamily();
+bool bPage = pDesigner  SFX_STYLE_FAMILY_PAGE == 
pDesigner-GetActualFamily();
 
 if ( bProtected || bPage )
 rSet.DisableItem( nSlotId );
@@ -252,7 +252,7 @@ void ScFormatShell::GetStyleState( SfxItemSet rSet )
 {
 ISfxTemplateCommon* pDesigner = SFX_APP()-
 
GetCurrentTemplateCommon(pTabViewShell-GetViewFrame()-GetBindings());
-sal_Bool bPage = pDesigner  SFX_STYLE_FAMILY_PAGE == 
pDesigner-GetActualFamily();
+bool bPage = pDesigner  SFX_STYLE_FAMILY_PAGE == 
pDesigner-GetActualFamily();
 
 if ( bProtected  !bPage )
 rSet.DisableItem( nSlotId );
@@ -289,7 +289,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 ScMarkData rMark   = GetViewData()-GetMarkData();
 ScModule*   pScMod  = SC_MOD();
 String  aRefName;
-sal_BoolbUndo   = pDoc-IsUndoEnabled();
+boolbUndo   = pDoc-IsUndoEnabled();
 
 if (   (nSlotId == SID_STYLE_NEW)
 || (nSlotId == SID_STYLE_EDIT)
@@ -303,9 +303,9 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 SfxStyleSheetBasePool*  pStylePool  = pDoc-GetStyleSheetPool();
 SfxStyleSheetBase*  pStyleSheet = NULL;
 
-sal_Bool bStyleToMarked = false;
-sal_Bool bListAction = false;
-sal_Bool bAddUndo = false;  // add ScUndoModifyStyle (style 
modified)
+bool bStyleToMarked = false;
+bool bListAction = false;
+bool bAddUndo = false;  // add ScUndoModifyStyle (style 
modified)
 ScStyleSaveData aOldData;   // for undo/redo
 ScStyleSaveData aNewData;
 
@@ -391,7 +391,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 
 case SID_STYLE_WATERCAN:
 {
-sal_Bool bWaterCan = pScMod-GetIsWaterCan();
+bool bWaterCan = pScMod-GetIsWaterCan();
 
 if( !bWaterCan )
 {
@@ -418,7 +418,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 
 if ( !bWaterCan  pStyleSheet )
 {
-pScMod-SetWaterCan( sal_True );
+pScMod-SetWaterCan( true );
 pTabViewShell-SetActivePointer( Pointer(POINTER_FILL) );
 rReq.Done();
 }
@@ -452,8 +452,8 @@ void ScFormatShell::ExecuteStyle( SfxRequest rReq )
 pTabViewShell-RemoveStyleSheetInUse( pStyleSheet 
);
 pStylePool-Remove( pStyleSheet );
 pTabViewShell-InvalidateAttribs();
-nRetMask = sal_True;
-bAddUndo = sal_True;
+nRetMask = true;
+bAddUndo = true;
 rReq.Done();
 }
 else
@@ -508,10 +508,10 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-02-27 Thread Kohei Yoshida
 sc/inc/appoptio.hxx   |   27 
 sc/inc/docoptio.hxx   |   37 --
 sc/inc/sc.hrc |7 +
 sc/source/core/data/documen3.cxx  |   29 
 sc/source/core/tool/appoptio.cxx  |  221 +-
 sc/source/core/tool/docoptio.cxx  |  217 -
 sc/source/ui/app/scmod.cxx|   98 +++-
 sc/source/ui/docshell/docsh3.cxx  |2 
 sc/source/ui/docshell/docsh6.cxx  |   41 +--
 sc/source/ui/inc/docsh.hxx|2 
 sc/source/ui/inc/tpformula.hxx|   10 -
 sc/source/ui/optdlg/tpformula.cxx |   88 ---
 12 files changed, 439 insertions(+), 340 deletions(-)

New commits:
commit 90284a5e7a1e5dcdd8e7473914db1ce6edc19f94
Author: Albert Thuswaldner albert.thuswald...@gmail.com
Date:   Mon Feb 27 00:41:39 2012 +0100

Splitting ScDocument::SetDocOptions, moved new SetFormulaOptions to 
ScDocShell

diff --git a/sc/source/core/data/documen3.cxx b/sc/source/core/data/documen3.cxx
index 28eab09..ddacf92 100644
--- a/sc/source/core/data/documen3.cxx
+++ b/sc/source/core/data/documen3.cxx
@@ -52,10 +52,8 @@
 #include rangelst.hxx
 #include chartarr.hxx
 #include chartlock.hxx
-#include compiler.hxx
 #include refupdat.hxx
 #include docoptio.hxx
-#include appoptio.hxx
 #include viewopti.hxx
 #include scextopt.hxx
 #include brdcst.hxx
@@ -67,7 +65,6 @@
 #include dociter.hxx
 #include detdata.hxx
 #include detfunc.hxx
-#include scmod.hxx// SC_MOD
 #include inputopt.hxx // GetExpandRefs
 #include chartlis.hxx
 #include sc.hrc   // SID_LINK
@@ -1938,39 +1935,10 @@ const ScDocOptions ScDocument::GetDocOptions() const
 
 void ScDocument::SetDocOptions( const ScDocOptions rOpt )
 {
-ScAppOptions rAppOpt=SC_MOD()-GetAppOptions();
-
 OSL_ENSURE( pDocOptions, No DocOptions! :-( );
-//bool bUpdateFuncNames = pDocOptions-GetUseEnglishFuncName() != 
rOpt.GetUseEnglishFuncName();
 
 *pDocOptions = rOpt;
-
 xPoolHelper-SetFormTableOpt(rOpt);
-
-SetGrammar( rAppOpt.GetFormulaSyntax() );
-
-//if (bUpdateFuncNames)
-{
-// This needs to be called first since it may re-initialize the entire
-// opcode map.
-if (rAppOpt.GetUseEnglishFuncName())
-{
-// switch native symbols to English.
-ScCompiler aComp(NULL, ScAddress());
-ScCompiler::OpCodeMapPtr xMap = 
aComp.GetOpCodeMap(::com::sun::star::sheet::FormulaLanguage::ENGLISH);
-ScCompiler::SetNativeSymbols(xMap);
-}
-else
-// re-initialize native symbols with localized function names.
-ScCompiler::ResetNativeSymbols();
-
-// Force re-population of function names for the function wizard, 
function tip etc.
-ScGlobal::ResetFunctionList();
-}
-
-// Update the separators.
-ScCompiler::UpdateSeparatorsNative(
-rAppOpt.GetFormulaSepArg(), rAppOpt.GetFormulaSepArrayCol(), 
rAppOpt.GetFormulaSepArrayRow());
 }
 
 const ScViewOptions ScDocument::GetViewOptions() const
diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx
index 9798306..f496211 100644
--- a/sc/source/ui/app/scmod.cxx
+++ b/sc/source/ui/app/scmod.cxx
@@ -1088,13 +1088,9 @@ void ScModule::ModifyOptions( const SfxItemSet rOptSet )
 }
 
 // Do all the format updates on open documents in one go
-if ( bUpdateDocFormat  pDoc )
+if ( bUpdateDocFormat  pDocSh )
 {
-const ScDocOptions rOpt = pDoc-GetDocOptions(); // Temporary fix to 
keep
-  // SettDocOption 
call as is
-
-  // Needs update.
-pDoc-SetDocOptions( rOpt );
+pDocSh-SetFormulaOptions( *pAppCfg );
 pDocSh-SetDocumentModified();
 }
 
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index f5692ef..522e9d7 100644
--- a/sc/source/ui/docshell/docsh3.cxx
+++ b/sc/source/ui/docshell/docsh3.cxx
@@ -432,6 +432,7 @@ void ScDocShell::InitOptions(bool bForLoading)  // 
called from InitNew and L
 ScModule* pScMod = SC_MOD();
 
 ScDocOptions  aDocOpt  = pScMod-GetDocOptions();
+ScAppOptions  aAppOpt  = pScMod-GetAppOptions();
 ScViewOptions aViewOpt = pScMod-GetViewOptions();
 aDocOpt.SetAutoSpell( bAutoSpell );
 
@@ -448,6 +449,7 @@ void ScDocShell::InitOptions(bool bForLoading)  // 
called from InitNew and L
 
 aDocument.SetDocOptions( aDocOpt );
 aDocument.SetViewOptions( aViewOpt );
+SetFormulaOptions( aAppOpt );
 
 //  Druck-Optionen werden jetzt direkt vor dem Drucken gesetzt
 
diff --git a/sc/source/ui/docshell/docsh6.cxx b/sc/source/ui/docshell/docsh6.cxx
index c02956c..9d054bb 100644
--- a/sc/source/ui/docshell/docsh6.cxx
+++ b/sc/source/ui/docshell/docsh6.cxx
@@ -47,9 +47,9 @@
 #include viewdata.hxx
 #include tabvwsh.hxx
 #include tablink.hxx
-#include appoptio.hxx
 #include globstr.hrc
 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-02-10 Thread Eike Rathke
 sc/inc/detdata.hxx|   18 +++-
 sc/source/core/tool/detdata.cxx   |   41 --
 sc/source/filter/xml/xmlexprt.cxx |8 +++
 sc/source/ui/docshell/docfunc.cxx |6 ++---
 sc/source/ui/undo/undocell.cxx|8 +++
 5 files changed, 37 insertions(+), 44 deletions(-)

New commits:
commit 43aa1115c88f1300c73337a3622c2c03faa699f7
Author: Eike Rathke er...@redhat.com
Date:   Fri Feb 10 17:26:44 2012 +0100

changes to convert detdata.cxx in SC module to boost:ptr_vector

* for includes from other modules use  instead of , i.e.
  boost/ptr_container/ptr_vector.hpp
* use size_t instead of int for container positions and count
* no need for DeleteAndDestroy(), in fact delete p followed by
  ptr_vector::erase() attempted to delete the instance twice and would crash
* adapted places that accessed DeleteAndDestroy() to operate on the vector
  instead
  * introduced GetDataVector() for that
* changed the DeleteOnTab() loop that used DeleteAndDestroy() to properly
  iterate over the container instead
* changed UpdateReference() to a loop using iterator
* changed operator==() to use size_t instead of sal_uInt16
  * note aside: mixing sal_uInt16 with a container's size isn't a good idea
* adapted places that access Count() and GetObject() to use size_t instead 
of
  sal_uInt16
* made GetObject() const and return const ScDetOpData*
* changed indentation to 4 spaces per level

diff --git a/sc/inc/detdata.hxx b/sc/inc/detdata.hxx
index 891c803..6ba78c7 100644
--- a/sc/inc/detdata.hxx
+++ b/sc/inc/detdata.hxx
@@ -30,8 +30,8 @@
 #define SC_DETDATA_HXX
 
 #include svl/svarray.hxx
+#include boost/ptr_container/ptr_vector.hpp
 #include global.hxx
-#include boost/ptr_container/ptr_vector.hpp
 
 
 //
@@ -79,7 +79,7 @@ typedef boost::ptr_vectorScDetOpData ScDetOpDataVector;
 class ScDetOpList
 {
 sal_BoolbHasAddError;   // updated in append
-ScDetOpDataVector aDetOpDataVector;
+ScDetOpDataVector aDetOpDataVector;
 
 public:
 ScDetOpList() : bHasAddError(false) {}
@@ -93,11 +93,11 @@ public:
 sal_Booloperator==( const ScDetOpList r ) const;   // for ref-undo
 
 void Append( ScDetOpData* pData );
-ScDetOpData* GetObject(int i);
-void DeleteAndDestroy(int i);
+ScDetOpDataVector  GetDataVector() { return aDetOpDataVector; }
+const ScDetOpData* GetObject( size_t nPos ) const;
 
 sal_BoolHasAddError() const { return bHasAddError; }
-int Count() const { return aDetOpDataVector.size(); }
+size_t  Count() const { return aDetOpDataVector.size(); }
 };
 
 
diff --git a/sc/source/core/tool/detdata.cxx b/sc/source/core/tool/detdata.cxx
index d23208c..5a0ed3a 100644
--- a/sc/source/core/tool/detdata.cxx
+++ b/sc/source/core/tool/detdata.cxx
@@ -40,33 +40,30 @@
 ScDetOpList::ScDetOpList(const ScDetOpList rList) :
 bHasAddError( false )
 {
-sal_uInt16 nCount = rList.Count();
+size_t nCount = rList.Count();
 
-for (sal_uInt16 i=0; inCount; i++)
+for (size_t i=0; inCount; i++)
 Append( new ScDetOpData(rList.aDetOpDataVector[i]) );
 }
 
 void ScDetOpList::DeleteOnTab( SCTAB nTab )
 {
-sal_uInt16 nPos = 0;
-while ( nPos  Count() )
+for (ScDetOpDataVector::iterator it = aDetOpDataVector.begin(); it != 
aDetOpDataVector.end(); /*noop*/ )
 {
 // look for operations on the deleted sheet
-
-if ( GetObject(nPos)-GetPos().Tab() == nTab )
-DeleteAndDestroy(nPos);
+if (it-GetPos().Tab() == nTab)
+it = aDetOpDataVector.erase( it);
 else
-++nPos;
+++it;
 }
 }
 
 void ScDetOpList::UpdateReference( ScDocument* pDoc, UpdateRefMode 
eUpdateRefMode,
 const ScRange rRange, SCsCOL nDx, SCsROW nDy, 
SCsTAB nDz )
 {
-sal_uInt16 nCount = Count();
-for (sal_uInt16 i=0; inCount; i++)
+for (ScDetOpDataVector::iterator it = aDetOpDataVector.begin(); it != 
aDetOpDataVector.end(); ++it )
 {
-ScAddress aPos = GetObject(i)-GetPos();
+ScAddress aPos = it-GetPos();
 SCCOL nCol1 = aPos.Col();
 SCROW nRow1 = aPos.Row();
 SCTAB nTab1 = aPos.Tab();
@@ -80,7 +77,7 @@ void ScDetOpList::UpdateReference( ScDocument* pDoc, 
UpdateRefMode eUpdateRefMod
 rRange.aEnd.Col(), rRange.aEnd.Row(), rRange.aEnd.Tab(), nDx, 
nDy, nDz,
 nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
 if ( eRes != UR_NOTHING )
-GetObject(i)-SetPos( ScAddress( nCol1, nRow1, nTab1 ) );
+it-SetPos( ScAddress( nCol1, nRow1, nTab1 ) );
 }
 }
 
@@ -97,29 +94,18 @@ sal_Bool ScDetOpList::operator==( const ScDetOpList r ) 
const
 {
 // fuer Ref-Undo
 
-sal_uInt16 nCount = Count();
+size_t nCount = 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-02-10 Thread Kohei Yoshida
 sc/inc/dpgroup.hxx   |4 
 sc/inc/dpsdbtab.hxx  |2 
 sc/inc/dpshttab.hxx  |2 
 sc/inc/dptabdat.hxx  |2 
 sc/inc/dptabsrc.hxx  |  137 ++
 sc/source/core/data/dpgroup.cxx  |8 
 sc/source/core/data/dpsdbtab.cxx |4 
 sc/source/core/data/dpshttab.cxx |6 
 sc/source/core/data/dptabres.cxx |8 
 sc/source/core/data/dptabsrc.cxx |  366 ++-
 sc/source/ui/view/notemark.cxx   |2 
 11 files changed, 218 insertions(+), 323 deletions(-)

New commits:
commit ce03ae64b582330fda0ecd709bc6e615e4879ecf
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Fri Feb 10 12:46:55 2012 -0500

Cleaned up ScDPSource and ScDPMember(s) a bit.

* boolean, string conversion.
* removing virtual keywords when it makes no sense.
* privatize methods that are called only from within.
* removed methods that are not used.
* etc.

diff --git a/sc/inc/dptabsrc.hxx b/sc/inc/dptabsrc.hxx
index 43869ee..aa1f7e5 100644
--- a/sc/inc/dptabsrc.hxx
+++ b/sc/inc/dptabsrc.hxx
@@ -29,12 +29,6 @@
 #ifndef SC_DPTABSRC_HXX
 #define SC_DPTABSRC_HXX
 
-#include vector
-#include boost/unordered_map.hpp
-#include boost/unordered_set.hpp
-#include list
-#include memory
-
 #include tools/string.hxx
 #include global.hxx   // enum ScSubTotalFunc
 #include com/sun/star/sheet/XDimensionsSupplier.hpp
@@ -64,6 +58,13 @@
 #include dptabdat.hxx
 #include dpglobal.hxx
 
+#include boost/unordered_map.hpp
+#include boost/unordered_set.hpp
+#include boost/noncopyable.hpp
+#include boost/scoped_ptr.hpp
+#include vector
+#include list
+
 namespace com { namespace sun { namespace star {
 namespace sheet {
 struct DataPilotFieldFilter;
@@ -113,10 +114,10 @@ private:
 longnRowDimCount;
 longnDataDimCount;
 longnPageDimCount;
-sal_BoolbColumnGrand;
-sal_BoolbRowGrand;
-sal_BoolbIgnoreEmptyRows;
-sal_BoolbRepeatIfEmpty;
+boolbColumnGrand;
+boolbRowGrand;
+boolbIgnoreEmptyRows;
+boolbRepeatIfEmpty;
 
 longnDupCount;
 
@@ -154,6 +155,13 @@ private:
 
 voidSetDupCount( long nNew );
 
+rtl::OUString getDataDescription();   //! ???
+
+void setIgnoreEmptyRows(bool bSet);
+void setRepeatIfEmpty(bool bSet);
+
+void disposeData();
+
 public:
 ScDPSource( ScDPTableData* pD );
 virtual ~ScDPSource();
@@ -169,7 +177,7 @@ public:
 
 longGetDataDimensionCount();
 ScDPDimension*  GetDataDimension(long nIndex);
-String  GetDataDimName(long nIndex);
+rtl::OUString GetDataDimName(long nIndex);
 const ScDPCache* GetCache();
 const ScDPItemData*GetItemDataById( long nDim, long nId );
 long   GetDataLayoutDim(){ return 
pData-GetColumnCount(); }
@@ -181,7 +189,7 @@ public:
 
 sal_BoolSubTotalAllowed(long nColumn);  //! move 
to ScDPResultData
 
-ScDPDimension*  AddDuplicated(long nSource, const String 
rNewName);
+ScDPDimension* AddDuplicated(long nSource, const rtl::OUString rNewName);
 longGetDupCount() const { return nDupCount; }
 
 longGetSourceDim(long nDim);
@@ -264,21 +272,6 @@ public:
 throw(::com::sun::star::uno::RuntimeException);
 virtual ::com::sun::star::uno::Sequence ::rtl::OUString  SAL_CALL 
getSupportedServiceNames()
 throw(::com::sun::star::uno::RuntimeException);
-
-virtual String  getDataDescription();   //! ???
-
-virtual sal_BoolgetColumnGrand() const;
-virtual voidsetColumnGrand(sal_Bool bSet);
-virtual sal_BoolgetRowGrand() const;
-virtual voidsetRowGrand(sal_Bool bSet);
-
-virtual sal_BoolgetIgnoreEmptyRows() const;
-virtual voidsetIgnoreEmptyRows(sal_Bool bSet);
-virtual sal_BoolgetRepeatIfEmpty() const;
-virtual voidsetRepeatIfEmpty(sal_Bool bSet);
-
-virtual voidvalidate(); //! ???
-virtual voiddisposeData();
 };
 
 class ScDPDimensions : public cppu::WeakImplHelper2
@@ -323,31 +316,28 @@ public:
 virtual ScDPDimension*  getByIndex(long nIndex) const;
 };
 
-class ScDPDimension : public cppu::WeakImplHelper5
+class ScDPDimension : boost::noncopyable, public cppu::WeakImplHelper5
 com::sun::star::sheet::XHierarchiesSupplier,
 com::sun::star::container::XNamed,
 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-02-09 Thread Kohei Yoshida
 sc/inc/dpgroup.hxx   |3 ++-
 sc/inc/dptablecache.hxx  |   14 +-
 sc/inc/dptabres.hxx  |   13 -
 sc/inc/dptabsrc.hxx  |2 ++
 sc/source/core/data/dpcachetable.cxx |1 +
 sc/source/core/data/dpoutput.cxx |1 -
 sc/source/core/data/dpsave.cxx   |1 -
 sc/source/core/data/dpshttab.cxx |1 -
 sc/source/core/data/dptablecache.cxx |   10 ++
 sc/source/core/data/dptabres.cxx |   10 ++
 sc/source/core/data/dptabsrc.cxx |4 +++-
 sc/source/core/data/global2.cxx  |1 -
 sc/source/ui/inc/fieldwnd.hxx|2 +-
 13 files changed, 38 insertions(+), 25 deletions(-)

New commits:
commit bef2d8a6f5a8d75f5b8721f1a3a068cabdd96b02
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Thu Feb 9 15:45:29 2012 -0500

Cleaned up more header include silliness.

diff --git a/sc/inc/dpgroup.hxx b/sc/inc/dpgroup.hxx
index 8f69828..bf7bea0 100644
--- a/sc/inc/dpgroup.hxx
+++ b/sc/inc/dpgroup.hxx
@@ -35,6 +35,7 @@
 
 #include dptabdat.hxx
 #include scdllapi.h
+#include dpitemdata.hxx
 
 class ScDocument;
 class SvNumberFormatter;
diff --git a/sc/inc/dptablecache.hxx b/sc/inc/dptablecache.hxx
index 54304f6..8934af6 100644
--- a/sc/inc/dptablecache.hxx
+++ b/sc/inc/dptablecache.hxx
@@ -30,7 +30,6 @@
 #define SC_DPTABLECACHE_HXX
 
 #include global.hxx
-#include dpitemdata.hxx
 
 #include svl/zforlist.hxx
 
@@ -38,17 +37,22 @@
 #include com/sun/star/sdbc/XRow.hpp
 #include com/sun/star/sdbc/XRowSet.hpp
 
-#include vector
+#include boost/noncopyable.hpp
+#include boost/scoped_ptr.hpp
 #include boost/ptr_container/ptr_vector.hpp
 
+#include vector
+
 struct ScQueryParam;
 class ScDPObject;
+class ScDPItemDataPool;
+class ScDPItemData;
 
 /**
  * This class represents the cached data part of the datapilot cache table
  * implementation.
  */
-class SC_DLLPUBLIC ScDPCache
+class SC_DLLPUBLIC ScDPCache : boost::noncopyable
 {
 public:
 typedef ::boost::ptr_vectorScDPItemData   DataListType;
@@ -93,7 +97,7 @@ private:
 DataListType maLabelNames;// Stores dimension names.
 std::vectorbool mbEmptyRow; // Keeps track of empty rows.
 
-mutable ScDPItemDataPoolmaAdditionalData;
+boost::scoped_ptrScDPItemDataPool mpAdditionalData;
 
 bool mbDisposing;
 
diff --git a/sc/inc/dptabres.hxx b/sc/inc/dptabres.hxx
index f5c10a2..80e77cc 100644
--- a/sc/inc/dptabres.hxx
+++ b/sc/inc/dptabres.hxx
@@ -29,17 +29,20 @@
 #ifndef SC_DPTABRES_HXX
 #define SC_DPTABRES_HXX
 
+#include global.hxx
+#include dpcachetable.hxx
+
 #include svl/svarray.hxx
 #include tools/string.hxx
 #include com/sun/star/sheet/MemberResult.hpp
 #include com/sun/star/sheet/DataResult.hpp
 #include com/sun/star/uno/Sequence.hxx
-#include global.hxx   // enum ScSubTotalFunc
-#include dpcachetable.hxx
+
 #include boost/unordered_map.hpp
 #include boost/unordered_set.hpp
 #include vector
 #include memory
+#include map
 
 namespace com { namespace sun { namespace star { namespace sheet {
 struct DataPilotFieldReference;
@@ -499,9 +502,9 @@ typedef std::vectorScDPDataMember* ScDPDataMembers;
 
 class ScDPResultDimension
 {
-public :
-typedef std::vector ScDPResultMember *   
MemberArray;
-typedef std::map  SCROW , ScDPResultMember * MemberHash;
+public:
+typedef std::vectorScDPResultMember* MemberArray;
+typedef std::mapSCROW, ScDPResultMember* MemberHash;
 private:
 const ScDPResultData*   pResultData;
 MemberArray maMemberArray;
diff --git a/sc/source/core/data/dpcachetable.cxx 
b/sc/source/core/data/dpcachetable.cxx
index ae9ca76..db0bcb4 100644
--- a/sc/source/core/data/dpcachetable.cxx
+++ b/sc/source/core/data/dpcachetable.cxx
@@ -35,6 +35,7 @@
 #include dpobject.hxx
 #include queryparam.hxx
 #include queryentry.hxx
+#include dpitemdata.hxx
 
 #include com/sun/star/i18n/LocaleDataItem.hpp
 #include com/sun/star/sdbc/DataType.hpp
diff --git a/sc/source/core/data/dptablecache.cxx 
b/sc/source/core/data/dptablecache.cxx
index e81d3a5..07b942f 100644
--- a/sc/source/core/data/dptablecache.cxx
+++ b/sc/source/core/data/dptablecache.cxx
@@ -36,6 +36,7 @@
 #include dpobject.hxx
 #include globstr.hrc
 #include docoptio.hxx
+#include dpitemdata.hxx
 
 #include rtl/math.hxx
 #include unotools/textsearch.hxx
@@ -223,6 +224,7 @@ bool ScDPCache::operator== ( const ScDPCache r ) const
 ScDPCache::ScDPCache(ScDocument* pDoc) :
 mpDoc( pDoc ),
 mnColumnCount ( 0 ),
+mpAdditionalData(new ScDPItemDataPool),
 mbDisposing(false)
 {
 }
@@ -682,7 +684,7 @@ SCROW ScDPCache::GetItemDataId(sal_uInt16 nDim, SCROW nRow, 
bool bRepeatIfEmpty)
 const ScDPItemData* ScDPCache::GetItemDataById(long nDim, SCROW nId) const
 {
 if ( nId = GetRowCount()  )
-return maAdditionalData.getData( nId - GetRowCount() );
+return mpAdditionalData-getData(nId - GetRowCount());
 
 if (  (size_t)nId = 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2012-01-31 Thread Eike Rathke
 sc/inc/cell.hxx|2 --
 sc/inc/formularesult.hxx   |   35 ---
 sc/source/core/data/cell.cxx   |5 -
 sc/source/core/data/table4.cxx |1 -
 4 files changed, 20 insertions(+), 23 deletions(-)

New commits:
commit 742b36ed8bd3880d4dcf6022fbc3165a213d80bb
Author: Eike Rathke er...@redhat.com
Date:   Tue Jan 31 20:40:47 2012 +0100

clone token in ScFormulaResult copy-ctor instead of referring

Replaces commit e2b11f4fd79dce4116badb0ecf6477546ca5d0d4

Prevent excessive references to single token instance during fill.

Because if not, we may run out of the 16-bit integer space to
store reference count.

diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index c1cb906..8a35b43 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -41,6 +41,20 @@ class ScFormulaResult
 static const Multiline MULTILINE_FALSE   = 1;
 static const Multiline MULTILINE_TRUE= 2;
 
+// Clone token if the 16-bit only reference counter is nearing it's
+// capacity during fill or copypaste, leaving 4k for temporary passing
+// around. (That should be enough for all times (TM) ;-)
+static const sal_uInt16 MAX_TOKENREF_COUNT = 0xf000;
+static void IncrementTokenRef( const formula::FormulaToken*  rp )
+{
+if (rp)
+{
+if (rp-GetRef() = MAX_TOKENREF_COUNT)
+rp = rp-Clone();
+rp-IncRef();
+}
+}
+
 union
 {
 double  mfValue;// double result direct for performance 
and memory consumption
@@ -94,8 +108,12 @@ public:
 const ScMatrixFormulaCellToken* 
pMatFormula =
 r.GetMatrixFormulaCellToken();
 if (pMatFormula)
+{
 mpToken = new 
ScMatrixFormulaCellToken( *pMatFormula);
-mpToken-IncRef();
+mpToken-IncRef();
+}
+else
+IncrementTokenRef( mpToken);
 }
 }
 else
@@ -308,8 +326,7 @@ inline void ScFormulaResult::Assign( const ScFormulaResult 
 r )
 inline void ScFormulaResult::SetToken( const formula::FormulaToken* p )
 {
 ResetToDefaults();
-if (p)
-p-IncRef();
+IncrementTokenRef( p);
 // Handle a result obtained from the interpreter to be assigned to a matrix
 // formula cell's ScMatrixFormulaCellToken.
 ScMatrixFormulaCellToken* pMatFormula = 
GetMatrixFormulaCellTokenNonConst();
commit 78997434dd813e7a8d949e510a9de8bbf77b8025
Author: Eike Rathke er...@redhat.com
Date:   Tue Jan 31 20:40:10 2012 +0100

Revert Prevent excessive references to single token instance during fill.

This reverts commit e2b11f4fd79dce4116badb0ecf6477546ca5d0d4.

To be replaced with a different solution.

diff --git a/sc/inc/cell.hxx b/sc/inc/cell.hxx
index 3bc7aee..52244f6 100644
--- a/sc/inc/cell.hxx
+++ b/sc/inc/cell.hxx
@@ -535,8 +535,6 @@ public:
 boolIsMultilineResult();
 
 voidMaybeInterpret();
-
-voidResetFormulaResult();
 };
 
 //  Iterator for references in a formula cell
diff --git a/sc/inc/formularesult.hxx b/sc/inc/formularesult.hxx
index 94c62f8..c1cb906 100644
--- a/sc/inc/formularesult.hxx
+++ b/sc/inc/formularesult.hxx
@@ -117,8 +117,6 @@ public:
 mpToken-DecRef();
 }
 
-inline void Reset();
-
 /** Well, guess what ... */
 inline  ScFormulaResultoperator=( const ScFormulaResult  r );
 
@@ -218,16 +216,6 @@ public:
 inline ScMatrixFormulaCellToken* GetMatrixFormulaCellTokenNonConst();
 };
 
-inline void ScFormulaResult::Reset()
-{
-ResetToDefaults();
-
-if (mbToken  mpToken)
-mpToken-DecRef();
-
-mbToken = true;
-mpToken = NULL;
-}
 
 inline void ScFormulaResult::ResetToDefaults()
 {
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index 1f89aed..2f3df26 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -2041,11 +2041,6 @@ void ScFormulaCell::MaybeInterpret()
 Interpret();
 }
 
-void ScFormulaCell::ResetFormulaResult()
-{
-aResult.Reset();
-}
-
 EditTextObject* ScFormulaCell::CreateURLObject()
 {
 String aCellText;
diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 6a21a07..dac4111 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -429,7 +429,6 @@ void ScTable::FillFormula(sal_uLong /* 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2011-12-19 Thread Markus Mohrhard
 sc/inc/document.hxx  |4 -
 sc/inc/externalrefmgr.hxx|   13 ++--
 sc/inc/globstr.hrc   |3 
 sc/inc/tokenarray.hxx|   11 ++-
 sc/source/core/data/cell.cxx |2 
 sc/source/core/data/document.cxx |  121 ---
 sc/source/core/tool/token.cxx|   54 +
 sc/source/ui/docshell/docsh.cxx  |   15 
 sc/source/ui/src/globstr.src |4 +
 9 files changed, 79 insertions(+), 148 deletions(-)

New commits:
commit b5363b8cedf09ce7e8c75022041f4dafda4b699f
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Tue Dec 20 06:53:52 2011 +0100

improve the handling of range names while copy between different docs

we now behave nearly the same way as excel does

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index 526ad41..83ad4a1 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -1864,10 +1864,6 @@ private: // CLOOK-Impl-methods
 
 voidCopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange 
rClipRange, const ScMarkData* pMarks, bool bAllTabs);
 voidCopyRangeNamesToClip(ScDocument* pClipDoc, const ScRange 
rClipRange, SCTAB nTab);
-voidCopyRangeNamesFromClip(ScDocument* pClipDoc, ScClipRangeNameData 
rRangeNames);
-voidUpdateRangeNamesInFormulas(
-ScClipRangeNameData rRangeNames, const ScRangeList rDestRanges, 
const ScMarkData rMark,
-SCCOL nXw, SCROW nYw);
 
 boolHasPartOfMerged( const ScRange rRange );
 
diff --git a/sc/inc/tokenarray.hxx b/sc/inc/tokenarray.hxx
index f766a46..1819de2 100644
--- a/sc/inc/tokenarray.hxx
+++ b/sc/inc/tokenarray.hxx
@@ -96,8 +96,15 @@ public:
 const ScAddress rOldPos,
 const ScAddress rNewPos );
 
-// Make all absolute references external references pointing to the old 
document
-void ReadjusteAbsolute3DReferences( const ScDocument* pOldDoc, const 
ScDocument* pNewDoc, const ScAddress rPos );
+/**
+ * Make all absolute references external references pointing to the old 
document
+ *
+ * @param pOldDoc old document
+ * @param pNewDoc new document
+ * @param rPos position of the cell to determine if the reference is in 
the copied area
+ * @param bRangeName set for range names, range names have special 
handling for absolute sheet ref + relative col/row ref
+ */
+void ReadjusteAbsolute3DReferences( const ScDocument* pOldDoc, const 
ScDocument* pNewDoc, const ScAddress rPos, bool bRangeName = false );
 };
 
 #endif // SC_TOKENARRAY_HXX
diff --git a/sc/source/core/data/cell.cxx b/sc/source/core/data/cell.cxx
index e85d984..a5d6df4 100644
--- a/sc/source/core/data/cell.cxx
+++ b/sc/source/core/data/cell.cxx
@@ -180,7 +180,7 @@ void adjustRangeName(ScToken* pToken, ScDocument rNewDoc, 
const ScDocument* pOl
 bNewGlobal = bOldGlobal;
 pRangeData = new ScRangeData(*pOldRangeData, rNewDoc);
 ScTokenArray* pRangeNameToken = pRangeData-GetCode();
-pRangeNameToken-ReadjusteAbsolute3DReferences(pOldDoc, rNewDoc, 
pRangeData-GetPos());
+pRangeNameToken-ReadjusteAbsolute3DReferences(pOldDoc, rNewDoc, 
pRangeData-GetPos(), true);
 bool bInserted;
 if (bNewGlobal)
 bInserted = rNewDoc.GetRangeName()-insert(pRangeData);
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 9796ceb..eb03a74 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2184,116 +2184,6 @@ void ScDocument::MergeNumberFormatter(ScDocument* 
pSrcDoc)
 }
 }
 
-void ScDocument::CopyRangeNamesFromClip(ScDocument* pClipDoc, 
ScClipRangeNameData rRangeNames)
-{
-if (!pClipDoc-pRangeName)
-return;
-
-ScClipRangeNameData aClipRangeNames;
-
-ScRangeName::const_iterator itr = pClipDoc-pRangeName-begin();
-ScRangeName::const_iterator itrEnd = pClipDoc-pRangeName-end();
-for (; itr != itrEnd; ++itr)//! DB-Bereiche Pivot-Bereiche auch
-{
-/*  Copy only if the name doesn't exist in this document.
-If it exists we use the already existing name instead,
-another possibility could be to create new names if
-documents differ.
-A proper solution would ask the user how to proceed.
-The adjustment of the indices in the formulas is done later.
-*/
-const ScRangeData* pExistingData = 
GetRangeName()-findByUpperName(itr-first);
-if (pExistingData)
-{
-sal_uInt16 nOldIndex = itr-second-GetIndex();
-sal_uInt16 nNewIndex = pExistingData-GetIndex();
-aClipRangeNames.insert(nOldIndex, nNewIndex);
-if ( !aClipRangeNames.mbReplace )
-aClipRangeNames.mbReplace = ( nOldIndex != nNewIndex );
-}
-else
-{
-ScRangeData* pData = new ScRangeData( *itr-second );
-

[Libreoffice-commits] .: 2 commits - sc/inc sc/source unotools/source

2011-11-29 Thread Stephan Bergmann
 sc/inc/nameuno.hxx  |5 +++--
 sc/source/ui/unoobj/nameuno.cxx |4 ++--
 unotools/source/ucbhelper/ucbhelper.cxx |   15 +++
 3 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit d3c772229cf93ecb1296a67f4ddf5e73afe41b7e
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Nov 29 20:03:10 2011 +0100

Use rtl::Reference.

diff --git a/sc/inc/nameuno.hxx b/sc/inc/nameuno.hxx
index 4872373..a83748c 100644
--- a/sc/inc/nameuno.hxx
+++ b/sc/inc/nameuno.hxx
@@ -49,6 +49,7 @@
 #include cppuhelper/implbase3.hxx
 #include cppuhelper/implbase5.hxx
 #include cppuhelper/implbase6.hxx
+#include rtl/ref.hxx
 
 class ScDocShell;
 class ScRangeName;
@@ -67,7 +68,7 @@ class ScNamedRangeObj : public ::cppu::WeakImplHelper6
 public SfxListener
 {
 private:
-com::sun::star::uno::Reference com::sun::star::sheet::XNamedRanges  
mxParent;
+rtl::Reference ScNamedRangesObj  mxParent;
 ScDocShell* pDocShell;
 String  aName;
 com::sun::star::uno::Reference com::sun::star::container::XNamed  
mxSheet;
@@ -81,7 +82,7 @@ private:
 SCTAB   GetTab_Impl();
 
 public:
-ScNamedRangeObj( com::sun::star::uno::Reference 
com::sun::star::sheet::XNamedRanges  xParent, ScDocShell* pDocSh, const 
String rNm,
+ScNamedRangeObj( rtl::Reference ScNamedRangesObj 
 xParent, ScDocShell* pDocSh, const String rNm,
 com::sun::star::uno::Reference 
com::sun::star::container::XNamed  xSheet = com::sun::star::uno::Reference 
com::sun::star::container::XNamed  ());
 virtual ~ScNamedRangeObj();
 
diff --git a/sc/source/ui/unoobj/nameuno.cxx b/sc/source/ui/unoobj/nameuno.cxx
index 3facf43..60f3025 100644
--- a/sc/source/ui/unoobj/nameuno.cxx
+++ b/sc/source/ui/unoobj/nameuno.cxx
@@ -97,7 +97,7 @@ bool lcl_UserVisibleName(const ScRangeData rData)
 return !rData.HasType(RT_DATABASE)  !rData.HasType(RT_SHARED);
 }
 
-ScNamedRangeObj::ScNamedRangeObj( Reference sheet::XNamedRanges  xParent, 
ScDocShell* pDocSh, const String rNm, Referencecontainer::XNamed xSheet):
+ScNamedRangeObj::ScNamedRangeObj( rtl::Reference ScNamedRangesObj  xParent, 
ScDocShell* pDocSh, const String rNm, Referencecontainer::XNamed xSheet):
 mxParent(xParent),
 pDocShell( pDocSh ),
 aName( rNm ),
@@ -213,7 +213,7 @@ void ScNamedRangeObj::Modify_Impl( const String* pNewName, 
const ScTokenArray* p
 if (pNewRanges-insert(pNew))
 {
 ScDocFunc aFunc(*pDocShell);
-aFunc.SetNewRangeNames(pNewRanges, 
dynamic_castScNamedRangesObj*(mxParent.get())-IsModifyAndBroadcast(), nTab);
+aFunc.SetNewRangeNames(pNewRanges, mxParent-IsModifyAndBroadcast(), 
nTab);
 
 aName = aInsName;   //! broadcast?
 }
commit ca6052b9a62596902f901f8fa36680d7abe989f5
Author: Stephan Bergmann sberg...@redhat.com
Date:   Tue Nov 29 20:02:50 2011 +0100

Special casing can be removed again.

diff --git a/unotools/source/ucbhelper/ucbhelper.cxx 
b/unotools/source/ucbhelper/ucbhelper.cxx
index 935620f..8487816 100644
--- a/unotools/source/ucbhelper/ucbhelper.cxx
+++ b/unotools/source/ucbhelper/ucbhelper.cxx
@@ -483,9 +483,6 @@ bool utl::UCBContentHelper::IsSubPath(
 bool utl::UCBContentHelper::EqualURLs(
 rtl::OUString const  url1, rtl::OUString const  url2)
 {
-if (url1.isEmpty() || url2.isEmpty()) {
-return false;
-}
 ucbhelper::ContentBroker * broker = ucbhelper::ContentBroker::get();
 if (broker == 0) {
 throw css::uno::RuntimeException(
@@ -493,11 +490,13 @@ bool utl::UCBContentHelper::EqualURLs(
 RTL_CONSTASCII_USTRINGPARAM(no ucbhelper::ContentBroker)),
 css::uno::Referencecss::uno::XInterface());
 }
-return 0 == broker-getContentProviderInterface()-compareContentIds(
-(broker-getContentIdentifierFactoryInterface()-
- createContentIdentifier(canonic(url1))),
-(broker-getContentIdentifierFactoryInterface()-
- createContentIdentifier(canonic(url2;
+return
+broker-getContentProviderInterface()-compareContentIds(
+(broker-getContentIdentifierFactoryInterface()-
+ createContentIdentifier(canonic(url1))),
+(broker-getContentIdentifierFactoryInterface()-
+ createContentIdentifier(canonic(url2
+== 0;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
Libreoffice-commits@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2011-11-23 Thread Kohei Yoshida
 sc/inc/markdata.hxx  |   40 +++---
 sc/inc/scmod.hxx |2 
 sc/source/core/data/markdata.cxx |   54 +--
 sc/source/core/tool/chgtrack.cxx |1 
 sc/source/ui/Accessibility/AccessibleCell.cxx|1 
 sc/source/ui/Accessibility/AccessibleDocument.cxx|2 
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |1 
 sc/source/ui/app/inputhdl.cxx|1 
 sc/source/ui/app/inputwin.cxx|1 
 sc/source/ui/app/scmod.cxx   |1 
 sc/source/ui/app/seltrans.cxx|1 
 sc/source/ui/docshell/dbdocfun.cxx   |1 
 sc/source/ui/docshell/docsh.cxx  |1 
 sc/source/ui/docshell/docsh3.cxx |1 
 sc/source/ui/docshell/editable.cxx   |1 
 sc/source/ui/drawfunc/fuins2.cxx |1 
 sc/source/ui/drawfunc/fumark.cxx |1 
 sc/source/ui/inc/AccessibleSpreadsheet.hxx   |1 
 sc/source/ui/inc/undodat.hxx |7 +-
 sc/source/ui/inc/undotab.hxx |6 +-
 sc/source/ui/inc/viewdata.hxx|   10 +--
 sc/source/ui/navipi/content.cxx  |1 
 sc/source/ui/navipi/navipi.cxx   |1 
 sc/source/ui/pagedlg/areasdlg.cxx|1 
 sc/source/ui/undo/undodat.cxx|9 +--
 sc/source/ui/undo/undotab.cxx|7 +-
 sc/source/ui/undo/undoutil.cxx   |1 
 sc/source/ui/unoobj/viewuno.cxx  |1 
 sc/source/ui/vba/vbarange.cxx|1 
 sc/source/ui/vba/vbawindow.cxx   |1 
 sc/source/ui/vba/vbaworksheet.cxx|1 
 sc/source/ui/vba/vbaworksheets.cxx   |1 
 sc/source/ui/view/cellsh.cxx |1 
 sc/source/ui/view/cellsh1.cxx|1 
 sc/source/ui/view/cellsh2.cxx|1 
 sc/source/ui/view/cellsh3.cxx|2 
 sc/source/ui/view/cliputil.cxx   |1 
 sc/source/ui/view/colrowba.cxx   |1 
 sc/source/ui/view/dbfunc.cxx |1 
 sc/source/ui/view/dbfunc3.cxx|1 
 sc/source/ui/view/formatsh.cxx   |1 
 sc/source/ui/view/gridwin.cxx|1 
 sc/source/ui/view/gridwin4.cxx   |1 
 sc/source/ui/view/hdrcont.cxx|1 
 sc/source/ui/view/preview.cxx|1 
 sc/source/ui/view/select.cxx |1 
 sc/source/ui/view/selectionstate.cxx |1 
 sc/source/ui/view/spelleng.cxx   |2 
 sc/source/ui/view/tabcont.cxx|1 
 sc/source/ui/view/tabview2.cxx   |1 
 sc/source/ui/view/tabview3.cxx   |1 
 sc/source/ui/view/tabvwsh3.cxx   |1 
 sc/source/ui/view/tabvwsha.cxx   |1 
 sc/source/ui/view/tabvwshc.cxx   |1 
 sc/source/ui/view/tabvwshf.cxx   |1 
 sc/source/ui/view/viewdata.cxx   |   38 -
 sc/source/ui/view/viewfun5.cxx   |1 
 sc/source/ui/view/viewfun6.cxx   |1 
 58 files changed, 145 insertions(+), 80 deletions(-)

New commits:
commit c4a3e29626126658cfb9e8755e9f98cfc4500abd
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Wed Nov 23 21:32:01 2011 -0500

Reducing header dependency on markdata.hxx.

diff --git a/sc/inc/scmod.hxx b/sc/inc/scmod.hxx
index e90936b..5a51b08 100644
--- a/sc/inc/scmod.hxx
+++ b/sc/inc/scmod.hxx
@@ -34,7 +34,6 @@
 #include vcl/timer.hxx
 #include svl/lstner.hxx
 #include global.hxx   // ScInputMode
-#include markdata.hxx // ScMarkData
 #include shellids.hxx
 #include unotools/options.hxx
 #include tools/shl.hxx
@@ -79,6 +78,7 @@ class ScTransferObj;
 class ScDrawTransferObj;
 class ScSelectionTransferObj;
 class ScFormEditData;
+class ScMarkData;
 struct ScDragData;
 struct ScClipData;
 
diff --git a/sc/source/core/tool/chgtrack.cxx b/sc/source/core/tool/chgtrack.cxx
index dc5b097..3a4fcf7 100644
--- a/sc/source/core/tool/chgtrack.cxx
+++ b/sc/source/core/tool/chgtrack.cxx
@@ -51,6 +51,7 @@
 #include inputopt.hxx // GetExpandRefs
 #include patattr.hxx
 #include hints.hxx
+#include markdata.hxx
 
 #include globstr.hrc
 
diff --git a/sc/source/ui/Accessibility/AccessibleCell.cxx 
b/sc/source/ui/Accessibility/AccessibleCell.cxx
index 881a895..6ca5585 100644
--- a/sc/source/ui/Accessibility/AccessibleCell.cxx
+++ 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source

2011-11-15 Thread Kohei Yoshida
 sc/inc/document.hxx  |2 
 sc/source/core/data/documen2.cxx |1 
 sc/source/core/data/documen8.cxx |2 
 sc/source/core/data/document.cxx |   16 +---
 sc/source/core/tool/addinlis.cxx |1 
 sc/source/core/tool/adiasync.cxx |1 
 sc/source/ui/docshell/docsh3.cxx |5 -
 sc/source/ui/view/gridwin4.cxx   |3 
 sc/source/ui/view/tabview3.cxx   |  152 +++
 9 files changed, 86 insertions(+), 97 deletions(-)

New commits:
commit 3b1e88a8eb6b3f9da7c899a791e491db21d1bbdc
Author: Kohei Yoshida kohei.yosh...@suse.com
Date:   Tue Nov 15 16:55:49 2011 -0500

Reset formula cell's changed flag only for those within visible range.

Especially avoid marking all cells in all sheets which would cause a
performance problem.

diff --git a/sc/inc/document.hxx b/sc/inc/document.hxx
index de903d0..02cc60d 100644
--- a/sc/inc/document.hxx
+++ b/sc/inc/document.hxx
@@ -864,7 +864,7 @@ public:
 const ::editeng::SvxBorderLine** ppRight,
 const ::editeng::SvxBorderLine** ppBottom 
) const;
 
-voidResetChanged( const ScRangeList rRanges );
+voidResetChanged( const ScRange rRange );
 
 voidSetDirty();
 voidSetDirty( const ScRange );
diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx
index 223c505..5798f4d 100644
--- a/sc/source/core/data/documen2.cxx
+++ b/sc/source/core/data/documen2.cxx
@@ -336,7 +336,6 @@ IMPL_LINK( ScDocument, TrackTimeHdl, Timer*, EMPTYARG )
 {
 TrackFormulas();
 pShell-Broadcast( SfxSimpleHint( FID_DATACHANGED ) );
-ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) );
 
 //  modified...
 
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 914cfef..1a439a7 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1056,7 +1056,6 @@ void ScDocument::UpdateExternalRefLinks(Window* pWin)
 {
 TrackFormulas();
 pShell-Broadcast( SfxSimpleHint(FID_DATACHANGED) );
-ResetChanged( ScRange(0, 0, 0, MAXCOL, MAXROW, MAXTAB) );
 
 // #i101960# set document modified, as in TrackTimeHdl for DDE links
 if (!pShell-IsModified())
@@ -1117,7 +1116,6 @@ void ScDocument::UpdateDdeLinks(Window* pWin)
 //  Formeln berechnen und painten wie im TrackTimeHdl
 TrackFormulas();
 pShell-Broadcast( SfxSimpleHint( FID_DATACHANGED ) );
-ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) );
 
 //  wenn FID_DATACHANGED irgendwann mal asynchron werden sollte
 //  (z.B. mit Invalidate am Window), muss hier ein Update 
erzwungen werden.
diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 9f44829..40e85d7 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3504,18 +3504,14 @@ sal_uInt16 ScDocument::GetErrCode( const ScAddress 
rPos ) const
 }
 
 
-void ScDocument::ResetChanged( const ScRangeList rRanges )
+void ScDocument::ResetChanged( const ScRange rRange )
 {
 SCTAB nTabSize = static_castSCTAB(maTabs.size());
-for (size_t i = 0, n = rRanges.size(); i  n; ++i)
-{
-const ScRange rRange = *rRanges[i];
-SCTAB nTab1 = rRange.aStart.Tab();
-SCTAB nTab2 = rRange.aEnd.Tab();
-for (SCTAB nTab = nTab1; nTab1 = nTab2  nTab  nTabSize; ++nTab)
-if (maTabs[nTab])
-maTabs[nTab]-ResetChanged(rRange);
-}
+SCTAB nTab1 = rRange.aStart.Tab();
+SCTAB nTab2 = rRange.aEnd.Tab();
+for (SCTAB nTab = nTab1; nTab1 = nTab2  nTab  nTabSize; ++nTab)
+if (maTabs[nTab])
+maTabs[nTab]-ResetChanged(rRange);
 }
 
 //
diff --git a/sc/source/core/tool/addinlis.cxx b/sc/source/core/tool/addinlis.cxx
index 267d006..292824a 100644
--- a/sc/source/core/tool/addinlis.cxx
+++ b/sc/source/core/tool/addinlis.cxx
@@ -135,7 +135,6 @@ void SAL_CALL ScAddInListener::modified( const 
::com::sun::star::sheet::ResultEv
 ScDocument* pDoc = (ScDocument*)*ppDoc;
 pDoc-TrackFormulas();
 pDoc-GetDocumentShell()-Broadcast( SfxSimpleHint( FID_DATACHANGED ) 
);
-pDoc-ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) );
 }
 }
 
diff --git a/sc/source/core/tool/adiasync.cxx b/sc/source/core/tool/adiasync.cxx
index 341aee1..208305f 100644
--- a/sc/source/core/tool/adiasync.cxx
+++ b/sc/source/core/tool/adiasync.cxx
@@ -151,7 +151,6 @@ void ScAddInAsync::CallBack( sal_uLong nHandleP, void* 
pData )
 ScDocument* pDoc = (ScDocument*)*ppDoc;
 pDoc-TrackFormulas();
 pDoc-GetDocumentShell()-Broadcast( SfxSimpleHint( FID_DATACHANGED ) 
);
-pDoc-ResetChanged( ScRange(0,0,0,MAXCOL,MAXROW,MAXTAB) );
 }
 }
 
diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx
index b392c2d..b7a139f 

[Libreoffice-commits] .: 2 commits - sc/inc sc/source unusedcode.easy

2011-11-04 Thread Markus Mohrhard
 sc/inc/document.hxx   |4 -
 sc/inc/table.hxx  |3 -
 sc/source/core/data/documen9.cxx  |   65 --
 sc/source/core/data/table1.cxx|9 ---
 sc/source/core/data/table2.cxx|   11 
 sc/source/filter/xml/xmlsubti.cxx |   93 --
 sc/source/filter/xml/xmlsubti.hxx |2 
 unusedcode.easy   |2 
 8 files changed, 42 insertions(+), 147 deletions(-)

New commits:
commit c9c98ab207fba4df35261c66b3753b9ce5e997ba
Author: Laurent Godard oooc...@free.fr
Date:   Fri Nov 4 15:24:53 2011 +0100

calc big doc : ScMyTables::NewSheet method cleaning

diff --git a/sc/source/filter/xml/xmlsubti.cxx 
b/sc/source/filter/xml/xmlsubti.cxx
index 04f9a8e..2bc5b7c 100644
--- a/sc/source/filter/xml/xmlsubti.cxx
+++ b/sc/source/filter/xml/xmlsubti.cxx
@@ -184,17 +184,41 @@ void ScMyTables::NewSheet(const rtl::OUString 
sTableName, const rtl::OUString
 ++nCurrentSheet;
 
 maProtectionData = rProtectData;
+ScDocument *pDoc = ScXMLConverter::GetScDocument(rImport.GetModel());
+
+if (nCurrentSheet  0)
+{
+pDoc-AppendTabOnLoad(sTableName);
+}
+
+rImport.SetTableStyle(sStyleName);
+SetTableStyle(sStyleName);
+}
+
+NewTable(1);
+}
+
+void ScMyTables::SetTableStyle(const rtl::OUString sStyleName)
+{
+//these uno calls are a bit difficult to remove, 
XMLTableStyleContext::FillPropertySet uses
+//SvXMLImportPropertyMapper::FillPropertySet
+if ( sStyleName.getLength() )
+{
+// #i57869# All table style properties for all sheets are now applied 
here,
+// before importing the contents.
+// This is needed for the background color.
+// Sheet visibility has special handling in ScDocFunc::SetTableVisible 
to
+// allow hiding the first sheet.
+// RTL layout is only remembered, not actually applied, so the shapes 
can
+// be loaded before mirroring.
+
 uno::Reference sheet::XSpreadsheetDocument xSpreadDoc( 
rImport.GetModel(), uno::UNO_QUERY );
+
 if ( xSpreadDoc.is() )
 {
 uno::Reference sheet::XSpreadsheets 
xSheets(xSpreadDoc-getSheets());
-if (xSheets.is())
+if ( xSheets.is() )
 {
-if (nCurrentSheet  0)
-{
-ScDocument *pDoc = 
ScXMLConverter::GetScDocument(rImport.GetModel());
-pDoc-AppendTabOnLoad(sTableName);
-}
 uno::Reference container::XIndexAccess xIndex( xSheets, 
uno::UNO_QUERY );
 if ( xIndex.is() )
 {
@@ -202,65 +226,28 @@ void ScMyTables::NewSheet(const rtl::OUString 
sTableName, const rtl::OUString
 if ( xCurrentSheet.is() )
 {
 xCurrentCellRange.set(xCurrentSheet, uno::UNO_QUERY);
-if (!(nCurrentSheet  0))
+uno::Reference beans::XPropertySet 
xProperties(xCurrentSheet, uno::UNO_QUERY);
+if ( xProperties.is() )
 {
-uno::Reference  container::XNamed  
xNamed(xCurrentSheet, uno::UNO_QUERY );
-if ( xNamed.is() )
-try
-{
-xNamed-setName(sTableName);
-}
-catch ( uno::RuntimeException )
-{
-ScDocument *pDoc = 
ScXMLConverter::GetScDocument(rImport.GetModel());
-if (pDoc)
-{
-ScXMLImport::MutexGuard 
aGuard(rImport);
-String 
sTabName(String::CreateFromAscii(Table));
-pDoc-CreateValidTabName(sTabName);
-rtl::OUString sOUTabName(sTabName);
-xNamed-setName(sOUTabName);
-}
-}
-}
-rImport.SetTableStyle(sStyleName);
-
-if ( sStyleName.getLength() )
-{
-// #i57869# All table style properties for all 
sheets are now applied here,
-// before importing the contents.
-// This is needed for the background color.
-// Sheet visibility has special handling in 
ScDocFunc::SetTableVisible to
-// allow hiding the first sheet.
-// RTL layout is only remembered, not actually 
applied, so the shapes can
-// be loaded