[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/inc sc/source

2013-08-26 Thread Michael Meeks
 sc/inc/global.hxx  |9 +
 sc/source/core/data/table2.cxx |3 ++-
 sc/source/ui/view/viewfun3.cxx |2 +-
 3 files changed, 8 insertions(+), 6 deletions(-)

New commits:
commit 07a69320a7b475e8b09b2faca8b6f728a62372ec
Author: Michael Meeks michael.me...@suse.com
Date:   Thu Aug 22 17:45:18 2013 +0100

fdo#39484 - don't loose outlines while trying to undo formulae changes.

Reviewed-on: https://gerrit.libreoffice.org/5592
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

Conflicts:
sc/source/core/data/table2.cxx

Change-Id: Ib3b2bab5beffb8164a8cd2c0b4db4c97f427507e

diff --git a/sc/inc/global.hxx b/sc/inc/global.hxx
index d559d74..e306669 100644
--- a/sc/inc/global.hxx
+++ b/sc/inc/global.hxx
@@ -187,12 +187,13 @@ const sal_uInt16 IDF_HARDATTR   = 0x0020;   /// Hard cell 
attributes.
 const sal_uInt16 IDF_STYLES = 0x0040;   /// Cell styles.
 const sal_uInt16 IDF_OBJECTS= 0x0080;   /// Drawing objects.
 const sal_uInt16 IDF_EDITATTR   = 0x0100;   /// Rich-text attributes.
-const sal_uInt16 IDF_SPECIAL_BOOLEAN = 0x1000;
-const sal_uInt16 IDF_ATTRIB = IDF_HARDATTR | IDF_STYLES;
-const sal_uInt16 IDF_CONTENTS   = IDF_VALUE | IDF_DATETIME | IDF_STRING | 
IDF_NOTE | IDF_FORMULA;
-const sal_uInt16 IDF_ALL= IDF_CONTENTS | IDF_ATTRIB | IDF_OBJECTS;
+const sal_uInt16 IDF_OUTLINE= 0x0800;   /// Sheet / outlining (grouping) 
information
 const sal_uInt16 IDF_NOCAPTIONS = 0x0200;   /// Internal use only (undo etc.): 
do not copy/delete caption objects of cell notes.
 const sal_uInt16 IDF_ADDNOTES   = 0x0400;   /// Internal use only (copy from 
clip): do not delete existing cell contents when pasting notes.
+const sal_uInt16 IDF_SPECIAL_BOOLEAN = 0x1000;
+const sal_uInt16 IDF_ATTRIB = IDF_HARDATTR | IDF_STYLES | IDF_OUTLINE;
+const sal_uInt16 IDF_CONTENTS   = IDF_VALUE | IDF_DATETIME | IDF_STRING | 
IDF_NOTE | IDF_FORMULA | IDF_OUTLINE;
+const sal_uInt16 IDF_ALL= IDF_CONTENTS | IDF_ATTRIB | IDF_OBJECTS;
 
 /// Copy flags for auto/series fill functions: do not touch notes and drawing 
objects.
 const sal_uInt16 IDF_AUTOFILL   = IDF_ALL  ~(IDF_NOTE | IDF_OBJECTS);
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 00d0632..f34f087 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -,7 +,8 @@ void ScTable::CopyToTable(SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
 if (bFlagChange)
 pDestTab-InvalidatePageBreaks();
 
-pDestTab-SetOutlineTable( pOutlineTable ); // auch nur wenn 
bColRowFlags
+if(nFlags  IDF_OUTLINE) // also only when bColRowFlags
+pDestTab-SetOutlineTable( pOutlineTable );
 }
 
 
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index e4417ab..b7de8ce 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -1205,7 +1205,7 @@ bool ScViewFunc::PasteFromClip( sal_uInt16 nFlags, 
ScDocument* pClipDoc,
 // all sheets - CopyToDocument skips those that don't exist in pUndoDoc
 SCTAB nTabCount = pDoc-GetTableCount();
 pDoc-CopyToDocument( nStartCol, nStartRow, 0, nUndoEndCol, 
nUndoEndRow, nTabCount-1,
-nUndoFlags, false, pUndoDoc );
+  nUndoFlags, false, pUndoDoc );
 
 if ( bCutMode )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/inc sc/source

2013-07-15 Thread Kohei Yoshida
 sc/inc/dpfilteredcache.hxx  |5 
 sc/source/core/data/dpfilteredcache.cxx |   12 +
 sc/source/core/data/dpgroup.cxx |  300 +++-
 3 files changed, 201 insertions(+), 116 deletions(-)

New commits:
commit 6877ddc50d601f57d4cf77379ae613a33df19711
Author: Kohei Yoshida kohei.yosh...@gmail.com
Date:   Sat Jul 13 16:59:16 2013 -0400

fdo#63998: Filtering by page fields to work again.

Conflicts:
sc/source/core/data/dpgroup.cxx

Change-Id: I267ccb30cfa6347313fa1de96e18731f0e22d57d
Reviewed-on: https://gerrit.libreoffice.org/4897
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/inc/dpfilteredcache.hxx b/sc/inc/dpfilteredcache.hxx
index 9caa2f8..c0002f2 100644
--- a/sc/inc/dpfilteredcache.hxx
+++ b/sc/inc/dpfilteredcache.hxx
@@ -56,6 +56,8 @@ public:
 /** returns true if the matching condition is met for a single cell
 value, or false otherwise. */
 virtual bool match( const  ScDPItemData rCellData ) const = 0;
+
+virtual std::vectorScDPItemData getMatchValues() const = 0;
 };
 
 /** ordinary single-item filter. */
@@ -66,7 +68,7 @@ public:
 virtual ~SingleFilter() {}
 
 virtual bool match(const ScDPItemData rCellData) const;
-
+virtual std::vectorScDPItemData getMatchValues() const;
 const ScDPItemData getMatchValue() const;
 
 private:
@@ -82,6 +84,7 @@ public:
 GroupFilter();
 virtual ~GroupFilter() {}
 virtual bool match(const ScDPItemData rCellData) const;
+virtual std::vectorScDPItemData getMatchValues() const;
 void addMatchItem(const ScDPItemData rItem);
 size_t getMatchItemCount() const;
 
diff --git a/sc/source/core/data/dpfilteredcache.cxx 
b/sc/source/core/data/dpfilteredcache.cxx
index ff82719..44e249f 100644
--- a/sc/source/core/data/dpfilteredcache.cxx
+++ b/sc/source/core/data/dpfilteredcache.cxx
@@ -63,6 +63,13 @@ bool ScDPFilteredCache::SingleFilter::match(const 
ScDPItemData rCellData) const
 return maItem == rCellData;
 }
 
+std::vectorScDPItemData ScDPFilteredCache::SingleFilter::getMatchValues() 
const
+{
+std::vectorScDPItemData aValues;
+aValues.push_back(maItem);
+return aValues;
+}
+
 const ScDPItemData ScDPFilteredCache::SingleFilter::getMatchValue() const
 {
 return maItem;
@@ -84,6 +91,11 @@ bool ScDPFilteredCache::GroupFilter::match(const 
ScDPItemData rCellData) const
 return false;
 }
 
+std::vectorScDPItemData ScDPFilteredCache::GroupFilter::getMatchValues() 
const
+{
+return maItems;
+}
+
 void ScDPFilteredCache::GroupFilter::addMatchItem(const ScDPItemData rItem)
 {
 maItems.push_back(rItem);
diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index 614b5b5..392173e 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -57,41 +57,58 @@ const sal_uInt16 SC_DP_LEAPYEAR = 1648; // arbitrary 
leap year for date calc
 class ScDPGroupNumFilter : public ScDPFilteredCache::FilterBase
 {
 public:
-ScDPGroupNumFilter(const ScDPItemData rValue, const ScDPNumGroupInfo 
rInfo);
+ScDPGroupNumFilter(const std::vectorScDPItemData rValues, const 
ScDPNumGroupInfo rInfo);
 virtual ~ScDPGroupNumFilter() {}
 virtual bool match(const ScDPItemData rCellData) const;
+virtual std::vectorScDPItemData getMatchValues() const;
 private:
-ScDPItemData maValue;
+std::vectorScDPItemData maValues;
 ScDPNumGroupInfo maNumInfo;
 };
 
-ScDPGroupNumFilter::ScDPGroupNumFilter(const ScDPItemData rValue, const 
ScDPNumGroupInfo rInfo) :
-maValue(rValue), maNumInfo(rInfo) {}
+ScDPGroupNumFilter::ScDPGroupNumFilter(const std::vectorScDPItemData 
rValues, const ScDPNumGroupInfo rInfo) :
+maValues(rValues), maNumInfo(rInfo) {}
 
 bool ScDPGroupNumFilter::match(const ScDPItemData rCellData) const
 {
 if (rCellData.GetType() != ScDPItemData::Value)
 return false;
 
-double fVal = maValue.GetValue();
-if (rtl::math::isInf(fVal))
+std::vectorScDPItemData::const_iterator it = maValues.begin(), itEnd = 
maValues.end();
+for (; it != itEnd; ++it)
 {
-if (rtl::math::isSignBitSet(fVal))
+double fVal = it-GetValue();
+if (rtl::math::isInf(fVal))
 {
-// Less than the min value.
-return rCellData.GetValue()  maNumInfo.mfStart;
+if (rtl::math::isSignBitSet(fVal))
+{
+// Less than the min value.
+if (rCellData.GetValue()  maNumInfo.mfStart)
+return true;
+}
+
+// Greater than the max value.
+if (maNumInfo.mfEnd  rCellData.GetValue())
+return true;
+
+continue;
 }
 
-// Greater than the max value.
-return maNumInfo.mfEnd  rCellData.GetValue();
+double low = fVal;
+double high 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/inc sc/source

2013-05-27 Thread Markus Mohrhard
 sc/inc/chartlis.hxx  |2 ++
 sc/source/core/tool/chartlis.cxx |5 +
 sc/source/ui/unoobj/chartuno.cxx |1 +
 3 files changed, 8 insertions(+)

New commits:
commit 92dc9cb50d2d7ebff6fb591d265589ef5f22dc1b
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Mon May 27 01:42:46 2013 +0200

remove chart listener when chart is deleted, fdo#64639

Change-Id: I7ebf75f49c89edcb0bba3a597ba24ac1c0a655ef
Reviewed-on: https://gerrit.libreoffice.org/4045
Reviewed-by: Noel Power noel.po...@suse.com
Tested-by: Noel Power noel.po...@suse.com

diff --git a/sc/inc/chartlis.hxx b/sc/inc/chartlis.hxx
index 788c326..e32a1f0 100644
--- a/sc/inc/chartlis.hxx
+++ b/sc/inc/chartlis.hxx
@@ -171,6 +171,8 @@ public:
 const ScChartListener* findByName(const rtl::OUString rName) const;
 bool hasListeners() const;
 
+void removeByName(const OUString rName);
+
 const ListenersType getListeners() const;
 ListenersType getListeners();
 StringSetType getNonOleObjectNames();
diff --git a/sc/source/core/tool/chartlis.cxx b/sc/source/core/tool/chartlis.cxx
index 67da747..712c60a404 100644
--- a/sc/source/core/tool/chartlis.cxx
+++ b/sc/source/core/tool/chartlis.cxx
@@ -469,6 +469,11 @@ void ScChartListenerCollection::insert(ScChartListener* 
pListener)
 maListeners.insert(aName, pListener);
 }
 
+void ScChartListenerCollection::removeByName(const rtl::OUString rName)
+{
+maListeners.erase(rName);
+}
+
 ScChartListener* ScChartListenerCollection::findByName(const rtl::OUString 
rName)
 {
 ListenersType::iterator it = maListeners.find(rName);
diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 8072f3b..092ddce 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -298,6 +298,7 @@ void SAL_CALL ScChartsObj::removeByName( const 
rtl::OUString aName )
 if (pObj)
 {
 ScDocument* pDoc = pDocShell-GetDocument();
+pDoc-GetChartListenerCollection()-removeByName(aName);
 ScDrawLayer* pModel = pDoc-GetDrawLayer(); // ist nicht 0
 SdrPage* pPage = pModel-GetPage(static_castsal_uInt16(nTab));// 
ist nicht 0
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/inc sc/source

2013-03-06 Thread Markus Mohrhard
 sc/inc/reftokenhelper.hxx  |2 +-
 sc/source/core/tool/reftokenhelper.cxx |   20 +++-
 sc/source/ui/unoobj/chart2uno.cxx  |   14 +++---
 3 files changed, 23 insertions(+), 13 deletions(-)

New commits:
commit 5a1c73cbf18ae5398f736d54224622b86a9bfd54
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Wed Mar 6 06:50:22 2013 +0100

prevent non-3D refs from being accepted in chart2, related fdo#61781

(cherry picked from commit 47ec29ae934c82a58436bca057503568e907)

Change-Id: I4c7f79393721bff3d5e6fda98b8d4bf16a5ee398
Edit: removed one unnecessary header file include. (erAck)
Reviewed-on: https://gerrit.libreoffice.org/2562
Reviewed-by: Eike Rathke er...@redhat.com
Tested-by: Eike Rathke er...@redhat.com

diff --git a/sc/inc/reftokenhelper.hxx b/sc/inc/reftokenhelper.hxx
index fed8232..d4fc698 100644
--- a/sc/inc/reftokenhelper.hxx
+++ b/sc/inc/reftokenhelper.hxx
@@ -46,7 +46,7 @@ public:
  */
 static void compileRangeRepresentation(
 ::std::vectorScTokenRef rRefTokens, const ::rtl::OUString 
rRangeStr, ScDocument* pDoc,
-const sal_Unicode cSep, ::formula::FormulaGrammar::Grammar eGrammar);
+const sal_Unicode cSep, ::formula::FormulaGrammar::Grammar eGrammar, 
bool bOnly3DRef = false);
 
 static bool getRangeFromToken(ScRange rRange, const ScTokenRef pToken, 
bool bExternal = false);
 
diff --git a/sc/source/core/tool/reftokenhelper.cxx 
b/sc/source/core/tool/reftokenhelper.cxx
index b59d140..09d0712 100644
--- a/sc/source/core/tool/reftokenhelper.cxx
+++ b/sc/source/core/tool/reftokenhelper.cxx
@@ -35,7 +35,7 @@ using ::rtl::OUString;
 
 void ScRefTokenHelper::compileRangeRepresentation(
 vectorScTokenRef rRefTokens, const OUString rRangeStr, ScDocument* 
pDoc,
-const sal_Unicode cSep, FormulaGrammar::Grammar eGrammar)
+const sal_Unicode cSep, FormulaGrammar::Grammar eGrammar, bool bOnly3DRef)
 {
 const sal_Unicode cQuote = '\'';
 
@@ -80,12 +80,22 @@ void ScRefTokenHelper::compileRangeRepresentation(
 switch (pT-GetType())
 {
 case svSingleRef:
-if (!pT-GetSingleRef().Valid())
-bFailure = true;
+{
+const ScSingleRefData rRef = pT-GetSingleRef();
+if (!rRef.Valid())
+bFailure = true;
+else if (bOnly3DRef  !rRef.IsFlag3D())
+bFailure = true;
+}
 break;
 case svDoubleRef:
-if (!pT-GetDoubleRef().Valid())
-bFailure = true;
+{
+const ScComplexRefData rRef = pT-GetDoubleRef();
+if (!rRef.Valid())
+bFailure = true;
+else if (bOnly3DRef  !rRef.Ref1.IsFlag3D())
+bFailure = true;
+}
 break;
 case svExternalSingleRef:
 if (!pT-GetSingleRef().ValidExternal())
diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 60b19c9..6bf1bfc 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -1052,7 +1052,7 @@ void ScChart2DataProvider::Notify( SfxBroadcaster 
/*rBC*/, const SfxHint rHint
 vectorScTokenRef aTokens;
 const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
 ScRefTokenHelper::compileRangeRepresentation(
-aTokens, aRangeRepresentation, m_pDocument, cSep, 
m_pDocument-GetGrammar());
+aTokens, aRangeRepresentation, m_pDocument, cSep, 
m_pDocument-GetGrammar(), true);
 return !aTokens.empty();
 }
 
@@ -1484,7 +1484,7 @@ ScChart2DataProvider::createDataSource(
 vectorScTokenRef aRefTokens;
 const sal_Unicode cSep = ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
 ScRefTokenHelper::compileRangeRepresentation(
-aRefTokens, aRangeRepresentation, m_pDocument, cSep, 
m_pDocument-GetGrammar());
+aRefTokens, aRangeRepresentation, m_pDocument, cSep, 
m_pDocument-GetGrammar(), true);
 if (aRefTokens.empty())
 // Invalid range representation.  Bail out.
 throw lang::IllegalArgumentException();
@@ -1818,7 +1818,7 @@ uno::Sequence beans::PropertyValue  SAL_CALL 
ScChart2DataProvider::detectArgum
 vectorScTokenRef aTokens;
 const sal_Unicode cSep = 
ScCompiler::GetNativeSymbol(ocSep).GetChar(0);
 ScRefTokenHelper::compileRangeRepresentation(
-aTokens, xLabel-getSourceRangeRepresentation(), 
m_pDocument, cSep, m_pDocument-GetGrammar());
+aTokens, xLabel-getSourceRangeRepresentation(), 
m_pDocument, cSep, m_pDocument-GetGrammar(), true);
 aLabel.initRangeAnalyzer(aTokens);
 vectorScTokenRef::const_iterator itr = aTokens.begin(), 
itrEnd 

[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - sc/inc sc/source

2013-02-25 Thread Markus Mohrhard
 sc/inc/conditio.hxx  |2 +-
 sc/source/core/data/conditio.cxx |   10 +-
 sc/source/core/data/table2.cxx   |2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

New commits:
commit a9ce4176d274587de755147cf52bbec91b53fa2b
Author: Markus Mohrhard markus.mohrh...@googlemail.com
Date:   Sat Feb 23 00:22:27 2013 +0100

use URM_COPY when copying cond formats, fdo#60306, fdo#60311

Change-Id: I7a232c27dd0c1eee6f389d30f46658500aaded47
Reviewed-on: https://gerrit.libreoffice.org/2414
Reviewed-by: Fridrich Strba fridr...@documentfoundation.org
Tested-by: Fridrich Strba fridr...@documentfoundation.org

diff --git a/sc/inc/conditio.hxx b/sc/inc/conditio.hxx
index 245fb66..810d3be 100644
--- a/sc/inc/conditio.hxx
+++ b/sc/inc/conditio.hxx
@@ -411,7 +411,7 @@ public:
 voidCompileAll();
 voidCompileXML();
 voidUpdateReference( UpdateRefMode eUpdateRefMode,
-const ScRange rRange, SCsCOL nDx, SCsROW nDy, 
SCsTAB nDz );
+const ScRange rRange, SCsCOL nDx, SCsROW nDy, 
SCsTAB nDz, bool bCopyAsMove = false );
 voidDeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW 
nRow2 );
 voidUpdateMoveTab( SCTAB nOldPos, SCTAB nNewPos );
 voidRenameCellStyle( const rtl::OUString rOld, const 
rtl::OUString rNew );
diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 843eda5..a6ba736 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1999,15 +1999,15 @@ void ScConditionalFormat::CompileXML()
 }
 
 void ScConditionalFormat::UpdateReference( UpdateRefMode eUpdateRefMode,
-const ScRange rRange, SCsCOL nDx, SCsROW nDy, 
SCsTAB nDz )
+const ScRange rRange, SCsCOL nDx, SCsROW nDy, 
SCsTAB nDz, bool bCopyAsMove )
 {
-if( eUpdateRefMode == URM_COPY  nDz != 0 )
+for(CondFormatContainer::iterator itr = maEntries.begin(); itr != 
maEntries.end(); ++itr)
+itr-UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz);
+
+if( eUpdateRefMode == URM_COPY  bCopyAsMove )
 maRanges.UpdateReference( URM_MOVE, pDoc, rRange, nDx, nDy, nDz );
 else
 maRanges.UpdateReference( eUpdateRefMode, pDoc, rRange, nDx, nDy, nDz 
);
-
-for(CondFormatContainer::iterator itr = maEntries.begin(); itr != 
maEntries.end(); ++itr)
-itr-UpdateReference(eUpdateRefMode, rRange, nDx, nDy, nDz);
 }
 
 void ScConditionalFormat::DeleteArea( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 918a602..9631116 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -684,7 +684,7 @@ void ScTable::CopyConditionalFormat( SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCRO
 ScConditionalFormat* pNewFormat = itr-Clone(pDocument);
 
 pNewFormat-AddRange(aIntersectedRange);
-pNewFormat-UpdateReference(URM_MOVE, aNewRange, nDx, nDy, 
pTable-nTab - nTab);
+pNewFormat-UpdateReference(URM_COPY, aNewRange, nDx, nDy, 
pTable-nTab - nTab, true);
 
 sal_uLong nMax = 0;
 for(ScConditionalFormatList::const_iterator itrCond = 
mpCondFormatList-begin();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits