[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/document.cxx |8 1 file changed, 8 insertions(+) New commits: commit 6c80a566d21ffc0f471f0b282929f964ab10e445 Author: Eike RathkeDate: Mon Apr 18 22:03:07 2016 +0200 Resolves: tdf#99322 re-establish group area listeners after update reference Change-Id: If2ec5f938c7278ce817de3d89dc84cc0584507ac (cherry picked from commit 44e2da58226448c5617eac08ca2ae3d9a9ad2afa) Reviewed-on: https://gerrit.libreoffice.org/24226 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 8e57020..16be98b 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2596,6 +2596,14 @@ void ScDocument::CopyBlockFromClip( SetInsertingFromOtherDoc( true); aRefCxt.meMode = URM_MOVE; UpdateReference(aRefCxt, rCxt.getUndoDoc(), false); + +// For URM_MOVE group listeners may have been removed, +// re-establish them. +/* TODO: actually only those in + * sc::RefUpdateContext::maRegroupCols are affected, + * come up with a start listeners that takes such. */ +StartNeededListeners(); + SetInsertingFromOtherDoc( bOldInserting); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/document.cxx | 36 +++- 1 file changed, 35 insertions(+), 1 deletion(-) New commits: commit 7f4e1a22ed288ff9b257298f36d471b54a20bd72 Author: Eike RathkeDate: Thu Apr 7 10:51:51 2016 +0100 Resolves: tdf#97897 (re)broadcast if formula groups were split DeleteSelection() and DeleteSelectionTab() remove listeners for split formula groups, broadcast change after listeners of new groups have been established. Change-Id: I017e92b5cbc5f866768f3732e9997028c0c065fa (cherry picked from commit 94a95dce43e07b40350ed849db148b2946e3fd5e) Reviewed-on: https://gerrit.libreoffice.org/23895 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 57d0ca5..8e57020 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1831,7 +1831,6 @@ void ScDocument::DeleteArea( { aRange.aStart.SetTab(i); aRange.aEnd.SetTab(i); - SetDirty( aRange, true); } } @@ -5722,6 +5721,21 @@ void ScDocument::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData& // Re-start listeners on those top bottom groups that have been split. SetNeedsListeningGroups(aGroupPos); StartNeededListeners(); + +// If formula groups were split their listeners were destroyed and may +// need to be notified now that they're restored, +// ScTable::DeleteSelection() couldn't do that. +if (!aGroupPos.empty()) +{ +ScRangeList aRangeList; +rMark.FillRangeListWithMarks( , false); +for (size_t i = 0; i < aRangeList.size(); ++i) +{ +const ScRange* pRange = aRangeList[i]; +if (pRange) +SetDirty( *pRange, true); +} +} } } @@ -5763,6 +5777,26 @@ void ScDocument::DeleteSelectionTab( // Re-start listeners on those top bottom groups that have been split. SetNeedsListeningGroups(aGroupPos); StartNeededListeners(); + +// If formula groups were split their listeners were destroyed and may +// need to be notified now that they're restored, +// ScTable::DeleteSelection() couldn't do that. +if (!aGroupPos.empty()) +{ +ScRangeList aRangeList; +rMark.FillRangeListWithMarks( , false); +for (size_t i = 0; i < aRangeList.size(); ++i) +{ +const ScRange* pRange = aRangeList[i]; +if (pRange && pRange->aStart.Tab() <= nTab && nTab <= pRange->aEnd.Tab()) +{ +ScRange aRange( *pRange); +aRange.aStart.SetTab( nTab); +aRange.aEnd.SetTab( nTab); +SetDirty( aRange, true); +} +} +} } } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/document.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 066db95acf6e6259ca954254fff4836a7d9d220c Author: Eike RathkeDate: Wed Apr 6 12:43:16 2016 +0100 (re)broadcast if value replaces cell of grouped formulas, tdf#97897 related Replacing a grouped formula cell with a different content may lead to the remaining cells of the group not being recalculated if they listen to a range that contains the current position. For example A1: 1 A2: =SUM($A$1:$A1) => 1 A3: =SUM($A$1:$A2) => 2 Enter 2 in A2 => A3 should be 3 but is not recalculated. Loading http://bugs.documentfoundation.org/attachment.cgi?id=122714 of tdf#97897 exhibits that behavior. Change-Id: I10b91e77549a7534143be3d6e3cc03026cdaa764 (cherry picked from commit ce28d83912d14bc81c455af64893842de78a8c8d) Reviewed-on: https://gerrit.libreoffice.org/23856 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 69909e4..57d0ca5 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3271,6 +3271,11 @@ bool ScDocument::SetString( SCCOL nCol, SCROW nRow, SCTAB nTab, const OUString& SetNeedsListeningGroups(aGroupPos); StartNeededListeners(); + +// Listeners may just have been setup that are affected by the current +// position thus were not notified by a ScColumn::BroadcastNewCell() +// during ScTable::SetString(), so do it here. +Broadcast( ScHint( SC_HINT_DATACHANGED, aPos)); } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/document.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit 62258ffd66ecc23de267512fb49369384469630b Author: Eike RathkeDate: Wed Apr 6 14:38:54 2016 +0100 (re)broadcast, same as in ScDocument::SetString(), tdf#97897 related As with ce28d83912d14bc81c455af64893842de78a8c8d Change-Id: I7cd30509138368d73b43c82d71d520d55417d416 (cherry picked from commit b6ba851c02570c17e0484c94065a2e72c5675e58) Reviewed-on: https://gerrit.libreoffice.org/23870 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 78b354a..69909e4 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3377,6 +3377,11 @@ void ScDocument::SetValue( const ScAddress& rPos, double fVal ) SetNeedsListeningGroups(aGroupPos); StartNeededListeners(); + +// Listeners may just have been setup that are affected by the current +// position thus were not notified by a ScColumn::BroadcastNewCell() +// during ScTable::SetValue(), so do it here. +Broadcast( ScHint( SC_HINT_DATACHANGED, rPos)); } else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/compiler.cxx | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) New commits: commit 7ba918f014f177718664cbd379c6386a7a258c59 Author: Eike RathkeDate: Tue Apr 5 18:03:00 2016 +0100 Resolves: tdf#98990 accept R1C1 notation entire column/row references ... which consist of only C4 or C[3] without a range operator. Change-Id: I1865f0ec4c4fec1101b93b6b40d6f26871a65f07 (cherry picked from commit 3c36ba50f65d663f35264f2a11c99c0ff98674a2) Reviewed-on: https://gerrit.libreoffice.org/23843 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 2bec067..80f37a4 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2995,15 +2995,19 @@ bool ScCompiler::IsReference( const OUString& rName ) } else { -// Special treatment for the 'E:\[doc]Sheet1:Sheet3'!D5 Excel sickness, -// mnRangeOpPosInSymbol did not catch the range operator as it is -// within a quoted name. switch (pConv->meConv) { case FormulaGrammar::CONV_XL_A1: -case FormulaGrammar::CONV_XL_R1C1: case FormulaGrammar::CONV_XL_OOX: -if (rName[0] == '\'' && IsDoubleReference( rName)) +// Special treatment for the 'E:\[doc]Sheet1:Sheet3'!D5 Excel +// sickness, mnRangeOpPosInSymbol did not catch the range +// operator as it is within a quoted name. +if (rName[0] != '\'') +return false; // Document name has to be single quoted. +// fallthru +case FormulaGrammar::CONV_XL_R1C1: +// C2 or C[1] are valid entire column references. +if (IsDoubleReference( rName)) return true; break; default: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/formulacell.cxx | 14 +- 1 file changed, 9 insertions(+), 5 deletions(-) New commits: commit fecbcf523ee1e8a13b18ba1cfde36a2368da6949 Author: Eike RathkeDate: Wed Mar 23 14:26:55 2016 +0100 add a recursion guard to lcl_FindRangeNamesInUse() Change-Id: Ifbc02304f5a2e080db2d6645e2c7f825a2c56cb5 Reviewed-on: https://gerrit.libreoffice.org/23473 Tested-by: Jenkins Reviewed-by: Michael Stahl diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index f9c92e6..ceb7f68 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -3555,7 +3555,8 @@ void ScFormulaCell::UpdateGrow( const ScRange& rArea, SCCOL nGrowX, SCROW nGrowY StartListeningTo( pDocument ); // Listener as previous } -static void lcl_FindRangeNamesInUse(std::set& rIndexes, ScTokenArray* pCode, ScRangeName* pNames) +static void lcl_FindRangeNamesInUse(std::set& rIndexes, ScTokenArray* pCode, ScRangeName* pNames, +int nRecursion) { for (FormulaToken* p = pCode->First(); p; p = pCode->Next()) { @@ -3564,16 +3565,19 @@ static void lcl_FindRangeNamesInUse(std::set& rIndexes, ScTokenArray sal_uInt16 nTokenIndex = p->GetIndex(); rIndexes.insert( nTokenIndex ); -ScRangeData* pSubName = pNames->findByIndex(p->GetIndex()); -if (pSubName) -lcl_FindRangeNamesInUse(rIndexes, pSubName->GetCode(), pNames); +if (nRecursion < 126) // whatever.. 42*3 +{ +ScRangeData* pSubName = pNames->findByIndex(p->GetIndex()); +if (pSubName) +lcl_FindRangeNamesInUse(rIndexes, pSubName->GetCode(), pNames, nRecursion+1); +} } } } void ScFormulaCell::FindRangeNamesInUse(std::set& rIndexes) const { -lcl_FindRangeNamesInUse( rIndexes, pCode, pDocument->GetRangeName() ); +lcl_FindRangeNamesInUse( rIndexes, pCode, pDocument->GetRangeName(), 0); } void ScFormulaCell::SetChanged(bool b) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/column2.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 527f2cd0b75f901efc683efd92a51af771b860b5 Author: Arul MichaelDate: Thu Mar 31 17:17:58 2016 +0530 tdf#92963 Pasting a whole row with data crashes all open LibO apps In ScColumn::GetNeededSize the memory pointed by rOptions.pPattern is freed and new value is set again in ScFormulaCell::InterpretTail function in pDocument->SetNumberFormat when pDocument->GetCondResult is called in column2.cxx:130.For fix setting the newly calculated ScPatternAttr* value after the GetCondResult call. Change-Id: I045404465b6dfa561b0821bb3b1875463aa7887a Reviewed-on: https://gerrit.libreoffice.org/23688 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit 99bf0b931401f556033f67297aa9783c4cf19b00) Reviewed-on: https://gerrit.libreoffice.org/23709 diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 8929ecd..0d4b869 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -127,6 +127,13 @@ long ScColumn::GetNeededSize( // conditional formatting const SfxItemSet* pCondSet = pDocument->GetCondResult( nCol, nRow, nTab ); +//The pPattern may change in GetCondResult +if (aCell.meType == CELLTYPE_FORMULA) +{ +pPattern = pAttrArray->GetPattern( nRow ); +if (ppPatternChange) +*ppPatternChange = pPattern; +} // line break? const SfxPoolItem* pCondItem; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/formulacell.cxx | 47 +++- 1 file changed, 46 insertions(+), 1 deletion(-) New commits: commit a84d144cc8ea2cf797583d0b9b4154690c59 Author: Eike RathkeDate: Tue Mar 22 17:16:07 2016 +0100 Resolves: tdf#98642 comparing RPN insufficient in shared formula detection (cherry picked from commit d6b32653ad34f0879ad1ada421a3a2655dd766e1) Backported. Change-Id: I78812c2d6fdb3464ccc2ebeee901a76f675effa4 Reviewed-on: https://gerrit.libreoffice.org/23437 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 1f9ffec..f9c92e6 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -3762,7 +3762,7 @@ ScFormulaCell::CompareState ScFormulaCell::CompareByTokenArray( ScFormulaCell& r break; case formula::svIndex: { -if(pThisTok->GetIndex() != pOtherTok->GetIndex()) +if(pThisTok->GetIndex() != pOtherTok->GetIndex() || pThisTok->IsGlobal() != pOtherTok->IsGlobal()) return NotEqual; } break; @@ -3786,6 +3786,51 @@ ScFormulaCell::CompareState ScFormulaCell::CompareByTokenArray( ScFormulaCell& r } } +// If still the same, check lexical names as different names may result in +// identical RPN code. + +pThis = pCode->GetArray(); +nThisLen = pCode->GetLen(); +pOther = rOther.pCode->GetArray(); +nOtherLen = rOther.pCode->GetLen(); + +if ( !pThis || !pOther ) +{ +// Error: no code for cells !" +return NotEqual; +} + +if ( nThisLen != nOtherLen ) +return NotEqual; + +for ( sal_uInt16 i = 0; i < nThisLen; i++ ) +{ +formula::FormulaToken *pThisTok = pThis[i]; +formula::FormulaToken *pOtherTok = pOther[i]; + +if ( pThisTok->GetType() != pOtherTok->GetType() || + pThisTok->GetOpCode() != pOtherTok->GetOpCode() || + pThisTok->GetParamCount() != pOtherTok->GetParamCount() ) +{ +// Incompatible type, op-code or param counts. +return NotEqual; +} + +switch (pThisTok->GetType()) +{ +// All index tokens are names. Different categories already had +// different OpCode values. +case formula::svIndex: +{ +if (pThisTok->GetIndex() != pOtherTok->GetIndex() || pThisTok->IsGlobal() != pOtherTok->IsGlobal()) +return NotEqual; +} +break; +default: +; +} +} + return bInvariant ? EqualInvariant : EqualRelativeRef; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/document.cxx | 18 ++ 1 file changed, 18 insertions(+) New commits: commit 1bfc042ea7af6f7b3b0410cb03cef41a358582d4 Author: Eike RathkeDate: Mon Feb 29 17:54:50 2016 +0100 fix the "group not recalculated after delete" second part of tdf#97897 If a formula cell group was split during deletion and the group also listened into the range where a cell was deleted, the group wasn't notified of the deletion. Change-Id: I858f5d4c0b647636611133fc32f3df7fbdaf7288 (cherry picked from commit 164419bfe6270015ccf94183c0b6273da7730391) Reviewed-on: https://gerrit.libreoffice.org/22784 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index bb6431a..78b354a 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -1818,6 +1818,24 @@ void ScDocument::DeleteArea( // Re-start listeners on those top bottom groups that have been split. SetNeedsListeningGroups(aGroupPos); StartNeededListeners(); + +// If formula groups were split their listeners were destroyed and may +// need to be notified now that they're restored, ScTable::DeleteArea() +// couldn't do that. +if (!aGroupPos.empty()) +{ +ScRange aRange(nCol1, nRow1, 0, nCol2, nRow2, 0); +for (SCTAB i = 0; i < static_cast(maTabs.size()); i++) +{ +if (rMark.GetTableSelect(i)) +{ +aRange.aStart.SetTab(i); +aRange.aEnd.SetTab(i); + +SetDirty( aRange, true); +} +} +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/formulacell.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit d277c677ba430ee682c291da1a178f85ac98c424 Author: Eike RathkeDate: Wed Mar 16 23:03:58 2016 +0100 ensure a correct index is assigned to a duplicated ScRangeData instance ScRangeName::insert() assigns an index only if the passed ScRangeData instance's index was 0. Duplicating an ScRangeData object duplicates also the index, so effectively two instances with the same index could be inserted to the named expressions collection, a following ScRangeName::findByIndex() retrieved one of them by chance. Change-Id: Ic141ffb1a683bda5907f4359167da84faf1649e1 (cherry picked from commit 336d816176650726f6d14539464d9fd28ddd032d) Reviewed-on: https://gerrit.libreoffice.org/23324 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index b34261b..1f9ffec 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -331,6 +331,7 @@ void adjustRangeName(formula::FormulaToken* pToken, ScDocument& rNewDoc, const S { bNewGlobal = bOldGlobal; pRangeData = new ScRangeData(*pOldRangeData, ); +pRangeData->SetIndex(0);// needed for insert to assign a new index ScTokenArray* pRangeNameToken = pRangeData->GetCode(); if (rNewDoc.GetPool() != const_cast (pOldDoc)->GetPool()) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/formulacell.cxx | 48 +--- 1 file changed, 29 insertions(+), 19 deletions(-) New commits: commit b14cc2f16d00c103cf415a54e163d54764d0a86b Author: Eike RathkeDate: Tue Mar 15 17:39:03 2016 +0100 Resolves: tdf#93196 add RecursionCounter guard also to InterpretFormulaGroup() ... same as for ScFormulaCell::InterpretTail() Change-Id: I444f259fe4e86ed0638a04f1b5d9272edd182e2e (cherry picked from commit 29ee431c1cf859c3d5a5041cff5cb04b89db27a0) Reviewed-on: https://gerrit.libreoffice.org/23280 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 36c64e1..b34261b 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1438,6 +1438,28 @@ bool ScFormulaCell::MarkUsedExternalReferences() return pCode && pDocument->MarkUsedExternalReferences(*pCode, aPos); } +namespace { +class RecursionCounter +{ +ScRecursionHelper& rRec; +boolbStackedInIteration; +public: +RecursionCounter( ScRecursionHelper& r, ScFormulaCell* p ) : rRec(r) +{ +bStackedInIteration = rRec.IsDoingIteration(); +if (bStackedInIteration) +rRec.GetRecursionInIterationStack().push( p); +rRec.IncRecursionCount(); +} +~RecursionCounter() +{ +rRec.DecRecursionCount(); +if (bStackedInIteration) +rRec.GetRecursionInIterationStack().pop(); +} +}; +} + void ScFormulaCell::Interpret() { if (!IsDirtyOrInTableOpDirty() || pDocument->GetRecursionHelper().IsInReturn()) @@ -1680,25 +1702,7 @@ void ScFormulaCell::Interpret() void ScFormulaCell::InterpretTail( ScInterpretTailParameter eTailParam ) { -class RecursionCounter -{ -ScRecursionHelper& rRec; -boolbStackedInIteration; -public: -RecursionCounter( ScRecursionHelper& r, ScFormulaCell* p ) : rRec(r) -{ -bStackedInIteration = rRec.IsDoingIteration(); -if (bStackedInIteration) -rRec.GetRecursionInIterationStack().push( p); -rRec.IncRecursionCount(); -} -~RecursionCounter() -{ -rRec.DecRecursionCount(); -if (bStackedInIteration) -rRec.GetRecursionInIterationStack().pop(); -} -} aRecursionCounter( pDocument->GetRecursionHelper(), this); +RecursionCounter aRecursionCounter( pDocument->GetRecursionHelper(), this); nSeenInIteration = pDocument->GetRecursionHelper().GetIteration(); if( !pCode->GetCodeLen() && !pCode->GetCodeError() ) { @@ -3844,6 +3848,12 @@ bool ScFormulaCell::InterpretFormulaGroup() if (!officecfg::Office::Common::Misc::UseOpenCL::get()) return false; +// Guard against endless recursion of Interpret() calls, for this to work +// ScFormulaCell::InterpretFormulaGroup() must never be called through +// anything else than ScFormulaCell::Interpret(), same as +// ScFormulaCell::InterpretTail() +RecursionCounter aRecursionCounter( pDocument->GetRecursionHelper(), this); + // TODO : Disable invariant formula group interpretation for now in order // to get implicit intersection to work. if (mxGroup->mbInvariant && false) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr4.cxx | 14 ++ 1 file changed, 14 insertions(+) New commits: commit 070fbda4edafb27c91c856039880099014f2b53f Author: Eike RathkeDate: Wed Mar 9 16:18:55 2016 +0100 Resolves: tdf#95226 second case, stack error count in JumpMatrix context For the early bail out on errors to work correctly and not prematurely end calculations the current error function needs to be stacked in JumpMatrix context, otherwise we may end up with ((nErrorFunction=74)>=(nErrorFunctionCount=2)) or some such.. (cherry picked from commit 62b40429946c0e5021912072dc79a60fc11fce06) Change-Id: I3559e15180694961585db92f6aa98a46430ae372 Reviewed-on: https://gerrit.libreoffice.org/23091 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 44e25c7..6ed55dd 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -75,6 +75,7 @@ #include #include #include +#include using namespace com::sun::star; using namespace formula; @@ -3564,6 +3565,7 @@ StackVar ScInterpreter::Interpret() sal_uLong nRetIndexExpr = 0; sal_uInt16 nErrorFunction = 0; sal_uInt16 nErrorFunctionCount = 0; +std::stack aErrorFunctionStack; sal_uInt16 nStackBase; nGlobalError = 0; @@ -4094,7 +4096,19 @@ StackVar ScInterpreter::Interpret() else nLevel = 0; if ( nLevel == 1 || (nLevel == 2 && aCode.IsEndOfPath()) ) +{ +if (nLevel == 1) +aErrorFunctionStack.push( nErrorFunction); bGotResult = JumpMatrix( nLevel ); +if (aErrorFunctionStack.empty()) +assert(!"ScInterpreter::Interpret - aErrorFunctionStack empty in JumpMatrix context"); +else +{ +nErrorFunction = aErrorFunctionStack.top(); +if (bGotResult) +aErrorFunctionStack.pop(); +} +} else pJumpMatrix = NULL; } while ( bGotResult ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/app/inputwin.cxx |4 1 file changed, 4 insertions(+) New commits: commit daa1882dc2360cead712c3f100cbef0f35c74f5d Author: Caolán McNamaraDate: Fri Feb 5 14:03:44 2016 + Resolves: tdf#97465 like wheel ignore swipe for sc input handler inputchanged (cherry picked from commit e35f3b6a3357fc3832a9d68ed37ddb9b5320ef0a) (cherry picked from commit 113f000d38c34dd4dda6903976f8febf6d95375c) Change-Id: Ide7fe1388ffe6f85a1f459037316d03193470d8a Reviewed-on: https://gerrit.libreoffice.org/22156 Tested-by: Jenkins Reviewed-by: Miklos Vajna diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index b3776fd..834f4a6 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1646,6 +1646,10 @@ void ScTextWnd::Command( const CommandEvent& rCEvt ) { //don't call InputChanged for CommandEventId::Wheel } +else if ( nCommand == CommandEventId::Swipe ) +{ +//don't call InputChanged for CommandEventId::Swipe +} else SC_MOD()->InputChanged( pEditView ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/token.cxx | 102 ++ 1 file changed, 93 insertions(+), 9 deletions(-) New commits: commit 406fdc37081a2bdbb4f15f80605f881105c15da0 Author: Eike RathkeDate: Tue Jan 26 16:10:06 2016 +0100 Resolves: tdf#93151 handle ExpandRefs and mnColDelta the same as mnRowDelta (cherry picked from commit 02e69f0c3acec2c2e81692bc53c4356591a84ba5) Conflicts: sc/source/core/tool/token.cxx Change-Id: I8cd00494fc63124443fc01582296ef17f4cd5e27 Reviewed-on: https://gerrit.libreoffice.org/21821 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index d826454..4369017 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -3320,17 +3320,33 @@ bool adjustDoubleRefInName( ScComplexRefData& rRef, const sc::RefUpdateContext& rCxt, const ScAddress& rPos ) { bool bRefChanged = false; -if (rCxt.mnRowDelta > 0 && rCxt.mrDoc.IsExpandRefs() && !rRef.Ref1.IsRowRel() && !rRef.Ref2.IsRowRel()) +if (rCxt.mrDoc.IsExpandRefs()) { -// Check and see if we should expand the range at the top. -ScRange aSelectedRange = getSelectedRange(rCxt); -ScRange aAbs = rRef.toAbs(rPos); -if (aSelectedRange.Intersects(aAbs)) +if (rCxt.mnRowDelta > 0 && !rRef.Ref1.IsRowRel() && !rRef.Ref2.IsRowRel()) { -// Selection intersects the referenced range. Only expand the -// bottom position. -rRef.Ref2.IncRow(rCxt.mnRowDelta); -return true; +// Check and see if we should expand the range at the top. +ScRange aSelectedRange = getSelectedRange(rCxt); +ScRange aAbs = rRef.toAbs(rPos); +if (aSelectedRange.Intersects(aAbs)) +{ +// Selection intersects the referenced range. Only expand the +// bottom position. +rRef.Ref2.IncRow(rCxt.mnRowDelta); +return true; +} +} +if (rCxt.mnColDelta > 0 && !rRef.Ref1.IsColRel() && !rRef.Ref2.IsColRel()) +{ +// Check and see if we should expand the range at the left. +ScRange aSelectedRange = getSelectedRange(rCxt); +ScRange aAbs = rRef.toAbs(rPos); +if (aSelectedRange.Intersects(aAbs)) +{ +// Selection intersects the referenced range. Only expand the +// right position. +rRef.Ref2.IncCol(rCxt.mnColDelta); +return true; +} } } @@ -3465,6 +3481,62 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName( aRes.mbReferenceModified = true; } +else if (rCxt.mnColDelta < 0) +{ +// column(s) deleted. + +if (rRef.IsEntireRow()) +// Rows of entire rows are not affected. +break; + +if (rRef.Ref1.IsColRel() || rRef.Ref2.IsColRel()) +// Don't modify relative references in names. +break; + +if (aAbs.aStart.Row() < rCxt.maRange.aStart.Row() || rCxt.maRange.aEnd.Row() < aAbs.aEnd.Row()) +// row range of the reference is not entirely in the deleted row range. +break; + +if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab()) +// wrong tables +break; + +ScRange aDeleted = rCxt.maRange; +aDeleted.aStart.IncCol(rCxt.mnColDelta); + aDeleted.aEnd.SetCol(aDeleted.aStart.Col()-rCxt.mnColDelta-1); + +if (aAbs.aEnd.Col() < aDeleted.aStart.Col() || aDeleted.aEnd.Col() < aAbs.aStart.Col()) +// reference range doesn't intersect with the deleted range. +break; + +if (aDeleted.aStart.Col() <= aAbs.aStart.Col() && aAbs.aEnd.Col() <= aDeleted.aEnd.Col()) +{ +// This reference is entirely deleted. +rRef.Ref1.SetColDeleted(true); +rRef.Ref2.SetColDeleted(true); +aRes.mbReferenceModified = true; +break; +} + +if (aAbs.aStart.Col() < aDeleted.aStart.Col()) +
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/opencl/formulagroupcl.cxx |7 +++ 1 file changed, 7 insertions(+) New commits: commit 6f50edb1aabaf9de37782e63abd109e2276bd0c4 Author: Tor LillqvistDate: Sun Oct 18 22:57:47 2015 +0300 tdf#97150: tdf#94924: If we can't handle strings, don't try to then Fixes the VLOOKUP problem reported in tdf#94540 by falling back to non-OpenCL for such a case, where one of the columns passed to the VLOOKUP contained strings. And since a while, we don't claim to handle strings in VLOOKUP. Which is true. (cherry picked from commit 476bef70f1d9fd58b29a1f6fb95e54567b031acf) Change-Id: I4140c86bf8166beb8201aa90c075d9f4432d9173 Reviewed-on: https://gerrit.libreoffice.org/21874 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index 2667f5d..4b8b50e 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -2659,6 +2659,13 @@ DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config, new DynamicKernelMixedSlidingArgument(mCalcConfig, ts, ft->Children[i], mpCodeGen, j))); } +else if (!AllStringsAreNull(pDVR->GetArrays()[j].mpStringArray, pDVR->GetArrayLength()) && + !pCodeGen->takeString()) +{ +// Can't handle +SAL_INFO("sc.opencl", "Strings but can't do that."); +throw UnhandledToken(pChild, ("unhandled operand " + StackVarEnumToString(pChild->GetType()) + " for ocPush").c_str()); +} else { // Not sure I can figure out what case this exactly is;) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/sharedformula.cxx | 12 +++- 1 file changed, 7 insertions(+), 5 deletions(-) New commits: commit 10f3272bb1bf36cae5eb6e80f9f1e0f4753ebb5d Author: YogeshDate: Thu Jan 21 16:24:40 2016 +0530 tdf#96910 : Calc crashes while using "Insert Column Left" for large Documents Change-Id: I6e813b7525a3d9b1db131db9f08fc20f7320345f Reviewed-on: https://gerrit.libreoffice.org/21661 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard (cherry picked from commit 208883398dcf9af6b88611097d1f75d5fbc9afad) Reviewed-on: https://gerrit.libreoffice.org/21792 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/core/tool/sharedformula.cxx b/sc/source/core/tool/sharedformula.cxx index 8e84ac0..fc9d778 100644 --- a/sc/source/core/tool/sharedformula.cxx +++ b/sc/source/core/tool/sharedformula.cxx @@ -119,11 +119,13 @@ void SharedFormulaUtil::splitFormulaCellGroups(CellStoreType& rCells, std::vecto for (++it; it != itEnd; ++it) { nRow = *it; -aPos = rCells.position(aPos.first, nRow); -if (aPos.first == rCells.end()) -return; - -splitFormulaCellGroup(aPos, nullptr); +if (ValidRow(nRow)) +{ +aPos = rCells.position(aPos.first, nRow); +if (aPos.first == rCells.end()) +return; +splitFormulaCellGroup(aPos, nullptr); +} } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/conditio.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 9cd87519d7a9d97b58fafff25280bd77fe04ab25 Author: Julien NabetDate: Fri Jan 22 20:18:33 2016 +0100 tdf#97308: fix logic with conditional "ends with" Change-Id: Ib9f9ed627dc37b11d8c3911aa4fe62141ff471c2 Reviewed-on: https://gerrit.libreoffice.org/21723 Tested-by: Jenkins Reviewed-by: Julien Nabet (cherry picked from commit a0a4ea3c636fc18cca6a3b2f9391996fb909e81f) Reviewed-on: https://gerrit.libreoffice.org/21731 Reviewed-by: Jochen Nitschke Reviewed-by: Markus Mohrhard diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index d4408d9..f087af6 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1108,12 +1108,12 @@ bool ScConditionEntry::IsValid( double nArg, const ScAddress& rPos ) const { OUString aStr = OUString::number(nVal1); OUString aStr2 = OUString::number(nArg); -bValid = !aStr2.endsWith(aStr); +bValid = aStr2.endsWith(aStr); } else { OUString aStr2 = OUString::number(nArg); -bValid = !aStr2.endsWith(aStrVal1); +bValid = aStr2.endsWith(aStrVal1); } break; case SC_COND_CONTAINS_TEXT: ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/app/inputhdl.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 26bafaacd071dcba4bf7f75776e31c5786cfd725 Author: Winfried DonkersDate: Mon Jan 18 12:27:49 2016 +0100 follow-up of tdf#89031 No function name hints or autocompletion when character right of caret is '$' Change-Id: I4fcfa6e29e5671e97743c7fc520953721d0bda24 Reviewed-on: https://gerrit.libreoffice.org/21577 Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit 1e2bcb3177d58e6f446296ae28fcff7f5da9b620) Reviewed-on: https://gerrit.libreoffice.org/21602 diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index fe9ef00..09bc73d 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1061,7 +1061,8 @@ void ScInputHandler::UseFormulaData() if ( aParagraph.getLength() > aSel.nEndPos && ( ScGlobal::pCharClass->isLetterNumeric( aParagraph, aSel.nEndPos ) || aParagraph[ aSel.nEndPos ] == '_' || - aParagraph[ aSel.nEndPos ] == '.' ) ) + aParagraph[ aSel.nEndPos ] == '.' || + aParagraph[ aSel.nEndPos ] == '$' ) ) return; // Is the cursor at the end of a word? ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr2.cxx |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) New commits: commit 3665652285f29021f4a12cc493fe8791b6afc126 Author: Eike RathkeDate: Tue Jan 5 15:42:27 2016 +0100 tdf#96198 accept WEEKNUM with only one parameter, tdf#50950 follow-up Loading ISOWEEKNUM(date) maps to WEEKNUM(date) so accept the actual ISOWEEKNUM parameter count defined in ODFF. This also ensures forward compatibility with 5.1 where 3e5deb8ccfaf0b73fb6cf394822e560dc036a686 (cherry picked from commit 15494f0f99d1cf6f75e8c2996377b242af247bbf) converts ISOWEEKNUM(date,mode) to real ISOWEEKNUM(date) if mode!=1 as there is no matching WEEKNUM(date,mode) defined. This WEEKNUM here never implemented the ODFF WEEKNUM but a mix of ISOWEEKNUM and something undefined different. Change-Id: Ibd0d4483486a1db28cc600821baae9f13b9dd687 Reviewed-on: https://gerrit.libreoffice.org/21118 Tested-by: Jenkins Reviewed-by: Markus Mohrhard diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 84a5bff..d82bc29 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -207,9 +207,12 @@ void ScInterpreter::ScGetDayOfWeek() void ScInterpreter::ScGetWeekOfYear() { -if ( MustHaveParamCount( GetByte(), 2 ) ) +sal_uInt8 nParamCount = GetByte(); +if ( MustHaveParamCount( nParamCount, 1, 2 ) ) { -short nFlag = (short) ::rtl::math::approxFloor(GetDouble()); +// Without mode parameter calculate ISO 8601 week starting on Monday +// like ISOWEEKNUM(), which this is loaded from. +short nFlag = (nParamCount == 1) ? 0 : (short) ::rtl::math::approxFloor(GetDouble()); Date aDate = *(pFormatter->GetNullDate()); aDate += (long)::rtl::math::approxFloor(GetDouble()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/column.cxx | 21 +++-- 1 file changed, 15 insertions(+), 6 deletions(-) New commits: commit 293e7bef122fc5f5f4b9cc7719e22489913e8726 Author: ArulDate: Tue Jan 12 15:35:14 2016 +0530 tdf#90606 Crash when delete a large part of a column with shift cells left skipping splitFormulaCellGroup() and joinFormulaCellAbove() for nEndRow equal to MAXROW since nEndRow + 1 is not valid Change-Id: Iabfcb33bf58d20331841ca386cca4a91fd6598bf Reviewed-on: https://gerrit.libreoffice.org/21389 Reviewed-by: jan iversen Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit 975ceab198a06558875006bbd9a4d0a2708e416e) Reviewed-on: https://gerrit.libreoffice.org/21393 diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 910981a..3a7daf1 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -1909,14 +1909,20 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) // Split the formula grouping at the top and bottom boundaries. sc::CellStoreType::position_type aPos = maCells.position(nStartRow); sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); -aPos = maCells.position(aPos.first, nEndRow+1); -sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); +if (ValidRow(nEndRow+1)) +{ +aPos = maCells.position(aPos.first, nEndRow+1); +sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); +} // Do the same with the destination column. aPos = rCol.maCells.position(nStartRow); sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); -aPos = rCol.maCells.position(aPos.first, nEndRow+1); -sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); +if (ValidRow(nEndRow+1)) +{ +aPos = rCol.maCells.position(aPos.first, nEndRow+1); +sc::SharedFormulaUtil::splitFormulaCellGroup(aPos, nullptr); +} // Move the broadcasters to the destination column. maBroadcasters.transfer(nStartRow, nEndRow, rCol.maBroadcasters, nStartRow); @@ -1930,8 +1936,11 @@ void ScColumn::MoveTo(SCROW nStartRow, SCROW nEndRow, ScColumn& rCol) // Re-group transferred formula cells. aPos = rCol.maCells.position(nStartRow); sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); -aPos = rCol.maCells.position(aPos.first, nEndRow+1); -sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); +if (ValidRow(nEndRow+1)) +{ +aPos = rCol.maCells.position(aPos.first, nEndRow+1); +sc::SharedFormulaUtil::joinFormulaCellAbove(aPos); +} CellStorageModified(); rCol.CellStorageModified(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/filter/excel/xechart.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit a0a35440453102d215456e3e2f16b4ee207b16de Author: Tomaž VajngerlDate: Sun Dec 20 22:13:19 2015 +0100 tdf#93949 ensure memory stream is properly flushed Change-Id: I6d6a926f5d3fd62dd3b7b78a5721f6483b3b4ee7 (cherry picked from commit c6b11cf681f8e8d131031ea7e5d19c4b6473503a) Reviewed-on: https://gerrit.libreoffice.org/20842 Tested-by: Jenkins Reviewed-by: David Tardon Tested-by: David Tardon diff --git a/sc/source/filter/excel/xechart.cxx b/sc/source/filter/excel/xechart.cxx index 4b6c300..ce6746a 100644 --- a/sc/source/filter/excel/xechart.cxx +++ b/sc/source/filter/excel/xechart.cxx @@ -720,6 +720,7 @@ void XclExpChEscherFormat::WriteBody( XclExpStream& rStrm ) // write Escher property container via temporary memory stream SvMemoryStream aMemStrm; maData.mxEscherSet->Commit( aMemStrm ); +aMemStrm.Flush(); aMemStrm.Seek( STREAM_SEEK_TO_BEGIN ); rStrm.CopyFromStream( aMemStrm ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/cellsh2.cxx | 31 --- 1 file changed, 24 insertions(+), 7 deletions(-) New commits: commit 5816c47a65d95629d34d6d40fd040e7bc44ea589 Author: Dennis FrancisDate: Sat Nov 28 22:47:02 2015 +0530 tdf#73006 : Put results in correct cells after Text to Columns Change-Id: I7a1653424edd93b2de0597ce8a94aa5f4fa85622 Reviewed-on: https://gerrit.libreoffice.org/20258 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit d4c22dbb1c9d71bb83c218d339df83e8727e469c) Reviewed-on: https://gerrit.libreoffice.org/20675 diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index aeca622..88ca0ad 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -70,7 +70,7 @@ using namespace com::sun::star; -static bool lcl_GetTextToColumnsRange( const ScViewData* pData, ScRange& rRange ) +static bool lcl_GetTextToColumnsRange( const ScViewData* pData, ScRange& rRange, bool bDoEmptyCheckOnly ) { OSL_ENSURE( pData, "lcl_GetTextToColumnsRange: pData is null!" ); @@ -100,11 +100,28 @@ static bool lcl_GetTextToColumnsRange( const ScViewData* pData, ScRange& rRange const ScDocument* pDoc = pData->GetDocument(); OSL_ENSURE( pDoc, "lcl_GetTextToColumnsRange: pDoc is null!" ); -if ( bRet && pDoc->IsBlockEmpty( rRange.aStart.Tab(), rRange.aStart.Col(), - rRange.aStart.Row(), rRange.aEnd.Col(), - rRange.aEnd.Row() ) ) +if ( bDoEmptyCheckOnly ) { -bRet = false; +if ( bRet && pDoc->IsBlockEmpty( rRange.aStart.Tab(), rRange.aStart.Col(), + rRange.aStart.Row(), rRange.aEnd.Col(), + rRange.aEnd.Row() ) ) +{ +bRet = false; +} +} +else if ( bRet ) +{ +rRange.PutInOrder(); +SCCOL nStartCol = rRange.aStart.Col(), nEndCol = rRange.aEnd.Col(); +SCROW nStartRow = rRange.aStart.Row(), nEndRow = rRange.aEnd.Row(); +bool bShrunk = false; +pDoc->ShrinkToUsedDataArea( bShrunk, rRange.aStart.Tab(), nStartCol, nStartRow, + nEndCol, nEndRow, false, false, true ); +if ( bShrunk ) +{ +rRange.aStart.SetRow( nStartRow ); +rRange.aEnd.SetRow( nEndRow ); +} } return bRet; @@ -942,7 +959,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) OSL_ENSURE( pData, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pData is null!" ); ScRange aRange; -if ( lcl_GetTextToColumnsRange( pData, aRange ) ) +if ( lcl_GetTextToColumnsRange( pData, aRange, false ) ) { ScDocument* pDoc = pData->GetDocument(); OSL_ENSURE( pDoc, "ScCellShell::ExecuteDB: SID_TEXT_TO_COLUMNS - pDoc is null!" ); @@ -1180,7 +1197,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) case SID_TEXT_TO_COLUMNS: { ScRange aRange; -if ( !lcl_GetTextToColumnsRange( pData, aRange ) ) +if ( !lcl_GetTextToColumnsRange( pData, aRange, true ) ) { rSet.DisableItem( nWhich ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/table6.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit eea70492fb19b2dbd6edc0c37a2b0ed81b3ead5c Author: Julien NabetDate: Fri Nov 20 00:09:36 2015 +0100 tdf#83126: Find All: Don't ignore Search Direction Rows/Col option bAll (ie "Find All") seems a little tricky for GetBackward but not for GetRowDirection method Change-Id: I47d2b378fb493bcdc1ad30902a3a677eedc50789 Reviewed-on: https://gerrit.libreoffice.org/20067 Tested-by: Jenkins Reviewed-by: Julien Nabet (cherry picked from commit 71f0e4e5e2efee05bccf13698752e84f5059db5f) Reviewed-on: https://gerrit.libreoffice.org/20105 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx index 3c24c8f..e679b18 100644 --- a/sc/source/core/data/table6.cxx +++ b/sc/source/core/data/table6.cxx @@ -371,7 +371,7 @@ bool ScTable::Search(const SvxSearchItem& rSearchItem, SCCOL& rCol, SCROW& rRow, else { SCROW nLastNonFilteredRow = -1; -if (!bAll && rSearchItem.GetRowDirection()) +if (rSearchItem.GetRowDirection()) { nCol++; while (!bFound && (nRow <= nLastRow)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/formulacell.cxx | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) New commits: commit e389e2b2d9bc87e451628e6f3f227d0eb781cf8b Author: Eike RathkeDate: Tue Dec 1 14:09:02 2015 +0100 Resolves: tdf#95748 no group interpreter when calculations are running (cherry picked from commit d46203b55d92185ab2c1d3ac79761100d26aaee3) Conflicts: sc/source/core/data/formulacell.cxx Change-Id: I17283fc5e39da2d7222c302dd63522df69d0ad96 Reviewed-on: https://gerrit.libreoffice.org/20328 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index 1bb5e4c..11d56f3 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -1479,8 +1479,16 @@ void ScFormulaCell::Interpret() } else { -if ( ! InterpretFormulaGroup() ) +// Do not attempt to interpret a group when calculations are already +// running, otherwise we may run into a circular reference hell. See +// tdf#95748 +if (rRecursionHelper.GetRecursionCount()) InterpretTail( SCITP_NORMAL); +else +{ +if (!InterpretFormulaGroup()) +InterpretTail( SCITP_NORMAL); +} } // While leaving a recursion or iteration stack, insert its cells to the ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/docshell/docsh.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit f7d37735bbe1ba2aa11fd5d0b4abee0fe088471a Author: Eike RathkeDate: Tue Dec 1 21:24:27 2015 +0100 Resolves: tdf#95629 quote CSV also if cell contains embedded '\r' CR Change-Id: I37fb62a53338a7edcac1c72153eefcee6096e6f9 (cherry picked from commit 129935443cfd9378e1263489fc4bf47aee1f1a46) Reviewed-on: https://gerrit.libreoffice.org/20340 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index a93aea4..d0c0836 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -1778,11 +1778,12 @@ sal_Int32 getTextSepPos( const StrT& rStr, const ScImportOptions& rAsciiOpt, const SepCharT& rTextSep, const SepCharT& rFieldSep, bool& rNeedQuotes) { // #i116636# quotes are needed if text delimiter (quote), field delimiter, -// or LF is in the cell text. +// or LF or CR is in the cell text. sal_Int32 nPos = rStr.indexOf(rTextSep); rNeedQuotes = rAsciiOpt.bQuoteAllText || (nPos >= 0) || (rStr.indexOf(rFieldSep) >= 0) || -(rStr.indexOf('\n') >= 0); +(rStr.indexOf('\n') >= 0) || +(rStr.indexOf('\r') >= 0); return nPos; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/viewfunc.cxx | 24 1 file changed, 12 insertions(+), 12 deletions(-) New commits: commit d9b6f836e58aa3ad1dc6120df89c4001dc7d3091 Author: Eike RathkeDate: Tue Nov 17 14:46:11 2015 +0100 Resolves: tdf#89907 do not modify original ScViewData's ScMarkData Change-Id: I2ae5a06f9ffe29de0b1cc5875615010da75f4ae9 (cherry picked from commit d1225d60af08ed874ed72066ae0320617d4c8a91) Reviewed-on: https://gerrit.libreoffice.org/20020 Tested-by: Jenkins Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 2cb7612..1bb2268 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1824,13 +1824,13 @@ void ScViewFunc::SetWidthOrHeight( if (rRanges.empty()) return; -// use view's mark if none specified -if ( !pMarkData ) -pMarkData = ().GetMarkData(); +// Use view's mark if none specified, but do not modify the original data, +// i.e. no MarkToMulti() on that. +ScMarkData aMarkData( pMarkData ? *pMarkData : GetViewData().GetMarkData()); ScDocShell* pDocSh = GetViewData().GetDocShell(); ScDocument& rDoc = pDocSh->GetDocument(); -SCTAB nFirstTab = pMarkData->GetFirstSelected(); +SCTAB nFirstTab = aMarkData.GetFirstSelected(); SCTAB nCurTab = GetViewData().GetTabNo(); SCTAB nTab; if (bRecord && !rDoc.IsUndoEnabled()) @@ -1839,7 +1839,7 @@ void ScViewFunc::SetWidthOrHeight( ScDocShellModificator aModificator( *pDocSh ); bool bAllowed = true; -ScMarkData::iterator itr = pMarkData->begin(), itrEnd = pMarkData->end(); +ScMarkData::iterator itr = aMarkData.begin(), itrEnd = aMarkData.end(); for (; itr != itrEnd && bAllowed; ++itr) { for (size_t i = 0, n = rRanges.size(); i < n && bAllowed; ++i) @@ -1886,7 +1886,7 @@ void ScViewFunc::SetWidthOrHeight( rDoc.BeginDrawUndo(); // Drawing Updates pUndoDoc = new ScDocument( SCDOCMODE_UNDO ); -itr = pMarkData->begin(); +itr = aMarkData.begin(); for (; itr != itrEnd; ++itr) { if (bWidth) @@ -1918,12 +1918,12 @@ void ScViewFunc::SetWidthOrHeight( } if ( eMode==SC_SIZE_OPTIMAL || eMode==SC_SIZE_VISOPT ) -pMarkData->MarkToMulti(); +aMarkData.MarkToMulti(); bool bShow = nSizeTwips > 0 || eMode != SC_SIZE_DIRECT; bool bOutline = false; -itr = pMarkData->begin(); +itr = aMarkData.begin(); for (; itr != itrEnd; ++itr) { nTab = *itr; @@ -2036,7 +2036,7 @@ void ScViewFunc::SetWidthOrHeight( { pDocSh->GetUndoManager()->AddUndoAction( new ScUndoWidthOrHeight( -pDocSh, *pMarkData, nStart, nCurTab, nEnd, nCurTab, +pDocSh, aMarkData, nStart, nCurTab, nEnd, nCurTab, pUndoDoc, aUndoRanges, pUndoTab, eMode, nSizeTwips, bWidth)); } @@ -2044,7 +2044,7 @@ void ScViewFunc::SetWidthOrHeight( // the new heights and widths. GetViewData().GetView()->RefreshZoom(); -itr = pMarkData->begin(); +itr = aMarkData.begin(); for (; itr != itrEnd; ++itr) rDoc.UpdatePageBreaks( *itr ); @@ -2052,7 +2052,7 @@ void ScViewFunc::SetWidthOrHeight( if (bPaint) { -itr = pMarkData->begin(); +itr = aMarkData.begin(); for (; itr != itrEnd; ++itr) { nTab = *itr; @@ -2087,7 +2087,7 @@ void ScViewFunc::SetWidthOrHeight( if (ScModelObj* pModelObj = HelperNotifyChanges::getMustPropagateChangesModel(*pDocSh)) { ScRangeList aChangeRanges; -itr = pMarkData->begin(); +itr = aMarkData.begin(); for (; itr != itrEnd; ++itr) { nTab = *itr; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr4.cxx |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit 956782b87d1c4a59159f9ec485f80909c19b397e Author: Eike RathkeDate: Wed Oct 28 22:30:24 2015 +0100 Resolves: tdf#95395 force range reference to array only in array formula, also tdf#95419 ... and not already if the function has a (ReferenceOr)ForceArray type parameter somewhere else in the parameter list. Regression triggered by commit 01eea7fe40c939311bf1920b6e8b4391a93c2e82 for MATCH, HLOOKUP and VLOOKUP first parameter, but behavior already present since OOo for LOOKUP; FORECAST in its first parameter, PROB, LINEST, LOGEST and TTEST in the last two parameters. Change-Id: I4a30ea3362f86274a048b0e3f47fa12da3001a3a (cherry picked from commit b5cd11b4b02a85a83db77ba9d8d1763f0cd88cb1) Reviewed-on: https://gerrit.libreoffice.org/19659 Tested-by: Jenkins Reviewed-by: Norbert Thiebaud diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 43a22c9..4327d61 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1399,7 +1399,13 @@ bool ScInterpreter::ConvertMatrixParameters() ScParameterClassification::Type eType = ScParameterClassification::GetParameterType( pCur, nParams - i); if ( eType != ScParameterClassification::Reference && -eType != ScParameterClassification::ReferenceOrForceArray) +eType != ScParameterClassification::ReferenceOrForceArray && +// For scalar Value: convert to Array/JumpMatrix +// only if in array formula context, else (function +// has ForceArray or ReferenceOrForceArray +// parameter *somewhere else*) pick a normal +// position dependent implicit intersection later. +(eType != ScParameterClassification::Value || bMatrixFormula)) { SCCOL nCol1, nCol2; SCROW nRow1, nRow2; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/app/scmod.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit be4e0ce8a9de6b6c32aa7a7e157b2dbef74f215a Author: Jan-Marek GlogowskiDate: Fri Oct 23 14:51:08 2015 +0200 tdf#94485 Lower Calc background spellchecker prio The Calc spell checker idle handler is currently running in the REPAINT / MEDIUM priority class - much too high. This races with the Calc GUI repaint for large documents, like the one attached to tdf#94485. So move it to the LOWER priority queue, to fix the lagging GUI. Change-Id: I6e4b05dd1a977182ec13f7e3a05f0722f502f226 (cherry picked from commit 0db68ef9ca624cd0bda45c35c24a9abe106faf57) Reviewed-on: https://gerrit.libreoffice.org/19556 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/ui/app/scmod.cxx b/sc/source/ui/app/scmod.cxx index c135b53..328785e 100644 --- a/sc/source/ui/app/scmod.cxx +++ b/sc/source/ui/app/scmod.cxx @@ -174,7 +174,7 @@ ScModule::ScModule( SfxObjectFactory* pFact ) : ERRCODE_AREA_APP2-1, GetResMgr() ); -aSpellIdle.SetPriority(SchedulerPriority::REPAINT); +aSpellIdle.SetPriority(SchedulerPriority::LOWER); aSpellIdle.SetIdleHdl( LINK( this, ScModule, SpellTimerHdl ) ); aIdleTimer.SetTimeout(SC_IDLE_MIN); aIdleTimer.SetTimeoutHdl( LINK( this, ScModule, IdleHandler ) ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr5.cxx |9 + 1 file changed, 5 insertions(+), 4 deletions(-) New commits: commit 26b38babf9a85caac32019cd86e2307b446743c7 Author: Dennis FrancisDate: Fri Oct 23 03:28:37 2015 +0530 tdf#32834 : improve the precision of MDETERM calculation MDETERM uses lcl_LUP_decompose() which as the name suggests does LUP decomposition. This patch allows additive cancellations to occur in a cleaner way while doing the *only* additive operation in LUP decomposition, that is while computing Shur complement. This patch does not change the high level semantics of the algorithm. Also note that this change makes improvement only in the case where matrix elements entered by the user are *integers*. The change allows MDETERM to evaluate to exact 0.0 for singular integer matrices. The steps to calculate Shur complement are : for i = k+1 to n aik = aik / akk; for j = k+1 to n aij = aij - akj*aik This is now modified as : for i = k+1 to n for j = k+1 to n aij = ( aij*akk - akj*aik ) / akk Without this change MDETERM() for certain singular matrices used to evaluate to a tiny non zero value, which also caused MINVERSE() to generate a wrong output. An example of such a matrix is : 1 2 3 4 5 6 7 8 9 Change-Id: Idd4211ddceab1b758fd05bfd57f7eecd5d4fd1a0 Reviewed-on: https://gerrit.libreoffice.org/19534 Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit e1e73a97b20af862f2fb914cb16a4f74c3ad31cb) Reviewed-on: https://gerrit.libreoffice.org/19578 diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index bfaa438..3947eba 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -709,11 +709,12 @@ static int lcl_LUP_decompose( ScMatrix* mA, const SCSIZE n, // Compute Schur complement. for (SCSIZE i = k+1; i < n; ++i) { -double fTmp = mA->GetDouble( k, i) / mA->GetDouble( k, k); -mA->PutDouble( fTmp, k, i); +double fNum = mA->GetDouble( k, i); +double fDen = mA->GetDouble( k, k); +mA->PutDouble( fNum/fDen, k, i); for (SCSIZE j = k+1; j < n; ++j) -mA->PutDouble( mA->GetDouble( j, i) - fTmp * mA->GetDouble( j, -k), j, i); +mA->PutDouble( ( mA->GetDouble( j, i) * fDen - +fNum * mA->GetDouble( j, k) ) / fDen, j, i); } } #if OSL_DEBUG_LEVEL > 1 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/docshell/docsh.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 5a00b977b617bdd9ef263067e95d26c3953c575c Author: Mike KaganskiDate: Sat Oct 24 19:03:33 2015 +1000 tdf#95220: Check if DrawingLayer is not nullptr bool ScDocShell::isTiledRendering() const crashed without this check Change-Id: Idb7ace05eb1aa37cbc3d956503c046b0e9b9d0e5 Reviewed-on: https://gerrit.libreoffice.org/19570 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit 4fc31c1569ba1dc0e2e3aaf9eb8f0747776daa04) Reviewed-on: https://gerrit.libreoffice.org/19579 diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index ad3b6bf..a93aea4 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -3185,7 +3185,7 @@ void ScDocShell::libreOfficeKitCallback(int nType, const char* pPayload) const bool ScDocShell::isTiledRendering() const { -return aDocument.GetDrawLayer()->isTiledRendering(); +return aDocument.GetDrawLayer() && aDocument.GetDrawLayer()->isTiledRendering(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr1.cxx |5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) New commits: commit e5314175b3860d2416840e1008305d3f91cee91a Author: Eike RathkeDate: Wed Oct 21 18:45:18 2015 +0200 Resolves: tdf#95226 fix broken IFERROR/IFNA array logic Change-Id: I059248659f51746cfc1d06faeaadaf3d645c03d3 (cherry picked from commit 968e2faff6d4283dacd9010d31cb4c0df45eb7c5) Reviewed-on: https://gerrit.libreoffice.org/19519 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 13e764d..7349771 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -354,11 +354,11 @@ void ScInterpreter::ScIfError( bool bNAonly ) SCSIZE nC = 0, nR = 0; for ( ; nC < nCols && (nC != nErrorCol || nR != nErrorRow); /*nop*/ ) { -for ( ; nR < nRows && (nC != nErrorCol || nR != nErrorRow); ++nR) +for (nR = 0 ; nR < nRows && (nC != nErrorCol || nR != nErrorRow); ++nR) { lcl_storeJumpMatResult(pMatPtr, pJumpMat, nC, nR); } -if (nC != nErrorCol || nR != nErrorRow) +if (nC != nErrorCol && nR != nErrorRow) ++nC; } // Now the mixed cases. @@ -376,6 +376,7 @@ void ScInterpreter::ScIfError( bool bNAonly ) lcl_storeJumpMatResult(pMatPtr, pJumpMat, nC, nR); } } +nR = 0; } xNew = new ScJumpMatrixToken( pJumpMat ); GetTokenMatrixMap().insert( ScTokenMatrixMap::value_type( pCur, xNew )); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/cctrl/checklistmenu.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit 01af5056ca9162abf55f87c374df0bf32437daa2 Author: Dennis FrancisDate: Wed Oct 14 22:44:56 2015 +0530 tdf#94908 : Autofilter ok button is blocked Reviewed-on: https://gerrit.libreoffice.org/19375 Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit f34ac236b9ed96f5c9158f1d833afefadbdb9395) Conflicts: sc/source/ui/cctrl/checklistmenu.cxx Change-Id: I0a1ad60cb6eea26899604641f981642943b06347 Reviewed-on: https://gerrit.libreoffice.org/19452 Reviewed-by: Dennis Francis Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index b4dc71b..8dca698 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -1257,6 +1257,9 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl) else maChkToggleAll->SetState( TRISTATE_INDET ); +if ( !maConfig.mbAllowEmptySet ) +maBtnOk->Enable( nSelCount != 0); + return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/viewfun4.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit db704b404bfa32aacd1bf0b8101e13eafd7b8b6b Author: Michael MeeksDate: Thu Oct 15 11:37:03 2015 +0100 tdf#93044 - fix silly calc copy/paste lifecycle issue. Change-Id: Ic3d26f45251ff27bacd572f0cb7a7aadf091e808 Reviewed-on: https://gerrit.libreoffice.org/19386 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx index 30320b9..e58267b 100644 --- a/sc/source/ui/view/viewfun4.cxx +++ b/sc/source/ui/view/viewfun4.cxx @@ -100,7 +100,7 @@ void ScViewFunc::PasteRTF( SCCOL nStartCol, SCROW nStartRow, if (pActWin) { pEngine->SetPaperSize(Size(10,10)); -VclPtrInstance< vcl::Window > aWin( pActWin ); +ScopedVclPtrInstance< vcl::Window > aWin( pActWin ); EditView aEditView( pEngine.get(), aWin.get() ); aEditView.SetOutputArea(Rectangle(0,0,10,10)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/tabcont.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 6894ebffe4154887fd8b2521b5c5d1980dfe9e62 Author: Tomaž VajngerlDate: Wed Oct 14 22:31:09 2015 +0200 tdf#93318 reintroduce first/last button in Calc tab bar Seems that first/last button are still useful when there are a lot of tabs. Using ctrl+click is not discoverable enough for the users so for now bring the buttons back. Also turn on enabling/disabling buttons when they have some effect (this was turned off for Calc for unknown reasons). Change-Id: I6bbb04d44066ebc6b89fe3d941ecafdbb378284a (cherry picked from commit b6fe593c8a60cc689e1bbb4d92d7cad89785be0d) Reviewed-on: https://gerrit.libreoffice.org/19380 Tested-by: Jenkins Reviewed-by: Adolfo Jayme Barrientos Tested-by: Adolfo Jayme Barrientos diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index 1c19b55..b8eaf10 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -38,7 +38,7 @@ // STATIC DATA --- ScTabControl::ScTabControl( vcl::Window* pParent, ScViewData* pData ) -: TabBar(pParent, WB_3DLOOK | WB_MINSCROLL | WB_RANGESELECT | WB_MULTISELECT | WB_DRAG) +: TabBar(pParent, WB_3DLOOK | WB_MINSCROLL | WB_SCROLL | WB_RANGESELECT | WB_MULTISELECT | WB_DRAG) , DropTargetHelper(this) , DragSourceHelper(this) , pViewData(pData) @@ -79,7 +79,7 @@ ScTabControl::ScTabControl( vcl::Window* pParent, ScViewData* pData ) EnableEditMode(); UpdateInputContext(); -SetScrollAlwaysEnabled(true); +SetScrollAlwaysEnabled(false); SetScrollAreaContextHdl( LINK( this, ScTabControl, ShowPageList ) ); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 25d385b4f4429b5d079dae6ba8770603e011456d Author: Eike RathkeDate: Tue Oct 13 18:29:27 2015 +0200 Resolves: tdf#94514 more restrictive check on end of column specifier ... needed since we accept A:A entire column notation without the need of a row number being specified. Change-Id: I84f6a39e213a4b554e0188e73b4acb34c7a98460 (cherry picked from commit 14bb562b4a8776974391641adcc62ded013ffd2f) Reviewed-on: https://gerrit.libreoffice.org/19359 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 051b062..4b56e80 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1153,7 +1153,7 @@ static sal_uInt16 lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDo else nBits = 0; -if( nCol > MAXCOL || rtl::isAsciiAlpha( *p ) ) +if (nCol > MAXCOL || (*p && *p != '$' && !rtl::isAsciiDigit( *p ))) nBits = 0; nRes |= nBits; if( !nBits ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr3.cxx |5 - 1 file changed, 4 insertions(+), 1 deletion(-) New commits: commit 595fb25648627c1db68c5df4852136dd7fb420d3 Author: Caolán McNamaraDate: Fri Oct 9 16:35:33 2015 +0100 crashtestig: infinite recurse in ooo32833-1.sxc integralPhi is called with nan(0xf01f6) which recurses through rtl_math_erfc->rtl_math_erf->rtl_math_erfc until we run out of stack Change-Id: Iab8a22fb23686d22d151f2508dbeb44ab47a76b7 (cherry picked from commit d2a07cd3214af27c5af601992e3c4a1a6e3b3dad) Reviewed-on: https://gerrit.libreoffice.org/19282 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 066394d..ec2fbdc 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -1598,7 +1598,10 @@ void ScInterpreter::ScLogNormDist( int nMinParamCount ) //expanded, see #i100119 void ScInterpreter::ScStdNormDist() { -PushDouble(integralPhi(GetDouble())); +double fVal = GetDouble(); +if (!rtl::math::isNan(fVal)) +fVal = integralPhi(fVal); +PushDouble(fVal); } void ScInterpreter::ScStdNormDist_MS() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/docshell/externalrefmgr.cxx | 16 1 file changed, 16 insertions(+) New commits: commit 2e566ad837d736c7f465c216916d9b8a6fc695bf Author: Eike RathkeDate: Fri Oct 9 09:49:01 2015 +0200 Resolves: tdf#93613 let referenced document evaluate macro config ... if the current document allows macros. Change-Id: I927981334e27d073696286ba680777a645d53653 (cherry picked from commit 8e2acdbcbd3afc1777d6e68a83ebbe6d8dd77645) Reviewed-on: https://gerrit.libreoffice.org/19264 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/ui/docshell/externalrefmgr.cxx b/sc/source/ui/docshell/externalrefmgr.cxx index 36a3882..8c557af 100644 --- a/sc/source/ui/docshell/externalrefmgr.cxx +++ b/sc/source/ui/docshell/externalrefmgr.cxx @@ -55,6 +55,7 @@ #include "scmatrix.hxx" #include #include +#include #include #include @@ -2397,6 +2398,21 @@ SfxObjectShellRef ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt // make medium hidden to prevent assertion from progress bar pSet->Put( SfxBoolItem(SID_HIDDEN, true) ); +// If the current document is allowed to execute macros then the referenced +// document may execute macros according to the security configuration. +SfxObjectShell* pShell = mpDoc->GetDocumentShell(); +if (pShell) +{ +SfxMedium* pMedium = pShell->GetMedium(); +if (pMedium) +{ +const SfxPoolItem* pItem; +if (pMedium->GetItemSet()->GetItemState( SID_MACROEXECMODE, false, ) == SfxItemState::SET && +static_cast(pItem)->GetValue() != css::document::MacroExecMode::NEVER_EXECUTE) +pSet->Put( SfxUInt16Item( SID_MACROEXECMODE, css::document::MacroExecMode::USE_CONFIG)); +} +} + unique_ptr pMedium(new SfxMedium(aFile, STREAM_STD_READ, pFilter, pSet)); if (pMedium->GetError() != ERRCODE_NONE) return NULL; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/parclass.cxx |4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) New commits: commit 70f5afe3707c155b412e05e9750c38d00b56d345 Author: Eike RathkeDate: Wed Oct 7 22:23:51 2015 +0200 Resolves: tdf#94796 LINEST and LOGEST have ForceArray parameters Change-Id: I6bd82191ef7c5bb2c7829daf341d360c6d09c11b (cherry picked from commit f3dfab0c23bde81a00fa2f16cf4d96c8809e5045) Reviewed-on: https://gerrit.libreoffice.org/19237 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx index 61c79cc..8d70419 100644 --- a/sc/source/core/tool/parclass.cxx +++ b/sc/source/core/tool/parclass.cxx @@ -167,8 +167,8 @@ const ScParameterClassification::RawData ScParameterClassification::pRawData[] = { ocRank,{{ Value, Reference, Value }, 0 }}, { ocRank_Avg,{{ Value, Reference, Value }, 0 }}, { ocRank_Eq, {{ Value, Reference, Value }, 0 }}, -{ ocLinest, {{ Reference, Reference, Value, Value }, 0 }}, -{ ocLogest, {{ Reference, Reference, Value, Value }, 0 }}, +{ ocLinest, {{ ForceArray, ForceArray, Value, Value }, 0 }}, +{ ocLogest, {{ ForceArray, ForceArray, Value, Value }, 0 }}, { ocRow, {{ Reference }, 0 }}, { ocRows,{{ Reference }, 1 }}, { ocRSQ, {{ ForceArray, ForceArray }, 0 }}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr4.cxx | 22 +++--- 1 file changed, 7 insertions(+), 15 deletions(-) New commits: commit c366c0ff5c9d3511a87ff1004a24a5a70f11ab8e Author: Eike RathkeDate: Fri Oct 9 16:25:10 2015 + Revert "Resolves: tdf#94869 propagate error when obtaining a scalar double value" This reverts commit bfd51e38599d717a3c1b19acd882b52175dd3d09. Calculating with NaN cries for even more problems.. Change-Id: Ie1b7cddc4f157859ee3087b0eadb3a082672a1c7 Reviewed-on: https://gerrit.libreoffice.org/19286 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index e351743..9d4821c 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1082,7 +1082,7 @@ double ScInterpreter::PopDouble() } else SetError( errUnknownStackVariable); -return CreateDoubleError( nGlobalError); +return 0.0; } svl::SharedString ScInterpreter::PopString() @@ -2186,10 +2186,7 @@ bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) { if (!pMat) -{ -SetError( errParameterExpected); -return CreateDoubleError( nGlobalError); -} +return 0.0; if ( !pJumpMatrix ) return pMat->GetDouble( 0 ); @@ -2202,7 +2199,7 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) return pMat->GetDouble( nC, nR); SetError( errNoValue); -return CreateDoubleError( nGlobalError); +return 0.0; } double ScInterpreter::GetDouble() @@ -2236,6 +2233,8 @@ double ScInterpreter::GetDouble() aCell.assign(*pDok, aAdr); nVal = GetCellValue(aAdr, aCell); } +else +nVal = 0.0; } break; case svExternalSingleRef: @@ -2264,6 +2263,7 @@ double ScInterpreter::GetDouble() break; case svError: PopError(); +nVal = 0.0; break; case svEmptyCell: case svMissing: @@ -2273,16 +2273,8 @@ double ScInterpreter::GetDouble() default: PopError(); SetError( errIllegalParameter); +nVal = 0.0; } - -// Propagate error also as double error, so matrix operations where one -// operand is a scalar get that propagated if there is no specific -// nGlobalError check, and when the matrix is pushed the error is cleared -// because the matrix is assumed to hold double errors at the corresponding -// positions. See PushMatrix(). -if (nGlobalError) -nVal = CreateDoubleError( nGlobalError); - if ( nFuncFmtType == nCurFmtType ) nFuncFmtIndex = nCurFmtIndex; return nVal; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr1.cxx | 10 +- 1 file changed, 5 insertions(+), 5 deletions(-) New commits: commit e88019a9c1d6fcaa3d116192ad392ed1fdad2cd2 Author: Caolán McNamaraDate: Fri Oct 9 16:22:56 2015 +0100 crashtesting: ooo95537-1.xls fails with a fAnz that is nan so it happily passes the pre-cast string bounds check and blows up in the post-cast string access Change-Id: Ifd4d087b37e8a84d886e2f7833dfc773b8bf1343 (cherry picked from commit 5d826db15beaff4f0930724431d34f7103111591) Reviewed-on: https://gerrit.libreoffice.org/19280 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index ff8a990..68802ae 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -7830,17 +7830,17 @@ void ScInterpreter::ScFind() sal_uInt8 nParamCount = GetByte(); if ( MustHaveParamCount( nParamCount, 2, 3 ) ) { -double fAnz; +sal_Int32 nAnz; if (nParamCount == 3) -fAnz = GetDouble(); +nAnz = GetDouble(); else -fAnz = 1.0; +nAnz = 1; OUString sStr = GetString().getString(); -if( fAnz < 1.0 || fAnz > (double) sStr.getLength() ) +if (nAnz < 1 || nAnz > sStr.getLength()) PushNoValue(); else { -sal_Int32 nPos = sStr.indexOf(GetString().getString(), static_cast(fAnz - 1)); +sal_Int32 nPos = sStr.indexOf(GetString().getString(), nAnz - 1); if (nPos == -1) PushNoValue(); else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr4.cxx | 22 +++--- 1 file changed, 15 insertions(+), 7 deletions(-) New commits: commit bfd51e38599d717a3c1b19acd882b52175dd3d09 Author: Eike RathkeDate: Wed Oct 7 20:56:23 2015 +0200 Resolves: tdf#94869 propagate error when obtaining a scalar double value ... if any operation like popping a value or calculating an intersection resulted in error, so the error gets passed as double error to matrix operations where one operand is a scalar value. Change-Id: I909ba25545625b827ce790e07d1ebe8643154703 (cherry picked from commit 934e47958c78d1184beaaefdf3baefd3eecbea05) Reviewed-on: https://gerrit.libreoffice.org/19235 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx index 9d4821c..e351743 100644 --- a/sc/source/core/tool/interpr4.cxx +++ b/sc/source/core/tool/interpr4.cxx @@ -1082,7 +1082,7 @@ double ScInterpreter::PopDouble() } else SetError( errUnknownStackVariable); -return 0.0; +return CreateDoubleError( nGlobalError); } svl::SharedString ScInterpreter::PopString() @@ -2186,7 +2186,10 @@ bool ScInterpreter::DoubleRefToPosSingleRef( const ScRange& rRange, ScAddress& r double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) { if (!pMat) -return 0.0; +{ +SetError( errParameterExpected); +return CreateDoubleError( nGlobalError); +} if ( !pJumpMatrix ) return pMat->GetDouble( 0 ); @@ -2199,7 +2202,7 @@ double ScInterpreter::GetDoubleFromMatrix(const ScMatrixRef& pMat) return pMat->GetDouble( nC, nR); SetError( errNoValue); -return 0.0; +return CreateDoubleError( nGlobalError); } double ScInterpreter::GetDouble() @@ -2233,8 +2236,6 @@ double ScInterpreter::GetDouble() aCell.assign(*pDok, aAdr); nVal = GetCellValue(aAdr, aCell); } -else -nVal = 0.0; } break; case svExternalSingleRef: @@ -2263,7 +2264,6 @@ double ScInterpreter::GetDouble() break; case svError: PopError(); -nVal = 0.0; break; case svEmptyCell: case svMissing: @@ -2273,8 +2273,16 @@ double ScInterpreter::GetDouble() default: PopError(); SetError( errIllegalParameter); -nVal = 0.0; } + +// Propagate error also as double error, so matrix operations where one +// operand is a scalar get that propagated if there is no specific +// nGlobalError check, and when the matrix is pushed the error is cleared +// because the matrix is assumed to hold double errors at the corresponding +// positions. See PushMatrix(). +if (nGlobalError) +nVal = CreateDoubleError( nGlobalError); + if ( nFuncFmtType == nCurFmtType ) nFuncFmtIndex = nCurFmtIndex; return nVal; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/output2.cxx |3 +++ 1 file changed, 3 insertions(+) New commits: commit b959b6ba7c3a7385e353ea2fa617b82e177960a0 Author: Eike RathkeDate: Tue Oct 6 15:56:10 2015 +0200 Resolves: tdf#78897 do not cache/reuse a repeat-filled string Column widths or fonts or sizes may differ. Change-Id: I1b4be9a6a6158e10439895534a8cb99c2ca408b7 (cherry picked from commit b94eccd1d1bb7e1a849e6a024acf84b7a7c12ed3) Reviewed-on: https://gerrit.libreoffice.org/19198 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index cd63e9d..7368322 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -509,6 +509,9 @@ bool ScDrawStringsVars::SetText( ScRefCellValue& rCell ) nChar = aString[ nPos + 1 ]; // delete placeholder and char to repeat aString = aString.replaceAt( nPos, 2, "" ); +// Do not cache/reuse a repeat-filled string, column widths +// or fonts or sizes may differ. +maLastCell.clear(); } } else ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/optdlg/calcoptionsdlg.cxx | 49 ++--- sc/source/ui/optdlg/calcoptionsdlg.hxx |1 2 files changed, 29 insertions(+), 21 deletions(-) New commits: commit fb38840771bc4c58de9bd62b960d0f2154fac394 Author: Eike RathkeDate: Tue Oct 6 17:59:38 2015 +0200 reintroduce initial coupling of EmptyStringAsZero to StringConversion ... as not all combinations make sense and aren't handled. For ILLEGAL and ZERO string conversions the EmptyAsZero checkbox is to be disabled. Also, remember the EmptyAsZero value again if the user toggled it. Got lost in commit e224c9cb929cd744674b5d4d265cfb4680c82a2b "Refactor OpenCL settings dialog" (cherry picked from commit d4bb1ea98640c0cf575f8ac556b22cdc6f83ba0d) Conflicts: sc/source/ui/optdlg/calcoptionsdlg.cxx Change-Id: I86f9278e3d7856c70e94c2d1eb9f507359b90899 Reviewed-on: https://gerrit.libreoffice.org/19211 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/ui/optdlg/calcoptionsdlg.cxx b/sc/source/ui/optdlg/calcoptionsdlg.cxx index 13e9487..a4f7e06 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.cxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.cxx @@ -97,6 +97,7 @@ ScCalcOptionsDialog::ScCalcOptionsDialog(vcl::Window* pParent, const ScCalcConfi get(mpEmptyAsZero,"checkEmptyAsZero"); mpEmptyAsZero->Check(rConfig.mbEmptyStringAsZero); mpEmptyAsZero->SetClickHdl(LINK(this, ScCalcOptionsDialog, AsZeroModifiedHdl)); +CoupleEmptyAsZeroToStringConversion(); get(mpSyntax,"comboSyntaxRef"); mpSyntax->SelectEntryPos( toSelectedItem(rConfig.meStringRefAddressSyntax) ); @@ -194,35 +195,41 @@ void ScCalcOptionsDialog::SelectedDeviceChanged() #endif } +void ScCalcOptionsDialog::CoupleEmptyAsZeroToStringConversion() +{ +switch (maConfig.meStringConversion) +{ +case ScCalcConfig::StringConversion::ILLEGAL: +maConfig.mbEmptyStringAsZero = false; +mpEmptyAsZero->Check(false); +mpEmptyAsZero->Enable(false); +break; +case ScCalcConfig::StringConversion::ZERO: +maConfig.mbEmptyStringAsZero = true; +mpEmptyAsZero->Check(); +mpEmptyAsZero->Enable(false); +break; +case ScCalcConfig::StringConversion::UNAMBIGUOUS: +case ScCalcConfig::StringConversion::LOCALE: +// Reset to the value the user selected before. +maConfig.mbEmptyStringAsZero = mbSelectedEmptyStringAsZero; +mpEmptyAsZero->Enable(true); +mpEmptyAsZero->Check( mbSelectedEmptyStringAsZero); +break; +} +} + IMPL_LINK(ScCalcOptionsDialog, AsZeroModifiedHdl, CheckBox*, pCheckBox ) { -maConfig.mbEmptyStringAsZero = pCheckBox->IsChecked(); +maConfig.mbEmptyStringAsZero = mbSelectedEmptyStringAsZero = pCheckBox->IsChecked(); return 0; } IMPL_LINK(ScCalcOptionsDialog, ConversionModifiedHdl, ListBox*, pConv ) { - maConfig.meStringConversion = (ScCalcConfig::StringConversion)pConv->GetSelectEntryPos(); -switch (maConfig.meStringConversion) -{ - case ScCalcConfig::StringConversion::ILLEGAL: -maConfig.mbEmptyStringAsZero = false; -mpEmptyAsZero->Check(false); -mpEmptyAsZero->Enable(false); - break; - case ScCalcConfig::StringConversion::ZERO: -maConfig.mbEmptyStringAsZero = true; -mpEmptyAsZero->Check(true); -mpEmptyAsZero->Enable(false); - break; - case ScCalcConfig::StringConversion::UNAMBIGUOUS: - case ScCalcConfig::StringConversion::LOCALE: -// Reset to the value the user selected before. -maConfig.mbEmptyStringAsZero = mbSelectedEmptyStringAsZero; -mpEmptyAsZero->Enable(true); - break; - } +maConfig.meStringConversion = (ScCalcConfig::StringConversion)pConv->GetSelectEntryPos(); +CoupleEmptyAsZeroToStringConversion(); return 0; } diff --git a/sc/source/ui/optdlg/calcoptionsdlg.hxx b/sc/source/ui/optdlg/calcoptionsdlg.hxx index 179b488..a2af6c7 100644 --- a/sc/source/ui/optdlg/calcoptionsdlg.hxx +++ b/sc/source/ui/optdlg/calcoptionsdlg.hxx @@ -54,6 +54,7 @@ public: private: void OpenCLAutomaticSelectionChanged(); void SelectedDeviceChanged(); +void CoupleEmptyAsZeroToStringConversion(); SvTreeListEntry *createItem(const OUString , const OUString& sValue) const; void setValueAt(size_t nPos, const OUString ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/filter/excel/impop.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit aaf53996e626bdce0c06c5f918e90c9a488eb42b Author: Caolán McNamaraDate: Sat Oct 3 11:53:48 2015 +0100 fix crash on loading certain xls Change-Id: I4f4563b07109df7e2288458cf8adda37582262cf (cherry picked from commit c4d1a99ec667bdd661669afd72a708bd9a963db2) Reviewed-on: https://gerrit.libreoffice.org/19110 Tested-by: Jenkins Reviewed-by: David Tardon diff --git a/sc/source/filter/excel/impop.cxx b/sc/source/filter/excel/impop.cxx index 0c5614f..904209d 100644 --- a/sc/source/filter/excel/impop.cxx +++ b/sc/source/filter/excel/impop.cxx @@ -1031,17 +1031,21 @@ void ImportExcel::Array34() aIn.Ignore( (GetBiff() >= EXC_BIFF5) ? 6 : 2 ); nFormLen = aIn.ReaduInt16(); +const ScTokenArray* pErgebnis = nullptr; + if( ValidColRow( nLastCol, nLastRow ) ) { // the read mark is now on the formula, length in nFormLen -const ScTokenArray* pErgebnis; pFormConv->Reset( ScAddress( static_cast(nFirstCol), static_cast(nFirstRow), GetCurrScTab() ) ); pFormConv->Convert( pErgebnis, maStrm, nFormLen, true, FT_CellFormula); -OSL_ENSURE( pErgebnis, "+ImportExcel::Array34(): ScTokenArray is NULL!" ); +SAL_WARN_IF(!pErgebnis, "sc", "+ImportExcel::Array34(): ScTokenArray is NULL!"); +} +if (pErgebnis) +{ ScDocumentImport& rDoc = GetDocImport(); ScRange aArrayRange(nFirstCol, nFirstRow, GetCurrScTab(), nLastCol, nLastRow, GetCurrScTab()); rDoc.setMatrixCells(aArrayRange, *pErgebnis, formula::FormulaGrammar::GRAM_ENGLISH_XL_A1); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/formulacell.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit f6a887bd1e426306df5efb3b1796afb0277158ed Author: Tor LillqvistDate: Wed Sep 30 12:39:11 2015 +0300 Probably good to move the more complicates test after the light-weight ones We will return false if any of the tests here match, so good to test the trivial things first before ones involving a potentially complex function call. Change-Id: I531282041c888799d37d95ae773daa349e60a37d diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx index b4ba29b..1bb5e4c 100644 --- a/sc/source/core/data/formulacell.cxx +++ b/sc/source/core/data/formulacell.cxx @@ -3804,9 +3804,6 @@ int splitup(int N, int K, int& A) bool ScFormulaCell::InterpretFormulaGroup() { -if (!officecfg::Office::Common::Misc::UseOpenCL::get()) -return false; - if (!mxGroup || !pCode) return false; @@ -3832,6 +3829,9 @@ bool ScFormulaCell::InterpretFormulaGroup() return false; } +if (!officecfg::Office::Common::Misc::UseOpenCL::get()) +return false; + // TODO : Disable invariant formula group interpretation for now in order // to get implicit intersection to work. if (mxGroup->mbInvariant && false) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/postit.cxx |8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) New commits: commit e108b24c1b63128f3ace77d0642d56179172ffed Author: Markus MohrhardDate: Sun Sep 27 21:05:13 2015 +0200 don't try to create OUString from editeng directly, tdf#94542 editeng uses special control characters (apparently 0x01) that need to be translated by editeng to the real characters. Let EditEngine handle the conversion from editeng string to OUString. Change-Id: If5014e1ada7f1df933a084b17bb307035ce01cc6 Reviewed-on: https://gerrit.libreoffice.org/19065 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx index 9eeabbf..733df67 100644 --- a/sc/source/core/data/postit.cxx +++ b/sc/source/core/data/postit.cxx @@ -45,6 +45,7 @@ #include "drwlayer.hxx" #include "userdat.hxx" #include "detfunc.hxx" +#include "editutil.hxx" #include @@ -545,11 +546,14 @@ OUString ScPostIt::GetText() const if( const EditTextObject* pEditObj = GetEditTextObject() ) { OUStringBuffer aBuffer; -for( sal_Int32 nPara = 0, nParaCount = pEditObj->GetParagraphCount(); nPara < nParaCount; ++nPara ) +ScNoteEditEngine& rEngine = mrDoc.GetNoteEngine(); +rEngine.SetText(*pEditObj); +sal_Int32 nParaCount = rEngine.GetParagraphCount(); +for( sal_Int32 nPara = 0; nPara < nParaCount; ++nPara ) { if( nPara > 0 ) aBuffer.append( '\n' ); -aBuffer.append( pEditObj->GetText( nPara ) ); +aBuffer.append(rEngine.GetText(nPara)); } return aBuffer.makeStringAndClear(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/vba/vbaeventshelper.cxx |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) New commits: commit 2d213a44ac71e5df5576463303a5a715e7b1700e Author: Caolán McNamaraDate: Wed Jun 3 10:57:18 2015 +0100 intermittent CppunitTest_sc_macros_test failure void OutputDevice::acquire() const: Assertion `mnRefCnt>0' failed" Window gets destroyed between postWindowResizeEvent and processWindowResizeEvent Change-Id: I3452a23ad8c3b6d863a56b73166520ef103dad1b (cherry picked from commit 5f36b1954438caef95053c2c0b7d0417e1aa5b31) Signed-off-by: Michael Stahl diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index d35e885..e787031 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -169,7 +169,8 @@ private: uno::Reference< frame::XModel > mxModel; ScDocShell* mpDocShell; WindowControllerMap maControllers; /// Maps VCL top windows to their controllers. -VclPtrmpActiveWindow; /// Currently activated window, to prevent multiple (de)activation. +std::set< VclPtr > maPostedWindows; /// Keeps processWindowResizeEvent windows from being deleted between postWindowResizeEvent and processWindowResizeEvent +VclPtrmpActiveWindow; /// Currently activated window, to prevent multiple (de)activation. boolmbWindowResized;/// True = window resize system event processed. boolmbBorderChanged;/// True = borders changed system event processed. boolmbDisposed; @@ -219,7 +220,9 @@ void ScVbaEventListener::startControllerListening( const uno::Reference< frame:: try { xControllerBorder->addBorderResizeListener( this ); } catch( uno::Exception& ) {} if( vcl::Window* pWindow = VCLUnoHelper::GetWindow( xWindow ) ) +{ maControllers[ pWindow ] = rxController; +} } void ScVbaEventListener::stopControllerListening( const uno::Reference< frame::XController >& rxController ) @@ -468,6 +471,7 @@ void ScVbaEventListener::postWindowResizeEvent( vcl::Window* pWindow ) { mbWindowResized = mbBorderChanged = false; acquire(); // ensure we don't get deleted before the timer fires +maPostedWindows.insert(pWindow); Application::PostUserEvent( LINK( this, ScVbaEventListener, processWindowResizeEvent ), pWindow ); } } @@ -484,7 +488,7 @@ IMPL_LINK( ScVbaEventListener, processWindowResizeEvent, vcl::Window*, pWindow ) This is handled via the disposing() function which removes the window pointer from the member maControllers. Thus, checking whether maControllers contains pWindow ensures that the window is still alive. */ -if( !mbDisposed && pWindow && (maControllers.count( pWindow ) > 0) ) +if( !mbDisposed && pWindow && !pWindow->IsDisposed() && (maControllers.count(pWindow) > 0) ) { // do not fire event unless all mouse buttons have been released vcl::Window::PointerState aPointerState = pWindow->GetPointerState(); @@ -500,6 +504,7 @@ IMPL_LINK( ScVbaEventListener, processWindowResizeEvent, vcl::Window*, pWindow ) } } } +maPostedWindows.erase(pWindow); release(); return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/vba/vbaeventshelper.cxx | 13 ++--- 1 file changed, 10 insertions(+), 3 deletions(-) New commits: commit eb9321d5524bb946fd03cbe28d1c5c44a64f6aa3 Author: Michael StahlDate: Wed Sep 30 10:31:23 2015 +0200 sc: fix crash in ScVbaEventListener::processWindowResizeEvent() This was crashing in CppunitTest_sc_macros_test on Windows with --enable-mergelibs (release build), because the first invocation of processWindowResizeEvent() deleted the vcl::Window, and the maControllers.count(pWindow) test creates a VclPtr for it, so ends up with a double-free. TODO: is processWindowResizeEvent() supposed to be idempotent? It would be possible to detect that there is already an event posted by checking m_PostedWindows in postWindowResizeEvent(). Change-Id: I7b72f2baf21bb8223e9fe4bd929d826217b920e5 (cherry picked from commit 520514cfe6a99f68b9e1d458fae20026f1a8f66b) Reviewed-on: https://gerrit.libreoffice.org/19022 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/ui/vba/vbaeventshelper.cxx b/sc/source/ui/vba/vbaeventshelper.cxx index e787031..d92f640 100644 --- a/sc/source/ui/vba/vbaeventshelper.cxx +++ b/sc/source/ui/vba/vbaeventshelper.cxx @@ -169,7 +169,7 @@ private: uno::Reference< frame::XModel > mxModel; ScDocShell* mpDocShell; WindowControllerMap maControllers; /// Maps VCL top windows to their controllers. -std::set< VclPtr > maPostedWindows; /// Keeps processWindowResizeEvent windows from being deleted between postWindowResizeEvent and processWindowResizeEvent +std::multiset< VclPtr > m_PostedWindows; /// Keeps processWindowResizeEvent windows from being deleted between postWindowResizeEvent and processWindowResizeEvent VclPtrmpActiveWindow; /// Currently activated window, to prevent multiple (de)activation. boolmbWindowResized;/// True = window resize system event processed. boolmbBorderChanged;/// True = borders changed system event processed. @@ -471,7 +471,7 @@ void ScVbaEventListener::postWindowResizeEvent( vcl::Window* pWindow ) { mbWindowResized = mbBorderChanged = false; acquire(); // ensure we don't get deleted before the timer fires -maPostedWindows.insert(pWindow); +m_PostedWindows.insert(pWindow); Application::PostUserEvent( LINK( this, ScVbaEventListener, processWindowResizeEvent ), pWindow ); } } @@ -504,7 +504,14 @@ IMPL_LINK( ScVbaEventListener, processWindowResizeEvent, vcl::Window*, pWindow ) } } } -maPostedWindows.erase(pWindow); +{ +// note: there may be multiple processWindowResizeEvent outstanding +// for pWindow, so it may have been added to m_PostedWindows multiple +// times - so this must delete exactly one of these elements! +auto const iter(m_PostedWindows.find(pWindow)); +assert(iter != m_PostedWindows.end()); +m_PostedWindows.erase(iter); +} release(); return 0; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/tabview3.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 064b759c4973d2735155ed71eb534093eae4da25 Author: Michael MeeksDate: Tue Sep 29 16:05:15 2015 +0100 tdf#93922 - dispose the calc InputHintWindow properly. Change-Id: I5c331380b872429cf1fa3908c6add8de879c9ed2 Reviewed-on: https://gerrit.libreoffice.org/18927 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index e7ffbed..ad84f1b 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -662,7 +662,7 @@ bool ScTabView::HasHintWindow() const void ScTabView::RemoveHintWindow() { -mpInputHintWindow.reset(); +mpInputHintWindow.disposeAndClear(); } // find window that should not be over the cursor ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/compiler.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 4a33435137e4d9fb7a85c527a37edc6780170d9a Author: Winfried DonkersDate: Wed Sep 23 15:13:46 2015 +0200 follow up of tdf#94214 provide forward compatibility for name change of FINV Reviewed-on: https://gerrit.libreoffice.org/18814 Reviewed-by: Christian Lohmaier Tested-by: Christian Lohmaier (cherry picked from commit 2cc040878ce816b0353224910333e33a20983359) Conflicts: sc/source/core/tool/compiler.cxx Change-Id: I0afd2555be94c452172e5a357f2f0897be381863 Reviewed-on: https://gerrit.libreoffice.org/18909 Reviewed-by: Eike Rathke Tested-by: Eike Rathke diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index ffd2635..ce6a31b 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2636,6 +2636,7 @@ bool ScCompiler::IsOpCode( const OUString& rName, bool bInArray ) { "GOALSEEK", ocBackSolver }, // GOALSEEK -> ORG.OPENOFFICE.GOALSEEK { "COM.MICROSOFT.F.DIST", ocFDist_LT }, // fdo#40835, -> FDIST -> COM.MICROSOFT.F.DIST // Renamed new names, prepare to read future names: +{ "FINV", ocFInv_LT },// COM.MICROSOFT.F.INV -> FINV //{ "ORG.OPENOFFICE.XXX", ocXXX } // XXX -> ORG.OPENOFFICE.XXX }; static const size_t nOdffAliases = sizeof(aOdffAliases) / sizeof(aOdffAliases[0]); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/cellsh2.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit 00adc13618d7957da43318a69559da82fbbb53a7 Author: Eike RathkeDate: Thu Sep 17 17:12:03 2015 +0200 Resolves: tdf#85979 TextToColumns is overwriting, so set at ScImportExport Change-Id: Id0fec512b53aab47f9951056e8726af0cce45708 (cherry picked from commit 624ab2e5a52e9b8aa139bae4cd1436d23b80bf8c) Reviewed-on: https://gerrit.libreoffice.org/18664 Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index 0ba2224..aeca622 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -979,6 +979,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) aImport.SetExtOptions( aOptions ); aImport.SetApi( false ); aImport.SetImportBroadcast( true ); +aImport.SetOverwriting( true ); aStream.Seek( 0 ); aImport.ImportStream( aStream, OUString(), SotClipboardFormatId::STRING ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr6.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 6b8b3ffad1222fcd4431aa87396ea77f66522707 Author: Eike RathkeDate: Fri Sep 25 13:42:04 2015 +0200 fix IterateMatrix for ifPRODUCT and ifSUMSQ ... if more than one argument is passed to PRODUCT() or SUMSQ() and matrix/array arguments are involved the functions returned wrong results. For example, wrong behavior =PRODUCT({2,3},{4,5}) gave 6 =SUMSQ({2,3},{4,5}) gave 34 Correct is =PRODUCT({2,3},{4,5}) result 120 =SUMSQ({2,3},{4,5}) result 54 Change-Id: Iec7b136a5cc678416f28b1abfe19cd0901ef22b6 (cherry picked from commit c1780ad265ce5f6abb3b91a4f70bf2b3d7a47149) Reviewed-on: https://gerrit.libreoffice.org/18864 Reviewed-by: Åukasz Hryniuk Tested-by: Åukasz Hryniuk diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx index b3daedd..e02abbc 100644 --- a/sc/source/core/tool/interpr6.cxx +++ b/sc/source/core/tool/interpr6.cxx @@ -384,7 +384,7 @@ void IterateMatrix( case ifPRODUCT: { ScMatrix::IterateResult aRes = pMat->Product(bTextAsZero); -fRes = aRes.mfFirst; +fRes *= aRes.mfFirst; fRes *= aRes.mfRest; rCount += aRes.mnCount; } @@ -392,6 +392,7 @@ void IterateMatrix( case ifSUMSQ: { ScMatrix::IterateResult aRes = pMat->SumSquare(bTextAsZero); +fRes += aRes.mfFirst; fRes += aRes.mfRest; rCount += aRes.mnCount; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/filter/excel/xipivot.cxx | 12 +--- 1 file changed, 9 insertions(+), 3 deletions(-) New commits: commit 24db3ec37d974402c0d3ce476c3aeffcff327ad7 Author: Eike RathkeDate: Mon Sep 21 15:26:50 2015 +0200 Resolves: rhbz#1264585 check data pilot field name availability Change-Id: Iaadf7044acb7299ee878de2fbc08992447587d62 (cherry picked from commit f09a91630c767370871389c28b81280807513431) Reviewed-on: https://gerrit.libreoffice.org/18751 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/filter/excel/xipivot.cxx b/sc/source/filter/excel/xipivot.cxx index 48fe3b3..92bad1d 100644 --- a/sc/source/filter/excel/xipivot.cxx +++ b/sc/source/filter/excel/xipivot.cxx @@ -1031,13 +1031,19 @@ void XclImpPTField::ConvertDataField( ScDPSaveData& rSaveData ) const XclPTDataFieldInfoList::const_iterator aIt = maDataInfoList.begin(), aEnd = maDataInfoList.end(); -ScDPSaveDimension& rSaveDim = *rSaveData.GetNewDimensionByName(aFieldName); -ConvertDataField( rSaveDim, *aIt ); +ScDPSaveDimension* pSaveDim = rSaveData.GetNewDimensionByName(aFieldName); +if (!pSaveDim) +{ +SAL_WARN("sc.filter","XclImpPTField::ConvertDataField - field name not found: " << aFieldName); +return; +} + +ConvertDataField( *pSaveDim, *aIt ); // multiple data fields -> clone dimension for( ++aIt; aIt != aEnd; ++aIt ) { -ScDPSaveDimension& rDupDim = rSaveData.DuplicateDimension( rSaveDim ); +ScDPSaveDimension& rDupDim = rSaveData.DuplicateDimension( *pSaveDim ); ConvertDataFieldInfo( rDupDim, *aIt ); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/document.cxx | 16 1 file changed, 12 insertions(+), 4 deletions(-) New commits: commit 50d4e7c928c372a14a5396971bc4c4ac1f437b51 Author: Eike RathkeDate: Mon Sep 14 17:27:41 2015 +0200 Resolves: tdf#93895 broadcast cell changes when multi-selection was pasted It is not sufficient to collect the cells, one has to broadcast on the collection. Change-Id: I11f889936aff43f958c56789e539809289819752 (cherry picked from commit 97ad6393525a928b5dfe2a6562d7604446da7af0) Reviewed-on: https://gerrit.libreoffice.org/18573 Tested-by: Jenkins Reviewed-by: Tor Lillqvist diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 153b77f..bb6431a 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -2961,10 +2961,18 @@ void ScDocument::CopyMultiRangeFromClip( // Create Listener after everything has been inserted StartListeningFromClip(aDestRange.aStart.Col(), aDestRange.aStart.Row(), aDestRange.aEnd.Col(), aDestRange.aEnd.Row(), rMark, nInsFlag ); -// Re-broadcast after all Listener have been created -SetDirtyFromClip( -aDestRange.aStart.Col(), aDestRange.aStart.Row(), aDestRange.aEnd.Col(), aDestRange.aEnd.Row(), -rMark, nInsFlag, aBroadcastSpans); + +{ +ScBulkBroadcast aBulkBroadcast( GetBASM()); + +// Set formula cells dirty and collect non-formula cells. +SetDirtyFromClip( +aDestRange.aStart.Col(), aDestRange.aStart.Row(), aDestRange.aEnd.Col(), aDestRange.aEnd.Row(), +rMark, nInsFlag, aBroadcastSpans); + +BroadcastAction aAction(*this); +aBroadcastSpans.executeColumnAction(*this, aAction); +} if (bResetCut) pClipDoc->GetClipParam().mbCutMode = false; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/inc/interpre.hxx |2 +- sc/source/core/tool/interpr2.cxx |4 ++-- sc/source/core/tool/interpr3.cxx | 16 ++-- sc/source/core/tool/interpr5.cxx |6 +++--- 4 files changed, 16 insertions(+), 12 deletions(-) New commits: commit 04ef6cf59052010cb6103e260dff6367b634acd8 Author: Winfried DonkersDate: Tue Sep 15 09:39:25 2015 +0200 tdf#94079 allow empty array for holiday sequence in Calc functions NETWORKDAYS and WORKDAY.INTL Change-Id: I2d42ab956e4ab9f2187a0c6bc3c64c9306ca892a Reviewed-on: https://gerrit.libreoffice.org/18559 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke (cherry picked from commit 75bde904d5b4f756037889f2b2ddee3e34dd81b8) Reviewed-on: https://gerrit.libreoffice.org/18595 diff --git a/sc/source/core/inc/interpre.hxx b/sc/source/core/inc/interpre.hxx index f804052..efa11d1 100644 --- a/sc/source/core/inc/interpre.hxx +++ b/sc/source/core/inc/interpre.hxx @@ -823,7 +823,7 @@ double GetMedian( ::std::vector & rArray ); double GetPercentile( ::std::vector & rArray, double fPercentile ); double GetPercentileExclusive( ::std::vector & rArray, double fPercentile ); void GetNumberSequenceArray( sal_uInt8 nParamCount, ::std::vector& rArray, bool bConvertTextInArray ); -void GetSortArray( sal_uInt8 nParamCount, ::std::vector& rSortArray, ::std::vector* pIndexOrder, bool bConvertTextInArray ); +void GetSortArray( sal_uInt8 nParamCount, ::std::vector& rSortArray, ::std::vector* pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray ); static void QuickSort(::std::vector& rSortArray, ::std::vector* pIndexOrder = NULL); void ScModalValue(); void ScModalValue_Multi(); diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx index 9df3a90..84a5bff 100644 --- a/sc/source/core/tool/interpr2.cxx +++ b/sc/source/core/tool/interpr2.cxx @@ -277,7 +277,7 @@ sal_uInt16 ScInterpreter::GetWeekendAndHolidayMasks( if ( nParamCount >= 3 ) { -GetSortArray( 1, rSortArray, NULL, false ); +GetSortArray( 1, rSortArray, NULL, false, true ); size_t nMax = rSortArray.size(); for ( size_t i = 0; i < nMax; i++ ) rSortArray.at( i ) = ::rtl::math::approxFloor( rSortArray.at( i ) ) + nNullDate; @@ -294,7 +294,7 @@ sal_uInt16 ScInterpreter::GetWeekendAndHolidayMasks_MS( OUString aWeekendDays; if ( nParamCount == 4 ) { -GetSortArray( 1, rSortArray, NULL, true ); +GetSortArray( 1, rSortArray, NULL, true, true ); size_t nMax = rSortArray.size(); for ( size_t i = 0; i < nMax; i++ ) rSortArray.at( i ) = ::rtl::math::approxFloor( rSortArray.at( i ) ) + nNullDate; diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx index 47ac91e..066394d 100644 --- a/sc/source/core/tool/interpr3.cxx +++ b/sc/source/core/tool/interpr3.cxx @@ -3465,7 +3465,7 @@ void ScInterpreter::ScModalValue() if ( !MustHaveParamCountMin( nParamCount, 1 ) ) return; vector aSortArray; -GetSortArray( nParamCount, aSortArray, NULL, false ); +GetSortArray( nParamCount, aSortArray, NULL, false, false ); SCSIZE nSize = aSortArray.size(); if (aSortArray.empty() || nSize == 0 || nGlobalError) PushNoValue(); @@ -3551,7 +3551,7 @@ void ScInterpreter::ScPercentrank( bool bInclusive ) double fSignificance = ( nParamCount == 3 ? ::rtl::math::approxFloor( GetDouble() ) : 3.0 ); double fNum = GetDouble(); vector aSortArray; -GetSortArray( 1, aSortArray, NULL, false ); +GetSortArray( 1, aSortArray, NULL, false, false ); SCSIZE nSize = aSortArray.size(); if ( aSortArray.empty() || nSize == 0 || nGlobalError ) PushNoValue(); @@ -3644,7 +3644,7 @@ void ScInterpreter::ScTrimMean() return; } vector aSortArray; -GetSortArray( 1, aSortArray, NULL, false ); +GetSortArray( 1, aSortArray, NULL, false, false ); SCSIZE nSize = aSortArray.size(); if (aSortArray.empty() || nSize == 0 || nGlobalError) PushNoValue(); @@ -3783,13 +3783,17 @@ void ScInterpreter::GetNumberSequenceArray( sal_uInt8 nParamCount, vector& rSortArray, vector* pIndexOrder, bool bConvertTextInArray ) +void ScInterpreter::GetSortArray( sal_uInt8 nParamCount, vector& rSortArray, vector* pIndexOrder, bool bConvertTextInArray, bool bAllowEmptyArray ) { GetNumberSequenceArray( nParamCount, rSortArray, bConvertTextInArray ); if (rSortArray.size() > MAX_ANZ_DOUBLE_FOR_SORT) SetError( errStackOverflow); -else if (rSortArray.empty()) +else if ( rSortArray.empty() ) +{ +if ( bAllowEmptyArray ) +return; SetError( errNoValue); +} if (nGlobalError == 0) QuickSort( rSortArray, pIndexOrder); @@ -3885,7 +3889,7 @@ void
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source sc/uiconfig
sc/source/ui/condformat/colorformat.cxx | 15 +-- sc/source/ui/inc/colorformat.hxx|1 + sc/uiconfig/scalc/ui/databaroptions.ui | 11 +++ 3 files changed, 25 insertions(+), 2 deletions(-) New commits: commit a2dd4653a24d87832e0e8c5cfe7ff60562b37ab7 Author: Katarina BehrensDate: Fri Sep 4 10:41:59 2015 +0200 tdf#91501: Add data bar colour to the list if not there yet Change-Id: I18dd5b8dc49bd9f4dc9c27556782fa5f2b3c4f58 diff --git a/sc/source/ui/condformat/colorformat.cxx b/sc/source/ui/condformat/colorformat.cxx index cfae7b7..3518e22 100644 --- a/sc/source/ui/condformat/colorformat.cxx +++ b/sc/source/ui/condformat/colorformat.cxx @@ -66,6 +66,16 @@ void SetValue( ScDocument* pDoc, ScColorScaleEntry* pEntry, Edit& aEdit) aEdit.Disable(); } +void SelectColor(const Color& aColor, const OUString aCustomName, ColorListBox& rLstBox) +{ +rLstBox.SelectEntry( aColor ); +if ( rLstBox.GetSelectEntryColor() != aColor ) +{ +rLstBox.InsertEntry( aColor, aCustomName ); +rLstBox.SelectEntry( aColor ); +} +} + } ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBarFormatData& rData, ScDocument* pDoc, const ScAddress& rPos): @@ -90,13 +100,14 @@ ScDataBarSettingsDlg::ScDataBarSettingsDlg(vcl::Window* pWindow, const ScDataBar get( mpCbOnlyBar, "only_bar"); maStrWarnSameValue = get("str_same_value")->GetText(); +maCustomColor = get("custom_color")->GetText(); Init(); -mpLbPos->SelectEntry( rData.maPositiveColor ); +::SelectColor( rData.maPositiveColor, maCustomColor, *mpLbPos); mpLbFillType->SelectEntryPos( rData.mbGradient ? 1 : 0 ); if(rData.mpNegativeColor) -mpLbNeg->SelectEntry( *rData.mpNegativeColor ); +::SelectColor( *rData.mpNegativeColor, maCustomColor, *mpLbNeg ); switch (rData.meAxisPosition) { diff --git a/sc/source/ui/inc/colorformat.hxx b/sc/source/ui/inc/colorformat.hxx index dd65562..2a3312e 100644 --- a/sc/source/ui/inc/colorformat.hxx +++ b/sc/source/ui/inc/colorformat.hxx @@ -43,6 +43,7 @@ private: VclPtr mpCbOnlyBar; OUString maStrWarnSameValue; +OUString maCustomColor; SvNumberFormatter* mpNumberFormatter; ScDocument* mpDoc; diff --git a/sc/uiconfig/scalc/ui/databaroptions.ui b/sc/uiconfig/scalc/ui/databaroptions.ui index 26860d6..c2a4ae2 100644 --- a/sc/uiconfig/scalc/ui/databaroptions.ui +++ b/sc/uiconfig/scalc/ui/databaroptions.ui @@ -523,6 +523,17 @@ 5 + + +False +Custom + + +False +True +6 + + False ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/dbgui/sfiltdlg.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit 0cd13904fa2c4619d21343637020f857b6c0760a Author: Michael MeeksDate: Thu Sep 3 14:21:53 2015 +0100 tdf#91882 - make this hideous busy-loop lower priority and less busy. This way the rendering code can get a look in. Change-Id: Id100031ffe1c4b415ed4ef1272a0772ec99ab4a9 Reviewed-on: https://gerrit.libreoffice.org/18301 Reviewed-by: Miklos Vajna Tested-by: Miklos Vajna diff --git a/sc/source/ui/dbgui/sfiltdlg.cxx b/sc/source/ui/dbgui/sfiltdlg.cxx index 9ae4d34..54fbad9 100644 --- a/sc/source/ui/dbgui/sfiltdlg.cxx +++ b/sc/source/ui/dbgui/sfiltdlg.cxx @@ -87,7 +87,8 @@ ScSpecialFilterDlg::ScSpecialFilterDlg( SfxBindings* pB, SfxChildWindow* pCW, vc // Hack: RefInput-Kontrolle pIdle = new Idle; -pIdle->SetPriority( SchedulerPriority::MEDIUM ); // 50ms warten +// FIXME: this is an abomination +pIdle->SetPriority( SchedulerPriority::LOWEST ); pIdle->SetIdleHdl( LINK( this, ScSpecialFilterDlg, TimeOutHdl ) ); pIdle->Start(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/condformat/condformatdlgentry.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit f2a367ffa4bb20ceb2bab11d8895653bf0d1309d Author: Katarina BehrensDate: Sat Aug 29 17:12:42 2015 +0200 tdf#93600: Avoid crash on entering '=' as a cell value To match formulas, 'formula is' condition should be used instead Change-Id: I37a9a2680c49bffcb8b25a11faedc1421cfa2d00 Reviewed-on: https://gerrit.libreoffice.org/18126 Tested-by: Jenkins Reviewed-by: Markus Mohrhard Tested-by: Markus Mohrhard Reviewed-on: https://gerrit.libreoffice.org/18159 Reviewed-by: Thorsten Behrens diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx b/sc/source/ui/condformat/condformatdlgentry.cxx index 018e7e8..79cf58f 100644 --- a/sc/source/ui/condformat/condformatdlgentry.cxx +++ b/sc/source/ui/condformat/condformatdlgentry.cxx @@ -313,7 +313,7 @@ IMPL_LINK(ScConditionFrmtEntry, OnEdChanged, Edit*, pEdit) boost::scoped_ptr ta(aComp.CompileString(aFormula)); // Error, warn the user -if( ta->GetCodeError() ) +if( ta->GetCodeError() || ( ta->GetLen() == 0 ) ) { pEdit->SetControlBackground(COL_LIGHTRED); maFtVal->SetText(ScGlobal::GetRscString(STR_VALID_DEFERROR)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) New commits: commit f139baa08cb65eba659890802d08ec0486b04260 Author: Eike RathkeDate: Wed Aug 26 13:06:05 2015 +0200 do not parse range fragments as valid ranges For example, "B2:" or ":B2" were accepted as valid range, with the missing part set to A1, which resulted in a A1:B2 range. An omitted sheet specifier always results in a valid relative sheet, hence that flag is set, so testing flags for non-null before the final result is available isn't sufficient. Additionally this revealed a flaw in handling of external references when loading documents if the original file name differs from the resulting real file name due to relative paths. Actually now the displayed file name matches the real file name when such a document was loaded, where before the original file name was displayed. Probably such references didn't even work before if the reference spanned more than one sheet, which is a rather rare case for external references. Change-Id: I38035f2e4b3a11c0280457498cf62b02f882d2a1 (cherry picked from commit 56238d58a7da705e4e91604964e6564d819a9196) Reviewed-on: https://gerrit.libreoffice.org/18035 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index fa34c64..051b062 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1198,7 +1198,14 @@ static sal_uInt16 lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDo // Need document name if inherited. if (bExtDocInherited) { -const OUString* pFileName = pRefMgr->getExternalFileName( pExtInfo->mnFileId); +// The FileId was created using the original file name, so +// obtain that. Otherwise lcl_ScRange_External_TabSpan() would +// retrieve a FileId for the real name and bail out if that +// differed from pExtInfo->mnFileId, as is the case when +// loading documents that refer external files relative to the +// current own document but were saved from a different path +// than loaded. +const OUString* pFileName = pRefMgr->getExternalFileName( pExtInfo->mnFileId, true); if (pFileName) aDocName = *pFileName; else @@ -1521,7 +1528,7 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange& rRange, nRes2 |= SCA_COL_ABSOLUTE; } } -if (nRes1 && nRes2) +if ((nRes1 & SCA_VALID) && (nRes2 & SCA_VALID)) { // PutInOrder / Justify sal_uInt16 nMask, nBits1, nBits2; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 656b39e18ec9cc34c06269657339e66801180f38 Author: Eike Rathke er...@redhat.com Date: Wed Aug 26 15:58:35 2015 + Revert do not parse range fragments as valid ranges This reverts commit 350b00af0a1d0bf516ac308e21849ece77acbaf6. Breaks CppunitTest_sc_subsequent_filters_test Change-Id: I92963fa16aacbf01f4d6660eff7497347538371d Reviewed-on: https://gerrit.libreoffice.org/18029 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 0920eb9..fa34c64 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1521,7 +1521,7 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange rRange, nRes2 |= SCA_COL_ABSOLUTE; } } -if ((nRes1 SCA_VALID) (nRes2 SCA_VALID)) +if (nRes1 nRes2) { // PutInOrder / Justify sal_uInt16 nMask, nBits1, nBits2; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx | 29 +++ sc/source/ui/StatisticsDialogs/SamplingDialog.cxx | 75 sc/source/ui/StatisticsDialogs/StatisticsInputOutputDialog.cxx | 71 +++ sc/source/ui/StatisticsDialogs/StatisticsTwoVariableDialog.cxx | 89 +- sc/source/ui/inc/RandomNumberGeneratorDialog.hxx |1 sc/source/ui/inc/SamplingDialog.hxx|1 sc/source/ui/inc/StatisticsInputOutputDialog.hxx |1 sc/source/ui/inc/StatisticsTwoVariableDialog.hxx |1 8 files changed, 259 insertions(+), 9 deletions(-) New commits: commit b171205219480747114e2964c51844fb3a6641af Author: Eike Rathke er...@redhat.com Date: Tue Aug 25 21:16:43 2015 +0200 Resolves: rhbz#1255811 implement Edit modify handler ... and disable/enable Apply/Ok buttons for in/valid ranges. (cherry picked from commit ad1284df599f3493e7c76c7f8b4230aab1946558) implement Edit modify handler, rhbz#1255811 related Same as in ScRandomNumberGeneratorDialog. (cherry picked from commit da9ecf1a59b85eb93004507fe55b92f74c2cdb4c) implement Edit modify handler, rhbz#1255811 related Same as in ScSamplingDialog. (cherry picked from commit a88fecdcdbf0b3f6a5ba3375f8193a9dc7ba7422) implement Edit modify handler, rhbz#1255811 related Same as in ScStatisticsInputOutputDialog. (cherry picked from commit b2363e98af7b0281279617e43b8fec5b898b9120) 1bc9296bfc8b1b2b8f3fc20183e2c626f94dee09 ff709ec2284673efa8824a9b8cfc037e4d6d567a 0e3eb06bc86cf77c405c54f312340c7b2551c1ec Change-Id: I52b5eae2f34e3fca7c0761b14124477a0d160b01 Reviewed-on: https://gerrit.libreoffice.org/18009 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx index ecc1a8b..cefabf8 100644 --- a/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/RandomNumberGeneratorDialog.cxx @@ -120,6 +120,7 @@ void ScRandomNumberGeneratorDialog::Init() mpInputRangeEdit-SetLoseFocusHdl ( aLink ); mpInputRangeButton-SetLoseFocusHdl ( aLink ); +mpInputRangeEdit-SetModifyHdl( LINK( this, ScRandomNumberGeneratorDialog, InputRangeModified )); mpParameter1Value-SetModifyHdl( LINK( this, ScRandomNumberGeneratorDialog, Parameter1ValueModified )); mpParameter2Value-SetModifyHdl( LINK( this, ScRandomNumberGeneratorDialog, Parameter2ValueModified )); @@ -170,11 +171,17 @@ void ScRandomNumberGeneratorDialog::SetReference( const ScRange rReferenceRange OUString aReferenceString(maInputRange.Format(SCR_ABS_3D, pDoc, pDoc-GetAddressConvention())); mpInputRangeEdit-SetRefString( aReferenceString ); + +mpButtonApply-Enable(); +mpButtonOk-Enable(); } } void ScRandomNumberGeneratorDialog::SelectGeneratorAndGenerateNumbers() { +if (!maInputRange.IsValid()) +return; + sal_Int16 aSelectedIndex = mpDistributionCombo- GetSelectEntryPos(); sal_Int64 aSelectedId = reinterpret_castsal_Int64(mpDistributionCombo-GetEntryData(aSelectedIndex)); @@ -357,6 +364,28 @@ IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, LoseFocusHandler) return 0; } +IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, InputRangeModified) +{ +ScRangeList aRangeList; +bool bValid = ParseWithNames( aRangeList, mpInputRangeEdit-GetText(), mpDoc); +const ScRange* pRange = (bValid aRangeList.size() == 1) ? aRangeList[0] : nullptr; +if (pRange) +{ +maInputRange = *pRange; +mpButtonApply-Enable(); +mpButtonOk-Enable(); +// Highlight the resulting range. +mpInputRangeEdit-StartUpdateData(); +} +else +{ +maInputRange = ScRange( ScAddress::INITIALIZE_INVALID); +mpButtonApply-Disable(); +mpButtonOk-Disable(); +} +return 0; +} + IMPL_LINK_NOARG(ScRandomNumberGeneratorDialog, Parameter1ValueModified) { sal_Int16 aSelectedIndex = mpDistributionCombo- GetSelectEntryPos(); diff --git a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx index e8bd197..bfd467f 100644 --- a/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx +++ b/sc/source/ui/StatisticsDialogs/SamplingDialog.cxx @@ -32,7 +32,9 @@ ScSamplingDialog::ScSamplingDialog( mpActiveEdit( NULL ), mViewData ( pViewData ), mDocument ( pViewData-GetDocument() ), +mInputRange ( ScAddress::INITIALIZE_INVALID ), mAddressDetails ( mDocument-GetAddressConvention(), 0, 0 ), +mOutputAddress ( ScAddress::INITIALIZE_INVALID ), mCurrentAddress ( pViewData-GetCurX(), pViewData-GetCurY(), pViewData-GetTabNo() ),
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 350b00af0a1d0bf516ac308e21849ece77acbaf6 Author: Eike Rathke er...@redhat.com Date: Wed Aug 26 13:06:05 2015 +0200 do not parse range fragments as valid ranges For example, B2: or :B2 were accepted as valid range, with the missing part set to A1, which resulted in a A1:B2 range. An omitted sheet specifier always results in a valid relative sheet, hence that flag is set, so testing flags for non-null before the final result is available isn't sufficient. Change-Id: I57d1b7cf71a298e7ac108b0e13aab88208f0f00c (cherry picked from commit ed6209f572bad38bdb066be668163fe8acf52056) Reviewed-on: https://gerrit.libreoffice.org/18023 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index fa34c64..0920eb9 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1521,7 +1521,7 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange rRange, nRes2 |= SCA_COL_ABSOLUTE; } } -if (nRes1 nRes2) +if ((nRes1 SCA_VALID) (nRes2 SCA_VALID)) { // PutInOrder / Justify sal_uInt16 nMask, nBits1, nBits2; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/formdlg/formula.cxx |1 + 1 file changed, 1 insertion(+) New commits: commit d92c8638a186900711faa88be5bed254b0574712 Author: Katarina Behrens katarina.behr...@cib.de Date: Mon Aug 24 13:09:49 2015 +0200 tdf#93437: release reference held by ScFormulaReferenceHelper which prevents destructor from being called. It was ScFormulaDlg's own m_aHelper member variable holding reference to 'this' (extra-wicked, through SetWindow(this)), never releasing it. Change-Id: I258a280e09674d1a2f1ddebea19ea1b42dcdc777 Reviewed-on: https://gerrit.libreoffice.org/17954 Reviewed-by: Michael Meeks michael.me...@collabora.com Tested-by: Michael Meeks michael.me...@collabora.com diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx index 0e216a3..5955afb 100644 --- a/sc/source/ui/formdlg/formula.cxx +++ b/sc/source/ui/formdlg/formula.cxx @@ -248,6 +248,7 @@ void ScFormulaDlg::dispose() { ScModule* pScMod = SC_MOD(); ScFormEditData* pData = pScMod-GetFormEditData(); +m_aHelper.dispose(); if (pData) // close dosen't destroy; { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/document.cxx |8 1 file changed, 8 insertions(+) New commits: commit 6855a8a9a7d44be5a020ef609536b76c2dfe05d2 Author: Eike Rathke er...@redhat.com Date: Tue Aug 18 11:33:44 2015 +0200 Resolves: tdf#92749 invalidate lookup caches after initial hard recalc ... because the caches are not setup as listeners during when the document's hard recalc state is active. Change-Id: Ie7ec84ee64d046e3e55ce26b92824e94a2f660e9 (cherry picked from commit f7e493229bd949066b4d8984dce7678b8687d1ae) Reviewed-on: https://gerrit.libreoffice.org/17829 Reviewed-by: Norbert Thiebaud nthieb...@gmail.com Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index e00a5cc..153b77f 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -3780,6 +3780,14 @@ void ScDocument::CalcAll() if (*it) (*it)-CalcAll(); ClearFormulaTree(); + +// In hard recalc state caches were not added as listeners, invalidate them +// so the next non-CalcAll() normal lookup will not be presented with +// outdated data. +/* TODO: come up with more detailed hard recalc states so we can + * differentiate between hard recalc after load and others. */ +if (GetHardRecalcState()) +ClearLookupCaches(); } void ScDocument::CompileAll() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/table3.cxx | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) New commits: commit 7cbcde5e8727b84b4d3ca9f80020082644d9638a Author: Eike Rathke er...@redhat.com Date: Thu Aug 13 18:34:27 2015 +0200 Resolves: tdf#93098 replace remembered listener when replacing cell ... where SvtListener* is the base of ScFormulaCell* and lead to use after delete. Change-Id: I45b8e16f05cf5d4d0d4858dc9cd0c748f8184978 (cherry picked from commit ea29d320754fdb21b336cb78f816b8081371def9) Reviewed-on: https://gerrit.libreoffice.org/17726 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx index 6b5f634..1c5a551 100644 --- a/sc/source/core/data/table3.cxx +++ b/sc/source/core/data/table3.cxx @@ -713,6 +713,7 @@ public: void fillSortedColumnArray( boost::ptr_vectorSortedColumn rSortedCols, SortedRowFlags rRowFlags, +std::vectorSvtListener* rCellListeners, ScSortInfoArray* pArray, SCTAB nTab, SCCOL nCol1, SCCOL nCol2, ScProgress* pProgress ) { SCROW nRow1 = pArray-GetStart(); @@ -770,6 +771,16 @@ void fillSortedColumnArray( pNew-GetCode()-AdjustReferenceOnMovedOriginIfOtherSheet(aOldPos, aCellPos); } +if (!rCellListeners.empty()) +{ +// Original source cells will be deleted during +// sc::CellStoreType::transfer(), SvtListener is a base +// class, so we need to replace it. +auto it( ::std::find( rCellListeners.begin(), rCellListeners.end(), rCell.maCell.mpFormula)); +if (it != rCellListeners.end()) +*it = pNew; +} + rCellStore.push_back(pNew); } break; @@ -1085,7 +1096,7 @@ void ScTable::SortReorderByRow( // a copy before updating the document. boost::ptr_vectorSortedColumn aSortedCols; // storage for copied cells. SortedRowFlags aRowFlags; -fillSortedColumnArray(aSortedCols, aRowFlags, pArray, nTab, nCol1, nCol2, pProgress); +fillSortedColumnArray(aSortedCols, aRowFlags, aCellListeners, pArray, nTab, nCol1, nCol2, pProgress); for (size_t i = 0, n = aSortedCols.size(); i n; ++i) { @@ -1270,7 +1281,8 @@ void ScTable::SortReorderByRowRefUpdate( // a copy before updating the document. boost::ptr_vectorSortedColumn aSortedCols; // storage for copied cells. SortedRowFlags aRowFlags; -fillSortedColumnArray(aSortedCols, aRowFlags, pArray, nTab, nCol1, nCol2, pProgress); +std::vectorSvtListener* aListenersDummy; +fillSortedColumnArray(aSortedCols, aRowFlags, aListenersDummy, pArray, nTab, nCol1, nCol2, pProgress); for (size_t i = 0, n = aSortedCols.size(); i n; ++i) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/column2.cxx | 14 +- 1 file changed, 13 insertions(+), 1 deletion(-) New commits: commit 31050925ad6788c627af23f751bdbf5768cc7afa Author: Eike Rathke er...@redhat.com Date: Sat Aug 15 00:47:03 2015 +0200 Resolves: tdf#93358 resync attribute pattern that may have changed Change-Id: If3ce8feec940c7212fe467f39db868630522b17e (cherry picked from commit f089de7dc5c367a3123129b08a9050b3bacc4eba) Reviewed-on: https://gerrit.libreoffice.org/17765 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 566c139..bb6a37d 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -824,7 +824,18 @@ void ScColumn::GetOptimalHeight( } if (bStdOnly) -if (HasEditCells(nStart,nEnd,nEditPos)) // includes mixed script types +{ +bool bHasEditCells = HasEditCells(nStart,nEnd,nEditPos); +// Call to HasEditCells() may change pattern due to +// calculation, = sync always. +// We don't know which row changed first, but as pPattern +// covered nStart to nEnd we can pick nStart. Worst case we +// have to repeat that for every row in range if every row +// changed. +pPattern = aIter.Resync( nStart, nStart, nEnd); +if (bHasEditCells nEnd nEditPos) +bHasEditCells = false; // run into that again +if (bHasEditCells) // includes mixed script types { if (nEditPos == nStart) { @@ -840,6 +851,7 @@ void ScColumn::GetOptimalHeight( nEnd = nEditPos - 1;// standard - part } } +} sc::SingleColumnSpanSet aSpanSet; aSpanSet.scan(*this, nStart, nEnd); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/bcaslot.cxx | 20 +++- 1 file changed, 15 insertions(+), 5 deletions(-) New commits: commit 61fb1d4de37f88f6408a483c3713a373340d6fb3 Author: Eike Rathke er...@redhat.com Date: Wed Aug 12 20:15:08 2015 +0200 Resolves: tdf#93388 broadcasting to removed listeners isn't a good idea This cures only a symptom, the underlying cause is that the broadcasters still are listed in maBulkGroupAreas. Change-Id: I9625483016a51eb6f6a7e3d58ed42c7dad3a57b3 (cherry picked from commit 2d4edd7de2e67db5bd17e7a89e2496611ebcc165) Reviewed-on: https://gerrit.libreoffice.org/17684 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index 2174216..f9d6a19 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -1155,12 +1155,22 @@ void ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas() for (; it != itEnd; ++it) { ScBroadcastArea* pArea = it-first; -const sc::ColumnSpanSet* pSpans = it-second; assert(pArea); -assert(pSpans); -aHint.setSpans(pSpans); -pArea-GetBroadcaster().Broadcast(aHint); -bBroadcasted = true; +SvtBroadcaster rBC = pArea-GetBroadcaster(); +if (!rBC.HasListeners()) +{ +/* FIXME: find the cause where the last listener is removed and + * this area is still listed here. */ + SAL_WARN(sc.core,ScBroadcastAreaSlotMachine::BulkBroadcastGroupAreas - pArea has no listeners and should had been removed already); +} +else +{ +const sc::ColumnSpanSet* pSpans = it-second; +assert(pSpans); +aHint.setSpans(pSpans); +rBC.Broadcast(aHint); +bBroadcasted = true; +} } maBulkGroupAreas.clear(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/sidebar/CellLineStyleControl.cxx |8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) New commits: commit c22d7f440885d4370c583eba3778851194013f2f Author: Maxim Monastirsky momonas...@gmail.com Date: Thu Aug 13 15:39:54 2015 +0300 Another GrabFocus during dispose Change-Id: I89f8aa5e087e95c96d63695be0ec4e9b4fbe0a0c (cherry picked from commit 4622823a800804acf15c0f4a5adecce03ae65189) Reviewed-on: https://gerrit.libreoffice.org/17706 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/ui/sidebar/CellLineStyleControl.cxx b/sc/source/ui/sidebar/CellLineStyleControl.cxx index 3098858..c250b90 100644 --- a/sc/source/ui/sidebar/CellLineStyleControl.cxx +++ b/sc/source/ui/sidebar/CellLineStyleControl.cxx @@ -96,14 +96,10 @@ void CellLineStyleControl::Initialize() void CellLineStyleControl::GetFocus() { -if(!mbVSfocus) -{ +if (!mbVSfocus maPushButtonMoreOptions) maPushButtonMoreOptions-GrabFocus(); -} -else -{ +else if (maCellLineStyleValueSet) maCellLineStyleValueSet-GrabFocus(); -} } void CellLineStyleControl::SetAllNoSel() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/output2.cxx | 52 -- 1 file changed, 30 insertions(+), 22 deletions(-) New commits: commit de44c2459b85a2a804155fb38b9b30c713789c3d Author: Eike Rathke er...@redhat.com Date: Mon Aug 10 21:03:28 2015 +0200 Resolves: tdf#86024 do not attempt to shorten numeric value output Regression of 087a79db1272858f107656c5ca3c6efb45680986 Change-Id: I903e05234882c79e6da6499cb17e16fd7226f91c (cherry picked from commit 2a06a052b920f696a794c2fb847fce63038220e9) Reviewed-on: https://gerrit.libreoffice.org/17636 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx index 5f43c75..cd63e9d 100644 --- a/sc/source/ui/view/output2.cxx +++ b/sc/source/ui/view/output2.cxx @@ -2017,32 +2017,40 @@ Rectangle ScOutputData::LayoutStrings(bool bPixelToLogic, bool bPaint, const ScA OUString aShort = aString; -double fVisibleRatio = 1.0; -double fTextWidth = aVars.GetTextSize().Width(); -sal_Int32 nTextLen = aString.getLength(); -if (eOutHorJust == SVX_HOR_JUSTIFY_LEFT aAreaParam.mnRightClipLength 0) +// But never fiddle with numeric values. +// (Which was the cause of tdf#86024). +// The General automatic format output takes +// care of this, or fixed width numbers either fit +// or display as ###. +if (!bCellIsValue) { -fVisibleRatio = (fTextWidth - aAreaParam.mnRightClipLength) / fTextWidth; -if (0.0 fVisibleRatio fVisibleRatio 1.0) +double fVisibleRatio = 1.0; +double fTextWidth = aVars.GetTextSize().Width(); +sal_Int32 nTextLen = aString.getLength(); +if (eOutHorJust == SVX_HOR_JUSTIFY_LEFT aAreaParam.mnRightClipLength 0) { -// Only show the left-end segment. -sal_Int32 nShortLen = fVisibleRatio*nTextLen + 1; -aShort = aShort.copy(0, nShortLen); +fVisibleRatio = (fTextWidth - aAreaParam.mnRightClipLength) / fTextWidth; +if (0.0 fVisibleRatio fVisibleRatio 1.0) +{ +// Only show the left-end segment. +sal_Int32 nShortLen = fVisibleRatio*nTextLen + 1; +aShort = aShort.copy(0, nShortLen); +} } -} -else if (eOutHorJust == SVX_HOR_JUSTIFY_RIGHT aAreaParam.mnLeftClipLength 0) -{ -fVisibleRatio = (fTextWidth - aAreaParam.mnLeftClipLength) / fTextWidth; -if (0.0 fVisibleRatio fVisibleRatio 1.0) +else if (eOutHorJust == SVX_HOR_JUSTIFY_RIGHT aAreaParam.mnLeftClipLength 0) { -// Only show the right-end segment. -sal_Int32 nShortLen = fVisibleRatio*nTextLen + 1; -aShort = aShort.copy(nTextLen-nShortLen); - -// Adjust the text position after shortening of the string. -double fShortWidth = pFmtDevice-GetTextWidth(aShort); -double fOffset = fTextWidth - fShortWidth; -aDrawTextPos.Move(fOffset, 0); +fVisibleRatio = (fTextWidth - aAreaParam.mnLeftClipLength) / fTextWidth; +if (0.0 fVisibleRatio fVisibleRatio 1.0) +{ +// Only show the right-end segment. +sal_Int32 nShortLen = fVisibleRatio*nTextLen + 1; +aShort = aShort.copy(nTextLen-nShortLen); + +// Adjust the text position after shortening of the string. +double fShortWidth = pFmtDevice-GetTextWidth(aShort); +double fOffset = fTextWidth -
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr5.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit e67bbe231f875477b16f3fe51dcf14e3711a73a5 Author: Åukasz Hryniuk lukasz.hryn...@wp.pl Date: Sat Aug 8 16:04:01 2015 +0200 tdf#89387 related, fix SumSquare bug in SumMXMY2 SumSquare returns IterateResult, which, because of rounding errors, store first value in mfFirst and rest in mfRest. They should be added to get the full sum of square of matrices difference. Change-Id: I9bc435801d94206960b0b4fe4a9149ef1abeb3be Reviewed-on: https://gerrit.libreoffice.org/17592 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com (cherry picked from commit d5bff1225a6739e8369bacd8392686bd26630d2f) Reviewed-on: https://gerrit.libreoffice.org/17639 diff --git a/sc/source/core/tool/interpr5.cxx b/sc/source/core/tool/interpr5.cxx index 8397a0e..c0606a9 100644 --- a/sc/source/core/tool/interpr5.cxx +++ b/sc/source/core/tool/interpr5.cxx @@ -1788,7 +1788,7 @@ void ScInterpreter::ScSumXMY2() else { ScMatrix::IterateResult aRes = pResMat-SumSquare(false); -double fSum = aRes.mfRest; +double fSum = aRes.mfFirst + aRes.mfRest; PushDouble(fSum); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/parclass.cxx |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) New commits: commit fc47e7bb752a60297327de2740fbcde63332522f Author: Eike Rathke er...@redhat.com Date: Tue Jul 21 16:09:34 2015 +0200 MATCH, HLOOKUP and VLOOKUP have a ReferenceOrForceArray parameter tdf#91278 related Change-Id: Iab4728b07649bcbb1beb372e68369f3762b13a5c (cherry picked from commit 01eea7fe40c939311bf1920b6e8b4391a93c2e82) Reviewed-on: https://gerrit.libreoffice.org/17264 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx index 8afc2b0..61c79cc 100644 --- a/sc/source/core/tool/parclass.cxx +++ b/sc/source/core/tool/parclass.cxx @@ -114,7 +114,7 @@ const ScParameterClassification::RawData ScParameterClassification::pRawData[] = { ocGreaterEqual,{{ Array, Array }, 0 }}, { ocGrowth, {{ Reference, Reference, Reference, Value }, 0 }}, { ocHarMean, {{ Reference }, 1 }}, -{ ocHLookup, {{ Value, Reference, Value, Value }, 0 }}, +{ ocHLookup, {{ Value, ReferenceOrForceArray, Value, Value }, 0 }}, { ocIRR, {{ Reference, Value }, 0 }}, { ocIndex, {{ Reference, Value, Value, Value }, 0 }}, { ocIntercept, {{ ForceArray, ForceArray }, 0 }}, @@ -126,7 +126,7 @@ const ScParameterClassification::RawData ScParameterClassification::pRawData[] = { ocLess,{{ Array, Array }, 0 }}, { ocLessEqual, {{ Array, Array }, 0 }}, { ocLookup, {{ Value, ReferenceOrForceArray, ReferenceOrForceArray }, 0 }}, -{ ocMatch, {{ Value, Reference, Reference }, 0 }}, +{ ocMatch, {{ Value, ReferenceOrForceArray, Value }, 0 }}, { ocMatDet, {{ ForceArray }, 0 }}, { ocMatInv, {{ ForceArray }, 0 }}, { ocMatMult, {{ ForceArray, ForceArray }, 0 }}, @@ -204,7 +204,7 @@ const ScParameterClassification::RawData ScParameterClassification::pRawData[] = { ocVarPA, {{ Reference }, 1 }}, { ocVarP_MS, {{ Reference }, 1 }}, { ocVarS,{{ Reference }, 1 }}, -{ ocVLookup, {{ Value, Reference, Value, Value }, 0 }}, +{ ocVLookup, {{ Value, ReferenceOrForceArray, Value, Value }, 0 }}, { ocXor, {{ Reference }, 1 }}, { ocZTest, {{ Reference, Value, Value }, 0 }}, { ocZTest_MS,{{ Reference, Value, Value }, 0 }}, ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/viewdata.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit 35e449707501c2f19a585fba3efcf1ccd217df6e Author: Laurent Godard lgodard.li...@laposte.net Date: Thu Jul 9 17:00:54 2015 +0200 init maTabData to the correct tab size tdf#92629 Change-Id: I6b226f8e992b3a2b6bcebc44b36ca1f2f06a128e Reviewed-on: https://gerrit.libreoffice.org/16894 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com (cherry picked from commit ebdc15f93587b59a79a5104f8358841a28940a82) diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index 8795afe..04d11f3 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -370,6 +370,12 @@ ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) : pThisTab = maTabData[nTabNo]; } +if (pDoc) +{ +SCTAB nTableCount = pDoc-GetTableCount(); +EnsureTabDataSize(nTableCount); +} + CalcPPT(); } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/view/viewfunc.cxx |6 ++ 1 file changed, 6 insertions(+) New commits: commit f1333692475201ce1be7a037397158051d8bd039 Author: Laurent Balland-Poirier laurent.balland-poir...@laposte.net Date: Wed Jul 29 22:18:04 2015 +0200 tdf#92918 Engineering notation lost with Add/Delete Decimal Place With scientific format, use the trick of thousand separator to detect Engineering notation. Change-Id: I7acdfb8bec646f9d6c1a17c334b60fa9708c8111 Reviewed-on: https://gerrit.libreoffice.org/17406 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com (cherry picked from commit f4bdd7989f237e8e90ac94c2798e0ea0fb31af6b) Reviewed-on: https://gerrit.libreoffice.org/17440 diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 3783473..2cb7612 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -2543,6 +2543,12 @@ void ScViewFunc::ChangeNumFmtDecimals( bool bIncrement ) nPrecision = aOut.getLength() - nPos - aDecSep.getLength(); // else keep 0 } +else +{ +if ( (nOldType css::util::NumberFormat::SCIENTIFIC) !bThousand + (pOldEntry-GetFormatIntegerDigits()%3 == 0) pOldEntry-GetFormatIntegerDigits() 0 ) +bThousand = true; +} if (!bError) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/column3.cxx |4 1 file changed, 4 insertions(+) New commits: commit 5b0c58818bcbe921075052b2dd11000edfade28b Author: Eike Rathke er...@redhat.com Date: Fri Jul 17 18:14:27 2015 +0200 Resolves: tdf#92767 use ISO 8601 for internal date string representation Change-Id: I481bf3295feb64827de2122234a9300d0b8ced40 (cherry picked from commit 3e17ed1fc2845da5a279d21ffa3ea51d637e515e) Reviewed-on: https://gerrit.libreoffice.org/17172 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Michael Meeks michael.me...@collabora.com Tested-by: Michael Meeks michael.me...@collabora.com diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx index 6c99226..40ec240 100644 --- a/sc/source/core/data/column3.cxx +++ b/sc/source/core/data/column3.cxx @@ -2020,6 +2020,10 @@ class FilterEntriesHandler fVal = rtl::math::approxFloor(fVal); mbHasDates = true; bDate = true; +// Convert string representation to ISO 8601 date to eliminate +// locale dependent behaviour later when filtering for dates. +sal_uInt32 nIndex = pFormatter-GetFormatIndex( NF_DATE_DIN_MMDD); +pFormatter-GetInputLineString( fVal, nIndex, aStr); } // maybe extend ScTypedStrData enum is also an option here mrStrings.push_back(ScTypedStrData(aStr, fVal, ScTypedStrData::Value,bDate)); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/filter/xml/xmlexprt.cxx |9 ++--- 1 file changed, 6 insertions(+), 3 deletions(-) New commits: commit 67c8a8e4c4fdf2e96dbf8503b8f8ff475f2117b9 Author: Eike Rathke er...@redhat.com Date: Mon Jul 20 11:46:17 2015 +0200 check annotation caption pointers, blind fix for rhbz#1242099 Apparently there may have been situations when the caption or its shape could not be obtained for whatever reason. Change-Id: Ie9b97d4b3999cb4645bb6b8b688b3666cfd71ccc (cherry picked from commit 47d90af52a548429224c38b5c58a70116e0f7907) Reviewed-on: https://gerrit.libreoffice.org/17220 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/filter/xml/xmlexprt.cxx b/sc/source/filter/xml/xmlexprt.cxx index 3ddd5bf..f44f6fc 100644 --- a/sc/source/filter/xml/xmlexprt.cxx +++ b/sc/source/filter/xml/xmlexprt.cxx @@ -3584,9 +3584,12 @@ void ScXMLExport::WriteAnnotation(ScMyCell rMyCell) pCurrentCell = rMyCell; SdrCaptionObj* pNoteCaption = pNote-GetOrCreateCaption(rMyCell.maCellAddress); -Referencedrawing::XShape xShape( pNoteCaption-getUnoShape(), uno::UNO_QUERY ); - -GetShapeExport()-exportShape(xShape, SEF_DEFAULT|XMLShapeExportFlags::ANNOTATION, NULL); +if (pNoteCaption) +{ +Referencedrawing::XShape xShape( pNoteCaption-getUnoShape(), uno::UNO_QUERY ); +if (xShape.is()) +GetShapeExport()-exportShape(xShape, SEF_DEFAULT|XMLShapeExportFlags::ANNOTATION, NULL); +} pCurrentCell = NULL; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/compiler.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 21be4e095056800fc8869868448e005728d1bb65 Author: Eike Rathke er...@redhat.com Date: Tue Jul 21 00:58:21 2015 +0200 Resolves: tdf#92448 check for numeric '.' only if sheet separator is '.' Change-Id: I427da08eed3fc5daed2bac4d588b66a3f03fd28c (cherry picked from commit 2fd3560e0815b547ada7d7f6557857fe3c8678ba) Reviewed-on: https://gerrit.libreoffice.org/17244 Reviewed-by: Markus Mohrhard markus.mohrh...@googlemail.com Tested-by: Markus Mohrhard markus.mohrh...@googlemail.com diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index 22272fb..8b1e079 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -2929,7 +2929,7 @@ bool ScCompiler::IsReference( const OUString rName ) if ( ch1 == cDecSep ) return false; // Who was that imbecile introducing '.' as the sheet name separator!?! -if ( rtl::isAsciiDigit( ch1 ) ) +if ( rtl::isAsciiDigit( ch1 ) pConv-getSpecialSymbol( Convention::SHEET_SEPARATOR) == '.' ) { // Numerical sheet name is valid. // But English 1.E2 or 1.E+2 is value 100, 1.E-2 is 0.01 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/app/inputhdl.cxx | 51 +++--- sc/source/ui/inc/inputhdl.hxx |3 -- 2 files changed, 20 insertions(+), 34 deletions(-) New commits: commit 579f5cbfc4636ae28e545b0d2e456e100b08b4ad Author: Winfried Donkers winfrieddonk...@libreoffice.org Date: Thu Jun 25 17:26:20 2015 +0200 tdf#89031 remove agressiveness from Calc function suggestions Change-Id: I7751a038f8482addc0e45c0461666bbd1c959d12 Reviewed-on: https://gerrit.libreoffice.org/16478 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com (cherry picked from commit f3d748937a177cbbc0033bcf54d0d0fd57a1b409) Reviewed-on: https://gerrit.libreoffice.org/17009 diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 2b6be65..fe9ef00 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -804,8 +804,7 @@ void ScInputHandler::HideTipBelow() aManualTip.clear(); } -void ScInputHandler::ShowArgumentsTip( const OUString rParagraph, OUString rSelText, const ESelection rSel, -bool bTryFirstSel ) +void ScInputHandler::ShowArgumentsTip( OUString rSelText ) { ScDocShell* pDocSh = pActiveViewSh-GetViewData().GetDocShell(); const sal_Unicode cSep = ScCompiler::GetNativeSymbolChar(ocSep); @@ -932,34 +931,6 @@ void ScInputHandler::ShowArgumentsTip( const OUString rParagraph, OUString rSe } } } -else if (bTryFirstSel) -{ -sal_Int32 nPosition = 0; -OUString aText = pEngine-GetWord( 0, rSel.nEndPos-1 ); -/* XXX: dubious, what is this condition supposed to exactly match? */ -if (rSel.nEndPos = aText.getLength() aText[ rSel.nEndPos-1 ] == '=') -{ -break; -} -OUString aNew; -nPosition = aText.getLength()+1; -ScTypedCaseStrSet::const_iterator it = -findText(*pFormulaDataPara, pFormulaDataPara-end(), aText, aNew, false); -if (it != pFormulaDataPara-end()) -{ -if( nPosition rParagraph.getLength() rParagraph[ nPosition ] =='(' ) -{ -ShowTipBelow( aNew ); -bFound = true; -} -else -break; -} -else -{ -break; -} -} else { break; @@ -986,7 +957,7 @@ void ScInputHandler::ShowTipCursor() { OUString aSelText( aParagraph.copy( 0, aSel.nEndPos )); -ShowArgumentsTip( aParagraph, aSelText, aSel, true); +ShowArgumentsTip( aSelText ); } } } @@ -1087,6 +1058,12 @@ void ScInputHandler::UseFormulaData() if ( aSel.nEndPos aParagraph.getLength() ) return; +if ( aParagraph.getLength() aSel.nEndPos + ( ScGlobal::pCharClass-isLetterNumeric( aParagraph, aSel.nEndPos ) || + aParagraph[ aSel.nEndPos ] == '_' || + aParagraph[ aSel.nEndPos ] == '.' ) ) +return; + // Is the cursor at the end of a word? if ( aSel.nEndPos 0 ) { @@ -1102,6 +1079,16 @@ void ScInputHandler::UseFormulaData() miAutoPosFormula = findText(*pFormulaData, miAutoPosFormula, aText, aNew, false); if (miAutoPosFormula != pFormulaData-end()) { +// check if partial function name is not Between quotes +bool bBetweenQuotes = false; +for ( int n = 0; n aSelText.getLength(); n++ ) +{ +if ( aSelText[ n ] == '' ) +bBetweenQuotes = !bBetweenQuotes; +} +if ( bBetweenQuotes ) +return; // we're between quotes + if (aNew[aNew.getLength()-1] == cParenthesesReplacement) aNew = aNew.copy( 0, aNew.getLength()-1) + (); ShowTip( aNew ); @@ -1112,7 +1099,7 @@ void ScInputHandler::UseFormulaData() // function name is complete: // show tip below the cell with function name and arguments of function -ShowArgumentsTip( aParagraph, aSelText, aSel, false); +ShowArgumentsTip( aSelText ); } } } diff --git a/sc/source/ui/inc/inputhdl.hxx b/sc/source/ui/inc/inputhdl.hxx index 5b0e837..bfb8e62 100644 --- a/sc/source/ui/inc/inputhdl.hxx +++ b/sc/source/ui/inc/inputhdl.hxx @@ -157,8 +157,7 @@ private: boolCursorAtClosingPar(); voidSkipClosingPar(); boolGetFuncName( OUString aStart, OUString aResult ); // fdo75264 -voidShowArgumentsTip( const OUString rParagraph,
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/documen7.cxx | 20 ++-- 1 file changed, 14 insertions(+), 6 deletions(-) New commits: commit e5988f2fdb4c4b3bb2beadf26a386cbd2e9d297e Author: Eike Rathke er...@redhat.com Date: Thu Jul 9 00:18:04 2015 +0200 Resolves: tdf#84762 collect all recalc-always cells before setting any dirty Change-Id: I38f69bcbb9eb550fb97b0f84bc0cb486863060b4 (cherry picked from commit bf35419b68d7f100a634572236f7d593638981c8) Reviewed-on: https://gerrit.libreoffice.org/16873 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/documen7.cxx b/sc/source/core/data/documen7.cxx index d89ea62..b67cce9 100644 --- a/sc/source/core/data/documen7.cxx +++ b/sc/source/core/data/documen7.cxx @@ -419,6 +419,7 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet CalcAll(); else { +::std::vectorScFormulaCell* vAlwaysDirty; ScFormulaCell* pCell = pFormulaTree; while ( pCell ) { @@ -428,12 +429,11 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet { if ( pCell-GetCode()-IsRecalcModeAlways() ) { -// pCell is set to Dirty again! -ScFormulaCell* pNext = pCell-GetNext(); -pCell-SetDirty(); -// if pNext==0 and new dependencies were appended at the end, -// this does not matter since they all are bDirty -pCell = pNext; +// pCell and dependents are to be set dirty again, collect +// them first and broadcast afterwards to not break the +// FormulaTree chain here. +vAlwaysDirty.push_back( pCell); +pCell = pCell-GetNext(); } else { // calculate the other single @@ -443,6 +443,14 @@ void ScDocument::CalcFormulaTree( bool bOnlyForced, bool bProgressBar, bool bSet } } } +for (::std::vectorScFormulaCell*::iterator it( vAlwaysDirty.begin()), itEnd( vAlwaysDirty.end()); +it != itEnd; ++it) +{ +pCell = *it; +if (!pCell-GetDirty()) +pCell-SetDirty(); +} + bool bProgress = !bOnlyForced nFormulaCodeInTree bProgressBar; if ( bProgress ) ScProgress::CreateInterpretProgress( this, true ); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/filter/excel/xlformula.cxx |6 +++--- sc/source/filter/oox/formulabase.cxx |6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) New commits: commit 0ca691f1999bda3638db67bdcc11569e1145563c Author: Winfried Donkers winfrieddonk...@libreoffice.org Date: Thu Jul 9 10:02:15 2015 +0200 fix export to xls, tdf#69552 CEILING.PRECISE, ISO.CEILING and FLOOR.PRECISE with 1 argument are now exported properly to xls. export test for xls activated. Reviewed-on: https://gerrit.libreoffice.org/16882 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com (cherry picked from commit 570852376464f238d7c3c0b58b37250ac5944a1c) Conflicts: sc/qa/unit/subsequent_export-test.cxx Tests not present on branch. Change-Id: Ib2a813183bbf8f2e9a5bbe08630403ffecb3cbb1 diff --git a/sc/source/filter/excel/xlformula.cxx b/sc/source/filter/excel/xlformula.cxx index 80098bc..157d11b 100644 --- a/sc/source/filter/excel/xlformula.cxx +++ b/sc/source/filter/excel/xlformula.cxx @@ -401,7 +401,7 @@ static const XclFunctionInfo saFuncTable_Oox[] = { ocNetWorkdays_MS, 255,3, 5, V, { RO_E, VR, VR, RO, RO }, EXC_FUNCFLAG_EXPORTONLY, EXC_FUNCNAME( NETWORKDAYS.INTL ) }, { ocWorkday_MS, NOID, 2, 4, V, { VR, VR, VR, RO }, EXC_FUNCFLAG_IMPORTONLY, EXC_FUNCNAME( WORKDAY.INTL ) }, { ocWorkday_MS, 255,3, 5, V, { RO_E, VR, VR, VR, RO }, EXC_FUNCFLAG_EXPORTONLY, EXC_FUNCNAME( WORKDAY.INTL ) }, -EXC_FUNCENTRY_V_VR( ocCeil_ISO, 2, 2, 0, ISO.CEILING ) +EXC_FUNCENTRY_V_VR( ocCeil_ISO, 1, 2, 0, ISO.CEILING ) }; #define EXC_FUNCENTRY_V_VR_IMPORT( opcode, minparam, maxparam, flags, asciiname ) \ @@ -486,8 +486,8 @@ static const XclFunctionInfo saFuncTable_2010[] = EXC_FUNCENTRY_V_RX( ocModalValue_Multi, 1, MX, 0, MODE.MULT ), EXC_FUNCENTRY_V_VR( ocNegBinomDist_MS, 4, 4, 0, NEGBINOM.DIST ), EXC_FUNCENTRY_V_VR( ocZTest_MS, 2, 3, 0, Z.TEST ), -EXC_FUNCENTRY_V_VR( ocCeil_Precise, 2, 2, 0, CEILING.PRECISE ), -EXC_FUNCENTRY_V_VR( ocFloor_Precise,2, 2, 0, FLOOR.PRECISE ), +EXC_FUNCENTRY_V_VR( ocCeil_Precise, 1, 2, 0, CEILING.PRECISE ), +EXC_FUNCENTRY_V_VR( ocFloor_Precise,1, 2, 0, FLOOR.PRECISE ), EXC_FUNCENTRY_V_VR( ocErf_MS, 1, 1, 0, ERF.PRECISE ), EXC_FUNCENTRY_V_VR( ocErfc_MS, 1, 1, 0, ERFC.PRECISE ), EXC_FUNCENTRY_V_RX( ocAggregate,3, MX, 0, AGGREGATE ), diff --git a/sc/source/filter/oox/formulabase.cxx b/sc/source/filter/oox/formulabase.cxx index f840b59..b31020b 100644 --- a/sc/source/filter/oox/formulabase.cxx +++ b/sc/source/filter/oox/formulabase.cxx @@ -732,7 +732,7 @@ static const FunctionData saFuncTableOox[] = { SUMIFS, SUMIFS, 482,NOID, 3, MX, V, { RO, RO, VR }, FUNCFLAG_MACROCALL | FUNCFLAG_PARAMPAIRS }, { AVERAGEIF, AVERAGEIF,483,NOID, 2, 3, V, { RO, VR, RO }, FUNCFLAG_MACROCALL }, { AVERAGEIFS, AVERAGEIFS, 484,NOID, 3, MX, V, { RO, RO, VR }, FUNCFLAG_MACROCALL | FUNCFLAG_PARAMPAIRS }, -{ COM.MICROSOFT.ISO.CEILING, ISO.CEILING, NOID,NOID, 2, 2, V, { VR }, FUNCFLAG_MACROCALL }, +{ COM.MICROSOFT.ISO.CEILING, ISO.CEILING, NOID,NOID, 1, 2, V, { VR }, FUNCFLAG_MACROCALL }, { COM.MICROSOFT.NETWORKDAYS.INTL, NETWORKDAYS.INTL, NOID, NOID, 2, 4, V, { VR, VR, VR, RX }, FUNCFLAG_MACROCALL }, { COM.MICROSOFT.WORKDAY.INTL, WORKDAY.INTL, NOID, NOID, 2, 4, V, { VR, VR, VR, RX }, FUNCFLAG_MACROCALL } }; @@ -809,8 +809,8 @@ static const FunctionData saFuncTable2010[] = { COM.MICROSOFT.MODE.MULT, MODE.MULT, NOID, NOID,1, MX, V, { VA }, FUNCFLAG_MACROCALL_NEW }, { COM.MICROSOFT.NEGBINOM.DIST, NEGBINOM.DIST, NOID, NOID,4, 4, V, { VR }, FUNCFLAG_MACROCALL_NEW }, { COM.MICROSOFT.Z.TEST, Z.TEST, NOID, NOID,2, 3, V, { RX, VR }, FUNCFLAG_MACROCALL_NEW }, -{ COM.MICROSOFT.CEILING.PRECISE,CEILING.PRECISE, NOID, NOID,2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW }, -{ COM.MICROSOFT.FLOOR.PRECISE, FLOOR.PRECISE, NOID, NOID,2, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW }, +{ COM.MICROSOFT.CEILING.PRECISE,CEILING.PRECISE, NOID, NOID,1, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW }, +{ COM.MICROSOFT.FLOOR.PRECISE, FLOOR.PRECISE, NOID, NOID,1, 2, V, { VR }, FUNCFLAG_MACROCALL_NEW }, { COM.MICROSOFT.ERF.PRECISE,ERF.PRECISE, NOID, NOID,1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW }, { COM.MICROSOFT.ERFC.PRECISE, ERFC.PRECISE,NOID, NOID,1, 1, V, { VR }, FUNCFLAG_MACROCALL_NEW }, { COM.MICROSOFT.AGGREGATE,
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/miscdlgs/anyrefdg.cxx |5 + 1 file changed, 5 insertions(+) New commits: commit f932f1197e1cabd901231223dc9c7ce9c171120e Author: Caolán McNamara caol...@redhat.com Date: Tue Jul 7 13:46:41 2015 +0100 Related: tdf#92392 clear some more vclptrs on dispose Change-Id: I91b8d082ff19328e35e2f1c2a02838d96224dc9c (cherry picked from commit 8e20a25319e16d2f74e18696480556bc841a1679) Reviewed-on: https://gerrit.libreoffice.org/16831 Reviewed-by: Michael Meeks michael.me...@collabora.com Tested-by: Michael Meeks michael.me...@collabora.com diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index 6208048..870692c 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -83,6 +83,11 @@ void ScFormulaReferenceHelper::dispose() pInputHdl-ResetDelayTimer(); // stop the timer for disabling the input line pAccel.reset(); + +mpOldEditParent.clear(); +m_pWindow.clear(); +pRefBtn.clear(); +pRefEdit.clear(); } void ScFormulaReferenceHelper::enableInput( bool bEnable ) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/document.cxx | 63 +++ 1 file changed, 63 insertions(+) New commits: commit d71ed0ee3fbf70c21513379184dea596b30b0baf Author: Eike Rathke er...@redhat.com Date: Tue Jul 7 23:36:02 2015 +0200 end/restart group listening in DeleteSelection(), similar to DeleteArea() Reproducer: * in A1 enter =SUM(B1:C4) * copy A1 to clipboard * paste to A2 and A3 * formula in A2 is =SUM(B2:C5) A3 is =SUM(B3:C6) * select A2:A3 * hit Del key to delete the two cells * enter any numeric value in B2 = formula result in A1 is not updated Shift+Ctrl+F9 hard recalc updates Change-Id: I55e55b8cfe69e9273170ceaea4e6c046b3d4f7b7 (cherry picked from commit a49b8af4cf03ae08cb7a28f66e24368a7b08ae3f) Reviewed-on: https://gerrit.libreoffice.org/16840 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx index 14ab9ac..e00a5cc 100644 --- a/sc/source/core/data/document.cxx +++ b/sc/source/core/data/document.cxx @@ -5646,18 +5646,81 @@ void ScDocument::ClearSelectionItems( const sal_uInt16* pWhich, const ScMarkData void ScDocument::DeleteSelection( InsertDeleteFlags nDelFlag, const ScMarkData rMark, bool bBroadcast ) { +sc::AutoCalcSwitch aACSwitch(*this, false); + +std::vectorScAddress aGroupPos; +// Destroy and reconstruct listeners only if content is affected. +bool bDelContent = ((nDelFlag ~IDF_CONTENTS) != nDelFlag); +if (bDelContent) +{ +// Record the positions of top and/or bottom formula groups that +// intersect the area borders. +sc::EndListeningContext aCxt(*this); +ScRangeList aRangeList; +rMark.FillRangeListWithMarks( aRangeList, false); +for (size_t i = 0; i aRangeList.size(); ++i) +{ +const ScRange* pRange = aRangeList[i]; +if (pRange) +EndListeningIntersectedGroups( aCxt, *pRange, aGroupPos); +} +aCxt.purgeEmptyBroadcasters(); +} + SCTAB nMax = static_castSCTAB(maTabs.size()); ScMarkData::const_iterator itr = rMark.begin(), itrEnd = rMark.end(); for (; itr != itrEnd *itr nMax; ++itr) if (maTabs[*itr]) maTabs[*itr]-DeleteSelection(nDelFlag, rMark, bBroadcast); + +if (bDelContent) +{ +// Re-start listeners on those top bottom groups that have been split. +SetNeedsListeningGroups(aGroupPos); +StartNeededListeners(); +} } void ScDocument::DeleteSelectionTab( SCTAB nTab, InsertDeleteFlags nDelFlag, const ScMarkData rMark, bool bBroadcast ) { if (ValidTab(nTab) nTab static_castSCTAB(maTabs.size()) maTabs[nTab]) +{ +sc::AutoCalcSwitch aACSwitch(*this, false); + +std::vectorScAddress aGroupPos; +// Destroy and reconstruct listeners only if content is affected. +bool bDelContent = ((nDelFlag ~IDF_CONTENTS) != nDelFlag); +if (bDelContent) +{ +// Record the positions of top and/or bottom formula groups that +// intersect the area borders. +sc::EndListeningContext aCxt(*this); +ScRangeList aRangeList; +rMark.FillRangeListWithMarks( aRangeList, false); +for (size_t i = 0; i aRangeList.size(); ++i) +{ +const ScRange* pRange = aRangeList[i]; +if (pRange pRange-aStart.Tab() = nTab nTab = pRange-aEnd.Tab()) +{ +ScRange aRange( *pRange); +aRange.aStart.SetTab( nTab); +aRange.aEnd.SetTab( nTab); +EndListeningIntersectedGroups( aCxt, aRange, aGroupPos); +} +} +aCxt.purgeEmptyBroadcasters(); +} + maTabs[nTab]-DeleteSelection(nDelFlag, rMark, bBroadcast); + +if (bDelContent) +{ +// Re-start listeners on those top bottom groups that have been split. +SetNeedsListeningGroups(aGroupPos); +StartNeededListeners(); +} +} else { OSL_FAIL(wrong table); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/inc/anyrefdg.hxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3fc53c64086298e1969064a1205ad9b7c660fc4c Author: Caolán McNamara caol...@redhat.com Date: Tue Jul 7 16:29:45 2015 +0100 Related: tdf#92392 protect against double dispose from dtor with disposeOnce Change-Id: I40f3bdea784a1abed8f9732a9444cd8d1eccf4a9 (cherry picked from commit 5f216c82ab5fbab44ab55a5127d0be7d4a2da8e3) Reviewed-on: https://gerrit.libreoffice.org/16830 Reviewed-by: Michael Meeks michael.me...@collabora.com Tested-by: Michael Meeks michael.me...@collabora.com diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 395dcaf..249a8b8 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -291,7 +291,7 @@ struct ScRefHdlrImpl: ScRefHdlrImplBase TBase, bBindRef ~ScRefHdlrImpl() { -dispose(); +TBase::disposeOnce(); } }; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/inc/anyrefdg.hxx |1 + sc/source/ui/miscdlgs/anyrefdg.cxx | 10 +- 2 files changed, 10 insertions(+), 1 deletion(-) New commits: commit f7367996e8ba6474bad7be2238cc7ab79178f264 Author: Michael Meeks michael.me...@collabora.com Date: Fri Jul 3 16:37:06 2015 +0100 tdf#92392 - Dispose ScFormulaReferenceHelper properly. Release the accelerator, and cleanup global references. Change-Id: Id9931527f1b6d89067bc1e520e521ccfa6e28197 Reviewed-on: https://gerrit.libreoffice.org/16740 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Michael Meeks michael.me...@collabora.com Tested-by: Michael Meeks michael.me...@collabora.com Reviewed-on: https://gerrit.libreoffice.org/16751 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/inc/anyrefdg.hxx b/sc/source/ui/inc/anyrefdg.hxx index 5f717ff..395dcaf 100644 --- a/sc/source/ui/inc/anyrefdg.hxx +++ b/sc/source/ui/inc/anyrefdg.hxx @@ -74,6 +74,7 @@ class ScFormulaReferenceHelper public: ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindings* _pBindings); ~ScFormulaReferenceHelper(); +void dispose(); voidShowSimpleReference(const OUString rStr); voidShowFormulaReference(const OUString rStr); diff --git a/sc/source/ui/miscdlgs/anyrefdg.cxx b/sc/source/ui/miscdlgs/anyrefdg.cxx index aab5194..6208048 100644 --- a/sc/source/ui/miscdlgs/anyrefdg.cxx +++ b/sc/source/ui/miscdlgs/anyrefdg.cxx @@ -65,17 +65,24 @@ ScFormulaReferenceHelper::ScFormulaReferenceHelper(IAnyRefDialog* _pDlg,SfxBindi ScFormulaReferenceHelper::~ScFormulaReferenceHelper() { +dispose(); +} + +void ScFormulaReferenceHelper::dispose() +{ if (bAccInserted) Application::RemoveAccel( pAccel.get() ); +bAccInserted = false; // common cleanup for ScAnyRefDlg and ScFormulaDlg is done here - HideReference(); enableInput( true ); ScInputHandler* pInputHdl = SC_MOD()-GetInputHdl(); if ( pInputHdl ) pInputHdl-ResetDelayTimer(); // stop the timer for disabling the input line + +pAccel.reset(); } void ScFormulaReferenceHelper::enableInput( bool bEnable ) @@ -831,6 +838,7 @@ void ScRefHandler::disposeRefHandler() m_rWindow.clear(); pActiveWin.clear(); LeaveRefMode(); +m_aHelper.dispose(); } bool ScRefHandler::LeaveRefMode() ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/cctrl/tbinsert.cxx |2 +- sc/source/ui/inc/tbinsert.hxx |4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) New commits: commit 979d93f5f4d3a0a2961da7c0529d948cae5c4ae1 Author: Maxim Monastirsky momonas...@gmail.com Date: Sun Jul 5 10:25:14 2015 +0300 This one should override SfxToolBoxControl::Select We don't have there Select(bool) since c3a89936abc7967ebe8916ca83cb38f6837f9aa1. (cherry picked from commit 4604a6a7cd66907fc29e01aacf2146f17fa19d34) (cherry picked from commit bc3c7f2557a1871fb1e41fc9cac4426a6b208901) Conflicts: sc/source/ui/cctrl/tbinsert.cxx Change-Id: Id496725d82289d1be004bdc36195877c12f336b0 Reviewed-on: https://gerrit.libreoffice.org/16772 Reviewed-by: Eike Rathke er...@redhat.com Tested-by: Eike Rathke er...@redhat.com diff --git a/sc/source/ui/cctrl/tbinsert.cxx b/sc/source/ui/cctrl/tbinsert.cxx index 8b3469a..2df6456 100644 --- a/sc/source/ui/cctrl/tbinsert.cxx +++ b/sc/source/ui/cctrl/tbinsert.cxx @@ -98,7 +98,7 @@ SfxPopupWindowType ScTbxInsertCtrl::GetPopupWindowType() const return nLastSlotId ? SfxPopupWindowType::ONTIMEOUT : SfxPopupWindowType::ONCLICK; } -void ScTbxInsertCtrl::Select( bool /* bMod1 */ ) +void ScTbxInsertCtrl::Select( sal_uInt16 /*nSelectModifier*/ ) { SfxViewShell* pCurSh( SfxViewShell::Current() ); SfxDispatcher* pDispatch( 0 ); diff --git a/sc/source/ui/inc/tbinsert.hxx b/sc/source/ui/inc/tbinsert.hxx index dda7018..cfaf4ae 100644 --- a/sc/source/ui/inc/tbinsert.hxx +++ b/sc/source/ui/inc/tbinsert.hxx @@ -25,9 +25,7 @@ class ScTbxInsertCtrl : public SfxToolBoxControl { sal_uInt16 nLastSlotId; - -using SfxToolBoxControl::Select; -voidSelect( bool bMod1 = false ); +virtual void Select( sal_uInt16 nSelectModifier ) SAL_OVERRIDE; public: SFX_DECL_TOOLBOX_CONTROL(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/Accessibility/AccessibleDocument.cxx |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) New commits: commit ea228fdffd17b87e398216625213a691fcb34825 Author: Caolán McNamara caol...@redhat.com Date: Thu Jul 2 16:40:21 2015 +0100 fix a11y crash seen on moving chart wizard dialog Change-Id: Ic3ba292e28fe12d7dcc2c2e67aeea48a4c8aaac2 (cherry picked from commit b161552bd9f7d6b6de9752e4f0e7d6f65bbcf42e) diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index a4e94cc..4cec468 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -813,8 +813,9 @@ uno::Reference XAccessible ScChildrenShapes::GetSelected(sal_Int32 nSelectedC std::vector uno::Reference drawing::XShape aShapes; FillShapes(aShapes); -if(aShapes.size()=0) +if (nSelectedChildIndex 0 || static_castsize_t(nSelectedChildIndex) = aShapes.size()) return xAccessible; + SortedShapes::iterator aItr; if (FindShape(aShapes[nSelectedChildIndex], aItr)) xAccessible = Get(aItr - maZOrderedShapes.begin()); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/cctrl/checklistmenu.cxx |3 +++ sc/source/ui/inc/checklistmenu.hxx |4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) New commits: commit 50b93a183bcdd9981a740a92cd5cc6be77be1973 Author: Michael Meeks michael.me...@collabora.com Date: Wed Jul 1 17:46:05 2015 +0100 tdf#92262 - fixup shared_ptr - VclPtr issue. Change-Id: Ia0b22e62001cff4a63ea197b77aebb1759f73122 Reviewed-on: https://gerrit.libreoffice.org/16664 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Michael Meeks michael.me...@collabora.com Tested-by: Michael Meeks michael.me...@collabora.com Reviewed-on: https://gerrit.libreoffice.org/16684 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/ui/cctrl/checklistmenu.cxx b/sc/source/ui/cctrl/checklistmenu.cxx index bbbed33..b4dc71b 100644 --- a/sc/source/ui/cctrl/checklistmenu.cxx +++ b/sc/source/ui/cctrl/checklistmenu.cxx @@ -100,6 +100,8 @@ ScMenuFloatingWindow::~ScMenuFloatingWindow() void ScMenuFloatingWindow::dispose() { EndPopupMode(); +for (auto i = maMenuItems.begin(); i != maMenuItems.end(); ++i) +i-mpSubMenuWin.disposeAndClear(); mpParentMenu.clear(); PopupMenuFloatingWindow::dispose(); } @@ -919,6 +921,7 @@ void ScCheckListMenuWindow::dispose() maBtnUnselectSingle.disposeAndClear(); maBtnOk.disposeAndClear(); maBtnCancel.disposeAndClear(); +maTabStopCtrls.clear(); ScMenuFloatingWindow::dispose(); } diff --git a/sc/source/ui/inc/checklistmenu.hxx b/sc/source/ui/inc/checklistmenu.hxx index 26732c9..f4e714a 100644 --- a/sc/source/ui/inc/checklistmenu.hxx +++ b/sc/source/ui/inc/checklistmenu.hxx @@ -147,8 +147,8 @@ private: struct MenuItemData { OUString maText; -boolmbEnabled:1; -boolmbSeparator:1; +bool mbEnabled:1; +bool mbSeparator:1; ::boost::shared_ptrAction mpAction; VclPtrScMenuFloatingWindow mpSubMenuWin; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx |8 1 file changed, 4 insertions(+), 4 deletions(-) New commits: commit 59487150df556457cb3c919b0b0ea5d6b625b185 Author: Eike Rathke er...@redhat.com Date: Tue Jun 30 14:30:20 2015 +0200 tdf#92426 explicitly set valid row/col for entire col/row references ... for callers that individually check for them, like ScRange::ParseAny() Change-Id: I23fc2c178a9c89b59f99f2fb86223324b7e5d378 (cherry picked from commit 07cd14f1e3ee718e56d063db8c331bec173f4408) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 0af90d6..fa34c64 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1491,15 +1491,15 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange rRange, { rRange.aStart.SetRow(0); rRange.aEnd.SetRow(MAXROW); -nRes1 |= SCA_ROW_ABSOLUTE; -nRes2 |= SCA_ROW_ABSOLUTE; +nRes1 |= SCA_VALID_ROW | SCA_ROW_ABSOLUTE; +nRes2 |= SCA_VALID_ROW | SCA_ROW_ABSOLUTE; } else { rRange.aStart.SetCol(0); rRange.aEnd.SetCol(MAXCOL); -nRes1 |= SCA_COL_ABSOLUTE; -nRes2 |= SCA_COL_ABSOLUTE; +nRes1 |= SCA_VALID_COL | SCA_COL_ABSOLUTE; +nRes2 |= SCA_VALID_COL | SCA_COL_ABSOLUTE; } } else if ((nRes1 SCA_VALID) (nRes2 SCA_VALID)) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source vcl/unx
sc/source/ui/Accessibility/AccessibleEditObject.cxx | 12 ++-- vcl/unx/gtk/window/gtksalframe.cxx | 12 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) New commits: commit 227e7f903fee64d63b48bd31707887ba28a019bc Author: Justin Luth justin_l...@sil.org Date: Tue Jun 30 15:55:46 2015 +0300 tdf#91641 adjust cursor when deleting preceding characters IMDeleteSurrounding is used by input methods to take multiple keystrokes and convert them into a special character. Then the composing keystrokes are removed. Before this fix, the cursor placement was not adjusted, so the special character was inserted in the wrong position and if 3+ keystrokes were involved, the wrong characters were deleted. Also fixes editLine should have focus on accessibleText init. The first time an accessibleEdit is created, it didnt recognize any focused text when editing in the Input Line. Change-Id: I5be9b75f74d4df82fbd57da3817a626b5fcbeba1 Reviewed-on: https://gerrit.libreoffice.org/15961 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com Reviewed-on: https://gerrit.libreoffice.org/16619 diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx b/sc/source/ui/Accessibility/AccessibleEditObject.cxx index e975bd5..c688165 100644 --- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx +++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx @@ -372,13 +372,21 @@ void ScAccessibleEditObject::CreateTextHelper() ::std::unique_ptr SvxEditSource pEditSource (new ScAccessibilityEditSource(std::move(pAccessibleTextData))); mpTextHelper = new ::accessibility::AccessibleTextHelper(std::move(pEditSource)); mpTextHelper-SetEventSource(this); -mpTextHelper-SetFocus(mbHasFocus); + +const ScInputHandler* pInputHdl = SC_MOD()-GetInputHdl(); +if ( pInputHdl pInputHdl-IsEditMode() ) +{ +mpTextHelper-SetFocus(true); +} +else +{ +mpTextHelper-SetFocus(mbHasFocus); +} // #i54814# activate cell in edit mode if( meObjectType == CellInEditMode ) { // do not activate cell object, if top edit line is active -const ScInputHandler* pInputHdl = SC_MOD()-GetInputHdl(); if( pInputHdl !pInputHdl-IsTopMode() ) { SdrHint aHint( HINT_BEGEDIT ); diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx index 017b7f1..7d25640 100644 --- a/vcl/unx/gtk/window/gtksalframe.cxx +++ b/vcl/unx/gtk/window/gtksalframe.cxx @@ -4630,7 +4630,7 @@ gboolean GtkSalFrame::IMHandler::signalIMRetrieveSurrounding( GtkIMContext* pCon uno::Referenceaccessibility::XAccessibleEditableText xText = lcl_GetxText(pFocusWin); if (xText.is()) { -sal_uInt32 nPosition = xText-getCaretPosition(); +sal_Int32 nPosition = xText-getCaretPosition(); OUString sAllText = xText-getText(); OString sUTF = OUStringToOString(sAllText, RTL_TEXTENCODING_UTF8); OUString sCursorText(sAllText.copy(0, nPosition)); @@ -4652,7 +4652,7 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint uno::Referenceaccessibility::XAccessibleEditableText xText = lcl_GetxText(pFocusWin); if (xText.is()) { -sal_uInt32 nPosition = xText-getCaretPosition(); +sal_Int32 nPosition = xText-getCaretPosition(); // #i111768# range checking sal_Int32 nDeletePos = nPosition + offset; sal_Int32 nDeleteEnd = nDeletePos + nchars; @@ -4664,6 +4664,14 @@ gboolean GtkSalFrame::IMHandler::signalIMDeleteSurrounding( GtkIMContext*, gint nDeleteEnd = xText-getCharacterCount(); xText-deleteText(nDeletePos, nDeleteEnd); +//tdf91641 adjust cursor if deleted chars shift it forward (normal case) +if (nDeletePos nPosition) +{ +if (nDeleteEnd = nPosition) +xText-setCaretPosition( nPosition-(nDeleteEnd-nDeletePos) ); +else +xText-setCaretPosition( nDeletePos ); +} return true; } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx | 19 +++ 1 file changed, 19 insertions(+) New commits: commit d2787cde7722dee09ae67e1d6bc9a3501ecc0d56 Author: Eike Rathke er...@redhat.com Date: Tue Jun 30 12:42:06 2015 +0200 tdf#92427 entire column/row reference also if both sticky parts are relative For example, convert A1:A1048576 to A:A but not A$1:A1048576 or A1:A$1048576 Change-Id: I7845134f79a04f7c031896d515ea1cb8050bd454 (cherry picked from commit 0ccefa0cb62da893556893bec2414c22cb2ad7b8) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 60d6d2e..0af90d6 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1502,6 +1502,25 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange rRange, nRes2 |= SCA_COL_ABSOLUTE; } } +else if ((nRes1 SCA_VALID) (nRes2 SCA_VALID)) +{ +// Flag entire column/row references so they can be displayed +// as such. If the sticky reference parts are not both +// absolute or relative, assume that the user thought about +// something we should not touch. +if (rRange.aStart.Row() == 0 rRange.aEnd.Row() == MAXROW +((nRes1 SCA_ROW_ABSOLUTE) == 0) ((nRes2 SCA_ROW_ABSOLUTE) == 0)) +{ +nRes1 |= SCA_ROW_ABSOLUTE; +nRes2 |= SCA_ROW_ABSOLUTE; +} +else if (rRange.aStart.Col() == 0 rRange.aEnd.Col() == MAXCOL +((nRes1 SCA_COL_ABSOLUTE) == 0) ((nRes2 SCA_COL_ABSOLUTE) == 0)) +{ +nRes1 |= SCA_COL_ABSOLUTE; +nRes2 |= SCA_COL_ABSOLUTE; +} +} if (nRes1 nRes2) { // PutInOrder / Justify ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/dptabsrc.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 6a2c4efbd1d6086ef0f1162e0e20eb0540ded2ba Author: Julien Nabet serval2...@yahoo.fr Date: Thu Jun 25 23:21:19 2015 +0200 Related tdf#92262: PIVOTTABLE: crash when clicking on the autofilter arrow Missing else in front of the if Regression from http://cgit.freedesktop.org/libreoffice/core/commit/?id=7b355da6853af6678c4ba22710d157cf8a6d43eb Change-Id: I3c32e8f09acbea7094c4268384ec4b1c4e028fc5 Reviewed-on: https://gerrit.libreoffice.org/16497 Tested-by: Jenkins c...@libreoffice.org Reviewed-by: Deena Francis deena.fran...@gmail.com Tested-by: Julien Nabet serval2...@yahoo.fr Reviewed-by: Julien Nabet serval2...@yahoo.fr (cherry picked from commit 594ef250f824772c467c0f3cc8001568d1e553a9) Reviewed-on: https://gerrit.libreoffice.org/16576 Reviewed-by: Caolán McNamara caol...@redhat.com Tested-by: Caolán McNamara caol...@redhat.com diff --git a/sc/source/core/data/dptabsrc.cxx b/sc/source/core/data/dptabsrc.cxx index f8c5ac7..1bcf434 100644 --- a/sc/source/core/data/dptabsrc.cxx +++ b/sc/source/core/data/dptabsrc.cxx @@ -2235,7 +2235,7 @@ uno::Any SAL_CALL ScDPLevel::getPropertyValue( const OUString aPropertyName ) uno::Any aRet; if ( aPropertyName == SC_UNO_DP_SHOWEMPTY ) lcl_SetBoolInAny(aRet, bShowEmpty); -if ( aPropertyName == SC_UNO_DP_REPEATITEMLABELS ) +else if ( aPropertyName == SC_UNO_DP_REPEATITEMLABELS ) lcl_SetBoolInAny(aRet, bRepeatItemLabels); else if ( aPropertyName == SC_UNO_DP_SUBTOTAL ) { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr1.cxx | 47 +++ 1 file changed, 47 insertions(+) New commits: commit f6b1e95817f061bcde0c28c61cac711d23146d8f Author: Eike Rathke er...@redhat.com Date: Mon Jun 29 18:07:12 2015 +0200 TableRef: can be used in INDIRECT Change-Id: I8eed87f0e6c0816a7d315f6c5ed039b0b193c322 (cherry picked from commit 30396941dbaa34d3573466a87e435621cfdadab3) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index df14604..568ce1f 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -7095,6 +7095,53 @@ void ScInterpreter::ScIndirect() } while (false); +/* TODO: simple named ranges and database ranges could be resolved. */ + +// It may be even a TableRef. +// Anything else that resolves to one reference could be added +// here, but we don't want to compile every arbitrary string. This +// is already nasty enough.. +sal_Int32 nIndex = 0; +if ((nIndex = sRefStr.indexOf('[')) = 0 sRefStr.indexOf(']',nIndex+1) nIndex) +{ +do +{ +ScCompiler aComp( pDok, aPos); +aComp.SetGrammar( pDok-GetGrammar()); +aComp.SetRefConvention( eConv); // must be after grammar +boost::scoped_ptrScTokenArray pArr( aComp.CompileString( sRefStr)); + +// Whatever.. use only the specific case. +if (!pArr-HasOpCode( ocTableRef)) +break; + +aComp.CompileTokenArray(); + +// A syntactically valid reference will generate exactly +// one RPN token, a reference or error. Discard everything +// else as error. +if (pArr-GetCodeLen() != 1) +break; + +ScTokenRef xTok( pArr-FirstRPN()); +if (!xTok) +break; + +switch (xTok-GetType()) +{ +case svSingleRef: +case svDoubleRef: +case svError: +PushTempToken( xTok.get()); +// success! +return; +default: +; // nothing +} +} +while (false); +} + PushError( errNoRef); } } ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr1.cxx | 35 ++- 1 file changed, 34 insertions(+), 1 deletion(-) New commits: commit 48d55a1b6f6ce9e38c9b48dfbbdb7231a7b66d3e Author: Eike Rathke er...@redhat.com Date: Mon Jun 29 20:50:53 2015 +0200 support plain database range (table) names in INDIRECT Change-Id: I89c1249315059d6a04615de27e8b9b18dfd300ff (cherry picked from commit 81b606f547fcfc254e040937519516b98f089241) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index 568ce1f..e2255ac 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -7095,7 +7095,40 @@ void ScInterpreter::ScIndirect() } while (false); -/* TODO: simple named ranges and database ranges could be resolved. */ +do +{ +OUString aName( ScGlobal::pCharClass-uppercase( sRefStr)); +ScDBCollection::NamedDBs rDBs = pDok-GetDBCollection()-getNamedDBs(); +const ScDBData* pData = rDBs.findByUpperName( aName); +if (!pData) +break; + +ScRange aRange; +pData-GetArea( aRange); + +// In Excel, specifying a table name without [] resolves to the +// same as with [], a range that excludes header and totals +// rows and contains only data rows. Do the same. +if (pData-HasHeader()) +aRange.aStart.IncRow(); +if (pData-HasTotals()) +aRange.aEnd.IncRow(-1); + +if (aRange.aStart.Row() aRange.aEnd.Row()) +break; + +if (aRange.aStart == aRange.aEnd) +PushSingleRef( aRange.aStart.Col(), aRange.aStart.Row(), +aRange.aStart.Tab()); +else +PushDoubleRef( aRange.aStart.Col(), aRange.aStart.Row(), +aRange.aStart.Tab(), aRange.aEnd.Col(), +aRange.aEnd.Row(), aRange.aEnd.Tab()); + +// success! +return; +} +while (false); // It may be even a TableRef. // Anything else that resolves to one reference could be added ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/interpr1.cxx |8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) New commits: commit f61d873202ddc30b7153e837d071d14dca07e3f4 Author: Eike Rathke er...@redhat.com Date: Mon Jun 29 22:20:04 2015 +0200 Resolves: tdf#31577 volatile lookup ranges must not be cached Change-Id: Iac8574329c8c8e0bc0ac956993ccdd085372a6cc (cherry picked from commit 5e83f49e5d62587f427ad416f5188ce81506c05b) diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index e2255ac..e1dfd2a 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -8503,7 +8503,13 @@ bool ScInterpreter::LookupQueryWithCache( ScAddress o_rResultPos, const ScQueryEntry rEntry = rParam.GetEntry(0); bool bColumnsMatch = (rParam.nCol1 == rEntry.nField); OSL_ENSURE( bColumnsMatch, ScInterpreter::LookupQueryWithCache: columns don't match); -if (!bColumnsMatch) +// At least all volatile functions that generate indirect references have +// to force non-cached lookup. +/* TODO: We could further classify volatile functions into reference + * generating and not reference generating functions to have to force less + * direct lookups here. We could even further attribute volatility per + * parameter so it would affect only the lookup range parameter. */ +if (!bColumnsMatch || GetVolatileType() != NOT_VOLATILE) bFound = lcl_LookupQuery( o_rResultPos, pDok, rParam, rEntry); else { ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/data/bcaslot.cxx |3 ++- sc/source/core/inc/refupdat.hxx |7 ++- sc/source/core/tool/lookupcache.cxx |2 +- sc/source/core/tool/refupdat.cxx| 34 -- 4 files changed, 37 insertions(+), 9 deletions(-) New commits: commit dc8df727a472778a5eaf34663224c9220b44b470 Author: Eike Rathke er...@redhat.com Date: Tue Jun 30 00:22:22 2015 +0200 introduce ScRefUpdateRes UR_STICKY Some callers of ScRefUpdate::Update() rely on a return value !=UR_NOTHING if rows or columns are inserted or deleted or moved, so simply ignoring the entire columns/rows cases is not possible even if the ranges actually don't change. Instead, return UR_STICKY that may allow to further differentiate in future. Change-Id: Iba6c1e5eb1a33d39ef677ef1de2f2d296bf504f1 (cherry picked from commit 9a21a20fb21e22d7a9ab336b41a253fb565eb1b0) diff --git a/sc/source/core/data/bcaslot.cxx b/sc/source/core/data/bcaslot.cxx index f63d7db..2174216 100644 --- a/sc/source/core/data/bcaslot.cxx +++ b/sc/source/core/data/bcaslot.cxx @@ -1069,7 +1069,8 @@ void ScBroadcastAreaSlotMachine::UpdateBroadcastAreas( { aRange = ScRange( theCol1,theRow1,theTab1, theCol2,theRow2,theTab2 ); pArea-UpdateRange( aRange ); -pArea-GetBroadcaster().Broadcast( ScAreaChangedHint( aRange ) ); // for DDE +// For DDE and ScLookupCache +pArea-GetBroadcaster().Broadcast( ScAreaChangedHint( aRange ) ); } // insert to slots diff --git a/sc/source/core/inc/refupdat.hxx b/sc/source/core/inc/refupdat.hxx index 20455ad..84c5eed 100644 --- a/sc/source/core/inc/refupdat.hxx +++ b/sc/source/core/inc/refupdat.hxx @@ -31,7 +31,12 @@ class ScRange; enum ScRefUpdateRes { UR_NOTHING = 0,// keine Anpassungen UR_UPDATED = 1,// Anpassungen erfolgt -UR_INVALID = 2 // Referenz wurde ungueltig +UR_INVALID = 2,// Referenz wurde ungueltig +UR_STICKY = 3 /** Not updated because the reference is sticky, + but would had been updated if it wasn't. For + entire columns/rows. Essentially the same as + not UR_NOTHING for the caller but allows + differentiation. */ }; class ScRefUpdate diff --git a/sc/source/core/tool/lookupcache.cxx b/sc/source/core/tool/lookupcache.cxx index 2d9aca6..8fed640 100644 --- a/sc/source/core/tool/lookupcache.cxx +++ b/sc/source/core/tool/lookupcache.cxx @@ -111,7 +111,7 @@ void ScLookupCache::Notify( const SfxHint rHint ) if (!mpDoc-IsInDtorClear()) { const ScHint* p = dynamic_castconst ScHint*(rHint); -if (p (p-GetId() SC_HINT_DATACHANGED)) +if ((p (p-GetId() SC_HINT_DATACHANGED)) || dynamic_castconst ScAreaChangedHint*(rHint)) { mpDoc-RemoveLookupCache( *this); delete this; diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index 6aa2c3f..8ca5373 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -208,8 +208,7 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo { bool bExpand = pDoc-IsExpandRefs(); if ( nDx (theRow1 = nRow1) (theRow2 = nRow2) -(theTab1 = nTab1) (theTab2 = nTab2) -!(theCol1 == 0 theCol2 == MAXCOL) ) +(theTab1 = nTab1) (theTab2 = nTab2)) { bool bExp = (bExpand IsExpand( theCol1, theCol2, nCol1, nDx )); bCut1 = lcl_MoveStart( theCol1, nCol1, nDx, MAXCOL ); @@ -226,10 +225,15 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo Expand( theCol1, theCol2, nCol1, nDx ); eRet = UR_UPDATED; } +if (eRet != UR_NOTHING oldCol1 == 0 oldCol2 == MAXCOL) +{ +eRet = UR_STICKY; +theCol1 = oldCol1; +theCol2 = oldCol2; +} } if ( nDy (theCol1 = nCol1) (theCol2 = nCol2) -(theTab1 = nTab1) (theTab2 = nTab2) -!(theRow1 == 0 theRow2 == MAXROW) ) +(theTab1 = nTab1) (theTab2 = nTab2)) { bool bExp = (bExpand IsExpand( theRow1, theRow2, nRow1, nDy )); bCut1 = lcl_MoveStart( theRow1, nRow1, nDy, MAXROW ); @@ -246,6 +250,12 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo Expand( theRow1, theRow2, nRow1, nDy ); eRet = UR_UPDATED; } +if (eRet != UR_NOTHING oldRow1 == 0 oldRow2 == MAXROW) +{ +eRet = UR_STICKY; +theRow1 = oldRow1; +theRow2 = oldRow2; +}
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/ui/app/inputwin.cxx |4 1 file changed, 4 insertions(+) New commits: commit bf985aa384e053bc829de4d2ff56ba22049297a8 Author: Katarina Behrens katarina.behr...@cib.de Date: Fri Jun 19 17:07:50 2015 +0200 tdf#83859: Make arrow keys work again in named ranges dropdown Regression from ed6b8c9f8d1b93230 which slightly changed the logic and set bHandled to true by default, thus effectively throwing all key press events except for Enter and Esc away. Set key press events (minus Enter Esc) to bHandled = false and let them fall through to be dealt with in the base class (ComboBox) Change-Id: Ie1d857725a7de1d0bed1fd59df7eef5390ae5f3d Reviewed-on: https://gerrit.libreoffice.org/16407 Reviewed-by: Adolfo Jayme Barrientos fit...@ubuntu.com Tested-by: Adolfo Jayme Barrientos fit...@ubuntu.com diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index 9d35bff..b3776fd 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2505,6 +2505,10 @@ bool ScPosWnd::Notify( NotifyEvent rNEvt ) ReleaseFocus_Impl(); } break; + +default: +bHandled = false; +break; } } break; ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/compiler.cxx | 88 --- 1 file changed, 65 insertions(+), 23 deletions(-) New commits: commit 7511c2af96f9b0a6830c64d6a80cb4d6c8e7af8f Author: Eike Rathke er...@redhat.com Date: Fri Jun 26 17:43:36 2015 +0200 tdf#44419 display entire column/row references as A:A/1:1 ... if both anchors of the other axis are absolute. Now that we can parse them as of commit 0c8778ce1df92ca3bc2a8dd2f64568fb257e9e39 (and follow-up 4091b4fbdce40262eba46ab94653287b1fd928e8). Change-Id: Ie67127fe2d7546e7e598ee1a4d89133c0862 (cherry picked from commit eeea41e2e726dd5d69cd323909e1666efb9de472) diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx index ec2e796..ad5b0ec 100644 --- a/sc/source/core/tool/compiler.cxx +++ b/sc/source/core/tool/compiler.cxx @@ -763,12 +763,25 @@ struct ConventionOOO_A1 : public Convention_A1 rBuf.append('.'); } +enum SingletonDisplay +{ +SINGLETON_NONE, +SINGLETON_COL, +SINGLETON_ROW +}; + static void MakeOneRefStrImpl( OUStringBuffer rBuffer, const OUString rErrRef, const std::vectorOUString rTabNames, const ScSingleRefData rRef, const ScAddress rAbsRef, -bool bForceTab, bool bODF ) +bool bForceTab, bool bODF, SingletonDisplay eSingletonDisplay ) { +// For ODF override singleton so earlier releases still can read what +// we write now as of 2015-06-26. +/* TODO: we may want to change that in future in a few releases. */ +if (bODF) +eSingletonDisplay = SINGLETON_NONE; + if( rRef.IsFlag3D() || bForceTab ) { if (!ValidTab(rAbsRef.Tab()) || rRef.IsTabDeleted()) @@ -787,18 +800,45 @@ struct ConventionOOO_A1 : public Convention_A1 } else if (bODF) rBuffer.append('.'); -if (!rRef.IsColRel()) -rBuffer.append('$'); -if (!ValidCol(rAbsRef.Col()) || rRef.IsColDeleted()) -rBuffer.append(rErrRef); -else -MakeColStr(rBuffer, rAbsRef.Col()); -if (!rRef.IsRowRel()) -rBuffer.append('$'); -if (!ValidRow(rAbsRef.Row()) || rRef.IsRowDeleted()) -rBuffer.append(rErrRef); -else -MakeRowStr(rBuffer, rAbsRef.Row()); + +if (eSingletonDisplay != SINGLETON_ROW) +{ +if (!rRef.IsColRel()) +rBuffer.append('$'); +if (!ValidCol(rAbsRef.Col()) || rRef.IsColDeleted()) +rBuffer.append(rErrRef); +else +MakeColStr(rBuffer, rAbsRef.Col()); +} + +if (eSingletonDisplay != SINGLETON_COL) +{ +if (!rRef.IsRowRel()) +rBuffer.append('$'); +if (!ValidRow(rAbsRef.Row()) || rRef.IsRowDeleted()) +rBuffer.append(rErrRef); +else +MakeRowStr(rBuffer, rAbsRef.Row()); +} +} + +static SingletonDisplay getSingletonDisplay( const ScAddress rAbs1, const ScAddress rAbs2, +const ScComplexRefData rRef ) +{ +// If any part is error, display as such. +if (!ValidCol(rAbs1.Col()) || rRef.Ref1.IsColDeleted() || !ValidRow(rAbs1.Row()) || rRef.Ref1.IsRowDeleted() || +!ValidCol(rAbs2.Col()) || rRef.Ref2.IsColDeleted() || !ValidRow(rAbs2.Row()) || rRef.Ref2.IsRowDeleted()) +return SINGLETON_NONE; + +// A:A or $A:$A or A:$A or $A:A, both row anchors must be absolute. +if (rAbs1.Row() == 0 rAbs2.Row() == MAXROW !rRef.Ref1.IsRowRel() !rRef.Ref2.IsRowRel()) +return SINGLETON_COL; + +// 1:1 or $1:$1 or 1:$1 or $1:1, both column anchors must be absolute. +if (rAbs1.Col() == 0 rAbs2.Col() == MAXCOL !rRef.Ref1.IsColRel() !rRef.Ref2.IsColRel()) +return SINGLETON_ROW; + +return SINGLETON_NONE; } virtual void makeRefStr( OUStringBuffer rBuffer, @@ -809,18 +849,19 @@ struct ConventionOOO_A1 : public Convention_A1 bool bSingleRef, bool /*bFromRangeName*/ ) const SAL_OVERRIDE { -ScComplexRefData aRef( rRef ); // In case absolute/relative positions weren't separately available: // transform relative to absolute! -ScAddress aAbs1 = aRef.Ref1.toAbs(rPos), aAbs2; +ScAddress aAbs1 = rRef.Ref1.toAbs(rPos), aAbs2; if( !bSingleRef ) -aAbs2 = aRef.Ref2.toAbs(rPos); +aAbs2 = rRef.Ref2.toAbs(rPos); -MakeOneRefStrImpl(rBuffer, rErrRef, rTabNames, aRef.Ref1, aAbs1, false, false); +SingletonDisplay eSingleton = bSingleRef ? SINGLETON_NONE : getSingletonDisplay( aAbs1, aAbs2, rRef); +MakeOneRefStrImpl(rBuffer, rErrRef, rTabNames, rRef.Ref1, aAbs1, false, false, eSingleton); if (!bSingleRef) {
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx |4 1 file changed, 4 insertions(+) New commits: commit 627d50e7d432463d6a625ba5b387df7e61e4fc76 Author: Eike Rathke er...@redhat.com Date: Fri Jun 26 16:30:12 2015 +0200 entire rows/cols have absolute col/row anchors, tdf#44419 follow-up Change-Id: I2ae8c1c81734efd7c80558ba5337253985e8e8b7 (cherry picked from commit 4091b4fbdce40262eba46ab94653287b1fd928e8) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index dbcfb15..8ac9d1a 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1491,11 +1491,15 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange rRange, { rRange.aStart.SetRow(0); rRange.aEnd.SetRow(MAXROW); +nRes1 |= SCA_ROW_ABSOLUTE; +nRes2 |= SCA_ROW_ABSOLUTE; } else { rRange.aStart.SetCol(0); rRange.aEnd.SetCol(MAXCOL); +nRes1 |= SCA_COL_ABSOLUTE; +nRes2 |= SCA_COL_ABSOLUTE; } } if (nRes1 nRes2) ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/grouparealistener.cxx | 33 +- 1 file changed, 32 insertions(+), 1 deletion(-) New commits: commit acb543b31dd7fe6c3370acec53e0710ed80a85f6 Author: Eike Rathke er...@redhat.com Date: Sat Jun 27 03:14:05 2015 +0200 tdf#90717 prevent crash, not really fixed Try to resync shared group top and length. Change-Id: I31bd0db7c1dceb880a22274edc4c3f20ce253095 (cherry picked from commit d8541c2a62121894bf87c91f1f89aea1ea30d680) diff --git a/sc/source/core/tool/grouparealistener.cxx b/sc/source/core/tool/grouparealistener.cxx index 46155f9..ac9ea7f 100644 --- a/sc/source/core/tool/grouparealistener.cxx +++ b/sc/source/core/tool/grouparealistener.cxx @@ -194,10 +194,41 @@ void FormulaGroupAreaListener::collectFormulaCells( ScFormulaCell* const * pp = mpColumn-GetFormulaCellBlockAddress( mnTopCellRow, nBlockSize); if (!pp) { -SAL_WARN(sc, GetFormulaCellBlockAddress not found); +SAL_WARN(sc.core, GetFormulaCellBlockAddress not found); return; } +/* FIXME: this is tdf#90717, when deleting a row fixed size area listeners + * such as BCA_ALWAYS or entire row listeners are (rightly) not destroyed, + * but mnTopCellRow and mnGroupLen also not updated, which needs fixing. + * Until then pull things as straight as possible here in such situation + * and prevent crash. */ +if (!(*pp)-IsSharedTop()) +{ +SCROW nRow = (*pp)-GetSharedTopRow(); +if (nRow 0) +SAL_WARN(sc.core, FormulaGroupAreaListener::collectFormulaCells() no shared top); +else +{ + SAL_WARN(sc.core,FormulaGroupAreaListener::collectFormulaCells() syncing mnTopCellRow from +mnTopCellRow to nRow); +const_castFormulaGroupAreaListener*(this)-mnTopCellRow = nRow; +pp = mpColumn-GetFormulaCellBlockAddress( mnTopCellRow, nBlockSize); +if (!pp) +{ +SAL_WARN(sc.core, GetFormulaCellBlockAddress not found); +return; +} +} +} +SCROW nLen = (*pp)-GetSharedLength(); +if (nLen != mnGroupLen) +{ +SAL_WARN(sc.core, FormulaGroupAreaListener::collectFormulaCells() syncing mnGroupLen from +mnGroupLen to nLen); +const_castFormulaGroupAreaListener*(this)-mnGroupLen = nLen; +} + /* FIXME: with tdf#89957 it happened that the actual block size in column * AP (shifted from AO) of sheet 'w' was smaller than the remembered group * length and correct. This is just a very ugly workaround, the real cause ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx |4 ++ sc/source/core/tool/refupdat.cxx | 10 +++-- sc/source/core/tool/token.cxx| 78 ++- 3 files changed, 78 insertions(+), 14 deletions(-) New commits: commit b07e0269e5dc266828c4d621d7daae085d644df4 Author: Eike Rathke er...@redhat.com Date: Sat Jun 27 00:13:20 2015 +0200 tdf#90573 do not shift/move entire col/row references and ranges This gets significant now that we have regular A:A/1:1 references. Change-Id: I6cee35173cb1c13b03f6bf4dfc0dce9949536e23 (cherry picked from commit dc34bb9b05cf7b5261122a73fa9c6f5356802c19) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 8ac9d1a..60d6d2e 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -2116,6 +2116,10 @@ bool ScAddress::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc ) bool ScRange::Move( SCsCOL dx, SCsROW dy, SCsTAB dz, ScDocument* pDoc ) { +if (dy aStart.Row() == 0 aEnd.Row() == MAXROW) +dy = 0; // Entire column not to be moved. +if (dx aStart.Col() == 0 aEnd.Col() == MAXCOL) +dx = 0; // Entire row not to be moved. bool b = aStart.Move( dx, dy, dz, pDoc ); b = aEnd.Move( dx, dy, dz, pDoc ); return b; diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx index a1f39be..6aa2c3f 100644 --- a/sc/source/core/tool/refupdat.cxx +++ b/sc/source/core/tool/refupdat.cxx @@ -208,7 +208,8 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo { bool bExpand = pDoc-IsExpandRefs(); if ( nDx (theRow1 = nRow1) (theRow2 = nRow2) -(theTab1 = nTab1) (theTab2 = nTab2) ) +(theTab1 = nTab1) (theTab2 = nTab2) +!(theCol1 == 0 theCol2 == MAXCOL) ) { bool bExp = (bExpand IsExpand( theCol1, theCol2, nCol1, nDx )); bCut1 = lcl_MoveStart( theCol1, nCol1, nDx, MAXCOL ); @@ -227,7 +228,8 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo } } if ( nDy (theCol1 = nCol1) (theCol2 = nCol2) -(theTab1 = nTab1) (theTab2 = nTab2) ) +(theTab1 = nTab1) (theTab2 = nTab2) +!(theRow1 == 0 theRow2 == MAXROW) ) { bool bExp = (bExpand IsExpand( theRow1, theRow2, nRow1, nDy )); bCut1 = lcl_MoveStart( theRow1, nRow1, nDy, MAXROW ); @@ -272,14 +274,14 @@ ScRefUpdateRes ScRefUpdate::Update( ScDocument* pDoc, UpdateRefMode eUpdateRefMo if ((theCol1 = nCol1-nDx) (theRow1 = nRow1-nDy) (theTab1 = nTab1-nDz) (theCol2 = nCol2-nDx) (theRow2 = nRow2-nDy) (theTab2 = nTab2-nDz)) { -if ( nDx ) +if ( nDx !(theCol1 == 0 theCol2 == MAXCOL) ) { bCut1 = lcl_MoveItCut( theCol1, nDx, MAXCOL ); bCut2 = lcl_MoveItCut( theCol2, nDx, MAXCOL ); if ( bCut1 || bCut2 ) eRet = UR_UPDATED; } -if ( nDy ) +if ( nDy !(theRow1 == 0 theRow2 == MAXROW) ) { bCut1 = lcl_MoveItCut( theRow1, nDy, MAXROW ); bCut2 = lcl_MoveItCut( theRow2, nDy, MAXROW ); diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx index 26c2032..4c041be 100644 --- a/sc/source/core/tool/token.cxx +++ b/sc/source/core/tool/token.cxx @@ -2569,13 +2569,18 @@ void setRefDeleted( ScComplexRefData rRef, const sc::RefUpdateContext rCxt ) } } -bool shrinkRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const ScRange rDeletedRange ) +bool shrinkRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const ScRange rDeletedRange, +const ScComplexRefData rRef ) { if (!rDeletedRange.Intersects(rRefRange)) return false; if (rCxt.mnColDelta 0) { +if (rRef.IsEntireRow()) +// Entire rows are not affected, columns are anchored. +return false; + // Shifting left. if (rRefRange.aStart.Row() rDeletedRange.aStart.Row() || rDeletedRange.aEnd.Row() rRefRange.aEnd.Row()) // Deleted range is only partially overlapping in vertical direction. Bail out. @@ -2614,6 +2619,10 @@ bool shrinkRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const Sc } else if (rCxt.mnRowDelta 0) { +if (rRef.IsEntireCol()) +// Entire columns are not affected, rows are anchored. +return false; + // Shifting up. if (rRefRange.aStart.Col() rDeletedRange.aStart.Col() || rDeletedRange.aEnd.Col() rRefRange.aEnd.Col()) @@ -2655,13 +2664,18 @@ bool shrinkRange( const sc::RefUpdateContext rCxt, ScRange rRefRange, const Sc return false; } -bool expandRange( const
[Libreoffice-commits] core.git: Branch 'libreoffice-5-0' - sc/source
sc/source/core/tool/address.cxx | 46 1 file changed, 42 insertions(+), 4 deletions(-) New commits: commit 7f939c3e6edb86f0b7e66e06dff8743830c18ef9 Author: Eike Rathke er...@redhat.com Date: Fri Jun 26 15:12:46 2015 +0200 tdf#44419 allow A:A and 1:1 references also in Calc A1 and ODF syntax They still get displayed as A1:A1048576 and A1:AMJ1 but are accepted as input. Change-Id: I6a44ce56767695af874e9f5122501a4c7925b0d6 (cherry picked from commit 0c8778ce1df92ca3bc2a8dd2f64568fb257e9e39) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index 18087a4..dbcfb15 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1031,14 +1031,21 @@ static sal_uInt16 lcl_ScRange_Parse_XL_A1( ScRange r, /** @param ppointer to null-terminated sal_Unicode string +@param rRawRes returns SCA_... flags without the final check for full +validity that is applied to the return value, with which +two addresses that form a column or row singleton range, +e.g. A:A or 1:1, can be detected. Used in +lcl_ScRange_Parse_OOo(). @param pRange pointer to range where rAddr effectively is *pRange-aEnd, used in conjunction with pExtInfo to determine the tab span of a 3D reference. */ static sal_uInt16 lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDoc, ScAddress rAddr, + sal_uInt16 rRawRes, ScAddress::ExternalInfo* pExtInfo = NULL, ScRange* pRange = NULL ) { sal_uInt16 nRes = 0; +rRawRes = 0; OUString aDocName; // the pure Document Name OUString aTab; boolbExtDoc = false; @@ -1263,6 +1270,8 @@ static sal_uInt16 lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDo } } +rRawRes |= nRes; + if ( !(nRes SCA_VALID_ROW) (nRes SCA_VALID_COL) !( (nRes SCA_TAB_3D) (nRes SCA_VALID_TAB)) ) { // no Row, no Tab, but Col = DM (...), B (...) et al @@ -1309,7 +1318,8 @@ static sal_uInt16 lcl_ScAddress_Parse ( const sal_Unicode* p, ScDocument* pDoc, default : case formula::FormulaGrammar::CONV_OOO: { -return lcl_ScAddress_Parse_OOo( p, pDoc, rAddr, pExtInfo, NULL ); +sal_uInt16 nRawRes = 0; +return lcl_ScAddress_Parse_OOo( p, pDoc, rAddr, nRawRes, pExtInfo, NULL ); } } } @@ -1460,10 +1470,35 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange rRange, OUStringBuffer aTmp(r); aTmp[nPos] = 0; const sal_Unicode* p = aTmp.getStr(); -if( (nRes1 = lcl_ScAddress_Parse_OOo( p, pDoc, rRange.aStart, pExtInfo, NULL ) ) != 0 ) +sal_uInt16 nRawRes1 = 0; +if (((nRes1 = lcl_ScAddress_Parse_OOo( p, pDoc, rRange.aStart, nRawRes1, pExtInfo, NULL)) != 0) || +((nRawRes1 (SCA_VALID_COL | SCA_VALID_ROW)) (nRawRes1 SCA_VALID_TAB))) { rRange.aEnd = rRange.aStart; // sheet must be initialized identical to first sheet -if ( (nRes2 = lcl_ScAddress_Parse_OOo( p + nPos+ 1, pDoc, rRange.aEnd, pExtInfo, rRange ) ) != 0 ) +sal_uInt16 nRawRes2 = 0; +nRes2 = lcl_ScAddress_Parse_OOo( p + nPos+ 1, pDoc, rRange.aEnd, nRawRes2, pExtInfo, rRange); +if (!((nRes1 SCA_VALID) (nRes2 SCA_VALID)) +// If not fully valid addresses, check if both have a valid +// column or row, and both have valid (or omitted) sheet references. +(nRawRes1 (SCA_VALID_COL | SCA_VALID_ROW)) (nRawRes1 SCA_VALID_TAB) +(nRawRes2 (SCA_VALID_COL | SCA_VALID_ROW)) (nRawRes2 SCA_VALID_TAB) +// Both must be column XOR row references, A:A or 1:1 but not A:1 or 1:A +((nRawRes1 (SCA_VALID_COL | SCA_VALID_ROW)) == (nRawRes2 (SCA_VALID_COL | SCA_VALID_ROW +{ +nRes1 = nRawRes1 | SCA_VALID; +nRes2 = nRawRes2 | SCA_VALID; +if (nRawRes1 SCA_VALID_COL) +{ +rRange.aStart.SetRow(0); +rRange.aEnd.SetRow(MAXROW); +} +else +{ +rRange.aStart.SetCol(0); +rRange.aEnd.SetCol(MAXCOL); +} +} +if (nRes1 nRes2) { // PutInOrder / Justify sal_uInt16 nMask, nBits1, nBits2; @@ -1503,7 +1538,10 @@ static sal_uInt16 lcl_ScRange_Parse_OOo( ScRange rRange, nRes2 |= SCA_TAB_ABSOLUTE; } else -nRes1 = 0; // keine Tokens aus halben Sachen +{ +