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

2018-09-04 Thread Libreoffice Gerrit user
 sc/source/core/data/dptabres.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 6ee76d210846b84e93420a321c7908721ffe9e43
Author: Caolán McNamara 
AuthorDate: Sun Sep 2 21:20:40 2018 +0100
Commit: Michael Stahl 
CommitDate: Tue Sep 4 14:20:23 2018 +0200

ofz#10189 check container size

Change-Id: Ie99e3b082795989290799d057a99b1bcff94b161
Reviewed-on: https://gerrit.libreoffice.org/59913
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index 2389e3d91dd0..e5198b4f2336 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -2863,10 +2863,14 @@ void ScDPResultDimension::LateInitFrom(
 {
 if ( rParams.IsEnd( nPos ) )
 return;
-OSL_ENSURE( nPos <= pItemData.size(), 
OString::number(pItemData.size()).getStr() );
+if (nPos >= pItemData.size())
+{
+SAL_WARN("sc.core", "pos " << nPos << ", but vector size is " << 
pItemData.size());
+return;
+}
+SCROW rThisData = pItemData[nPos];
 ScDPDimension* pThisDim = rParams.GetDim( nPos );
 ScDPLevel* pThisLevel = rParams.GetLevel( nPos );
-SCROW rThisData = pItemData[nPos];
 
 if (!pThisDim || !pThisLevel)
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-31 Thread Libreoffice Gerrit user
 sc/source/core/data/document.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9858b7004856a632778dde0dc7edddb14b673194
Author: Michael Weghorn 
AuthorDate: Thu Aug 30 12:59:06 2018 +0200
Commit: Eike Rathke 
CommitDate: Fri Aug 31 20:37:28 2018 +0200

tdf#112454 Also consider last SCTAB in loop

Since 'rRange.aEnd.Tab()' is valid, it needs to
be included in the loop to get a valid result.

Reviewed-on: https://gerrit.libreoffice.org/59798
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 
(cherry picked from commit 03b361673d04f31e0602d2988e4df26eaeb53a34)

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

Backported.

Change-Id: I7b2447e059dc03444c56e7fc0b113e1b618dd510
Reviewed-on: https://gerrit.libreoffice.org/59878
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 2d1834d57cd9..941657c0545b 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -6725,7 +6725,7 @@ bool ScDocument::ContainsNotesInRange( const ScRangeList& 
rRange ) const
 for( size_t i = 0; i < rRange.size(); ++i)
 {
 const ScRange* pRange = rRange[i];
-for( SCTAB nTab = pRange->aStart.Tab(); nTab < pRange->aEnd.Tab(); 
++nTab )
+for( SCTAB nTab = pRange->aStart.Tab(); nTab <= pRange->aEnd.Tab(); 
++nTab )
 {
 bool bContainsNote = maTabs[nTab]->ContainsNotesInRange( *pRange );
 if(bContainsNote)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-23 Thread Libreoffice Gerrit user
 sc/source/core/data/conditio.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6d6136398afd1581c6292ba8091c3c5186eaf4b1
Author: Eike Rathke 
AuthorDate: Wed Aug 22 20:00:16 2018 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Aug 23 12:35:41 2018 +0200

Resolves: tdf#119402 +- typo sign flip

Regression from

commit 667aa6ade94a4dee441868d21db037e42c871932
CommitDate: Wed Jul 19 20:13:58 2017 +0200

Avoid temporary Date and normalization

that introduced a sign flip
from+  5 - eDay
to  + (5 + eDay)
instead of  + (5 - eDay)

Change-Id: I28194296b20552135e6abd24eb9eefe8634ce7c0
Reviewed-on: https://gerrit.libreoffice.org/59461
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit cadd6c595b250b3ce0025a2a09c160eaae483d5a)
Reviewed-on: https://gerrit.libreoffice.org/59475
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 2b55201d8359..eca7064b0119 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1672,7 +1672,7 @@ bool ScCondDateFormatEntry::IsValid( const ScAddress& 
rPos ) const
 if( eDay != SUNDAY )
 {
 Date aBegin(rActDate - (1 + static_cast(eDay)));
-Date aEnd(rActDate + (5 + static_cast(eDay)));
+Date aEnd(rActDate + (5 - static_cast(eDay)));
 return aCellDate.IsBetween( aBegin, aEnd );
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-22 Thread Libreoffice Gerrit user
 sc/source/core/tool/token.cxx |   13 +
 1 file changed, 5 insertions(+), 8 deletions(-)

New commits:
commit 211e4a9e03ef5f1c7c26617859435285d2699339
Author: Eike Rathke 
AuthorDate: Fri Aug 17 12:22:09 2018 +0200
Commit: Caolán McNamara 
CommitDate: Wed Aug 22 09:33:28 2018 +0200

Resolves: tdf#118983 do not expand range if sheet references not affected

Change-Id: Ib207d3723ce1d370a953e652957aaed399affc9c
Reviewed-on: https://gerrit.libreoffice.org/59255
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit da0dc858fc05e7f1d6a60ca61f722044e688d4f8)
Reviewed-on: https://gerrit.libreoffice.org/59272
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 089ed5b5f48d..56e21d19625e 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3900,6 +3900,11 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
 {
 ScComplexRefData& rRef = *p->GetDoubleRef();
 ScRange aAbs = rRef.toAbs(rPos);
+
+if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || 
aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab())
+// Sheet references not affected.
+break;
+
 if (rCxt.maRange.In(aAbs))
 {
 // This range is entirely within the shifted 
region.
@@ -3922,10 +3927,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
 // column range of the reference is not 
entirely in the deleted column 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.IncRow(rCxt.mnRowDelta);
 
aDeleted.aEnd.SetRow(aDeleted.aStart.Row()-rCxt.mnRowDelta-1);
@@ -3982,10 +3983,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
 // 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);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-17 Thread Libreoffice Gerrit user
 sc/source/ui/app/inputhdl.cxx |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

New commits:
commit 319db92f96c9b886cecee97136175e12e94da547
Author: Maxim Monastirsky 
AuthorDate: Mon Aug 6 23:50:21 2018 +0300
Commit: Eike Rathke 
CommitDate: Fri Aug 17 19:41:10 2018 +0200

tdf#119128 toggle INSERT/OVERWRITE is broken

Regression of 632bc11ce8fab1c4046ab24810b90a7ce9ac5914
("tdf#117017 Pasting into the formula bar shouldn't
retain formatting"). Toggling the overwrite mode sets
the EVControlBits::OVERWRITE bit from inside the editeng
keyboard handler, so make sure to not override it.

Change-Id: I2b5e3fe9cb885ed20e7528fdfe2fd59f5ef05f42
Reviewed-on: https://gerrit.libreoffice.org/58658
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 
(cherry picked from commit 92a4e4eac7520541a433e40836cafa4e29edf47f)
Reviewed-on: https://gerrit.libreoffice.org/58718
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 90c1fbc59437..f7bfb702896b 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3397,15 +3397,14 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, 
bool bStartEdit /* = false
 {
 if (pTableView)
 {
-EVControlBits nControl = pTableView->GetControlWord();
 if (pTopView)
-pTableView->SetControlWord(nControl | 
EVControlBits::SINGLELINEPASTE);
+
pTableView->SetControlWord(pTableView->GetControlWord() | 
EVControlBits::SINGLELINEPASTE);
 
 vcl::Window* pFrameWin = pActiveViewSh ? 
pActiveViewSh->GetFrameWin() : nullptr;
 if ( pTableView->PostKeyEvent( rKEvt, pFrameWin ) )
 bUsed = true;
 
-pTableView->SetControlWord(nControl);
+
pTableView->SetControlWord(pTableView->GetControlWord() & 
~EVControlBits::SINGLELINEPASTE);
 }
 if (pTopView)
 if ( pTopView->PostKeyEvent( rKEvt ) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-17 Thread Libreoffice Gerrit user
 sc/source/ui/view/viewfunc.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit fb63a622cb843d2d0178bc26ff35d9b17deaee5a
Author: Julien Nabet 
AuthorDate: Tue Aug 14 22:01:42 2018 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 17 14:10:22 2018 +0200

Related tdf#118547: Lock mark on protected sheet tab

Fix opposite case, see 
https://bugs.documentfoundation.org/show_bug.cgi?id=118547#c10

Reviewed-on: https://gerrit.libreoffice.org/59035
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit d064ced9e9db3f924dd954b86c40f21addab1c68)

Change-Id: I2c4e55f8929b1979e71a4040dfac1ba7cff51aeb
Reviewed-on: https://gerrit.libreoffice.org/59041
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 3f6e583c6f60..435a5a6f1ad5 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2541,7 +2541,11 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& 
rPassword )
 bool bUndo (rDoc.IsUndoEnabled());
 
 if ( nTab == TABLEID_DOC || rMark.GetSelectCount() <= 1 )
+{
 bChanged = rFunc.Unprotect( nTab, rPassword, false );
+if (bChanged && nTab != TABLEID_DOC)
+SetTabProtectionSymbol(nTab, false);
+}
 else
 {
 //  modifying several tabs is handled here
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-15 Thread Libreoffice Gerrit user
 sc/source/ui/unoobj/PivotTableDataProvider.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ff16f75a474533187253a190557d6e2195a7e4cb
Author: Caolán McNamara 
AuthorDate: Wed Aug 15 10:42:33 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Wed Aug 15 14:10:37 2018 +0200

tdf#115086 crash in assignLabelsToDataSequence

since...

commit c45358e928b9b9419bba10a0fcb661696cb7647a
Date:   Mon Apr 24 00:09:08 2017 +0200

preserve "Total" label on round-trip, remove code duplication

Change-Id: I83ed20e1cab8d67f2f5aedcaf862756d9548bf9f
Reviewed-on: https://gerrit.libreoffice.org/59062
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx 
b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index cfdea1bed39e..12f432a19085 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -617,7 +617,7 @@ PivotTableDataProvider::assignLabelsToDataSequence(size_t 
nIndex)
 {
 aLabel = ScGlobal::GetRscString(STR_PIVOT_TOTAL);
 }
-else
+else if (nIndex < m_aLabels.size())
 {
 for (ValueAndFormat const & rItem : m_aLabels[nIndex])
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-15 Thread Libreoffice Gerrit user
 sc/source/ui/app/inputhdl.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d1ce7f60c7ce7721a41093bebcbe7e87cb800688
Author: Caolán McNamara 
AuthorDate: Wed Aug 15 09:11:26 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Wed Aug 15 14:09:43 2018 +0200

Resolves: tdf#118609 crash in calc after some manipulation through basic

Change-Id: I518b15359b29c845604d2e9cde64bdb637078ba1
Reviewed-on: https://gerrit.libreoffice.org/59054
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index da4be2812150..90c1fbc59437 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1908,7 +1908,7 @@ void ScInputHandler::SetInputWindow(  ScInputWindow* pNew 
)
 
 void ScInputHandler::StopInputWinEngine( bool bAll )
 {
-if (pInputWin)
+if (pInputWin && !pInputWin->IsDisposed())
 pInputWin->StopEditEngine( bAll );
 
 pTopView = nullptr; // invalid now
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-25 Thread Libreoffice Gerrit user
 sc/source/filter/rtf/eeimpars.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d909146913c762c2cdb6bed52fbbd817c05681e9
Author: Caolán McNamara 
AuthorDate: Tue Jul 24 14:20:20 2018 +0100
Commit: Eike Rathke 
CommitDate: Thu Jul 26 00:35:46 2018 +0200

ofz#9431 don't check attribs of Invalid column

Change-Id: I9c5adcadfa2a8593ff90622449d6bdfa4810f2c0
Reviewed-on: https://gerrit.libreoffice.org/57917
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/filter/rtf/eeimpars.cxx 
b/sc/source/filter/rtf/eeimpars.cxx
index a3af0cb868b7..1518e56e419f 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -156,7 +156,7 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, 
double nOutputFactor, SvNu
 SCCOL nCol = nStartCol + pE->nCol + nMergeColAdd;
 // Determine RowMerge
 // Pure ColMerge and ColMerge of the first MergeRow already done 
during parsing
-if ( nRow <= nOverlapRowMax )
+if (nRow <= nOverlapRowMax && ValidCol(nCol))
 {
 while ( nCol <= MAXCOL && mpDoc->HasAttrib( nCol, nRow, nTab,
 nCol, nRow, nTab, HasAttrFlags::Overlapped ) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-08 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |   36 +++-
 1 file changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 8f3515b5e54dabb08ddb01253d9503e9c16cfebe
Author: Eike Rathke 
Date:   Sat Jul 7 23:00:50 2018 +0200

Resolves: tdf#118561 handle external references as jump matrix result

Change-Id: I0381179347960293f5d470ed231d626cb6707b5a
Reviewed-on: https://gerrit.libreoffice.org/57144
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit a5b9bb7be70c7aec2388199e68a0cf86dd220955)
Reviewed-on: https://gerrit.libreoffice.org/57148
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 49c7d009f05a..cb0ac61a3cc6 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -714,10 +714,44 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
 }
 }
 break;
+case svExternalSingleRef:
+{
+ScExternalRefCache::TokenRef pToken;
+PopExternalSingleRef(pToken);
+if (nGlobalError != FormulaError::NONE)
+{
+pJumpMatrix->PutResultDouble( CreateDoubleError( 
nGlobalError), nC, nR );
+nGlobalError = FormulaError::NONE;
+}
+else
+{
+switch (pToken->GetType())
+{
+case svDouble:
+pJumpMatrix->PutResultDouble( 
pToken->GetDouble(), nC, nR );
+break;
+case svString:
+pJumpMatrix->PutResultString( 
pToken->GetString(), nC, nR );
+break;
+case svEmptyCell:
+pJumpMatrix->PutResultEmpty( nC, nR );
+break;
+default:
+// svError was already handled (set by
+// PopExternalSingleRef()) with nGlobalError
+// above.
+assert(!"unhandled svExternalSingleRef case");
+pJumpMatrix->PutResultDouble( 
CreateDoubleError(
+
FormulaError::UnknownStackVariable), nC, nR );
+}
+}
+}
+break;
+case svExternalDoubleRef:
 case svMatrix:
 {   // match matrix offsets
 double fVal;
-ScMatrixRef pMat = PopMatrix();
+ScMatrixRef pMat = GetMatrix();
 if ( nGlobalError != FormulaError::NONE )
 {
 fVal = CreateDoubleError( nGlobalError );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-08 Thread Eike Rathke
 sc/source/ui/undo/undotab.cxx  |2 ++
 sc/source/ui/view/viewfunc.cxx |   13 +
 2 files changed, 11 insertions(+), 4 deletions(-)

New commits:
commit dc9c326c378f252df83aa90a61df51a60d574c8c
Author: Eike Rathke 
Date:   Fri Jul 6 20:09:55 2018 +0200

tdf#118547: Remove lock mark only if password is correct, tdf#95880 
follow-up

 This is a combination of 3 commits.

tdf#118547: Remove lock mark only if password is correct

Reviewed-on: https://gerrit.libreoffice.org/57044
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit c3a732a11c320b98e31dad79f421d4d73f33a15b)

Related: tdf#118547 handle multi-sheet un-/protect, tdf#95880 follow-up

Also don't attempt to remove a lock for TABLEID_DOC that is not a
sheet.

Reviewed-on: https://gerrit.libreoffice.org/57060
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7eba8e98508d547f43fecbe3175a11a05956b30a)

Handle protection lock mark in Undo/Redo, tdf#68290 follow-up

Reviewed-on: https://gerrit.libreoffice.org/57063
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 6fb449d127d1da165f610c4c99c2c7d9c5afbb97)

Change-Id: I9f5731dfaaf9b4cc67e600a8b1c01709e7c9ba99
28775a068215a59063ed95fd141e125cf2155aa7
c88cb375f9f6030c9268fca84de7a5434bb82dc1
Reviewed-on: https://gerrit.libreoffice.org/57091
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index db0c34d0568c..f8bd5dc6940b 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -1254,6 +1254,8 @@ void ScUndoTabProtect::DoProtect(bool bProtect)
 ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 if (pViewShell)
 {
+if (ScTabView* pTabView = pViewShell->GetViewData().GetView())
+pTabView->SetTabProtectionSymbol( mnTab, bProtect);
 pViewShell->UpdateLayerLocks();
 pViewShell->UpdateInputHandler(true);   // so that input can be 
immediately entered again
 }
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 27e9ad05d738..3f6e583c6f60 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2489,12 +2489,14 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const 
ScTableProtection& rProtect )
 
 ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
 for (; itr != itrEnd; ++itr)
+{
 rFunc.ProtectSheet(*itr, rProtect);
+SetTabProtectionSymbol(*itr, true);
+}
 
 if (bUndo)
 pDocSh->GetUndoManager()->LeaveListAction();
 
-SetTabProtectionSymbol(nTab, true);
 UpdateLayerLocks(); //! broadcast to all views
 }
 
@@ -2552,15 +2554,18 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& 
rPassword )
 
 ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
 for (; itr != itrEnd; ++itr)
+{
 if ( rFunc.Unprotect( *itr, rPassword, false ) )
-bChanged = true;
+{
+bChanged = true;
+SetTabProtectionSymbol( *itr, false);
+}
+}
 
 if (bUndo)
 pDocSh->GetUndoManager()->LeaveListAction();
 }
 
-SetTabProtectionSymbol(nTab, false);
-
 if (bChanged)
 UpdateLayerLocks(); //! broadcast to all views
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-04 Thread Gabor Kelemen
 sc/source/ui/optdlg/tpcalc.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 41a780a589151afa1159403231c59c57bc8a1bc8
Author: Gabor Kelemen 
Date:   Tue Jul 3 07:41:47 2018 +0200

tdf#118452 Don't crash when multi thread calculation is disabled

...by default configuration.

Change-Id: If6075ae66537f613434dd38766324436f2426517
Reviewed-on: https://gerrit.libreoffice.org/56840
Tested-by: Jenkins
Reviewed-by: Andras Timar 
(cherry picked from commit e119194aeec907f3d02cb914e5afde5ac763df7c)
Reviewed-on: https://gerrit.libreoffice.org/56856

diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 4ec601a23ac6..764d55d98e57 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -183,7 +183,7 @@ void ScTpCalcOptions::Reset( const SfxItemSet* /* 
rCoreAttrs */ )
 m_pEdPrec->SetValue(nPrec);
 }
 
-m_pBtnThread->Enable();
+m_pBtnThread->Enable( 
!officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::isReadOnly()
 );
 m_pBtnThread->Check( 
officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get()
 );
 
 CheckClickHdl(m_pBtnIterate);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-20 Thread Dennis Francis
 sc/source/core/data/column.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 8ea1e4e4a47b0a1b0cf3dfcb0b1e2a32f0db3d88
Author: Dennis Francis 
Date:   Mon Jun 18 08:14:24 2018 +0530

tdf#118189 : Propagate the state of mbNeedsNumberFormat...

from source formula-cell to destination while calling
SetFormulaCell() on dest formula-cell in CopyByCloneHandler
CopyByCloneHandler get called when some data range is pasted
to a document, or when data is copied to an undo document.

This is a follow-up of the commit
37f6e5de1e72d209b0892734f4de5c4d8a849885
(tdf#114710 : Fixes crash when pasting as GDI metafile)

Change-Id: I936310f13080f2de763ebcd5cb046a25d61d978e
Reviewed-on: https://gerrit.libreoffice.org/55975
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 67c88e284af74c88e37cc8f66cdfc0e346de45ac)
Reviewed-on: https://gerrit.libreoffice.org/56134

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 73afe1a810f8..03dea4fcc50b 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1430,7 +1430,7 @@ class CopyByCloneHandler
 // Clone as formula cell.
 ScFormulaCell* pCell = new ScFormulaCell(rSrcCell, 
mrDestCol.GetDoc(), aDestPos, mnFormulaCellCloneFlags);
 pCell->SetDirtyVar();
-mrDestCol.SetFormulaCell(maDestPos, nRow, pCell, meListenType);
+mrDestCol.SetFormulaCell(maDestPos, nRow, pCell, meListenType, 
rSrcCell.NeedsNumberFormat());
 setDefaultAttrToDest(nRow);
 return;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-14 Thread Eike Rathke
 sc/source/core/tool/interpr6.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 32bcda269b07a88cecbb5a2fde10d4b4d7ce7538
Author: Eike Rathke 
Date:   Thu Jun 14 15:00:14 2018 +0200

Resolves: tdf#118161 use ScCellIterator::isEmpty() for COUNTA()

... instead of hasEmptyData() that considers inherited svEmptyCell
as well.

Effectively a regression from

commit 0e9e3be6f51436c1e5bf1481a434a85e334c09ea
CommitDate: Tue Mar 26 01:41:17 2013 -0400

More on ScCellIterator usage migration.

that started to include mpCurFormula->IsEmpty() in
ScCellIterator::isEmpty() which later was renamed to
ScCellIterator::hasEmptyData() and isEmpty() introduced for real
empty.

Change-Id: Iec97d58080016c28bc9a7e47d056e4d301263928
(cherry picked from commit cfe2e4eb835c06b24adabd60c7a3fddbd3f4dbc9)
Reviewed-on: https://gerrit.libreoffice.org/55804
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 449375638cb5..c93511e23444 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -809,7 +809,7 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, 
bool bTextAsZero )
 ScCellIterator aIter( pDok, aRange, mnSubTotalFlags );
 for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
 {
-if ( !aIter.hasEmptyData() )
+if ( !aIter.isEmpty() )
 {
 ++nCount;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-14 Thread Caolán McNamara
 sc/source/ui/dbgui/PivotLayoutDialog.cxx   |2 ++
 sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx |   22 ++
 sc/source/ui/inc/PivotLayoutDialog.hxx |2 ++
 sc/source/ui/inc/PivotLayoutTreeListBase.hxx   |3 +++
 4 files changed, 29 insertions(+)

New commits:
commit da8401de3c692514b6b4671fab3bb5562e88aa19
Author: Caolán McNamara 
Date:   Wed Jun 6 12:17:59 2018 +0100

tdf#116552 restore copy on focus and jump focus to source

This is surely an utter abuse of focus and an a11y disaster, but it
used to work this way.

Change-Id: I265a2bafbc2cdd17ff4a5b7c2805def63c510d5c
Reviewed-on: https://gerrit.libreoffice.org/55375
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/dbgui/PivotLayoutDialog.cxx 
b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
index 129969c926f3..70f436c0396e 100644
--- a/sc/source/ui/dbgui/PivotLayoutDialog.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutDialog.cxx
@@ -71,6 +71,7 @@ ScPivotLayoutDialog::ScPivotLayoutDialog(
 ScViewData* pViewData, const ScDPObject* 
pPivotTableObject, bool bNewPivotTable) :
 ScAnyRefDlg   (pSfxBindings, pChildWindow, pParent, 
"PivotTableLayout", "modules/scalc/ui/pivottablelayoutdialog.ui"),
 maPivotTableObject(*pPivotTableObject),
+mpPreviouslyFocusedListBox(nullptr),
 mpViewData(pViewData),
 mpDocument(pViewData->GetDocument()),
 mbNewPivotTable   (bNewPivotTable),
@@ -188,6 +189,7 @@ ScPivotLayoutDialog::~ScPivotLayoutDialog()
 
 void ScPivotLayoutDialog::dispose()
 {
+mpPreviouslyFocusedListBox.clear();
 mpListBoxField.clear();
 mpListBoxPage.clear();
 mpListBoxColumn.clear();
diff --git a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx 
b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
index 236a939655ca..d6512365197b 100644
--- a/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
+++ b/sc/source/ui/dbgui/PivotLayoutTreeListBase.cxx
@@ -117,4 +117,26 @@ void ScPivotLayoutTreeListBase::RemoveEntryForItem(const 
ScItemValue* pItemValue
 }
 }
 
+void ScPivotLayoutTreeListBase::GetFocus()
+{
+SvTreeListBox::GetFocus();
+
+if (!mpParent || !mpParent->mpPreviouslyFocusedListBox)
+return;
+
+if (GetGetFocusFlags() & GetFocusFlags::Mnemonic)
+{
+SvTreeListEntry* pEntry = 
mpParent->mpPreviouslyFocusedListBox->GetCurEntry();
+if (pEntry)
+InsertEntryForSourceTarget(pEntry, nullptr);
+mpParent->mpPreviouslyFocusedListBox->GrabFocus();
+}
+}
+
+void ScPivotLayoutTreeListBase::LoseFocus()
+{
+SvTreeListBox::LoseFocus();
+if (mpParent)
+mpParent->mpPreviouslyFocusedListBox = this;
+}
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/PivotLayoutDialog.hxx 
b/sc/source/ui/inc/PivotLayoutDialog.hxx
index 25f12db90e5d..96d6218adb3d 100644
--- a/sc/source/ui/inc/PivotLayoutDialog.hxx
+++ b/sc/source/ui/inc/PivotLayoutDialog.hxx
@@ -42,6 +42,8 @@ class ScPivotLayoutDialog : public ScAnyRefDlg
 public:
 ScDPObject maPivotTableObject;
 
+VclPtr mpPreviouslyFocusedListBox;
+
 private:
 ScViewData* mpViewData;
 ScDocument* mpDocument;
diff --git a/sc/source/ui/inc/PivotLayoutTreeListBase.hxx 
b/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
index 41ff3a344909..b651f7e132af 100644
--- a/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
+++ b/sc/source/ui/inc/PivotLayoutTreeListBase.hxx
@@ -53,6 +53,9 @@ public:
  SvTreeListEntry* pEntry) override;
 virtual void DragFinished(sal_Int8 nDropAction) override;
 
+virtual void GetFocus() override;
+virtual void LoseFocus() override;
+
 void PushEntriesToPivotFieldVector(ScPivotFieldVector& rVector);
 
 void RemoveEntryForItem(const ScItemValue* pItemValue);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-05 Thread Noel Grandin
 sc/source/core/data/table2.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit c30963b8b4bbbe42a24b97aafa161eff9d7ccdd4
Author: Noel Grandin 
Date:   Thu May 10 10:56:27 2018 +0200

tdf#117522 Calc Column Width after Insert Columns

regression from
commit d6fb5ca5661195520ca7a7ca2d0145a1e11be099
dyncolcontainer: use ScCompressedArray for pColWidth

Change-Id: I65d1197c0c638216e063f74def4efb98bfbb9aad
Reviewed-on: https://gerrit.libreoffice.org/54067
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
(cherry picked from commit a111a7ba4067dc11070c4b1ab6eb24cc89263770)
Reviewed-on: https://gerrit.libreoffice.org/55119
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index b7b169e418b8..4be3a7ec6840 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -284,6 +284,9 @@ void ScTable::InsertCol(
 if (mpColWidth && mpColFlags)
 {
 mpColWidth->InsertPreservingSize(nStartCol, nSize, STD_COL_WIDTH);
+// The inserted columns have the same widths as the columns, which 
were selected for insert.
+for (SCSIZE i=0; i < std::min(MAXCOL-nSize-nStartCol, nSize); ++i)
+mpColWidth->SetValue(nStartCol + i, 
mpColWidth->GetValue(nStartCol+i+nSize));
 mpColFlags->InsertPreservingSize(nStartCol, nSize, CRFlags::NONE);
 }
 if (pOutlineTable)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-05 Thread Eike Rathke
 sc/source/core/tool/compiler.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit 2f923aa12e2cbb759e504e06dd3efdfd9e552d34
Author: Eike Rathke 
Date:   Mon Jun 4 23:05:59 2018 +0200

Resolves: tdf#117879 preserve formula after inline array error

Use FormulaError::NestedArray for now to be able to backport
without new string resources. Introduce a more specific error in
another change.

Change-Id: I49bf731f0b17c81dc6a125718bf104e218e508cc
Reviewed-on: https://gerrit.libreoffice.org/55300
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit 2d330a5c48fd200db10fba7c40688221185c2dec)
Reviewed-on: https://gerrit.libreoffice.org/55308
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index cf1a5b0eb01a..9e9edb77dc7a 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4577,7 +4577,14 @@ ScTokenArray* ScCompiler::CompileString( const OUString& 
rFormula )
 }
 }
 FormulaToken* pNewToken = static_cast(pArr)->Add( 
maRawToken.CreateToken());
-if (!pNewToken)
+if (!pNewToken && eOp == ocArrayClose && pArr->OpCodeBefore( 
pArr->GetLen()) == ocArrayClose)
+{
+// Nested inline array or non-value/non-string in array. The
+// original tokens are still in the ScTokenArray and not merged
+// into an ScMatrixToken. Set error but keep on tokenizing.
+SetError( FormulaError::NestedArray);
+}
+else if (!pNewToken)
 {
 SetError(FormulaError::CodeOverflow);
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-29 Thread Armin Le Grand
 sc/source/ui/view/output.cxx |   21 +++--
 1 file changed, 15 insertions(+), 6 deletions(-)

New commits:
commit 08e45e11a0e74cdb4a17ec29df9d03ad03b7f7c0
Author: Armin Le Grand 
Date:   Thu Apr 19 18:56:55 2018 +0200

tdf#115582 Correct coordinate usage for sc's ::Array

In ScOutputData::SetCellRotations() eventually existing
CellRotations are added to the svx::frame::Array data
that gets created for repaint. This used the wrong coordinate
calculation, thus in some cases the repaint of rotated
Cells failed.

Change-Id: Ib5df8576e8c9404d717d5dcc5662aa04b82cf959
Reviewed-on: https://gerrit.libreoffice.org/53171
Tested-by: Jenkins 
Reviewed-by: Armin Le Grand 
(cherry picked from commit 0185e65bcd73dbad2205a39369e1e06b33a2ca51)
Reviewed-on: https://gerrit.libreoffice.org/54922

diff --git a/sc/source/ui/view/output.cxx b/sc/source/ui/view/output.cxx
index 6e0fa1a77e5c..ac525bb0f803 100644
--- a/sc/source/ui/view/output.cxx
+++ b/sc/source/ui/view/output.cxx
@@ -657,13 +657,22 @@ void ScOutputData::SetCellRotations()
 // Needed for CellInfo internal decisions (bg fill, 
...)
 pInfo->nRotateDir = nDir;
 
-// add rotation info to Array information
-const long 
nAttrRotate(pPattern->GetRotateVal(pCondSet));
-const SvxRotateMode 
eRotMode(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue());
-const double fOrient((bLayoutRTL ? -1.0 : 1.0) * 
nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
-svx::frame::Array& rArray = mrTabInfo.maArray;
+// create target coordinates
+const SCCOL nTargetX(nX - nVisX1 + 1);
+const SCROW nTargetY(nY - nVisY1 + 1);
 
-rArray.SetCellRotation(nX+1, nY+1, eRotMode, fOrient);
+// Check for values - below in SetCellRotation these 
will
+// be converted to size_t and thus may not be negative
+if(nTargetX >= 0 && nTargetY >= 0)
+{
+// add rotation info to Array information
+const long 
nAttrRotate(pPattern->GetRotateVal(pCondSet));
+const SvxRotateMode 
eRotMode(pPattern->GetItem(ATTR_ROTATE_MODE, pCondSet).GetValue());
+const double fOrient((bLayoutRTL ? -1.0 : 1.0) * 
nAttrRotate * F_PI18000); // 1/100th degrees -> [0..2PI]
+svx::frame::Array& rArray = mrTabInfo.maArray;
+
+rArray.SetCellRotation(nTargetX, nTargetY, 
eRotMode, fOrient);
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-18 Thread Eike Rathke
 sc/source/ui/inc/viewdata.hxx  |   12 
 sc/source/ui/view/viewdata.cxx |   34 +-
 2 files changed, 33 insertions(+), 13 deletions(-)

New commits:
commit 3de630074d69517d97c4dc874ad74203d7699e88
Author: Eike Rathke 
Date:   Thu May 17 14:07:16 2018 +0200

Resolves: tdf#117093 sanitize the active grid window value

Don't know yet how that could had happened, but the sample
document has a bad ActiveSplitRange value that doesn't match
HorizontalSplitMode and VerticalSplitMode.

* sanitize the value when reading view settings
* prevent writing such value to help versions that don't sanitize

Change-Id: I1b450c7b8102148a24d545ff7568f725d7492a6a
(cherry picked from commit 646e9564007b13bd841d28e7c02c060d2f96fb39)
Reviewed-on: https://gerrit.libreoffice.org/54504
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 889df879a665..5292f06e8152 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -200,6 +200,18 @@ private:
 voidReadUserDataSequence(
 const css::uno::Sequence & 
rSettings,
 ScViewData& rViewData, SCTAB nTab, bool& rHasZoom);
+
+/** Sanitize the active split range value to not point into a grid window
+that would never be initialized due to non-matching split modes.
+
+This is to be done when reading settings from file formats or
+configurations that could have arbitrary values. The caller is
+reponsible for actually assigning the new value to eWhichActive because
+we want this function to be const to be able to call the check from
+anywhere.
+ */
+SAL_WARN_UNUSED_RESULT ScSplitPos SanitizeWhichActive() const;
+
 public:
 ~ScViewDataTable();
 };
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 64998f7cc2f6..e28704470b4e 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -293,8 +293,12 @@ void ScViewDataTable::WriteUserDataSequence(uno::Sequence 

 pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= 
sal_Int32(nFixPosY);
 else
 pSettings[SC_VERTICAL_SPLIT_POSITION].Value <<= 
sal_Int32(nVSplitPos);
+// Prevent writing odd settings that would make crash versions that
+// don't apply SanitizeWhichActive() when reading the settings.
+// See tdf#117093
+const ScSplitPos eActiveSplitRange = SanitizeWhichActive();
 pSettings[SC_ACTIVE_SPLIT_RANGE].Name = SC_ACTIVESPLITRANGE;
-pSettings[SC_ACTIVE_SPLIT_RANGE].Value <<= sal_Int16(eWhichActive);
+pSettings[SC_ACTIVE_SPLIT_RANGE].Value <<= 
sal_Int16(eActiveSplitRange);
 pSettings[SC_POSITION_LEFT].Name = SC_POSITIONLEFT;
 pSettings[SC_POSITION_LEFT].Value <<= sal_Int32(nPosX[SC_SPLIT_LEFT]);
 pSettings[SC_POSITION_RIGHT].Name = SC_POSITIONRIGHT;
@@ -451,6 +455,7 @@ void ScViewDataTable::ReadUserDataSequence(const 
uno::Sequence GetDrawLayer()->ReadUserDataSequenceValue([i]);
 }
+
 if (eHSplitMode == SC_SPLIT_FIX)
 nFixPosX = SanitizeCol( static_cast( bHasHSplitInTwips ? 
nTempPosHTw : nTempPosH ));
 else
@@ -460,6 +465,20 @@ void ScViewDataTable::ReadUserDataSequence(const 
uno::Sequence ( bHasVSplitInTwips ? 
nTempPosVTw : nTempPosV ));
 else
 nVSplitPos = bHasVSplitInTwips ? static_cast< long >( nTempPosVTw * 
rViewData.GetPPTY() ) : nTempPosV;
+
+eWhichActive = SanitizeWhichActive();
+}
+
+ScSplitPos ScViewDataTable::SanitizeWhichActive() const
+{
+if ((WhichH(eWhichActive) == SC_SPLIT_RIGHT && eHSplitMode == 
SC_SPLIT_NONE) ||
+(WhichV(eWhichActive) == SC_SPLIT_TOP && eVSplitMode == 
SC_SPLIT_NONE))
+{
+SAL_WARN("sc.ui","ScViewDataTable::SanitizeWhichActive - bad 
eWhichActive " << eWhichActive);
+// The default always initialized grid window is SC_SPLIT_BOTTOMLEFT.
+return SC_SPLIT_BOTTOMLEFT;
+}
+return eWhichActive;
 }
 
 ScViewData::ScViewData( ScDocShell* pDocSh, ScTabViewShell* pViewSh ) :
@@ -2776,18 +2795,7 @@ void ScViewData::ReadUserData(const OUString& rData)
 maTabData[nPos]->nPosY[0] = SanitizeRow( 
aTabOpt.getToken(9,cTabSep).toInt32());
 maTabData[nPos]->nPosY[1] = SanitizeRow( 
aTabOpt.getToken(10,cTabSep).toInt32());
 
-// test whether the active part according to SplitMode exists at 
all
-//  (Bug #44516#)
-ScSplitPos eTest = maTabData[nPos]->eWhichActive;
-if ( ( WhichH( eTest ) == SC_SPLIT_RIGHT &&
-maTabData[nPos]->eHSplitMode == SC_SPLIT_NONE ) ||
- ( WhichV( eTest ) == SC_SPLIT_TOP &&
-

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

2018-05-16 Thread Eike Rathke
 sc/source/filter/oox/worksheethelper.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit a49200d976b8dc0a33d5d1f3a3e52bf2e97828f2
Author: Eike Rathke 
Date:   Mon May 14 14:38:36 2018 +0200

Related: tdf#116939 Disable  overflow detection due to excess ...

... custom column widths.

It's probably just confusing to users, even if technically
correct. Live with truncation of a "layout form" if no content is
present.

Change-Id: I43d77c3e019badd053cb21d92aacd64c7bbcf0e6
Reviewed-on: https://gerrit.libreoffice.org/54319
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 
(cherry picked from commit f72bd4f02b70e1c4855795b4237e2965556c4689)
Reviewed-on: https://gerrit.libreoffice.org/54332
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index 6af0e32a1e80..24df7a71a83d 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -772,9 +772,6 @@ void WorksheetGlobals::setColumnModel( const ColumnModel& 
rModel )
 --nLastCol;
 // This is totally fouled up. If we saved 1025 and the file is saved
 // with Excel again, it increments the value to 1026.
-/* TODO: we may have to completely ignore the very last
- *  value and use checkCol(...,false) on
- * that, if it turns out that Excel stores arbitrary columns. */
 else if (nLastCol == mrMaxApiPos.Col() + 2)
 nLastCol -= 2;
 // Excel may add a column range for the remaining columns (with
@@ -784,7 +781,12 @@ void WorksheetGlobals::setColumnModel( const ColumnModel& 
rModel )
 // the range that should be caught anyway.
 else if (nLastCol == getAddressConverter().getMaxXlsAddress().Col())
 nLastCol = mrMaxApiPos.Col();
-else if( !getAddressConverter().checkCol( nLastCol, true ) )
+// User may have applied custom column widths to arbitrary excess
+// columns. Ignore those and don't track as overflow columns (false).
+// Effectively this does the same as the above cases, just keep them
+// for explanation.
+// Actual data present should trigger the overflow detection later.
+else if( !getAddressConverter().checkCol( nLastCol, false ) )
 nLastCol = mrMaxApiPos.Col();
 // try to find entry in column model map that is able to merge with 
the passed model
 bool bInsertModel = true;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-08 Thread Caolán McNamara
 sc/source/ui/view/tabview5.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 34e5922c2dea4bb3a54c3df3822b9d843c5be277
Author: Caolán McNamara 
Date:   Thu May 3 15:08:17 2018 +0100

Resolves: tdf#117005 undo/redo skips comment when switching sheets

while insert comment is active

regression from

commit 80509950d35cebaede89fcb52c446a1fd3e45ba3
Author: Caolán McNamara 
Date:   Mon Jul 4 15:31:29 2016 +0100

Resolves: tdf#100761 after insert note, focus cannot return to inputbar

which is a suspected regression from.

commit 11d605cc5a0c221d2423b6e63f502db660d085d2
Date:   Mon Feb 1 18:39:51 2016 +0200

tdf#84843 Stop using PseudoSlots for drawing slots

Change-Id: Id4614624cbb85411ba0d368ae072a05f5f9e09ad
Reviewed-on: https://gerrit.libreoffice.org/53799
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx
index 005399636816..b36e86271764 100644
--- a/sc/source/ui/view/tabview5.cxx
+++ b/sc/source/ui/view/tabview5.cxx
@@ -372,7 +372,8 @@ void ScTabView::DrawDeselectAll()
 if (pDrawView)
 {
 ScTabViewShell* pViewSh = aViewData.GetViewShell();
-if (pDrawActual && pViewSh->IsDrawTextShell())
+if ( pDrawActual &&
+( pViewSh->IsDrawTextShell() || pDrawActual->GetSlotID() == 
SID_DRAW_NOTEEDIT ) )
 {
 // end text edit (as if escape pressed, in FuDraw)
 aViewData.GetDispatcher().Execute( pDrawActual->GetSlotID(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-05-04 Thread Maxim Monastirsky
 sc/source/ui/app/inputhdl.cxx |6 ++
 sc/source/ui/app/inputwin.cxx |5 +
 sc/source/ui/view/editsh.cxx  |   12 ++--
 3 files changed, 21 insertions(+), 2 deletions(-)

New commits:
commit 599ab0f82ebcb29a5205d77daed72b842e839800
Author: Maxim Monastirsky 
Date:   Sun Apr 15 22:28:32 2018 +0300

tdf#117017 Make modifier keys not trigger the InputChanged handler

(cherry picked from commit a860c94f0da22065074cc36e8ddda73261641533)

sc: Fix menubar auto-accelerator behavior under gtk2

... when the focus is in the input field of the formula bar.
Regression of commit d90dcf3554a84b5600800ee6deb3cde879c62b8d
("tdf#113894 release ctrl of ctrl+v in input line should strip
formatting").

(cherry picked from commit baddcc38dee7b286cc73c1eaeb6f78d10b911a8e)

tdf#117017 Pasting into the formula bar shouldn't retain formatting

This is (kind of) regression from the previous commit
a860c94f0da22065074cc36e8ddda73261641533 ("tdf#117017 Make modifier
keys not trigger the InputChanged handler").

Reset of formatting when pasting into the formula bar via a keyboard
shortcut, was actually a side effect of the gtk auto-accelerator
work. In particual, bibisect (of the 5.2 cycle) points to commit
8d53d01f38b856f177aca3ed4d3cba3db10f24a5 ("tdf#96739: Send Ctrl-Left/
RightShift events to correct window"). The behavior was later changed
back with commit 0321dbb9be72f92c02919457cdc3c4e76cfbd11d
("Resolves: tdf#99324 let sidebar toggle auto-mnemonics on/off with
alt"), but introduced again upon request of tdf#113894, with commit
d90dcf3554a84b5600800ee6deb3cde879c62b8d ("tdf#113894 release ctrl of
ctrl+v in input line should strip formatting"). Now it's broken again
with the previous commit of this bug.

However, even if not retaining formatting is the desired behavior,
triggering it on a modifier key release isn't a good idea. So keep
the previous commit, and implement tdf#113894 differently. In
addition, make sure to get identical behavior regardless of the
pasting method, be it via a keyboard shortcut, a toolbar button or a
menu/context menu command. And users can still override this behavior
with the usual paste special dialog, or the toolbar dropdown.

(cherry picked from commit 632bc11ce8fab1c4046ab24810b90a7ce9ac5914)

Change-Id: Ib05883688ef4143c0b53871c4336920dde6f91cc
Reviewed-on: https://gerrit.libreoffice.org/53144
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 94f3464c783f..da4be2812150 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -3397,9 +3397,15 @@ bool ScInputHandler::KeyInput( const KeyEvent& rKEvt, 
bool bStartEdit /* = false
 {
 if (pTableView)
 {
+EVControlBits nControl = pTableView->GetControlWord();
+if (pTopView)
+pTableView->SetControlWord(nControl | 
EVControlBits::SINGLELINEPASTE);
+
 vcl::Window* pFrameWin = pActiveViewSh ? 
pActiveViewSh->GetFrameWin() : nullptr;
 if ( pTableView->PostKeyEvent( rKEvt, pFrameWin ) )
 bUsed = true;
+
+pTableView->SetControlWord(nControl);
 }
 if (pTopView)
 if ( pTopView->PostKeyEvent( rKEvt ) )
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 6572e0b01d95..4a8ea6ea7ff6 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1425,6 +1425,11 @@ void ScTextWnd::Command( const CommandEvent& rCEvt )
 {
 //don't call InputChanged for CommandEventId::Swipe
 }
+else if ( nCommand == CommandEventId::ModKeyChange )
+{
+//pass alt press/release to parent impl
+Window::Command(rCEvt);
+}
 else
 SC_MOD()->InputChanged( mpEditView.get() );
 }
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index 9cbac20a0fc8..235e9773660c 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -229,10 +229,18 @@ void ScEditShell::Execute( SfxRequest& rReq )
 break;
 
 case SID_PASTE:
-pTableView->PasteSpecial();
+{
+EVControlBits nControl = pTableView->GetControlWord();
 if (pTopView)
+{
 pTopView->Paste();
-break;
+pTableView->SetControlWord(nControl | 
EVControlBits::SINGLELINEPASTE);
+}
+
+ 

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

2018-05-02 Thread Eike Rathke
 sc/source/filter/oox/worksheethelper.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 8a9e5326e77e86de2962ee7569d883091f7fe4c7
Author: Eike Rathke 
Date:   Fri Apr 27 16:10:17 2018 +0200

Resolves: tdf#116939 cater for the last cols col incremented by Excel

Change-Id: I48c4b9afb4cf2cb826ae2bb52067256e7fcb2c83
(cherry picked from commit b78ab482911356ef282f7fd40a4509320608a203)
Reviewed-on: https://gerrit.libreoffice.org/53565
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index aade8b4e88d0..6af0e32a1e80 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -770,6 +770,13 @@ void WorksheetGlobals::setColumnModel( const ColumnModel& 
rModel )
 // checkCol(). Cater for this oddity.
 if (nLastCol == mrMaxApiPos.Col() + 1)
 --nLastCol;
+// This is totally fouled up. If we saved 1025 and the file is saved
+// with Excel again, it increments the value to 1026.
+/* TODO: we may have to completely ignore the very last
+ *  value and use checkCol(...,false) on
+ * that, if it turns out that Excel stores arbitrary columns. */
+else if (nLastCol == mrMaxApiPos.Col() + 2)
+nLastCol -= 2;
 // Excel may add a column range for the remaining columns (with
 // ), even if not used or only used to grey out
 // columns in page break view. Don't let that trigger overflow warning,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-24 Thread Eike Rathke
 sc/source/filter/oox/worksheethelper.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit eeb8ce7d4e008fdc99032e21be655e522bd55c77
Author: Eike Rathke 
Date:   Tue Apr 24 13:10:08 2018 +0200

Related: tdf#116274 ignore the one excess cols definition's last column


  ...
  


may be present even if there isn't any content. Apparently used
with pageBreakPreview to grey out the area.

Change-Id: I6a79f9ec692ec07b02f4b4205ccd0cf3cf9f363f
(cherry picked from commit 16265dcdb21d7cf69c65c2a84f1d21a5d8574dd4)
Reviewed-on: https://gerrit.libreoffice.org/53377
Reviewed-by: Markus Mohrhard 
Tested-by: Jenkins 

diff --git a/sc/source/filter/oox/worksheethelper.cxx 
b/sc/source/filter/oox/worksheethelper.cxx
index c1cdae73e4b1..aade8b4e88d0 100644
--- a/sc/source/filter/oox/worksheethelper.cxx
+++ b/sc/source/filter/oox/worksheethelper.cxx
@@ -770,6 +770,13 @@ void WorksheetGlobals::setColumnModel( const ColumnModel& 
rModel )
 // checkCol(). Cater for this oddity.
 if (nLastCol == mrMaxApiPos.Col() + 1)
 --nLastCol;
+// Excel may add a column range for the remaining columns (with
+// ), even if not used or only used to grey out
+// columns in page break view. Don't let that trigger overflow warning,
+// so check for the last possible column. If there really is content in
+// the range that should be caught anyway.
+else if (nLastCol == getAddressConverter().getMaxXlsAddress().Col())
+nLastCol = mrMaxApiPos.Col();
 else if( !getAddressConverter().checkCol( nLastCol, true ) )
 nLastCol = mrMaxApiPos.Col();
 // try to find entry in column model map that is able to merge with 
the passed model
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-23 Thread Maxim Monastirsky
 sc/source/ui/view/cellsh.cxx   |2 --
 sc/source/ui/view/tabview3.cxx |2 --
 2 files changed, 4 deletions(-)

New commits:
commit a3ea83896f2d3aefa8cd67b3aa54884450999481
Author: Maxim Monastirsky 
Date:   Sun Apr 15 13:15:28 2018 +0300

tdf#116821 Keep row/column buttons enabled even when insert impossible

So other commands included in these buttons (like delete or set height/
width), could still be used.

Change-Id: If9e96116aebf73b2d20fb8d63ee67da3d17e3d9f
Reviewed-on: https://gerrit.libreoffice.org/52909
Tested-by: Jenkins 
Reviewed-by: Maxim Monastirsky 
(cherry picked from commit 3732d5ab1782bbadfee457115fbd8dce78453cc2)
Reviewed-on: https://gerrit.libreoffice.org/53286
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 8167be10088f..acbb5768552b 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -246,7 +246,6 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
 break;
 }
 case FID_INS_CELLSDOWN:
-case SID_ROW_OPERATIONS:
 bDisable = (!bSimpleArea) || GetViewData()->SimpleColMarked();
 break;
 
@@ -267,7 +266,6 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
 break;
 }
 case FID_INS_CELLSRIGHT:
-case SID_COLUMN_OPERATIONS:
 bDisable = (!bSimpleArea) || GetViewData()->SimpleRowMarked();
 break;
 
diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 69bc8035b421..6e93f5f5756a 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -535,8 +535,6 @@ void ScTabView::SelectionChanged()
 rBindings.Invalidate( FID_INS_CELL );
 rBindings.Invalidate( FID_INS_CELLSDOWN );
 rBindings.Invalidate( FID_INS_CELLSRIGHT );
-rBindings.Invalidate( SID_ROW_OPERATIONS );
-rBindings.Invalidate( SID_COLUMN_OPERATIONS );
 
 rBindings.Invalidate( FID_CHG_COMMENT );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-17 Thread Eike Rathke
 sc/source/core/data/table3.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 4b48a0b49de597fc9e9abb012fb31b6fedfee85b
Author: Eike Rathke 
Date:   Mon Apr 16 16:02:17 2018 +0200

Resolves: tdf#116003 check presence of subtotal in group, tdf#107267 
follow-up

Change-Id: Ifed6e28926c689dd17914b8b1cbf47b58e2ffcdc
(cherry picked from commit f50e370db8f7ae20b12e312ad89a0f9961b7ee7a)
Reviewed-on: https://gerrit.libreoffice.org/52989
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index cf96a01a926e..d649e581782f 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2164,11 +2164,20 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
 
 for (sal_uInt16 nLevel = 0; nLevel no formula or
+// label and do not insert a row.
+continue;
+}
+
 // increment end row
 nGlobalEndRow++;
 
 // add row entry for formula
-aRowEntry.nGroupNo = nLevelCount - nLevel - 1;
+aRowEntry.nGroupNo = nGroupNo;
 aRowEntry.nSubStartRow = nGlobalStartRow;
 aRowEntry.nFuncStart = nGlobalStartFunc;
 aRowEntry.nDestRow = nGlobalEndRow;
@@ -2186,10 +2195,9 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
 DBShowRow(aRowEntry.nDestRow, true);
 
 // insert label
-ScSubTotalFunc* eResFunc = 
rParam.pFunctions[aRowEntry.nGroupNo];
 OUString label = ScGlobal::GetRscString(STR_TABLE_GRAND);
 label += " ";
-label += 
ScGlobal::GetRscString(lcl_GetSubTotalStrId(eResFunc[0]));
+label += 
ScGlobal::GetRscString(lcl_GetSubTotalStrId(pResFunc[0]));
 SetString(nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, 
nTab, label);
 ApplyStyle(nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, 
pStyle);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-13 Thread Caolán McNamara
 sc/source/ui/view/gridwin4.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit ccb90e3266336d6b022c48ec90cd55450c9c209e
Author: Caolán McNamara 
Date:   Thu Apr 12 14:53:20 2018 +0100

Related: tdf#100925 background not getting set under X sometimes

not sure why this is the case, but it is reminiscent of rhbz#1283420 which
results in missing glyphs in some circumstances
X11CairoTextRender::getCairoContext has a hack in it for that problem, whic
forces a read from the underlying X Drawable before writing to it which 
seems
to have the effect of syncing it up.

So, just before drawing the bg, draw a glyph on it to get it synced, and 
then
overwrite it.

Change-Id: I27e8e989b91821869d8b75a59728ac513d1b
Reviewed-on: https://gerrit.libreoffice.org/52818
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index 92b0eee6cc96..83d4e18ce8cd 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1021,7 +1021,12 @@ void ScGridWindow::DrawContent(OutputDevice , 
const ScTableInfo& rTableI
 }
 
 // paint the background
-rDevice.DrawRect(rDevice.PixelToLogic(aBackground));
+tools::Rectangle aLogicRect(rDevice.PixelToLogic(aBackground));
+//tdf#100925, rhbz#1283420, Draw some text here, to get
+//X11CairoTextRender::getCairoContext called, so that the forced read
+//from the underlying X Drawable gets it to sync.
+rDevice.DrawText(aLogicRect.BottomLeft(), " ");
+rDevice.DrawRect(aLogicRect);
 
 // paint the editeng text
 tools::Rectangle aEditRect(Point(nScrX, nScrY), 
Size(aOutputData.GetScrW(), aOutputData.GetScrH()));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-13 Thread Caolán McNamara
 sc/source/ui/view/select.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 14b042d86e5d3e20dbc73efe08b831810bd52711
Author: Caolán McNamara 
Date:   Tue Apr 10 16:55:50 2018 +0100

Resolves: tdf#116813 Height/Width swapped

Change-Id: I9b41a4b65fda895ed73fa346fb0b8e13df010706
Reviewed-on: https://gerrit.libreoffice.org/52693
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index fcfe6eddf1c5..b8dd689eb640 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -329,8 +329,8 @@ bool ScViewFunctionSet::SetCursorAtPoint( const Point& 
rPointPixel, bool /* bDon
 // above a neighbour cell
 if (bFillingSelection)
 {
-bBottomScroll = aEffPos.X() >= aWinSize.Height();
-bRightScroll  = aEffPos.Y() >= aWinSize.Width();
+bBottomScroll = aEffPos.Y() >= aWinSize.Height();
+bRightScroll  = aEffPos.X() >= aWinSize.Width();
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-05 Thread Caolán McNamara
 sc/source/filter/excel/xichart.cxx |   18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

New commits:
commit c30c7fc991e1bc5e7d81ec0c1e5abeca33d14162
Author: Caolán McNamara 
Date:   Mon Mar 26 12:59:14 2018 +0100

forcepoint #32 survive missing value range

Change-Id: I90315f0481bf73c4d9071959bf5408f4a2690257
Reviewed-on: https://gerrit.libreoffice.org/51885
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/filter/excel/xichart.cxx 
b/sc/source/filter/excel/xichart.cxx
index 5cef222d07ce..895a9caa5e7c 100644
--- a/sc/source/filter/excel/xichart.cxx
+++ b/sc/source/filter/excel/xichart.cxx
@@ -3371,15 +3371,19 @@ Reference< XAxis > XclImpChAxis::CreateAxis( const 
XclImpChTypeGroup& rTypeGroup
 {
 case cssc2::AxisType::CATEGORY:
 case cssc2::AxisType::SERIES:
-OSL_ENSURE( mxLabelRange, "Missing Label Range" );
 // #i71684# radar charts have reversed rotation direction
 if (mxLabelRange)
 mxLabelRange->Convert( aAxisProp, aScaleData, 
rTypeInfo.meTypeCateg == EXC_CHTYPECATEG_RADAR );
+else
+SAL_WARN("sc.filter", "missing LabelRange");
 break;
 case cssc2::AxisType::REALNUMBER:
 case cssc2::AxisType::PERCENT:
 // #i85167# pie/donut charts have reversed rotation direction 
(at Y axis!)
-mxValueRange->Convert( aScaleData, rTypeInfo.meTypeCateg == 
EXC_CHTYPECATEG_PIE );
+if (mxValueRange)
+mxValueRange->Convert( aScaleData, rTypeInfo.meTypeCateg 
== EXC_CHTYPECATEG_PIE );
+else
+SAL_WARN("sc.filter", "missing ValueRange");
 break;
 default:
 OSL_FAIL( "XclImpChAxis::CreateAxis - unknown axis type" );
@@ -3428,12 +3432,18 @@ void XclImpChAxis::ConvertAxisPosition( ScfPropertySet& 
rPropSet, const XclImpCh
 {
 if( ((GetAxisType() == EXC_CHAXIS_X) && 
rTypeGroup.GetTypeInfo().mbCategoryAxis) || (GetAxisType() == EXC_CHAXIS_Z) )
 {
-OSL_ENSURE( mxLabelRange, "Missing Label Range" );
 if (mxLabelRange)
 mxLabelRange->ConvertAxisPosition( rPropSet, 
rTypeGroup.Is3dChart() );
+else
+SAL_WARN("sc.filter", "missing LabelRange");
 }
 else
-mxValueRange->ConvertAxisPosition( rPropSet );
+{
+if (mxValueRange)
+mxValueRange->ConvertAxisPosition( rPropSet );
+else
+SAL_WARN("sc.filter", "missing ValueRange");
+}
 }
 
 void XclImpChAxis::ReadChAxisLine( XclImpStream& rStrm )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-05 Thread Caolán McNamara
 sc/source/filter/xml/xmlcelli.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit c52efdf90592235e73f2d4c6e8579fb980c537c3
Author: Caolán McNamara 
Date:   Mon Mar 26 13:44:31 2018 +0100

forcepoint #34 survive missing autostyles

Change-Id: I742816297659d614e836a8d5e8965b1c55154719
Reviewed-on: https://gerrit.libreoffice.org/51891
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/filter/xml/xmlcelli.cxx 
b/sc/source/filter/xml/xmlcelli.cxx
index 0148dc965026..59fe6237d371 100644
--- a/sc/source/filter/xml/xmlcelli.cxx
+++ b/sc/source/filter/xml/xmlcelli.cxx
@@ -360,6 +360,8 @@ void ScXMLTableRowCellContext::PushFormat(sal_Int32 nBegin, 
sal_Int32 nEnd, cons
 sal_Int32 nEntryCount = xMapper->GetEntryCount();
 
 SvXMLStylesContext* pAutoStyles = GetImport().GetAutoStyles();
+if (!pAutoStyles)
+return;
 
 // Style name for text span corresponds with the name of an automatic 
style.
 const XMLPropStyleContext* pStyle = dynamic_cast(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-04-05 Thread Caolán McNamara
 sc/source/core/data/column3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 0213fc80c7bf8022fc2781c5a230d169eaa2c885
Author: Caolán McNamara 
Date:   Mon Mar 26 12:50:20 2018 +0100

forcepoint #31 check validity of another group range

Change-Id: I82ff3e47a033c91581b108e1685b1ff4d5865895
Reviewed-on: https://gerrit.libreoffice.org/51882
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index a50856290c35..855f82c39423 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -3115,6 +3115,8 @@ public:
 {
 // Previous cell is a regular cell and current cell is a group.
 nRow += xCurGrp->mnLength;
+if (xCurGrp->mnLength > std::distance(it, itEnd))
+throw css::lang::IllegalArgumentException();
 std::advance(it, xCurGrp->mnLength);
 pPrev->SetCellGroup(xCurGrp);
 xCurGrp->mpTopCell = pPrev;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-26 Thread Eike Rathke
 sc/source/core/data/dociter.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit c3ca9d933b289df49e45f223493f3a22a1f74d14
Author: Eike Rathke 
Date:   Fri Mar 23 13:13:03 2018 +0100

Enable binary search for numeric values again

... as used in LOOKUP and VLOOKUP.

This was disabled as a fallout from

commit bad266fa06294f1dacec11ec02dfc6ae4ec8cdc4
CommitDate: Mon Feb 22 21:30:28 2016 +0100

ScQueryEntry::GetSearchTextPtr() with SearchType, tdf#72196

that changed the !bRegExp condition (which includes numeric) to
bLiteral (which covers only text string) searches.

Change-Id: I265286ffe75bc7cd9e660ab82b0e647d82865eb9
(cherry picked from commit c53235ba9aab844c4b16ecf7a28429e256bace6d)
Reviewed-on: https://gerrit.libreoffice.org/51779
Tested-by: Eike Rathke 
Reviewed-by: Dennis Francis 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 13abb17a9fc4..96af2dbc3150 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1288,8 +1288,9 @@ bool ScQueryCellIterator::FindEqualOrSortedLastInRange( 
SCCOL& nFoundCol,
 bIgnoreMismatchOnLeadingStrings = true;
 bool bLiteral = mpParam->eSearchType == 
utl::SearchParam::SearchType::Normal &&
 mpParam->GetEntry(0).GetQueryItem().meType == ScQueryEntry::ByString;
-bool bBinary = bLiteral && mpParam->bByRow && (mpParam->GetEntry(0).eOp ==
-SC_LESS_EQUAL || mpParam->GetEntry(0).eOp == SC_GREATER_EQUAL);
+bool bBinary = mpParam->bByRow &&
+(bLiteral || mpParam->GetEntry(0).GetQueryItem().meType == 
ScQueryEntry::ByValue) &&
+(mpParam->GetEntry(0).eOp == SC_LESS_EQUAL || mpParam->GetEntry(0).eOp 
== SC_GREATER_EQUAL);
 bool bFound = false;
 if (bBinary)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-21 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit b0e7b2336d5d5723a9feab124f7c8a152f96dda4
Author: Eike Rathke 
Date:   Sat Mar 10 20:34:36 2018 +0100

Resolves: tdf#116324 treat jump empty path as 0 when nested

Apparently a fallout from

commit 0f45ac20cd2ab2a64c40c7d6850f333cc33feeb0
AuthorDate: Mon Jun 28 11:40:39 2010 -0400
CommitDate: Sat Nov 6 23:40:00 2010 -0400

More on fixing build by eliminating use of ScMatrixValue.

or other commits related to ScMatrix handling.

Change-Id: I10e8b58aed51cd707b1503dbbc0b369aea4a2805
(cherry picked from commit 8930f8f530b4879226a6bac55bfeb551ac9e7489)
Reviewed-on: https://gerrit.libreoffice.org/51053
Tested-by: Jenkins 
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 679a165f7e9c..49c7d009f05a 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -130,8 +130,10 @@ void ScInterpreter::ScIfJump()
 else
 {
 // Treat empty and empty path as 0, but string
-// as error.
-bIsValue = (!pMat->IsString(nC, nR) || 
pMat->IsEmpty(nC, nR));
+// as error. ScMatrix::IsValueOrEmpty() returns
+// true for any empty, empty path, empty cell,
+// empty result.
+bIsValue = pMat->IsValueOrEmpty(nC, nR);
 bTrue = false;
 fVal = (bIsValue ? 0.0 : CreateDoubleError( 
FormulaError::NoValue));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-21 Thread Eike Rathke
 sc/source/ui/view/viewfun2.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 2f504da556cb091db0ad7c47f1bb90220d890c66
Author: Eike Rathke 
Date:   Tue Mar 6 21:26:23 2018 +0100

Resolves: tdf#116215 separate column sums and row sums, tdf#71339 related

Change-Id: Ifc7ab0c460f521ad3be4aa2785d54a1e4ed304e5
(cherry picked from commit 9d8dcec608dde63c68b34450a95a3b168121e289)
Reviewed-on: https://gerrit.libreoffice.org/50845
Tested-by: Jenkins 
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 5d5457b4e088..7f4ca39fc8e2 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -614,7 +614,10 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
 SCCOL nMarkEndCol = nEndCol;
 SCROW nMarkEndRow = nEndRow;
 ScAutoSum eSum = ScAutoSumNone;
-ScRangeList aSumRangeList;
+SCROW nColSums = 0;
+SCCOL nRowSums = 0;
+SCROW nColSumsStartRow = 0;
+SCCOL nRowSumsStartCol = 0;
 
 if ( bRow )
 {
@@ -638,12 +641,15 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
 {
 if ( !pDoc->IsBlockEmpty( nTab, nCol, nStartRow, nCol, nSumEndRow 
) )
 {
+ScRangeList aRangeList;
 // Include the originally selected start row.
 const ScRange aRange( nCol, rRange.aStart.Row(), nTab, nCol, 
nSumEndRow, nTab );
-if ( (eSum = lcl_GetAutoSumForColumnRange( pDoc, 
aSumRangeList, aRange )) != ScAutoSumNone )
+if ( (eSum = lcl_GetAutoSumForColumnRange( pDoc, aRangeList, 
aRange )) != ScAutoSumNone )
 {
+if (++nRowSums == 1)
+nRowSumsStartCol = aRangeList[0]->aStart.Col();
 const OUString aFormula = GetAutoSumFormula(
-aSumRangeList, bSubTotal, ScAddress(nCol, nInsRow, 
nTab));
+aRangeList, bSubTotal, ScAddress(nCol, nInsRow, nTab));
 EnterData( nCol, nInsRow, nTab, aFormula );
 }
 }
@@ -672,11 +678,14 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
 {
 if ( !pDoc->IsBlockEmpty( nTab, nStartCol, nRow, nSumEndCol, nRow 
) )
 {
+ScRangeList aRangeList;
 // Include the originally selected start column.
 const ScRange aRange( rRange.aStart.Col(), nRow, nTab, 
nSumEndCol, nRow, nTab );
-if ( (eSum = lcl_GetAutoSumForRowRange( pDoc, aSumRangeList, 
aRange )) != ScAutoSumNone )
+if ( (eSum = lcl_GetAutoSumForRowRange( pDoc, aRangeList, 
aRange )) != ScAutoSumNone )
 {
-const OUString aFormula = GetAutoSumFormula( 
aSumRangeList, bSubTotal, ScAddress(nInsCol, nRow, nTab) );
+if (++nColSums == 1)
+nColSumsStartRow = aRangeList[0]->aStart.Row();
+const OUString aFormula = GetAutoSumFormula( aRangeList, 
bSubTotal, ScAddress(nInsCol, nRow, nTab) );
 EnterData( nInsCol, nRow, nTab, aFormula );
 }
 }
@@ -689,10 +698,10 @@ bool ScViewFunc::AutoSum( const ScRange& rRange, bool 
bSubTotal, bool bSetCursor
 // original selection. All extended by end column/row where the sum is put.
 const ScRange aMarkRange(
 (eSum == ScAutoSumSum ?
- (aSumRangeList.size() == 1 ? aSumRangeList[0]->aStart.Col() : 
nStartCol) :
+ (nRowSums == 1 ? nRowSumsStartCol : nStartCol) :
  rRange.aStart.Col()),
 (eSum == ScAutoSumSum ?
- (aSumRangeList.size() == 1 ? aSumRangeList[0]->aStart.Row() : 
nStartRow) :
+ (nColSums == 1 ? nColSumsStartRow : nStartRow) :
  rRange.aStart.Row()),
 nTab, nMarkEndCol, nMarkEndRow, nTab );
 MarkRange( aMarkRange, false, bContinue );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-16 Thread Caolán McNamara
 sc/source/ui/view/select.cxx |   25 -
 1 file changed, 20 insertions(+), 5 deletions(-)

New commits:
commit d47a28723ee5b8df2f9e34449b15fac7970a1c69
Author: Caolán McNamara 
Date:   Thu Mar 15 16:54:44 2018 +

Resolves: tdf#115923 try a different approach to solving tdf#46637

Try scrolling to the cell the mouse is over if its not fully visible already
and this is not autofill selection. To avoid the mouse over the autofill 
handle
which overflows into neighbours scrolling the neighbour cell into view 
before
its truly desired to be selected when the mouse passes the center point

in other words, for autofill go back to how it always was

Change-Id: I6f67ad0f49c2d4087949f71f38322f06ced13c79
Reviewed-on: https://gerrit.libreoffice.org/51392
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/view/select.cxx b/sc/source/ui/view/select.cxx
index f06043c79276..fcfe6eddf1c5 100644
--- a/sc/source/ui/view/select.cxx
+++ b/sc/source/ui/view/select.cxx
@@ -321,13 +321,28 @@ bool ScViewFunctionSet::SetCursorAtPoint( const Point& 
rPointPixel, bool /* bDon
  pEngine->GetWindow(),
  nullptr, false);
 
-bool bBottomScroll = ( aEditArea.Bottom() >= aWinSize.Height() );
-bool bRightScroll  = ( aEditArea.Right() >= aWinSize.Width() );
+bool bFillingSelection = pViewData->IsFillMode() || 
pViewData->GetFillMode() == ScFillMode::MATRIX;
+bool bBottomScroll;
+bool bRightScroll;
+// for Autofill don't yet assume we want to auto-scroll to the cell under 
the mouse
+// because the autofill handle extends into a cells neighbours so initial 
click is usually
+// above a neighbour cell
+if (bFillingSelection)
+{
+bBottomScroll = aEffPos.X() >= aWinSize.Height();
+bRightScroll  = aEffPos.Y() >= aWinSize.Width();
+}
+else
+{
+//in the normal case make the full selected cell visible
+bBottomScroll = aEditArea.Bottom() >= aWinSize.Height();
+bRightScroll  = aEditArea.Right() >= aWinSize.Width();
+}
+
 bool bScroll = bRightScroll || bBottomScroll || bLeftScroll || bTopScroll;
 
-// for Autofill switch in the center of cell
-// thereby don't prevent scrolling to bottom/right
-if ( pViewData->IsFillMode() || pViewData->GetFillMode() == 
ScFillMode::MATRIX )
+// for Autofill switch in the center of cell thereby don't prevent 
scrolling to bottom/right
+if (bFillingSelection)
 {
 bool bLeft, bTop;
 pViewData->GetMouseQuadrant( aEffPos, GetWhich(), nPosX, nPosY, bLeft, 
bTop );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-15 Thread Eike Rathke
 sc/source/filter/inc/addressconverter.hxx |4 +
 sc/source/filter/oox/excelfilter.cxx  |   69 +-
 sc/source/filter/oox/sheetdatacontext.cxx |   21 +++--
 sc/source/filter/oox/worksheethelper.cxx  |   10 +++-
 4 files changed, 96 insertions(+), 8 deletions(-)

New commits:
commit 621634923ab7c11ceef9757c481f92977ef863f6
Author: Eike Rathke 
Date:   Wed Feb 28 22:39:30 2018 +0100

Resolves: tdf#114555 check .xlsx col/row/tab overflow and display warning

 This is a combination of 2 commits.

Resolves: tdf#114555 check .xlsx col/row/tab overflow and display warning

Cherry-picked from 66564dac88ffcc781b4fade7ca0f4f72af6b8bca and
backported / un-weld-ed by using the original patch set
https://gerrit.libreoffice.org/#/c/50541/1 before weld-ing, and
getRID_ERRCTX() instead of RID_ERRCTX.

Related: tdf#114555 cater for lastcolumn+1 oddity if last is last possible

Else our own saved .xlsx files raise the excess columns warning.

(cherry picked from commit ccc977ba10b61108a56e00a79c0f7a1517e026cc)

e1791dd026d9faf4b391ad34da43ec0c70c8de83

Change-Id: I3091a890b6d4a3f27d9284fc5c0e2df3bc8ce527
Reviewed-on: https://gerrit.libreoffice.org/50570
Tested-by: Jenkins 
Reviewed-by: Bartosz Kosiorek 

diff --git a/sc/source/filter/inc/addressconverter.hxx 
b/sc/source/filter/inc/addressconverter.hxx
index 57f1f33cabcd..d1d53531e0f1 100644
--- a/sc/source/filter/inc/addressconverter.hxx
+++ b/sc/source/filter/inc/addressconverter.hxx
@@ -479,6 +479,10 @@ public:
 static css::uno::Sequence
 toApiSequence(const ScRangeList& orRanges);
 
+boolisColOverflow() const { return mbColOverflow; }
+boolisRowOverflow() const { return mbRowOverflow; }
+boolisTabOverflow() const { return mbTabOverflow; }
+
 private:
 voidinitializeMaxPos(
 sal_Int16 nMaxXlsTab, sal_Int32 nMaxXlsCol, 
sal_Int32 nMaxXlsRow );
diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index 171f5ff67cf7..55cee4841b7f 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -30,6 +30,15 @@
 #include 
 #include 
 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
 namespace oox {
 namespace xls {
 
@@ -97,9 +106,65 @@ bool ExcelFilter::importDocument()
 the class WorkbookHelper, and execute the import filter by 
constructing
 an instance of WorkbookFragment and loading the file. */
 WorkbookGlobalsRef xBookGlob(WorkbookHelper::constructGlobals(*this));
-if (xBookGlob.get() && importFragment(new WorkbookFragment(*xBookGlob, 
aWorkbookPath)))
+if (xBookGlob.get())
 {
-return true;
+rtl::Reference xWorkbookFragment( new 
WorkbookFragment(*xBookGlob, aWorkbookPath));
+bool bRet = importFragment( xWorkbookFragment);
+if (bRet)
+{
+const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
+const AddressConverter& rAC = pWF->getAddressConverter();
+if (rAC.isTabOverflow() || rAC.isColOverflow() || 
rAC.isRowOverflow())
+{
+const ScDocument& rDoc = pWF->getScDocument();
+if (rDoc.IsUserInteractionEnabled())
+{
+// Show data loss warning.
+
+INetURLObject aURL( getFileUrl());
+SfxErrorContext aContext( ERRCTX_SFX_OPENDOC,
+aURL.getName( INetURLObject::LAST_SEGMENT, 
true,
+
INetURLObject::DecodeMechanism::WithCharset),
+nullptr, getRID_ERRCTX());
+
+OUString aWarning;
+aContext.GetString( ERRCODE_NONE.MakeWarning(), 
aWarning);
+aWarning += ":\n";
+
+OUString aMsg;
+if (rAC.isTabOverflow())
+{
+if (ErrorHandler::GetErrorString( 
SCWARN_IMPORT_SHEET_OVERFLOW, aMsg))
+aWarning += aMsg;
+}
+if (rAC.isColOverflow())
+{
+if (!aMsg.isEmpty())
+aWarning += "\n";
+if (ErrorHandler::GetErrorString( 
SCWARN_IMPORT_COLUMN_OVERFLOW, aMsg))
+aWarning += aMsg;
+}
+if (rAC.isRowOverflow())
+{
+if (!aMsg.isEmpty())
+

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

2018-03-15 Thread Eike Rathke
 sc/source/ui/view/viewfun2.cxx |   26 ++
 1 file changed, 26 insertions(+)

New commits:
commit 1c354750f9e52bfa241e3edffeb6d84dd8b92e5e
Author: Eike Rathke 
Date:   Thu Mar 1 22:41:50 2018 +0100

Resolves: tdf#54197 update input line with new cell content after Ctrl+D 
fill

 This is a combination of 3 commits.

Resolves: tdf#54197 update input line with new cell content after Ctrl+D 
fill

... and invalidate cell slots.

Related: tdf#115297 copy AutoSpellData from row above if no selection

Related: tdf#54197 copy AutoSpellData from adjacent if no selection

62ebb3579d5c05e71ca10879ae0ade5bda3bbeba
82223a64f5c5ec3c98dba390d88af8369a322bd7

Change-Id: Icbe7784430f7ddeed8fa0bc56352269447ee8cbb
Reviewed-on: https://gerrit.libreoffice.org/50608
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index fb4c178e10f1..5d5457b4e088 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1264,10 +1264,36 @@ void ScViewFunc::FillSimple( FillDir eDir )
 {
 pDocSh->UpdateOle(());
 UpdateScrollBars();
+
 bool bDoAutoSpell = 
pDocSh->GetDocument().GetDocOptions().IsAutoSpell();
 if ( bDoAutoSpell )
+{
+// Copy AutoSpellData from above(left/right/below) if no 
selection.
+switch (eDir)
+{
+case FILL_TO_BOTTOM:
+if (aRange.aStart.Row() > 0 && aRange.aStart.Row() == 
aRange.aEnd.Row())
+aRange.aStart.IncRow(-1);
+break;
+case FILL_TO_TOP:
+if (aRange.aEnd.Row() < MAXROW && aRange.aStart.Row() 
== aRange.aEnd.Row())
+aRange.aEnd.IncRow(1);
+break;
+case FILL_TO_RIGHT:
+if (aRange.aStart.Col() > 0 && aRange.aStart.Col() == 
aRange.aEnd.Col())
+aRange.aStart.IncCol(-1);
+break;
+case FILL_TO_LEFT:
+if (aRange.aEnd.Col() < MAXCOL && aRange.aStart.Col() 
== aRange.aEnd.Col())
+aRange.aEnd.IncCol(1);
+break;
+}
 CopyAutoSpellData(eDir, aRange.aStart.Col(), 
aRange.aStart.Row(), aRange.aEnd.Col(), aRange.aEnd.Row(),
 ::std::numeric_limits::max());
+}
+
+// Invalidate cell slots and update input line with new content.
+CellContentChanged();
 }
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-15 Thread Eike Rathke
 sc/source/core/tool/interpr1.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit f7247d66b3376b37da403acd74ee49f59b8b18a5
Author: Eike Rathke 
Date:   Fri Mar 2 21:38:08 2018 +0100

Resolves: tdf#116149 handle external references in VAR* and STDEV* functions

Change-Id: I644a5f8f92452ca775ee3b42a73d3f0a0ac3c623
(cherry picked from commit 38b87bbb24c1d1cc088d3d135e7e95b3ec75d386)
Reviewed-on: https://gerrit.libreoffice.org/50647
Tested-by: Jenkins 
Reviewed-by: Michael Meeks 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index ca588b6a9f03..18a93676fa4a 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3932,9 +3932,11 @@ void ScInterpreter::GetStVarParams( bool bTextAsZero, 
double(*VarResult)( double
 }
 }
 break;
+case svExternalSingleRef :
+case svExternalDoubleRef :
 case svMatrix :
 {
-ScMatrixRef pMat = PopMatrix();
+ScMatrixRef pMat = GetMatrix();
 if (pMat)
 {
 SCSIZE nC, nR;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-15 Thread Markus Mohrhard
 sc/source/core/data/table7.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 15443038c4b8d4c1e7d1aa32df72f41ba93b5b8b
Author: Markus Mohrhard 
Date:   Thu Feb 22 22:43:35 2018 +0100

copy multiple single row cond formats correctly, tdf#115835

Change-Id: Ic20cc27f03edf3dbd27975f99c788bf5bffd4c48
Reviewed-on: https://gerrit.libreoffice.org/50211
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 
(cherry picked from commit c557889748292d25996ea8f587d7564c74e6f121)
Reviewed-on: https://gerrit.libreoffice.org/50292
Reviewed-by: Michael Meeks 

diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index 6fe30a795fa7..47bcfbd5117f 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -130,10 +130,10 @@ void ScTable::CopyOneCellFromClip(
 assert(nColOffset >= 0);
 aCol[nCol].CopyOneCellFromClip(rCxt, nRow1, nRow2, nColOffset);
 
-if ((rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB) && (nColOffset 
== 0))
+if (rCxt.getInsertFlag() & InsertDeleteFlags::ATTRIB)
 {
 for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
-CopyConditionalFormat(nCol, nRow, nCol + nSrcColSize - 1, 
nRow, nCol - aSrcRange.aStart.Col(),
+CopyConditionalFormat(nCol, nRow, nCol, nRow, nCol - 
aSrcRange.aStart.Col() - nColOffset,
 nRow - nSrcRow, pSrcTab);
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-13 Thread Caolán McNamara
 sc/source/ui/inc/viewdata.hxx  |4 ++--
 sc/source/ui/view/viewdata.cxx |   12 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 216d244c6b8f4dcfe1348da05fcd6debc13bbd38
Author: Caolán McNamara 
Date:   Mon Mar 12 12:32:52 2018 +

forcepoint #26 check input against max valid enum values

Change-Id: Ide72884c77904ae9495b5189cde086e43923e4bd
Reviewed-on: https://gerrit.libreoffice.org/51137
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index a87f3dbe6f11..889df879a665 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -40,9 +40,9 @@ enum class ScFillMode
 MATRIX  = 4,
 };
 
-enum ScSplitMode { SC_SPLIT_NONE = 0, SC_SPLIT_NORMAL, SC_SPLIT_FIX };
+enum ScSplitMode { SC_SPLIT_NONE = 0, SC_SPLIT_NORMAL, SC_SPLIT_FIX, 
SC_SPLIT_MODE_MAX_ENUM = SC_SPLIT_FIX };
 
-enum ScSplitPos { SC_SPLIT_TOPLEFT, SC_SPLIT_TOPRIGHT, SC_SPLIT_BOTTOMLEFT, 
SC_SPLIT_BOTTOMRIGHT };
+enum ScSplitPos { SC_SPLIT_TOPLEFT, SC_SPLIT_TOPRIGHT, SC_SPLIT_BOTTOMLEFT, 
SC_SPLIT_BOTTOMRIGHT, SC_SPLIT_POS_MAX_ENUM = SC_SPLIT_BOTTOMRIGHT };
 enum ScHSplitPos { SC_SPLIT_LEFT, SC_SPLIT_RIGHT };
 enum ScVSplitPos { SC_SPLIT_TOP, SC_SPLIT_BOTTOM };
 
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 1728e4990927..64998f7cc2f6 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -350,13 +350,13 @@ void ScViewDataTable::ReadUserDataSequence(const 
uno::Sequence >= nTemp16;
-eHSplitMode = static_cast(nTemp16);
+if ((aSettings[i].Value >>= nTemp16) && nTemp16 <= 
ScSplitMode::SC_SPLIT_MODE_MAX_ENUM)
+eHSplitMode = static_cast(nTemp16);
 }
 else if (sName == SC_VERTICALSPLITMODE)
 {
-aSettings[i].Value >>= nTemp16;
-eVSplitMode = static_cast(nTemp16);
+if ((aSettings[i].Value >>= nTemp16) && nTemp16 <= 
ScSplitMode::SC_SPLIT_MODE_MAX_ENUM)
+eVSplitMode = static_cast(nTemp16);
 }
 else if (sName == SC_HORIZONTALSPLITPOSITION)
 {
@@ -380,8 +380,8 @@ void ScViewDataTable::ReadUserDataSequence(const 
uno::Sequence >= nTemp16;
-eWhichActive = static_cast(nTemp16);
+if ((aSettings[i].Value >>= nTemp16) && nTemp16 <= 
ScSplitPos::SC_SPLIT_POS_MAX_ENUM)
+eWhichActive = static_cast(nTemp16);
 }
 else if (sName == SC_POSITIONLEFT)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-13 Thread Mike Kaganski
 sc/source/ui/view/prevwsh.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit e722d9a406da01514bb256def98624da3eafee0c
Author: Mike Kaganski 
Date:   Mon Mar 12 10:07:06 2018 +0300

tdf#103175: Initialize DrawLayer if required

Change-Id: Ia99dd1e349e807d339dce0ead518a72a31e0fc02
Reviewed-on: https://gerrit.libreoffice.org/51096
Tested-by: Jenkins 
Reviewed-by: Mike Kaganski 
(cherry picked from commit de53d4690d25b9f1bbc0def6c66ce5b45b2fdc96)
Reviewed-on: https://gerrit.libreoffice.org/51110
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx
index 8fe89c51673b..281d10f8d569 100644
--- a/sc/source/ui/view/prevwsh.cxx
+++ b/sc/source/ui/view/prevwsh.cxx
@@ -940,7 +940,8 @@ void ScPreviewShell::WriteUserDataSequence(uno::Sequence < 
beans::PropertyValue
 }
 
 // Common SdrModel processing
-GetDocument().GetDrawLayer()->WriteUserDataSequence(rSeq);
+if (ScDrawLayer* pDrawLayer = GetDocument().GetDrawLayer())
+pDrawLayer->WriteUserDataSequence(rSeq);
 }
 
 void ScPreviewShell::ReadUserDataSequence(const uno::Sequence < 
beans::PropertyValue >& rSeq)
@@ -967,7 +968,7 @@ void ScPreviewShell::ReadUserDataSequence(const 
uno::Sequence < beans::PropertyV
 pPreview->SetPageNo(nTemp);
 }
 // Fallback to common SdrModel processing
-else 
GetDocument().GetDrawLayer()->ReadUserDataSequenceValue(pSeq);
+else 
pDocShell->MakeDrawLayer()->ReadUserDataSequenceValue(pSeq);
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-03-04 Thread Julien Nabet
 sc/source/core/data/dbdocutl.cxx |   19 +++
 1 file changed, 11 insertions(+), 8 deletions(-)

New commits:
commit bab7cef648025038055d3284773d33f102d42f13
Author: Julien Nabet 
Date:   Sun Mar 4 16:02:45 2018 +0100

Related tdf#116171: don't try to convert empty value in timestamp

Assert retrieved:
warn:tools.datetime:3915:3915:tools/source/datetime/tdate.cxx:109: 
Date::setDateFromDMY - sure about 0 year? It's not in the calendar.
soffice.bin: 
/home/julien/lo/libreoffice/tools/source/datetime/tdate.cxx:62: sal_Int32 
{anonymous}::ImpYearToDays(sal_Int16): Assertion `nYear != 0' failed.

Thread 1 "soffice.bin" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
51  ../sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce 
type.
(gdb) bt
0  0x773a26a0 in __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:51
1  0x773a3cf7 in __GI_abort () at abort.c:90
2  0x7739afca in __assert_fail_base (fmt=0x774eb890 "%s%s%s:%u: 
%s%sAssertion `%s' failed.
%n", assertion=assertion@entry=0x7fffed7d43a4 "nYear != 0", 
file=file@entry=0x7fffed7d4368 
"/home/julien/lo/libreoffice/tools/source/datetime/tdate.cxx", 
line=line@entry=62, function=function@entry=0x7fffed7d4720 <(anonymous 
namespace)::ImpYearToDays(short)::__PRETTY_FUNCTION__> "sal_Int32 
{anonymous}::ImpYearToDays(sal_Int16)") at assert.c:92
3  0x7739b042 in __GI___assert_fail (assertion=0x7fffed7d43a4 
"nYear != 0", file=0x7fffed7d4368 
"/home/julien/lo/libreoffice/tools/source/datetime/tdate.cxx", line=62, 
function=0x7fffed7d4720 <(anonymous 
namespace)::ImpYearToDays(short)::__PRETTY_FUNCTION__> "sal_Int32 
{anonymous}::ImpYearToDays(sal_Int16)") at assert.c:101
4  0x7fffed75e7e2 in (anonymous namespace)::ImpYearToDays(sal_Int16) 
(nYear=0) at /home/julien/lo/libreoffice/tools/source/datetime/tdate.cxx:62
5  0x7fffed75eeb5 in Date::DateToDays(unsigned short, unsigned short, 
short) (nDay=0, nMonth=0, nYear=0)
at /home/julien/lo/libreoffice/tools/source/datetime/tdate.cxx:156
6  0x7fffed75ee6d in Date::GetAsNormalizedDays() const 
(this=0x7fff0318) at 
/home/julien/lo/libreoffice/tools/source/datetime/tdate.cxx:149
7  0x7fffed760342 in operator-(Date const&, Date const&) (rDate1=0-0-0, 
rDate2=1899-12-30) at 
/home/julien/lo/libreoffice/tools/source/datetime/tdate.cxx:609
8  0x7fffc7e8b705 in ScDatabaseDocUtil::PutData(ScDocument*, short, 
int, short, com::sun::star::uno::Reference const&, 
long, long, bool, ScDatabaseDocUtil::StrData*) (pDoc=0x5794c920, nCol=14, 
nRow=1, nTab=0, xRow=
uno::Reference to (dbaccess::ORowSet *) 0x57b5db08, nRowPos=15, 
nType=93, bCurrency=false, pStrData=0x7fff04b0)
at /home/julien/lo/libreoffice/sc/source/core/data/dbdocutl.cxx:127
9  0x7fffc892e963 in ScDocShell::DBaseImport(rtl::OUString const&, 
unsigned short, std::__debug::map >&, 
ScFlatBoolRowSegments&) (this=
0x5794c8c0, 
rFullFileName="/home/julien/lo/bugs/116171_dbffoxpro/addresses.dbf", 
eCharSet=63, aColWidthParam=std::__debug::map with 14 elements = {...}, 
rRowHeightsRecalc=...) at 
/home/julien/lo/libreoffice/sc/source/ui/docshell/docsh8.cxx:413

Change-Id: I240ddd435c148360dc9a874913596b4844d726dc
Reviewed-on: https://gerrit.libreoffice.org/50732
Tested-by: Jenkins 
(cherry picked from commit a77b493392ecdfe2e58bb0fcfa7363a8583dffe4)
Reviewed-on: https://gerrit.libreoffice.org/50745
Reviewed-by: Lionel Elie Mamane 

diff --git a/sc/source/core/data/dbdocutl.cxx b/sc/source/core/data/dbdocutl.cxx
index ce72695fedae..9356cff994fe 100644
--- a/sc/source/core/data/dbdocutl.cxx
+++ b/sc/source/core/data/dbdocutl.cxx
@@ -124,14 +124,17 @@ void ScDatabaseDocUtil::PutData( ScDocument* pDoc, SCCOL 
nCol, SCROW nRow, SCTAB
 css::util::NumberFormat::DATETIME, 
ScGlobal::eLnge );
 
 util::DateTime aStamp = xRow->getTimestamp(nRowPos);
-nVal = ( Date( aStamp.Day, aStamp.Month, aStamp.Year ) -
-pFormTable->GetNullDate() ) +
-   aStamp.Hours   / 
static_cast(::tools::Time::hourPerDay)   +
-   aStamp.Minutes / 
static_cast(::tools::Time::minutePerDay) +
-   aStamp.Seconds / 
static_cast(::tools::Time::secondPerDay) +
-   aStamp.NanoSeconds / 
static_cast(::tools::Time::nanoSecPerDay);
-bEmptyFlag = xRow->wasNull();
-bValue = true;
+if (aStamp.Year != 0)
+{
+nVal = ( Date( aStamp.Day, aStamp.Month, 

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

2018-02-26 Thread Eike Rathke
 sc/source/core/inc/jumpmatrix.hxx  |4 +++-
 sc/source/core/tool/interpr1.cxx   |   16 +++-
 sc/source/core/tool/interpr4.cxx   |2 +-
 sc/source/core/tool/jumpmatrix.cxx |3 ++-
 4 files changed, 17 insertions(+), 8 deletions(-)

New commits:
commit ed2a66a2ccace13c3d85490300cd623109214b0e
Author: Eike Rathke 
Date:   Thu Feb 8 22:48:56 2018 +0100

Resolves: tdf#115493 use matrix as result of jump command, tdf#58874 related


{=SUM(IF(EXACT(OFFSET(A7,0,0):OFFSET(A7,2,0),A$1),OFFSET(A7,0,1):OFFSET(A7,2,1),0))}
shall be the same as
{=SUM(IF(EXACT(A7:A9,A$1),B7:B9,0))}

Change-Id: Id503ef41140d1e9c4aeabbec08d1199dd6dd8593
(cherry picked from commit e0a94ded5d1635fa2a2d9e222bfcfa0a2289a01f)
Reviewed-on: https://gerrit.libreoffice.org/49464
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/inc/jumpmatrix.hxx 
b/sc/source/core/inc/jumpmatrix.hxx
index cbc1a1d0671c..084f5a91f4bb 100644
--- a/sc/source/core/inc/jumpmatrix.hxx
+++ b/sc/source/core/inc/jumpmatrix.hxx
@@ -67,6 +67,7 @@ class ScJumpMatrix
 SCSIZE  nCurRow;
 SCSIZE  nResMatCols;
 SCSIZE  nResMatRows;
+OpCode  meOp;
 boolbStarted;
 
 // Buffer result ranges to be able to set a range of identically typed
@@ -96,7 +97,7 @@ class ScJumpMatrix
 ScJumpMatrix& operator=( const ScJumpMatrix& ) = delete;
 
 public:
-ScJumpMatrix( SCSIZE nColsP, SCSIZE nRowsP );
+ScJumpMatrix( OpCode eOp, SCSIZE nColsP, SCSIZE nRowsP );
 ~ScJumpMatrix();
 void GetDimensions( SCSIZE& rCols, SCSIZE& rRows ) const;
 void SetJump( SCSIZE nCol, SCSIZE nRow, double fBool, short nStart, short 
nNext );
@@ -111,6 +112,7 @@ public:
 void GetResMatDimensions( SCSIZE& rCols, SCSIZE& rRows );
 void SetNewResMat( SCSIZE nNewCols, SCSIZE nNewRows );
 ScRefList& GetRefList();
+OpCode GetOpCode() const { return meOp; }
 
 void PutResultDouble( double fVal, SCSIZE nC, SCSIZE nR );
 void PutResultString( const svl::SharedString& rStr, SCSIZE nC, SCSIZE nR 
);
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index e59b46c9f42f..ca588b6a9f03 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -110,7 +110,8 @@ void ScInterpreter::ScIfJump()
 xNew = (*aMapIter).second;
 else
 {
-std::shared_ptr pJumpMat( 
std::make_shared( nCols, nRows ) );
+std::shared_ptr pJumpMat( 
std::make_shared(
+pCur->GetOpCode(), nCols, nRows));
 for ( SCSIZE nC=0; nC < nCols; ++nC )
 {
 for ( SCSIZE nR=0; nR < nRows; ++nR )
@@ -339,7 +340,8 @@ void ScInterpreter::ScIfError( bool bNAonly )
 else
 {
 const ScMatrix* pMatPtr = pMat.get();
-std::shared_ptr pJumpMat( 
std::make_shared( nCols, nRows ) );
+std::shared_ptr pJumpMat( 
std::make_shared(
+pCur->GetOpCode(), nCols, nRows));
 // Init all jumps to no error to save single calls. Error
 // is the exceptional condition.
 const double fFlagResult = CreateDoubleError( 
FormulaError::JumpMatHasResult);
@@ -430,7 +432,8 @@ void ScInterpreter::ScChooseJump()
 xNew = (*aMapIter).second;
 else
 {
-std::shared_ptr pJumpMat( 
std::make_shared( nCols, nRows ) );
+std::shared_ptr pJumpMat( 
std::make_shared(
+pCur->GetOpCode(), nCols, nRows));
 for ( SCSIZE nC=0; nC < nCols; ++nC )
 {
 for ( SCSIZE nR=0; nR < nRows; ++nR )
@@ -799,8 +802,11 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
 {   // We're done with it, throw away jump matrix, keep result.
 // For an intermediate result of Reference use the array of references,
 // else (also for a final result of Reference) use the matrix.
-formula::ParamClass eReturnType = 
ScParameterClassification::GetParameterType( pCur, SAL_MAX_UINT16);
-if (eReturnType == ParamClass::Reference && aCode.PeekNextOperator())
+// Treat the result of a jump command as final and use the matrix (see
+// tdf#115493 for why).
+if (!FormulaCompiler::IsOpCodeJumpCommand( pJumpMatrix->GetOpCode()) &&
+ScParameterClassification::GetParameterType( pCur, 
SAL_MAX_UINT16) == ParamClass::Reference &&
+aCode.PeekNextOperator())
 {
 FormulaTokenRef xRef = new ScRefListToken(true);
 *(xRef->GetRefList()) = 

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

2018-02-26 Thread Eike Rathke
 sc/source/core/data/table1.cxx |   25 ++---
 1 file changed, 22 insertions(+), 3 deletions(-)

New commits:
commit a16ecbb7a23ef639e3a164383e777ee0eccb399b
Author: Eike Rathke 
Date:   Wed Feb 21 14:53:06 2018 +0100

Limit ScColumnsRange::Iterator to available columns within bounds

Change-Id: Id5481a975dce99a51cc5619e200e5ea46ad3ad1b
Reviewed-on: https://gerrit.libreoffice.org/50106
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 
(cherry picked from commit 6fc75b669438728ba6a4e55d53a79fa0cf006529)
Reviewed-on: https://gerrit.libreoffice.org/50125
Reviewed-by: Noel Grandin 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 7b275495eb3b..4ce1306258f1 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -2396,9 +2396,28 @@ const ScConditionalFormatList* 
ScTable::GetCondFormList() const
 
 ScColumnsRange ScTable::GetColumnsRange(SCCOL nColBegin, SCCOL nColEnd) const
 {
-// because the range is inclusive, some code will pass nColEnd( nColBegin, aCol.size());
+if (nColEnd < 0)
+nEffEnd = 0;
+else
+nEffEnd = std::min( nColEnd + 1, aCol.size());
+}
+else
+{
+// Any empty will do.
+nEffBegin = nEffEnd = 0;
+}
+return ScColumnsRange( ScColumnsRange::Iterator( aCol.begin() + nEffBegin),
+   ScColumnsRange::Iterator( aCol.begin() + nEffEnd));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-14 Thread Eike Rathke
 sc/source/core/data/documentimport.cxx |   20 ++--
 1 file changed, 18 insertions(+), 2 deletions(-)

New commits:
commit f4ba47543baf2b63444752ba08f4712d2806adef
Author: Eike Rathke 
Date:   Tue Feb 13 18:08:28 2018 +0100

CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()

and ScDocumentImport::setMatrixCells()

 This is a combination of 2 commits.

CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()

(cherry picked from commit bcd62f2050336951ad56892d6e0a42f63c59a674)

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

More CheckLinkFormulaNeedingCheck() for ScDocumentImport::setFormulaCell()

and ScDocumentImport::setMatrixCells()

(cherry picked from commit f41c14706c6bf8aa5c3df220c706669f1ec6e1f6)

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

d3303fb71889c760424459daa79feca0f2510a3c

Change-Id: I1587be914b390b2597185dd5af870d1d785010a4
Reviewed-on: https://gerrit.libreoffice.org/49732
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/data/documentimport.cxx 
b/sc/source/core/data/documentimport.cxx
index 1062cc893cd7..713f72615ded 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -25,6 +25,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -278,9 +279,14 @@ void ScDocumentImport::setFormulaCell(
 if (!pBlockPos)
 return;
 
+std::unique_ptr pFC =
+o3tl::make_unique(>mrDoc, rPos, rFormula, 
eGrammar);
+
+mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pFC->GetCode());
+
 sc::CellStoreType& rCells = pTab->aCol[rPos.Col()].maCells;
 pBlockPos->miCellPos =
-rCells.set(pBlockPos->miCellPos, rPos.Row(), new 
ScFormulaCell(>mrDoc, rPos, rFormula, eGrammar));
+rCells.set(pBlockPos->miCellPos, rPos.Row(), pFC.release());
 }
 
 void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScTokenArray* 
pArray)
@@ -294,9 +300,14 @@ void ScDocumentImport::setFormulaCell(const ScAddress& 
rPos, ScTokenArray* pArra
 if (!pBlockPos)
 return;
 
+std::unique_ptr pFC =
+o3tl::make_unique(>mrDoc, rPos, pArray);
+
+mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pFC->GetCode());
+
 sc::CellStoreType& rCells = pTab->aCol[rPos.Col()].maCells;
 pBlockPos->miCellPos =
-rCells.set(pBlockPos->miCellPos, rPos.Row(), new 
ScFormulaCell(>mrDoc, rPos, pArray));
+rCells.set(pBlockPos->miCellPos, rPos.Row(), pFC.release());
 }
 
 void ScDocumentImport::setFormulaCell(const ScAddress& rPos, ScFormulaCell* 
pCell)
@@ -310,6 +321,9 @@ void ScDocumentImport::setFormulaCell(const ScAddress& 
rPos, ScFormulaCell* pCel
 if (!pBlockPos)
 return;
 
+if (pCell)
+mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pCell->GetCode());
+
 sc::CellStoreType& rCells = pTab->aCol[rPos.Col()].maCells;
 pBlockPos->miCellPos =
 rCells.set(pBlockPos->miCellPos, rPos.Row(), pCell);
@@ -334,6 +348,8 @@ void ScDocumentImport::setMatrixCells(
 // Set the master cell.
 ScFormulaCell* pCell = new ScFormulaCell(>mrDoc, rBasePos, rArray, 
eGram, ScMatrixMode::Formula);
 
+mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( *pCell->GetCode());
+
 pBlockPos->miCellPos =
 rCells.set(pBlockPos->miCellPos, rBasePos.Row(), pCell);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-14 Thread Markus Mohrhard
 sc/source/ui/view/tabvwsh4.cxx |8 +---
 1 file changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 9e8e6cf5441bbdb09b890e16c14c495bdda4e624
Author: Markus Mohrhard 
Date:   Wed Feb 14 02:25:32 2018 +0100

it does not make sense to check for nullptr and then access anyway

Seems to be related to the crashreports with the signatures:

http://crashreport.libreoffice.org/stats/signature/ScTabViewShell::~ScTabViewShell()

http://crashreport.libreoffice.org/stats/signature/ScInputHandler::EnterHandler(ScEnterMode)

Change-Id: Iff22db3988687a52a7596f01facd5bdd12ce4140
Reviewed-on: https://gerrit.libreoffice.org/49694
Reviewed-by: Markus Mohrhard 
Tested-by: Markus Mohrhard 
(cherry picked from commit 2fd7c18f42710bdaaf3262f4be9f1a706b33d38d)
Reviewed-on: https://gerrit.libreoffice.org/49700
Tested-by: Jenkins 
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx
index 5c0b1e8ab594..55caac70a18f 100644
--- a/sc/source/ui/view/tabvwsh4.cxx
+++ b/sc/source/ui/view/tabvwsh4.cxx
@@ -1774,10 +1774,12 @@ ScTabViewShell::~ScTabViewShell()
 // all to NULL, in case the TabView-dtor tries to access them
 //! (should not really! ??!?!)
 if (mpInputHandler)
+{
 mpInputHandler->SetDocumentDisposing(true);
-// We end edit mode, before destroying the input handler and the edit 
engine
-// and before end listening (in order to call 
ScTabViewShell::KillEditView())
-mpInputHandler->EnterHandler();
+// We end edit mode, before destroying the input handler and the edit 
engine
+// and before end listening (in order to call 
ScTabViewShell::KillEditView())
+mpInputHandler->EnterHandler();
+}
 
 ScDocShell* pDocSh = GetViewData().GetDocShell();
 EndListening(*pDocSh);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-13 Thread Eike Rathke
 sc/source/ui/docshell/impex.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 973338389732d6da9c21288b3f3455fc35b9fe0a
Author: Eike Rathke 
Date:   Mon Feb 12 17:02:29 2018 +0100

CheckLinkFormulaNeedingCheck() for .slk import

Change-Id: I79953cf4fd6e9e00351a3b1f1687b6024085e395
(cherry picked from commit 664c2902a6672be51c4a3163a5bf44aa2145d408)
Reviewed-on: https://gerrit.libreoffice.org/49610
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index e4ed928537be..6d0d788c46ad 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1896,6 +1896,7 @@ bool ScImportExport::Sylk2Doc( SvStream& rStrm )
 const formula::FormulaGrammar::Grammar eGrammar = 
formula::FormulaGrammar::GRAM_PODF_A1;
 ScCompiler aComp( pDoc, aPos, eGrammar);
 ScTokenArray* pCode = aComp.CompileString( aText );
+pDoc->CheckLinkFormulaNeedingCheck( *pCode);
 if ( ch == 'M' )
 {
 ScMarkData aMark;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-13 Thread Eike Rathke
 sc/source/core/data/table3.cxx |   35 ++-
 1 file changed, 22 insertions(+), 13 deletions(-)

New commits:
commit 114b9562e58a91b34c6e931c281d8a3900744750
Author: Eike Rathke 
Date:   Tue Feb 13 10:45:21 2018 +0100

Resolves: tdf#95192 correctly split non-numeral/numeral parts for natural 
sort

XCharacterClassification::parsePredefinedToken() with
KParseType::IDENTNAME and KParseTokens::ANY_LETTER does exactly
that, it parses one identifier name consisting of Unicode letters
and stops at the first non-letter character (additionally '-'
hyphen-minus was allowed as character).

Instead, scan for the first (any Unicode) digit and split there.

Also, copying the whole string to the prefix string if no split
happens was unnecessary, the caller does not use the prefix if no
number was found. Nail this as post condition.

Change-Id: I941f9739b39c36c83b63145e3b762ec558738c1c
(cherry picked from commit 2d62a1016438ea0bc079e6de3a5bcdcb34680f43)
Reviewed-on: https://gerrit.libreoffice.org/49629
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index f4b63f4f1eaf..cf96a01a926e 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -85,13 +85,16 @@ using namespace ::com::sun::star::i18n;
 Original string to be split into pieces
 
 @param sPrefix
-Prefix string that consists of the part before the first number token
+Prefix string that consists of the part before the first number token.
+If no number was found, sPrefix is unchanged.
 
 @param sSuffix
 String after the last number token.  This may still contain number strings.
+If no number was found, sSuffix is unchanged.
 
 @param fNum
 Number converted from the middle number string
+If no number was found, fNum is unchanged.
 
 @return Returns TRUE if a numeral element is found in a given string, or
 FALSE if no numeral element is found.
@@ -99,28 +102,34 @@ using namespace ::com::sun::star::i18n;
 bool SplitString( const OUString ,
 OUString , OUString , double  )
 {
-i18n::LocaleDataItem2 aLocaleItem = ScGlobal::pLocaleData->getLocaleItem();
-
-// Get prefix element
-OUString sUser = "-";
-ParseResult aPRPre = ScGlobal::pCharClass->parsePredefinedToken(
-KParseType::IDENTNAME, sWhole, 0,
-KParseTokens::ANY_LETTER, sUser, KParseTokens::ANY_LETTER, sUser );
-sPrefix = sWhole.copy( 0, aPRPre.EndPos );
+// Get prefix element, search for any digit and stop.
+sal_Int32 nPos = 0;
+while (nPos < sWhole.getLength())
+{
+const sal_uInt16 nType = ScGlobal::pCharClass->getCharacterType( 
sWhole, nPos);
+if (nType & KCharacterType::DIGIT)
+break;
+sWhole.iterateCodePoints(  );
+}
 
 // Return FALSE if no numeral element is found
-if ( aPRPre.EndPos == sWhole.getLength() )
+if ( nPos == sWhole.getLength() )
 return false;
 
 // Get numeral element
-sUser = aLocaleItem.decimalSeparator;
+OUString sUser = ScGlobal::pLocaleData->getNumDecimalSep();
 ParseResult aPRNum = ScGlobal::pCharClass->parsePredefinedToken(
-KParseType::ANY_NUMBER, sWhole, aPRPre.EndPos,
+KParseType::ANY_NUMBER, sWhole, nPos,
 KParseTokens::ANY_NUMBER, "", KParseTokens::ANY_NUMBER, sUser );
 
-if ( aPRNum.EndPos == aPRPre.EndPos )
+if ( aPRNum.EndPos == nPos )
+{
+SAL_WARN("sc.core","naturalsort::SplitString - digit found but no 
number parsed, pos " <<
+nPos << " : " << sWhole);
 return false;
+}
 
+sPrefix = sWhole.copy( 0, nPos );
 fNum = aPRNum.Value;
 sSuffix = sWhole.copy( aPRNum.EndPos );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-12 Thread Laurent BP
 sc/source/ui/formdlg/formula.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit c5647bd503b1d72229492b55257b0e3eb8f42464
Author: Laurent BP 
Date:   Sat Feb 10 20:54:25 2018 +0100

tdf#72440 Abs sheet ref must be given

When resolving tdf#90799, sheet ref was forced abs
But its value must be changed.
It worked only if initial sheet = Sheet1

Change-Id: I715f93dce93beb78d767e00dd45fb9634cb173a8
Reviewed-on: https://gerrit.libreoffice.org/49548
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 
(cherry picked from commit d69017c8a17be21657ea7ab9d37023ee59116799)
Reviewed-on: https://gerrit.libreoffice.org/49608

diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 6c52eb700b4b..bc1ac159f7c8 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -448,8 +448,9 @@ void ScFormulaDlg::SetReference( const ScRange& rRef, 
ScDocument* pRefDoc )
 bool bSingle = aRefData.Ref1 == aRefData.Ref2;
 if (m_CursorPos.Tab() != rRef.aStart.Tab())
 {
+// pointer-selected => absolute sheet reference
+aRefData.Ref1.SetAbsTab( rRef.aStart.Tab() );
 aRefData.Ref1.SetFlag3D(true);
-aRefData.Ref1.SetTabRel(false); // pointer-selected => 
absolute sheet reference
 }
 if (bSingle)
 aArray.AddSingleReference(aRefData.Ref1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-09 Thread Eike Rathke
 sc/source/core/data/documentimport.cxx |1 +
 sc/source/ui/docshell/impex.cxx|   11 +++
 2 files changed, 12 insertions(+)

New commits:
commit 20e0ed5c664f7ee49ee074ebf8ea72023e896217
Author: Eike Rathke 
Date:   Fri Feb 9 15:17:35 2018 +0100

CheckLinkFormulaNeedingCheck() for .csv import

Change-Id: I89be713531436f10b38d38f9e0fa527db1e036cd
(cherry picked from commit c7dd72b2bd6a7988e4e1074e9a85222b53ba84ac)
Reviewed-on: https://gerrit.libreoffice.org/49498
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/documentimport.cxx 
b/sc/source/core/data/documentimport.cxx
index c46f1b09c95d..1062cc893cd7 100644
--- a/sc/source/core/data/documentimport.cxx
+++ b/sc/source/core/data/documentimport.cxx
@@ -206,6 +206,7 @@ void ScDocumentImport::setAutoInput(const ScAddress& rPos, 
const OUString& rStr,
 pBlockPos->miCellPos = rCells.set(pBlockPos->miCellPos, 
rPos.Row(), aCell.mfValue);
 break;
 case CELLTYPE_FORMULA:
+mpImpl->mrDoc.CheckLinkFormulaNeedingCheck( 
*aCell.mpFormula->GetCode());
 // This formula cell instance is directly placed in the document 
without copying.
 pBlockPos->miCellPos = rCells.set(pBlockPos->miCellPos, 
rPos.Row(), aCell.mpFormula);
 aCell.mpFormula = nullptr;
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 88bab11ffb11..e4ed928537be 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1206,7 +1206,18 @@ static bool lcl_PutString(
 if ( bUseDocImport )
 rDocImport.setAutoInput(ScAddress(nCol, nRow, nTab), rStr, 
);
 else
+{
 pDoc->SetString( nCol, nRow, nTab, rStr,  );
+// ScColumn::ParseString() is strict about the first character
+// having to be '=' for formula, so we can use that here and don't
+// need to obtain the created cell for each and every value.
+if (rStr.getLength() > 1 && rStr[0] == '=')
+{
+const ScFormulaCell* pFC = pDoc->GetFormulaCell( ScAddress( 
nCol, nRow, nTab));
+if (pFC)
+pDoc->CheckLinkFormulaNeedingCheck( *pFC->GetCode());
+}
+}
 }
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-09 Thread Eike Rathke
 sc/source/core/tool/compiler.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 04835fd953d28e44843e9473be4f4d99a24eddf0
Author: Eike Rathke 
Date:   Wed Feb 7 22:21:51 2018 +0100

tdf#115493 postpone name resolution after unsuccessful IsNamedRange()

... for names used in named expressions when compiling during
import and collecting named expressions, to not match an arbitrary
other name.

Change-Id: I02a92747a1485b46873281de98879a89385d4622
(cherry picked from commit 30083601334279f33a3021dfe7d22970d02c8e9e)
Reviewed-on: https://gerrit.libreoffice.org/49396
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 3c6365a5e7c6..cf1a5b0eb01a 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -4274,6 +4274,15 @@ bool ScCompiler::NextNewToken( bool bInArray )
 
 if (IsNamedRange( aUpper ))
 return true;
+
+// Compiling a named expression during collecting them in import shall
+// not match arbitrary names that otherwise if all named expressions
+// were present would be recognized as named expression. Such name will
+// flag an error below and will be recompiled in a second step later
+// with ScRangeData::CompileUnresolvedXML()
+if (meExtendedErrorDetection == EXTENDED_ERROR_DETECTION_NAME_NO_BREAK 
&& pDoc->IsImportingXML())
+break;  // while
+
 // Preserve case of file names in external references.
 bool bInvalidExternalNameRange;
 if (IsExternalNamedRange( aOrg, bInvalidExternalNameRange ))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-06 Thread Bartosz Kosiorek
 sc/source/core/tool/interpr1.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit b8e9f185c509213b4daae018ec27483dacdad2a0
Author: Bartosz Kosiorek 
Date:   Tue Feb 6 00:45:32 2018 +0100

tdf#114820 Fix reading external reference for VLOOKUP and HLOOKUP

Change-Id: Iaa1307123d97a740bdaf90647e8adff224211851
Reviewed-on: https://gerrit.libreoffice.org/49263
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
(cherry picked from commit 5c3d0a70a0edb182714725ef920d74667feffb0e)
Reviewed-on: https://gerrit.libreoffice.org/49315

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index ab3f28d27225..e59b46c9f42f 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -7151,7 +7151,9 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
 }
 }
 break;
-case svMatrix :
+case svExternalDoubleRef:
+case svExternalSingleRef:
+case svMatrix:
 {
 svl::SharedString aStr;
 const ScMatValType nType = 
GetDoubleOrStringFromMatrix(rItem.mfVal, aStr);
@@ -7168,6 +7170,7 @@ bool ScInterpreter::FillEntry(ScQueryEntry& rEntry)
 } // switch ( GetStackType() )
 return true;
 }
+
 void ScInterpreter::ScVLookup()
 {
 CalculateLookup(false);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-06 Thread Bartosz Kosiorek
 sc/source/core/tool/interpr1.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d9fafddcf8eb37916c8a8e76af36d67c8db84a98
Author: Bartosz Kosiorek 
Date:   Tue Feb 6 02:10:14 2018 +0100

tdf#115162 Fix support for external reference for IFS functions

Functions SUMIFS, AVERAGEIFS, COUNTIFS, MINIFS, MAXIFS were not
supported External references.

The root cause issue, was using PopMatrix() method for:
svExternalSingleRef and svExternalDoubleRef.

PopMatrix() method only supports svMatrix, and in other
cases returns FormulaError::IllegalParameter error.

To resolve that issue, the method GetMatrix() was used.
It is properly support svMatrix, svExternalSingleRef and 
svExternalDoubleRef.

Change-Id: I3e30ca50069264a6d990b16ec668e6d0df51c6e6
Reviewed-on: https://gerrit.libreoffice.org/49264
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
(cherry picked from commit b6db65752c60de7268e4f65d7fc5ac110adb2fb0)
Reviewed-on: https://gerrit.libreoffice.org/49283

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index d3b5829a5db8..ab3f28d27225 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -5805,7 +5805,7 @@ void ScInterpreter::IterateParametersIfs( 
double(*ResultFunc)( const sc::ParamIf
 case svExternalSingleRef:
 case svExternalDoubleRef:
 {
-pQueryMatrix = PopMatrix();
+pQueryMatrix = GetMatrix();
 if (!pQueryMatrix)
 {
 PushError( FormulaError::IllegalParameter);
@@ -6029,7 +6029,7 @@ void ScInterpreter::IterateParametersIfs( 
double(*ResultFunc)( const sc::ParamIf
 case svExternalSingleRef:
 case svExternalDoubleRef:
 {
-pMainMatrix = PopMatrix();
+pMainMatrix = GetMatrix();
 if (!pMainMatrix)
 {
 PushError( FormulaError::IllegalParameter);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-06 Thread Eike Rathke
 sc/source/core/data/documen8.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 71adbb0aa8a945665aab2a0a29c7a09e5d894ad4
Author: Eike Rathke 
Date:   Mon Feb 5 23:13:08 2018 +0100

Turn assert into SAL_WARN

In the wild there are named expressions without expression and
formula error cells without formula.

Change-Id: I11546b09173de65cebe776529edee74c549d73c8
(cherry picked from commit 951dd781743c975a7d29cc30e88e1b4a56c0b176)
Reviewed-on: https://gerrit.libreoffice.org/49258
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index f38a3c63b457..ee30432eafca 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1194,7 +1194,10 @@ void ScDocument::CheckLinkFormulaNeedingCheck( const 
ScTokenArray& rCode )
 }
 else
 {
-assert(!"called with empty ScTokenArray");
+// Possible with named expression without expression like Excel
+// internal print ranges, obscure user define names, ... formula error
+// cells without formula ...
+SAL_WARN("sc.core","ScDocument::CheckLinkFormulaNeedingCheck - called 
with empty ScTokenArray");
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-02-02 Thread Eike Rathke
 sc/source/filter/excel/tokstack.cxx |   79 +++-
 sc/source/filter/inc/tokstack.hxx   |   24 ++
 sc/source/filter/lotus/lotform.cxx  |   27 +---
 3 files changed, 85 insertions(+), 45 deletions(-)

New commits:
commit 6e2f927704980c0057d5deb3a6bc3ef5540379a4
Author: Eike Rathke 
Date:   Fri Dec 1 10:54:01 2017 +0100

ofz: guard against binary crap argument counts and ID/OpCode generation

 This is a combination of 2 commits.

ofz: guard against binary crap argument counts and ID/OpCode generation

(cherry picked from commit 889c72a7e54f241342f42b1b0a05858902228cbc)

Do not force non-existent parameters into the TokenPool, ofz-related

(cherry picked from commit e6ced1496da9580cf885cce1a2fc9f67528c3a0e)

2fa0ae81b987af592c14486040077c9ff157fab9

Change-Id: I60e181729713f3b202e880707a79e9da80d9d85d
Reviewed-on: https://gerrit.libreoffice.org/49161
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/excel/tokstack.cxx 
b/sc/source/filter/excel/tokstack.cxx
index 39a334d5..4129b50f2287 100644
--- a/sc/source/filter/excel/tokstack.cxx
+++ b/sc/source/filter/excel/tokstack.cxx
@@ -108,6 +108,21 @@ bool TokenPool::GrowId()
 return true;
 }
 
+bool TokenPool::CheckElementOrGrow()
+{
+// Last possible ID to be assigned somewhere is nElementAkt+1
+if (nElementAkt + 1 == nScTokenOff - 1)
+{
+SAL_WARN("sc.filter","TokenPool::CheckElementOrGrow - last possible ID 
" << nElementAkt+1);
+return false;
+}
+
+if (nElementAkt >= nElement)
+return GrowElement();
+
+return true;
+}
+
 bool TokenPool::GrowElement()
 {
 sal_uInt16 nElementNew = lcl_canGrow( nElement);
@@ -161,9 +176,11 @@ bool TokenPool::GrowMatrix()
 
 bool TokenPool::GetElement( const sal_uInt16 nId )
 {
-OSL_ENSURE( nId < nElementAkt, "*TokenPool::GetElement(): Id too large!?" 
);
 if (nId >= nElementAkt)
+{
+SAL_WARN("sc.filter","TokenPool::GetElement - Id too large, " << nId 
<< " >= " << nElementAkt);
 return false;
+}
 
 bool bRet = true;
 if( pType[ nId ] == T_Id )
@@ -394,9 +411,8 @@ void TokenPool::operator >>( TokenId& rId )
 {
 rId = static_cast( nElementAkt + 1 );
 
-if( nElementAkt >= nElement )
-if (!GrowElement())
-return;
+if (!CheckElementOrGrow())
+return;
 
 pElement[ nElementAkt ] = nP_IdLast;// Start of Token-sequence
 pType[ nElementAkt ] = T_Id;// set Typeinfo
@@ -409,9 +425,8 @@ void TokenPool::operator >>( TokenId& rId )
 
 const TokenId TokenPool::Store( const double& rDouble )
 {
-if( nElementAkt >= nElement )
-if (!GrowElement())
-return static_cast(nElementAkt+1);
+if (!CheckElementOrGrow())
+return static_cast(nElementAkt+1);
 
 if( pP_Dbl.m_writemark >= pP_Dbl.m_capacity )
 if (!pP_Dbl.Grow())
@@ -438,9 +453,8 @@ const TokenId TokenPool::Store( const sal_uInt16 nIndex )
 const TokenId TokenPool::Store( const OUString& rString )
 {
 // mostly copied to Store( const sal_Char* ), to avoid a temporary string
-if( nElementAkt >= nElement )
-if (!GrowElement())
-return static_cast(nElementAkt+1);
+if (!CheckElementOrGrow())
+return static_cast(nElementAkt+1);
 
 if( ppP_Str.m_writemark >= ppP_Str.m_capacity )
 if (!ppP_Str.Grow())
@@ -468,9 +482,8 @@ const TokenId TokenPool::Store( const OUString& rString )
 
 const TokenId TokenPool::Store( const ScSingleRefData& rTr )
 {
-if( nElementAkt >= nElement )
-if (!GrowElement())
-return static_cast(nElementAkt+1);
+if (!CheckElementOrGrow())
+return static_cast(nElementAkt+1);
 
 if( ppP_RefTr.m_writemark >= ppP_RefTr.m_capacity )
 if (!ppP_RefTr.Grow())
@@ -492,9 +505,8 @@ const TokenId TokenPool::Store( const ScSingleRefData& rTr )
 
 const TokenId TokenPool::Store( const ScComplexRefData& rTr )
 {
-if( nElementAkt >= nElement )
-if (!GrowElement())
-return static_cast(nElementAkt+1);
+if (!CheckElementOrGrow())
+return static_cast(nElementAkt+1);
 
 if( ppP_RefTr.m_writemark + 1 >= ppP_RefTr.m_capacity )
 if (!ppP_RefTr.Grow(2))
@@ -522,9 +534,8 @@ const TokenId TokenPool::Store( const ScComplexRefData& rTr 
)
 
 const TokenId TokenPool::Store( const DefTokenId e, const OUString& r )
 {
-if( nElementAkt >= nElement )
-if (!GrowElement())
-return static_cast(nElementAkt+1);
+if (!CheckElementOrGrow())
+return static_cast(nElementAkt+1);
 
 if( ppP_Ext.m_writemark >= ppP_Ext.m_capacity )
 if (!ppP_Ext.Grow())
@@ -549,9 +560,8 @@ const TokenId TokenPool::Store( const DefTokenId e, const 
OUString& r )
 
 const TokenId 

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

2018-02-02 Thread Eike Rathke
 sc/source/filter/qpro/qpro.cxx |5 
 sc/source/filter/qpro/qproform.cxx |   39 -
 2 files changed, 31 insertions(+), 13 deletions(-)

New commits:
commit 5b51f45bcbf5fb70b7e53d9deaf5663402f61b27
Author: Eike Rathke 
Date:   Wed Jan 31 18:00:15 2018 +0100

ofz: do not force non-existent parameters into the TokenPool

 This is a combination of 4 commits.

ofz: guard against binary crap argument counts and ID/OpCode generation

Same as in sc/source/filter/lotus/lotform.cxx LotusToSc::DoFunc()

(cherry picked from commit d2473faee119c35b518849afe3daa6977a751c68)

ofz: do not force non-existent parameters into the TokenPool

Apart from that, the hard coded storage order for ocRRI and ocIpmt
did the same as the general loop, just with a fixed number of
parameters. Instead, limit the number of arguments for the loop
for these opcodes.

(cherry picked from commit bc697917c79609243305dcecc7aeef2f3776611c)

Author was too dumb to adjust a copy-pasta digit

(cherry picked from commit 6fc7f3f8409040a3d977b944b3fa4151faf31301)

Check for end-of-stream after reading formula headers

(cherry picked from commit 1698425c6e2341835aef8c405c06482d4d78d73a)

378ccaf60da61c1a38451456d8422ee33c50
7d171fdf21c02af9a14600c5e0c6294c0f3ebb57
0de0ceeda63d733779aa595bdbd0f2be97827694

Change-Id: I4972e065ab96abdea42d64481d4e30674230ab99
Reviewed-on: https://gerrit.libreoffice.org/49120
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/qpro/qpro.cxx b/sc/source/filter/qpro/qpro.cxx
index 0c1d18d59ffd..e7e2a6d17d27 100644
--- a/sc/source/filter/qpro/qpro.cxx
+++ b/sc/source/filter/qpro/qpro.cxx
@@ -101,6 +101,11 @@ ErrCode ScQProReader::readSheet( SCTAB nTab, ScDocument* 
pDoc, ScQProStyle *pSty
 double nValue;
 sal_uInt16 nState, nLen;
 mpStream->ReadUChar( nCol ).ReadUChar( nDummy ).ReadUInt16( 
nRow ).ReadUInt16( nStyle ).ReadDouble( nValue ).ReadUInt16( nState 
).ReadUInt16( nLen );
+if (!mpStream->good())
+{
+eRet = SCERR_IMPORT_FORMAT;
+break;
+}
 ScAddress aAddr( nCol, nRow, nTab );
 const ScTokenArray *pArray;
 
diff --git a/sc/source/filter/qpro/qproform.cxx 
b/sc/source/filter/qpro/qproform.cxx
index 73da364969c9..e4a83bcee6e4 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -94,8 +94,12 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, 
const sal_Char* pExtStr
 
 if( nArgs < nBufSize )
 {
-for( nCount = 0; nCount < nArgs ; nCount++ )
+for( nCount = 0; nCount < nArgs && aStack.HasMoreTokens() ; nCount++ )
 aStack >> eParam[ nCount ];
+
+if (nCount < nArgs)
+// Adapt count to reality. All sort of binary crap is possible.
+nArgs = static_cast(nCount);
 }
 else
 return;
@@ -132,20 +136,29 @@ void QProToSc::DoFunc( DefTokenId eOc, sal_uInt16 nArgs, 
const sal_Char* pExtStr
 
 if( nArgs> 0 )
 {
-sal_Int16 nLast = nArgs- 1;
-
 if( eOc == ocRRI )
-aPool << eParam[ 2 ] << ocSep << eParam[ 1 ] << ocSep << eParam[ 0 
];
-if( eOc == ocIpmt )
-aPool << eParam[ 3 ] << ocSep << eParam[ 2 ] << ocSep << eParam[ 1 
] << ocSep << eParam[ 0 ];
-else
 {
-aPool << eParam[ nLast ];
-for( nCount = nLast - 1 ; nCount >= 0 ; nCount-- )
-{
-if( nCount != -1 )
-aPool << ocSep << eParam[ nCount ];
-}
+// There should be at least 3 arguments, but with binary crap may 
not..
+SAL_WARN_IF( nArgs < 3, "sc.filter","QProToSc::DoFunc - ocRRI 
expects 3 parameters but got " << nArgs);
+// Store first 3 parameters to pool in order 2,1,0
+if (nArgs > 3)
+nArgs = 3;
+}
+else if( eOc == ocIpmt )
+{
+// There should be at least 4 arguments, but with binary crap may 
not..
+SAL_WARN_IF( nArgs < 4, "sc.filter","QProToSc::DoFunc - ocIpmt 
expects 4 parameters but got " << nArgs);
+// Store first 4 parameters to pool in order 3,2,1,0
+if (nArgs > 4)
+nArgs = 4;
+}
+
+sal_Int16 nLast = nArgs - 1;
+aPool << eParam[ nLast ];
+for( nCount = nLast - 1 ; nCount >= 0 ; nCount-- )
+{
+if( nCount != -1 )
+aPool << ocSep << eParam[ nCount ];
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org

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

2018-01-30 Thread Vasily Melenchuk
 sc/source/ui/docshell/externalrefmgr.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit cef36cbbeafa9d7899bfb9c2404dec253cc86ee2
Author: Vasily Melenchuk 
Date:   Tue Jan 23 13:59:01 2018 +0300

tdf#115044: do not load external documents if it is not allowed

Referenced external document data can be loaded after user
permission from dialog or corresponding settings.

Change-Id: If3aec37c8bbdee4aebeb99c7807e87c26df8e592
Reviewed-on: https://gerrit.libreoffice.org/48398
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
(cherry picked from commit 8b98991a66197a71953dbb900dc3aece6b4f9e3a)
Reviewed-on: https://gerrit.libreoffice.org/48869
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 9cee85bee434..480046766557 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2368,6 +2368,15 @@ ScDocument* 
ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
 if (!pFileName)
 return nullptr;
 
+// Do not load document until it was allowed
+SfxObjectShell* pDocShell = mpDoc->GetDocumentShell();
+if ( pDocShell )
+{
+const comphelper::EmbeddedObjectContainer& rContainer = 
pDocShell->GetEmbeddedObjectContainer();
+if ( !rContainer.getUserAllowsLinkUpdate() )
+return nullptr;
+}
+
 ScDocument* pSrcDoc = nullptr;
 ScDocShell* pShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell,
 false));
 while (pShell)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-30 Thread Eike Rathke
 sc/source/core/tool/rangenam.cxx|8 +++-
 sc/source/filter/excel/xiname.cxx   |3 +++
 sc/source/filter/oox/defnamesbuffer.cxx |2 ++
 3 files changed, 12 insertions(+), 1 deletion(-)

New commits:
commit 9e019a647dc76706c438a8842c40ce7a8829216f
Author: Eike Rathke 
Date:   Mon Jan 29 18:19:33 2018 +0100

CheckLinkFormulaNeedingCheck() for named expressions

 This is a combination of 3 commits.

CheckLinkFormulaNeedingCheck() for .ods named expressions

This is specifically necessary for named expressions that are used
in conditional format formulas, for which RPN is generated at a
later stage, not during import.

(cherry picked from commit eae9648e99be53ba441d9d8207aac6f3ce211ef2)

CheckLinkFormulaNeedingCheck() for .xls named expressions

(cherry picked from commit 8512f13c42ae3fbb287a555616fe10ff04295616)

CheckLinkFormulaNeedingCheck() for .xlsx named expressions

(cherry picked from commit a1f933ee2b9e23a505d937035821e9571cf4119c)

e03cb5767c34f8157a492a6d6c3b0700d065052d
217c89822ab477a6c383d170ae739e44efd10fa3

Change-Id: I54ab8dc14f81d6b18b0d17f448187d19d8e396fc
Reviewed-on: https://gerrit.libreoffice.org/48857
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/rangenam.cxx b/sc/source/core/tool/rangenam.cxx
index de12cc15cf6c..bf946130337b 100644
--- a/sc/source/core/tool/rangenam.cxx
+++ b/sc/source/core/tool/rangenam.cxx
@@ -63,9 +63,14 @@ ScRangeData::ScRangeData( ScDocument* pDok,
 mnMaxCol(-1)
 {
 if (!rSymbol.isEmpty())
-CompileRangeData( rSymbol, pDoc->IsImportingXML());
+{
 // Let the compiler set an error on unknown names for a subsequent
 // CompileUnresolvedXML().
+const bool bImporting = pDoc->IsImportingXML();
+CompileRangeData( rSymbol, bImporting);
+if (bImporting)
+pDoc->CheckLinkFormulaNeedingCheck( *pCode);
+}
 else
 {
 // #i63513#/#i65690# don't leave pCode as NULL.
@@ -194,6 +199,7 @@ void ScRangeData::CompileUnresolvedXML( 
sc::CompileFormulaContext& rCxt )
 // Don't let the compiler set an error for unknown names on final
 // compile, errors are handled by the interpreter thereafter.
 CompileRangeData( aSymbol, false);
+rCxt.getDoc()->CheckLinkFormulaNeedingCheck( *pCode);
 }
 }
 
diff --git a/sc/source/filter/excel/xiname.cxx 
b/sc/source/filter/excel/xiname.cxx
index eb4c537398fe..12e6ba3e91f8 100644
--- a/sc/source/filter/excel/xiname.cxx
+++ b/sc/source/filter/excel/xiname.cxx
@@ -270,7 +270,10 @@ void XclImpName::InsertName(const ScTokenArray* pArray)
 }
 }
 if (pData)
+{
+GetDoc().CheckLinkFormulaNeedingCheck( *pData->GetCode());
 mpScData = pData;   // cache for later use
+}
 }
 
 XclImpNameManager::XclImpNameManager( const XclImpRoot& rRoot ) :
diff --git a/sc/source/filter/oox/defnamesbuffer.cxx 
b/sc/source/filter/oox/defnamesbuffer.cxx
index d7fb59ff934a..6f761b2c9b7c 100644
--- a/sc/source/filter/oox/defnamesbuffer.cxx
+++ b/sc/source/filter/oox/defnamesbuffer.cxx
@@ -39,6 +39,7 @@
 #include 
 #include 
 #include 
+#include 
 
 namespace oox {
 namespace xls {
@@ -332,6 +333,7 @@ std::unique_ptr DefinedName::getScTokens(
 // after, a resulting error must be reset.
 FormulaError nErr = pArray->GetCodeError();
 aCompiler.CompileTokenArray();
+getScDocument().CheckLinkFormulaNeedingCheck( *pArray);
 pArray->DelRPN();
 pArray->SetCodeError(nErr);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-29 Thread Eike Rathke
 sc/source/core/data/conditio.cxx  |6 ++
 sc/source/core/data/documen8.cxx  |   17 +++--
 sc/source/filter/excel/xicontent.cxx  |6 ++
 sc/source/filter/oox/condformatbuffer.cxx |2 ++
 4 files changed, 29 insertions(+), 2 deletions(-)

New commits:
commit b7aedaf539a08e1b8a6966a75ebcbb7527466dd0
Author: Eike Rathke 
Date:   Thu Jan 25 13:20:27 2018 +0100

CheckLinkFormulaNeedingCheck() for conditional format expressions

 This is a combination of 4 commits.

Prepare CheckLinkFormulaNeedingCheck() to use either RPN or tokenized code

Conditional format formulas aren't finally compiled until needed
so the check will have to operate on the tokenized expression
instead of RPN code.

(cherry picked from commit faa0305ba3d0dc698fce4915d4f3a1fb52422380)

CheckLinkFormulaNeedingCheck() for .ods conditional format expressions

(cherry picked from commit 2930ba2ac5d9423f2848b968edcd8ddc71966186)

CheckLinkFormulaNeedingCheck() for .xlsx conditional format expressions

(cherry picked from commit fef24d9f999ee54d7936900485d97ff26656f517)

CheckLinkFormulaNeedingCheck() for .xls conditional format expressions

(cherry picked from commit af2a2a0c72db312902e466c36697b5c198041e82)

45eb1ab5efa0ec9da2663f20427d2474ce300826
31ede1a23223a798141a0891deeabd8cf88fff58
afa112cc591b411d80ead48bf726788d361f6eb3

Change-Id: I68837e9bd33f125ab47b10b1a6fa18175abd1627
Reviewed-on: https://gerrit.libreoffice.org/48718
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index 7e2d9a30b372..2b55201d8359 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -524,6 +524,12 @@ void ScConditionEntry::CompileXML()
 Compile( GetExpression(aSrcPos, 0, 0, eTempGrammar1),
  GetExpression(aSrcPos, 1, 0, eTempGrammar2),
  aStrNmsp1, aStrNmsp2, eTempGrammar1, eTempGrammar2, true );
+
+// Importing ocDde/ocWebservice?
+if (pFormula1)
+mpDoc->CheckLinkFormulaNeedingCheck(*pFormula1);
+if (pFormula2)
+mpDoc->CheckLinkFormulaNeedingCheck(*pFormula2);
 }
 
 void ScConditionEntry::SetSrcString( const OUString& rNew )
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index 4a2b7b5a9f99..f38a3c63b457 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -1181,8 +1181,21 @@ void ScDocument::CheckLinkFormulaNeedingCheck( const 
ScTokenArray& rCode )
 if (HasLinkFormulaNeedingCheck())
 return;
 
-if (rCode.HasOpCodeRPN(ocDde) || rCode.HasOpCodeRPN(ocWebservice))
-SetLinkFormulaNeedingCheck(true);
+// Prefer RPN over tokenized formula if available.
+if (rCode.GetCodeLen())
+{
+if (rCode.HasOpCodeRPN(ocDde) || rCode.HasOpCodeRPN(ocWebservice))
+SetLinkFormulaNeedingCheck(true);
+}
+else if (rCode.GetLen())
+{
+if (rCode.HasOpCode(ocDde) || rCode.HasOpCode(ocWebservice))
+SetLinkFormulaNeedingCheck(true);
+}
+else
+{
+assert(!"called with empty ScTokenArray");
+}
 }
 
 // TimerDelays etc.
diff --git a/sc/source/filter/excel/xicontent.cxx 
b/sc/source/filter/excel/xicontent.cxx
index 3d0de0d1413c..fd81ada12fe4 100644
--- a/sc/source/filter/excel/xicontent.cxx
+++ b/sc/source/filter/excel/xicontent.cxx
@@ -662,7 +662,10 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
 rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize1, false, FT_CondFormat );
 // formula converter owns pTokArr -> create a copy of the token array
 if( pTokArr )
+{
 xTokArr1.reset( pTokArr->Clone() );
+GetDocRef().CheckLinkFormulaNeedingCheck( *xTokArr1);
+}
 }
 
 ::std::unique_ptr< ScTokenArray > pTokArr2;
@@ -673,7 +676,10 @@ void XclImpCondFormat::ReadCF( XclImpStream& rStrm )
 rFmlaConv.Convert( pTokArr, rStrm, nFmlaSize2, false, FT_CondFormat );
 // formula converter owns pTokArr -> create a copy of the token array
 if( pTokArr )
+{
 pTokArr2.reset( pTokArr->Clone() );
+GetDocRef().CheckLinkFormulaNeedingCheck( *pTokArr2);
+}
 }
 
 // *** create the Calc conditional formatting ***
diff --git a/sc/source/filter/oox/condformatbuffer.cxx 
b/sc/source/filter/oox/condformatbuffer.cxx
index 515e0422accc..3a46a3b28fa6 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -868,11 +868,13 @@ void CondFormatRule::finalizeImport()
 {
 pTokenArray2.reset(new ScTokenArray());
 ScTokenConversion::ConvertToTokenArray( rDoc, *pTokenArray2.get(), 

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

2018-01-27 Thread Eike Rathke
 sc/source/core/tool/rangelst.cxx |  164 +--
 1 file changed, 89 insertions(+), 75 deletions(-)

New commits:
commit 269f4c8c283f8b723fc63a5d4c975f28700a9cf8
Author: Eike Rathke 
Date:   Mon Jan 22 19:55:38 2018 +0100

Flatten ScRangeList::Join() and ScRangePairList::Join() recursion

 This is a combination of 2 commits.

Flatten ScRangeList::Join() recursion

Joining an existing list of identical ranges could end up in a
very deep (but not infinite) recursion which could lead to stack
exhaustion. Recursion is unnecessary if we re-enter the loop with
the picked range. Continuing the loop as it was done after
recursion isn't necessary either, to the contrary, as long as
there is one join try the entire list again.

Commit f6eefd96cb16a9b5607fe59bdbf9b1121c9b56e8 pointed this out
as the UBSan build runs with ulimit -s 8192

Reviewed-on: https://gerrit.libreoffice.org/48360
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 
(cherry picked from commit 03f429665b4d57f63b8e2862a55e5c4273bc7a2b)

Flatten ScRangePairList::Join() recursion

Similar to ScRangeList::Join() done before.

Reviewed-on: https://gerrit.libreoffice.org/48361
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 
(cherry picked from commit 73049e5dbf9430df077dd26bed9d01435f745544)

e513b4c72bc211c196e13761b63446174321a389

Change-Id: Ibbc542fc8ae6d1509744aa731771eb6e32a38841
Reviewed-on: https://gerrit.libreoffice.org/48404
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index ae9ebd2b5d67..cb042885a160 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -207,12 +207,6 @@ void ScRangeList::Join( const ScRange& r, bool bIsInList )
 Append( r );
 return ;
 }
-SCCOL nCol1 = r.aStart.Col();
-SCROW nRow1 = r.aStart.Row();
-SCTAB nTab1 = r.aStart.Tab();
-SCCOL nCol2 = r.aEnd.Col();
-SCROW nRow2 = r.aEnd.Row();
-SCTAB nTab2 = r.aEnd.Tab();
 
 // One common usage is to join ranges that actually are top to bottom
 // appends but the caller doesn't exactly know about it, e.g. when invoked
@@ -225,6 +219,7 @@ void ScRangeList::Join( const ScRange& r, bool bIsInList )
 
 if (!bIsInList)
 {
+const SCROW nRow1 = r.aStart.Row();
 if (nRow1 > mnMaxRowUsed + 1)
 {
 Append( r );
@@ -235,9 +230,10 @@ void ScRangeList::Join( const ScRange& r, bool bIsInList )
 // Check if we can simply enlarge the last range.
 ScRange* p = maRanges.back();
 if (p->aEnd.Row() + 1 == nRow1 &&
-p->aStart.Col() == nCol1 && p->aEnd.Col() == nCol2 &&
-p->aStart.Tab() == nTab1 && p->aEnd.Tab() == nTab2)
+p->aStart.Col() == r.aStart.Col() && p->aEnd.Col() == 
r.aEnd.Col() &&
+p->aStart.Tab() == r.aStart.Tab() && p->aEnd.Tab() == 
r.aEnd.Tab())
 {
+const SCROW nRow2 = r.aEnd.Row();
 p->aEnd.SetRow( nRow2 );
 mnMaxRowUsed = nRow2;
 return;
@@ -245,43 +241,45 @@ void ScRangeList::Join( const ScRange& r, bool bIsInList )
 }
 }
 
-ScRange* pOver = const_cast(); // nasty but true when 
bInList
-size_t nOldPos = 0;
-if ( bIsInList )
-{
-// Find the current position of this range.
-for ( size_t i = 0, nRanges = maRanges.size(); i < nRanges; ++i )
-{
-if ( maRanges[i] == pOver )
-{
-nOldPos = i;
-break;
-}
-}
-}
 bool bJoinedInput = false;
+const ScRange* pOver = 
+
+Label_Range_Join:
 
-// We need to query the size of the container dynamically since its size
-// may change during the loop.
-for ( size_t i = 0; i < maRanges.size() && pOver; ++i )
+assert(pOver);
+const SCCOL nCol1 = pOver->aStart.Col();
+const SCROW nRow1 = pOver->aStart.Row();
+const SCCOL nTab1 = pOver->aStart.Tab();
+const SCCOL nCol2 = pOver->aEnd.Col();
+const SCROW nRow2 = pOver->aEnd.Row();
+const SCCOL nTab2 = pOver->aEnd.Tab();
+
+size_t nOverPos = std::numeric_limits::max();
+for (size_t i = 0; i < maRanges.size(); ++i)
 {
 ScRange* p = maRanges[i];
 if ( p == pOver )
+{
+nOverPos = i;
 continue;   // the same one, continue with the next
+}
 bool bJoined = false;
-if ( p->In( r ) )
-{   //range r included in or identical to range p
+if ( p->In( *pOver ) )
+{   

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

2018-01-27 Thread Eike Rathke
 sc/source/core/tool/interpr3.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 45b5060048daac415f43b75152f3251ee8d1fead
Author: Eike Rathke 
Date:   Fri Jan 19 18:30:45 2018 +0100

Don't push error twice

No harm was done as the stack is cleaned up afterwards, but it's wrong
anyway and having to push the result downwards during cleanup is
unnecessary.

Change-Id: I0b2c153c9791ce5c287d340bac466c19cd6a5703
(cherry picked from commit 2e832eff2fea4005fb43521593f979657ef7c111)
Reviewed-on: https://gerrit.libreoffice.org/48226
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 7c9753cae3b7..b66d867a0bcb 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -2704,13 +2704,14 @@ void ScInterpreter::ScTTest()
 }
 else if (fTyp == 2.0)
 {
-CalculateTest(false,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF);
+if (!CalculateTest(false,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF))
+return; // error was pushed
 }
 else if (fTyp == 3.0)
 {
-CalculateTest(true,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF);
+if (!CalculateTest(true,nC1, nC2,nR1, nR2,pMat1,pMat2,fT,fF))
+return; // error was pushed
 }
-
 else
 {
 PushIllegalArgument();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-25 Thread Jim Raykowski
 sc/source/ui/view/formatsh.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 4c6fc246c9d9388b7a512cb4371bc6bb09e8581b
Author: Jim Raykowski 
Date:   Mon Dec 18 15:03:02 2017 -0900

tdf#114519 Update cell content on sidebar number format change

In Calc, when the cursor is flashing in a cell (input mode) and the
sidebar Number Format panel 'Select a category of contents' drop down
selection is changed the cell contents does not update on selection
change.

This patch ends cell input mode on 'Select a category of contents' drop
down change allowing cell to be updated to the selected number format.

Change-Id: Ia1f46499ada2cfbcc82bd5babb6cf56ae0d6259c
Reviewed-on: https://gerrit.libreoffice.org/46883
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit 7416c2ea6c25ec1ff60ce1055b79b216cd501140)
Reviewed-on: https://gerrit.libreoffice.org/48632
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 82f5ba3fbc97..b6522696ad34 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -1004,6 +1004,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq )
 {
 switch ( nSlot )
 {
+case SID_NUMBER_TYPE_FORMAT:
 case SID_NUMBER_TWODEC:
 case SID_NUMBER_SCIENTIFIC:
 case SID_NUMBER_DATE:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-18 Thread Ahmed GHANMI
 sc/source/core/data/table3.cxx |   75 +
 1 file changed, 39 insertions(+), 36 deletions(-)

New commits:
commit a91cd78c443cc2365f4fd6398ea054cb7ef37ca5
Author: Ahmed GHANMI 
Date:   Thu Jan 18 10:40:50 2018 +0100

tdf#114720: Fix subtotal crash

A condition was added in order to not make subtotal
functions if category was not checked.

Change-Id: I56f11330fa16bf0d3199576ce2545cbc8d13e864
Reviewed-on: https://gerrit.libreoffice.org/48099
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit 6cb011cc644d8f2e189ce5b8e5de7ff297969840)
Reviewed-on: https://gerrit.libreoffice.org/48162
Tested-by: Jenkins 

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index b973dd8fd6bc..f4b63f4f1eaf 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2139,48 +2139,51 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
 }
 }
 
-// generate global total
-SCROW nGlobalStartRow = aRowVector[0].nSubStartRow;
-SCROW nGlobalStartFunc = aRowVector[0].nFuncStart;
-SCROW nGlobalEndRow = 0;
-SCROW nGlobalEndFunc = 0;
-for ( ::std::vector< RowEntry >::const_iterator iEntry( 
aRowVector.begin());
-iEntry != aRowVector.end(); ++iEntry)
-{
-nGlobalEndRow = (nGlobalEndRow < iEntry->nDestRow) ? iEntry->nDestRow 
: nGlobalEndRow;
-nGlobalEndFunc = (nGlobalEndFunc < iEntry->nFuncEnd) ? 
iEntry->nFuncEnd : nGlobalEndRow;
-}
-
-for (sal_uInt16 nLevel=0; nLevel 0)
 {
-// increment end row
-nGlobalEndRow++;
+// generate global total
+SCROW nGlobalStartRow = aRowVector[0].nSubStartRow;
+SCROW nGlobalStartFunc = aRowVector[0].nFuncStart;
+SCROW nGlobalEndRow = 0;
+SCROW nGlobalEndFunc = 0;
+for (::std::vector< RowEntry >::const_iterator 
iEntry(aRowVector.begin());
+ iEntry != aRowVector.end(); ++iEntry)
+{
+nGlobalEndRow = (nGlobalEndRow < iEntry->nDestRow) ? 
iEntry->nDestRow : nGlobalEndRow;
+nGlobalEndFunc = (nGlobalEndFunc < iEntry->nFuncEnd) ? 
iEntry->nFuncEnd : nGlobalEndRow;
+}
 
-// add row entry for formula
-aRowEntry.nGroupNo = nLevelCount-nLevel-1;
-aRowEntry.nSubStartRow = nGlobalStartRow;
-aRowEntry.nFuncStart = nGlobalStartFunc;
-aRowEntry.nDestRow = nGlobalEndRow;
-aRowEntry.nFuncEnd = nGlobalEndFunc;
+for (sal_uInt16 nLevel = 0; nLevelInsertRow( 0, nTab, MAXCOL, nTab, 
aRowEntry.nDestRow, 1 );
+// increment row
+nGlobalEndFunc++;
 
-if (bSpaceLeft)
-{
-aRowVector.push_back( aRowEntry );
-nEndRow++;
-DBShowRow(aRowEntry.nDestRow, true);
+bSpaceLeft = pDocument->InsertRow(0, nTab, MAXCOL, nTab, 
aRowEntry.nDestRow, 1);
 
-// insert label
-ScSubTotalFunc* eResFunc = rParam.pFunctions[aRowEntry.nGroupNo];
-OUString label = ScGlobal::GetRscString( STR_TABLE_GRAND );
-label += " ";
-label += ScGlobal::GetRscString(lcl_GetSubTotalStrId(eResFunc[0]));
-SetString( nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, 
nTab, label );
-ApplyStyle( nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, 
pStyle );
+if (bSpaceLeft)
+{
+aRowVector.push_back(aRowEntry);
+nEndRow++;
+DBShowRow(aRowEntry.nDestRow, true);
+
+// insert label
+ScSubTotalFunc* eResFunc = 
rParam.pFunctions[aRowEntry.nGroupNo];
+OUString label = ScGlobal::GetRscString(STR_TABLE_GRAND);
+label += " ";
+label += 
ScGlobal::GetRscString(lcl_GetSubTotalStrId(eResFunc[0]));
+SetString(nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, 
nTab, label);
+ApplyStyle(nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, 
pStyle);
+}
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-16 Thread Julien Nabet
 sc/source/ui/view/tabvwshf.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 98d825fbfecd3f63bf40b2e6d799f1ba4e43d0af
Author: Julien Nabet 
Date:   Sun Jan 14 10:20:09 2018 +0100

tdf#114992: fix crash in deleting sheet

See bt:
https://bugs.documentfoundation.org/attachment.cgi?id=139087

Change-Id: Iee72385a8e5400436da72fe5e18b8cdfccad193d
Reviewed-on: https://gerrit.libreoffice.org/47850
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 1d71f886d6760e5b3eeb4a0f9aaaead0816a45aa)
Reviewed-on: https://gerrit.libreoffice.org/47859
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx
index 3cbe8c83aa8f..f315b6cbe89f 100644
--- a/sc/source/ui/view/tabvwshf.cxx
+++ b/sc/source/ui/view/tabvwshf.cxx
@@ -612,7 +612,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq )
 {
 const ScDPObject& rDPObj = (*pDPs)[i];
 const ScSheetSourceDesc* pSheetSourceDesc 
= rDPObj.GetSheetDesc();
-if 
(pSheetSourceDesc->GetSourceRange().aStart.Tab() == nSelTab)
+if (pSheetSourceDesc && 
pSheetSourceDesc->GetSourceRange().aStart.Tab() == nSelTab)
 bTabWithPivotTable = true;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-16 Thread Markus Mohrhard
 sc/source/ui/navipi/navipi.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 2c202d82ed024c65e1bde3b93cb14dd4a03bd2a5
Author: Markus Mohrhard 
Date:   Thu Jan 11 22:42:07 2018 +0100

shapes provide their name through the container::XNamed interface, 
tdf#114932

This is actually a problem introduced by 
1c80246e5ff8aeb3e05384d86766a56aa878c7be
and not by 5ee141ee2fb77c3cc452ac656235d7e83e15072c as mentioned in the bug 
report.

Change-Id: I5f4032c13cf5eac3e515ada10b9bfa87598da438
Reviewed-on: https://gerrit.libreoffice.org/47841
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 
(cherry picked from commit cfa0b631d00f1c17d15646ddcf78093b7f4df03b)
Reviewed-on: https://gerrit.libreoffice.org/47843
Reviewed-by: Noel Grandin 
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index e84c61e056dc..79ebee607a68 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -809,9 +809,9 @@ void ScNavigatorDlg::UpdateSelection()
 uno::Reference< drawing::XShape > xShape;
 if( xIndexAccess->getByIndex(0) >>= xShape )
 {
-uno::Reference< beans::XPropertySet > xProps( xShape, 
uno::UNO_QUERY_THROW );
-OUString sName;
-if( ( xProps->getPropertyValue("Name") >>= sName ) && 
!sName.isEmpty() )
+uno::Reference< container::XNamed > xNamed( xShape, 
uno::UNO_QUERY_THROW );
+OUString sName = xNamed->getName();
+if (!sName.isEmpty())
 {
 aLbEntries->SelectEntryByName( ScContentId::DRAWING, sName );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-12 Thread Caolán McNamara
 sc/source/core/tool/interpr7.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit 3271e8b90f5d522fdfe1de46b77e7f67cdaa75af
Author: Caolán McNamara 
Date:   Wed Jan 10 14:27:35 2018 +

limit WEBSERVICE to http[s] protocols

and like excel...

'For protocols that aren’t supported, such as ftp:// or file://, WEBSERVICE
returns the #VALUE! error value.'

Change-Id: I0e9c6fd3426fad56a199eafac48de9b0f23914b3
Reviewed-on: https://gerrit.libreoffice.org/47775
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/interpr7.cxx b/sc/source/core/tool/interpr7.cxx
index b92bf8cccf22..863664cc5309 100644
--- a/sc/source/core/tool/interpr7.cxx
+++ b/sc/source/core/tool/interpr7.cxx
@@ -14,6 +14,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -247,6 +248,14 @@ void ScInterpreter::ScWebservice()
 return;
 }
 
+INetURLObject aObj(aURI, INetProtocol::File);
+INetProtocol eProtocol = aObj.GetProtocol();
+if (eProtocol != INetProtocol::Http && eProtocol != 
INetProtocol::Https)
+{
+PushError( FormulaError::NoValue );
+return;
+}
+
 uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( 
ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), 
uno::UNO_QUERY );
 if(!xFileAccess.is())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-12 Thread Caolán McNamara
 sc/source/ui/docshell/arealink.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dc2a2bd172762e95ebc66d58ba04b2071d00d0b1
Author: Caolán McNamara 
Date:   Fri Jan 12 10:48:59 2018 +

VclPtr, missing dispose

Change-Id: I790cd8be0d461d4c82c9b1c64e334bd37115dcaf
Reviewed-on: https://gerrit.libreoffice.org/47802
Tested-by: Jenkins 
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 95fc79d8ed01..ce6ba04c5e8d 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -88,7 +88,7 @@ void ScAreaLink::Edit(vcl::Window* pParent, const 
Link& /* rEn
 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
 OSL_ENSURE(pFact, "ScAbstractFactory create fail!");
 
-VclPtr pDlg = 
pFact->CreateScLinkedAreaDlg(pParent);
+ScopedVclPtr 
pDlg(pFact->CreateScLinkedAreaDlg(pParent));
 OSL_ENSURE(pDlg, "Dialog create fail!");
 pDlg->InitFromOldLink( aFileName, aFilterName, aOptions, aSourceArea, 
GetRefreshDelay() );
 pImpl->m_pDialog = pDlg;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-12 Thread Stephan Bergmann
 sc/source/ui/navipi/navipi.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit efb5faa2255d0b18705e908a46d403cbe26d25d0
Author: Stephan Bergmann 
Date:   Thu Jan 11 17:20:02 2018 +0100

Add back initialization of ScNavigatorSettings::maExpandedVec

...lost with 2ea92be9973e6892727eae37ae958863702b3658 "convert SC_CONVERT
constants to scoped enum".  And indeed, e.g., opening the document from
 through 
steps 1
and 2 in a UBSan build reports a use of an uninitialized (bad-valued) bool 
in
ScNavigatorSettings::IsExpanded.

Change-Id: If0dfadc6bd8033e61e334f59b3028ab005a892cd
Reviewed-on: https://gerrit.libreoffice.org/47767
Tested-by: Jenkins 
Reviewed-by: Noel Grandin 
(cherry picked from commit fbec01b7af438fc7409c875e59be7483772b53a2)
Reviewed-on: https://gerrit.libreoffice.org/47785
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index b980f8354ebe..e84c61e056dc 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -435,6 +435,7 @@ ScNavigatorSettings::ScNavigatorSettings()
 : mnRootSelected(ScContentId::ROOT)
 , mnChildSelected(SC_CONTENT_NOCHILD)
 {
+maExpandedVec.fill(false);
 }
 
 SFX_IMPL_CHILDWINDOWCONTEXT( ScNavigatorDialogWrapper, SID_NAVIGATOR )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-01-07 Thread Maxim Monastirsky
 sc/source/ui/view/tabview3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 081a544b92ab7adbdfe29d56d91019556ffc07c9
Author: Maxim Monastirsky 
Date:   Thu Nov 30 21:49:34 2017 +0200

tdf#113980 Refresh row/column buttons state after selection change

Change-Id: I21684ffe83d7b924e1d83c853ed4846e0db53c3b
Reviewed-on: https://gerrit.libreoffice.org/45614
Tested-by: Jenkins 
Reviewed-by: Maxim Monastirsky 
(cherry picked from commit 4b65a67caacee1ef0b31219d55bfe0cc6032c9f3)
Reviewed-on: https://gerrit.libreoffice.org/47026
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 6e93f5f5756a..69bc8035b421 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -535,6 +535,8 @@ void ScTabView::SelectionChanged()
 rBindings.Invalidate( FID_INS_CELL );
 rBindings.Invalidate( FID_INS_CELLSDOWN );
 rBindings.Invalidate( FID_INS_CELLSRIGHT );
+rBindings.Invalidate( SID_ROW_OPERATIONS );
+rBindings.Invalidate( SID_COLUMN_OPERATIONS );
 
 rBindings.Invalidate( FID_CHG_COMMENT );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-22 Thread Dennis Francis
 sc/source/ui/inc/tpcalc.hxx  |2 +
 sc/source/ui/optdlg/tpcalc.cxx   |   13 ++
 sc/uiconfig/scalc/ui/optcalculatepage.ui |   59 +++
 3 files changed, 74 insertions(+)

New commits:
commit 670fa15f3d26dc93bd507990f94d14bf93a0c94c
Author: Dennis Francis 
Date:   Tue Dec 19 08:55:46 2017 +0530

Add UI config option to enable/disable threading.

Clarify that this is experimental.

Change-Id: I7a83d80c0db233a48026d1254021b926f28002f3
Reviewed-on: https://gerrit.libreoffice.org/46782
Reviewed-by: Michael Meeks 
Tested-by: Jenkins 
Reviewed-on: https://gerrit.libreoffice.org/46937
Reviewed-by: Eike Rathke 
Tested-by: Michael Meeks 

diff --git a/sc/source/ui/inc/tpcalc.hxx b/sc/source/ui/inc/tpcalc.hxx
index 4cb10646da01..3108604820a9 100644
--- a/sc/source/ui/inc/tpcalc.hxx
+++ b/sc/source/ui/inc/tpcalc.hxx
@@ -68,6 +68,8 @@ private:
 VclPtr  m_pFtPrec;
 VclPtr   m_pEdPrec;
 
+VclPtr   m_pBtnThread;
+
 ScDocOptions*  pOldOptions;
 ScDocOptions*  pLocalOptions;
 sal_uInt16 nWhichCalc;
diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx
index 541a63096e1b..4ec601a23ac6 100644
--- a/sc/source/ui/optdlg/tpcalc.cxx
+++ b/sc/source/ui/optdlg/tpcalc.cxx
@@ -63,6 +63,7 @@ ScTpCalcOptions::ScTpCalcOptions(vcl::Window* pParent, const 
SfxItemSet& rCoreAt
 get(m_pBtnGeneralPrec, "generalprec");
 get(m_pFtPrec, "precft");
 get(m_pEdPrec, "prec");
+get(m_pBtnThread, "threadingenabled");
 Init();
 SetExchangeSupport();
 }
@@ -94,6 +95,7 @@ void ScTpCalcOptions::dispose()
 m_pBtnGeneralPrec.clear();
 m_pFtPrec.clear();
 m_pEdPrec.clear();
+m_pBtnThread.clear();
 SfxTabPage::dispose();
 }
 
@@ -104,6 +106,7 @@ void ScTpCalcOptions::Init()
 m_pBtnDateStd->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) );
 m_pBtnDateSc10->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) 
);
 m_pBtnDate1904->SetClickHdl( LINK( this, ScTpCalcOptions, RadioClickHdl ) 
);
+m_pBtnThread->SetClickHdl( LINK( this, ScTpCalcOptions, CheckClickHdl ) );
 }
 
 VclPtr ScTpCalcOptions::Create( vcl::Window* pParent, const 
SfxItemSet* rAttrSet )
@@ -180,6 +183,9 @@ void ScTpCalcOptions::Reset( const SfxItemSet* /* 
rCoreAttrs */ )
 m_pEdPrec->SetValue(nPrec);
 }
 
+m_pBtnThread->Enable();
+m_pBtnThread->Check( 
officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get()
 );
+
 CheckClickHdl(m_pBtnIterate);
 }
 
@@ -200,6 +206,13 @@ bool ScTpCalcOptions::FillItemSet( SfxItemSet* rCoreAttrs )
 else
 pLocalOptions->SetStdPrecision( SvNumberFormatter::UNLIMITED_PRECISION 
);
 
+bool bShouldEnableThreading = m_pBtnThread->IsChecked();
+if (bShouldEnableThreading != 
officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get())
+{
+std::shared_ptr 
xBatch(comphelper::ConfigurationChanges::create());
+
officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::set(bShouldEnableThreading,
 xBatch);
+xBatch->commit();
+}
 if ( *pLocalOptions != *pOldOptions )
 {
 rCoreAttrs->Put( ScTpCalcItem( nWhichCalc, *pLocalOptions ) );
diff --git a/sc/uiconfig/scalc/ui/optcalculatepage.ui 
b/sc/uiconfig/scalc/ui/optcalculatepage.ui
index 14153f079709..c158906f92c8 100644
--- a/sc/uiconfig/scalc/ui/optcalculatepage.ui
+++ b/sc/uiconfig/scalc/ui/optcalculatepage.ui
@@ -23,6 +23,65 @@
 12
 18
 
+  
+True
+False
+True
+0
+none
+
+  
+True
+False
+True
+6
+12
+
+  
+True
+False
+True
+6
+12
+
+  
+Enable multi-threaded calculation: 
Warning Experimental.
+True
+True
+False
+Enable Experimental 
multi-threaded calculation of formula-groups, this may break your 
spreadsheet.
+True
+0
+True
+  
+  
+0
+0
+2
+  
+
+  
+
+  
+
+
+  
+True
+False
+CPU threading settings
+
+  
+
+  
+
+  
+  
+0
+2
+2
+  
+
+
   
 True
 False
___

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

2017-12-19 Thread tagezi
 sc/source/ui/condformat/condformatdlg.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit fe31edb29e5e77bb60e3aa73ec6a0380314acc61
Author: tagezi 
Date:   Tue Dec 19 13:32:26 2017 +0200

tdf#114545 Enabling/Disabling Ok button depending on correct format

Change-Id: Iab3c4363dda0260d16c7167946044c39c21b863a
Reviewed-on: https://gerrit.libreoffice.org/46790
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins 
(cherry picked from commit 7504af39686171ffb16e70f798d9ecf4ea98f1d3)
Reviewed-on: https://gerrit.libreoffice.org/46823
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index b7b0c40a73d8..0409efd5dda6 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -772,9 +772,15 @@ IMPL_LINK( ScCondFormatDlg, EdRangeModifyHdl, Edit&, 
rEdit, void )
 ScRefFlags nFlags = aRange.Parse(aRangeStr, mpViewData->GetDocument(),
 mpViewData->GetDocument()->GetAddressConvention());
 if(nFlags & ScRefFlags::VALID)
+{
 
rEdit.SetControlBackground(GetSettings().GetStyleSettings().GetWindowColor());
+mpBtnOk->Enable(true);
+}
 else
+{
 rEdit.SetControlBackground(COL_LIGHTRED);
+mpBtnOk->Enable(false);
+}
 
 updateTitle();
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-19 Thread Jim Raykowski
 sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit e68184f712b151c03c2282bacd662ae103f3d3f2
Author: Jim Raykowski 
Date:   Sun Dec 17 09:42:54 2017 -0900

Uncheck Engineering notation checkbox on Scientific selection

In Calc, the Engineering notation checkbox in the Sidebar Properties
deck Number Format panel can show checked when the cell number format
does not contain engineering notation.

Change-Id: Ia26fc430aecd7af2e0f614bf9314d99f8408e690
Reviewed-on: https://gerrit.libreoffice.org/46650
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
(cherry picked from commit 9e7caee0173c5ec2d8b5cfa6aedfd1c9674d442b)
Reviewed-on: https://gerrit.libreoffice.org/46826

diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx 
b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index 54c3975c9b08..a0c9eb940f8f 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -214,6 +214,7 @@ void NumberFormatPropertyPanel::NotifyItemUpdate(
 mpBtnThousand->Check(false);
 mpBtnEngineering->Show(bIsScientific);
 mpBtnEngineering->Enable(bIsScientific);
+mpBtnEngineering->Check(false);
 mpBtnNegRed->Enable();
 mpFtDenominator->Show(bIsFraction);
 mpEdDenominator->Show(bIsFraction);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-19 Thread Eike Rathke
 sc/source/core/tool/interpr6.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 3fb74dbbe2ccce8daf83a189fe8bd567ac29259b
Author: Eike Rathke 
Date:   Tue Dec 19 16:28:04 2017 +0100

Resolves: tdf#114539 only pop own parameters from stack

... and not another pending one..

Change-Id: Ief5c27ccfb0b4121f2ba019e0fb8770dabbf60cf
(cherry picked from commit 4b444b4c1efc2be219e6975e30048ff616fdac0f)
Reviewed-on: https://gerrit.libreoffice.org/46800
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index 04a664831c9f..62c96376c664 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -1070,10 +1070,11 @@ void ScInterpreter::ScRawSubtract()
 // Obtain the minuend.
 double fRes = GetDouble();
 
-while (nGlobalError == FormulaError::NONE && nParamCount-- > 1)
+while (nGlobalError == FormulaError::NONE && nParamCount > 1)
 {
 // Simple single values without matrix support.
 fRes -= GetDouble();
+--nParamCount;
 }
 while (nParamCount-- > 0)
 PopError();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-16 Thread Eike Rathke
 sc/source/core/tool/token.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit a6ada5480eb165c3b0b3d8d5333c9cbf434b11ff
Author: Eike Rathke 
Date:   Sat Dec 16 01:36:16 2017 +0100

Blacklist CELL() and INFO() for threading

They access one utl::TransliterationWrapper via
ScCellKeywordTranslator::transKeyword() for the localized
keywords.

Change-Id: Ia3c1ec8def761b3448d6be4c81d42723e1a28ea2
(cherry picked from commit cef05fdcf8453cf6a799234de55182d5f51dde70)
Reviewed-on: https://gerrit.libreoffice.org/46581
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 709d00e3e2ad..fe1682bd74e7 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1345,7 +1345,9 @@ void ScTokenArray::CheckForThreading( OpCode eOp  )
 ocTableOp,
 ocVLookup,
 ocHLookup,
-ocMatch
+ocMatch,
+ocCell,
+ocInfo
 });
 
 // We only call this if it was already disabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-15 Thread Eike Rathke
 sc/source/core/tool/dbdata.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 1aa8011d9186dc4d221469058a9fcaf5a93ae765
Author: Eike Rathke 
Date:   Fri Dec 15 16:27:54 2017 +0100

Resolves: tdf#113537 don't keep nEndRow=MAXROW if data ends above

Change-Id: I186034cada9718c067fa4dc7f72e2ca55ac06f83
(cherry picked from commit fa100e0abc83b876ca18b4178c44fb1dfc452a5d)
Reviewed-on: https://gerrit.libreoffice.org/46565
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/sc/source/core/tool/dbdata.cxx b/sc/source/core/tool/dbdata.cxx
index 020b2daed980..0b7ebd3b6bfe 100644
--- a/sc/source/core/tool/dbdata.cxx
+++ b/sc/source/core/tool/dbdata.cxx
@@ -624,7 +624,12 @@ void ScDBData::ExtendDataArea(const ScDocument* pDoc)
 SCCOL nOldCol1 = nStartCol, nOldCol2 = nEndCol;
 SCROW nOldEndRow = nEndRow;
 pDoc->GetDataArea(nTable, nStartCol, nStartRow, nEndCol, nEndRow, false, 
true);
-nEndRow = std::max(nEndRow, nOldEndRow);
+// nOldEndRow==MAXROW may easily happen when selecting whole columns and
+// setting an AutoFilter (i.e. creating an anonymous database-range). We
+// certainly don't want to iterate over nearly a million empty cells, but
+// keep only an intentionally user selected range.
+if (nOldEndRow < MAXROW && nEndRow < nOldEndRow)
+nEndRow = nOldEndRow;
 if (nStartCol != nOldCol1 || nEndCol != nOldCol2)
 {
 SAL_WARN_IF( !maTableColumnNames.empty(), "sc.core", 
"ScDBData::ExtendDataArea - invalidating column names/offsets");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-15 Thread Jim Raykowski
 sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 5769b301dc307d2019faf1a480b930182d03ba54
Author: Jim Raykowski 
Date:   Thu Dec 7 22:52:00 2017 -0900

tdf#114216 Uncheck Thousands separator on Number category selection

Change-Id: Iaf616379fad1333d63bc397a9fba2220d7bbfc9b
Reviewed-on: https://gerrit.libreoffice.org/46072
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
(cherry picked from commit eee645a4c281a99247fa7ae6e34711283156c614)
Reviewed-on: https://gerrit.libreoffice.org/46540

diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx 
b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index e52a08e83be5..54c3975c9b08 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -211,6 +211,7 @@ void NumberFormatPropertyPanel::NotifyItemUpdate(
 bool bIsFraction ( nVal == 7 );  // For fraction, Decimal 
places is replaced by Denominator places
 mpBtnThousand->Show(!bIsScientific);
 mpBtnThousand->Enable(!bIsScientific);
+mpBtnThousand->Check(false);
 mpBtnEngineering->Show(bIsScientific);
 mpBtnEngineering->Enable(bIsScientific);
 mpBtnNegRed->Enable();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-15 Thread Dennis Francis
 sc/source/core/tool/token.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 574b06d36e3f0df1dfa1029e8d33473237807dcb
Author: Dennis Francis 
Date:   Fri Dec 15 12:18:55 2017 +0530

tdf#114479 : Blacklist MATCH() for threading

due to reasons similar to VLOOKUP/HLOOKUP

Change-Id: I4eeefd37d87d19ed4c27c58cd661206ce916823a
Reviewed-on: https://gerrit.libreoffice.org/46499
Tested-by: Jenkins 
Reviewed-by: Dennis Francis 
(cherry picked from commit 2ba36f21bad74cbbd68611afddaf9bbdc8ffda50)
Reviewed-on: https://gerrit.libreoffice.org/46510
Reviewed-by: Michael Meeks 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index e8d249a2ac50..709d00e3e2ad 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1344,7 +1344,8 @@ void ScTokenArray::CheckForThreading( OpCode eOp  )
 ocOffset,
 ocTableOp,
 ocVLookup,
-ocHLookup
+ocHLookup,
+ocMatch
 });
 
 // We only call this if it was already disabled
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-11 Thread Eike Rathke
 sc/source/core/tool/compiler.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b030bf19e29f031b0a640dd92c38d654785f1a99
Author: Eike Rathke 
Date:   Mon Dec 11 18:21:32 2017 +0100

Resolves: tdf#114406 treat % as the operator that it is

Regression from

commit 73c7e0921d752df53004ed55735f3ecc592f
Date:   Tue Sep 20 21:39:10 2016 +0200

sc-perf: tdf#79023 for ODFF do not call SvNumberFormatter to 
determine numeric

for ODFF, and for OOXML

commit a8a8ff59c5749bbe1f2f58ea8fd42d66e6ae2a81
Date:   Tue Sep 20 22:37:59 2016 +0200

sc-perf: tdf#79023 do not call SvNumberFormatter also for numbers 
in OOXML

Numbers followed by a percent operator like 100% were always
(wrongly) treated as one entity (by '%' having ScCharFlags::Value)
and incidentally handled by the number formatter's parser, which
so far "worked" in the sense that the correct constant number was
produced (i.e. 1 here), but the expression detail was lost.

The commits above for performance reasons when reading ODF or
OOXML files don't let a symbol pass through the number formatter's
parser anymore and the "100%" does not represent a strict number,
so lead to #NAME? error at the end.

Set the proper flags in the compiler's character table to treat
'%' as operator in all circumstances.

Change-Id: I266beb74a313c779370e5fac42f45d0fb5cdba0c
(cherry picked from commit f6b2349e880afa82f9267087fb48b6e4f8a9aa05)
Reviewed-on: https://gerrit.libreoffice.org/46254
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 8f74f42276a4..3c6365a5e7c6 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -323,7 +323,7 @@ ScCompiler::Convention::Convention( 
FormulaGrammar::AddressConvention eConv )
 /* $ */ t[36] = ScCharFlags::CharWord | ScCharFlags::Word | 
ScCharFlags::CharIdent | ScCharFlags::Ident;
 if (FormulaGrammar::CONV_ODF == meConv)
 /* $ */ t[36] |= ScCharFlags::OdfNameMarker;
-/* % */ t[37] = ScCharFlags::Value;
+/* % */ t[37] = ScCharFlags::Char | ScCharFlags::WordSep | 
ScCharFlags::ValueSep;
 /* & */ t[38] = ScCharFlags::Char | ScCharFlags::WordSep | 
ScCharFlags::ValueSep;
 /* ' */ t[39] = ScCharFlags::NameSep;
 /* ( */ t[40] = ScCharFlags::Char | ScCharFlags::WordSep | 
ScCharFlags::ValueSep;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-11 Thread Caolán McNamara
 sc/source/core/data/formulacell.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit a63e8a7fa3b0f98501e8bc20a1adf6ca235a7dd1
Author: Caolán McNamara 
Date:   Sun Dec 10 20:15:31 2017 +

tdf#114342 move recursion guard to encompass threaded path too

Change-Id: If815d3faeb72fd8a176225fb80f87ee584ece3ba
Reviewed-on: https://gerrit.libreoffice.org/46215
Reviewed-by: Michael Meeks 
Tested-by: Michael Meeks 

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 2f541d8514c7..06c3bb70eb76 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4342,6 +4342,12 @@ bool ScFormulaCell::InterpretFormulaGroup()
 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);
+
 if (!bThreadingProhibited && !ScCalcConfig::isOpenCLEnabled() &&
 pCode->GetVectorState() == FormulaVectorEnabledForThreading &&
 
officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::get())
@@ -4478,12 +4484,6 @@ bool ScFormulaCell::InterpretFormulaGroup()
 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-6-0' - sc/source

2017-12-09 Thread Eike Rathke
 sc/source/ui/view/formatsh.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit dbbf644d22e3a893d83508d2c74e04a7ef9f8020
Author: Eike Rathke 
Date:   Fri Dec 8 22:20:39 2017 +0100

A "standard" format does not necessarily mean the General format

Actually there can be up to three and most times are at least two
(short,medium[,long]) of which usually the medium default is
General.

Change-Id: Iab853fbaa2db3dca488ee40f63271ccd55b6b517
(cherry picked from commit 4d850442a04b63e4ed92dcd431c8620ce12010c2)
Reviewed-on: https://gerrit.libreoffice.org/46128
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 005a1c7a5174..82f5ba3fbc97 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2540,20 +2540,18 @@ void ScFormatShell::GetNumFormatState( SfxItemSet& rSet 
)
 if ( rAttrSet.GetItemState( ATTR_VALUE_FORMAT ) >= 
SfxItemState::DEFAULT ) //Modify for more robust
 {
 const SvNumberformat* pFormatEntry = 
pFormatter->GetEntry( nNumberFormat );
-bool bStandard = false;
 
 if ( pFormatEntry )
 {
 aFormatCode = pFormatEntry->GetType();
-bStandard = pFormatEntry->IsStandard();
 }
 
 switch(aFormatCode)
 {
 case css::util::NumberFormat::NUMBER:
 case css::util::NumberFormat::NUMBER| 
css::util::NumberFormat::DEFINED:
-//use format code and standard format code to 
judge whether it is General,
-if (bStandard)
+// Determine if General format.
+if ((nNumberFormat % SV_COUNTRY_LANGUAGE_OFFSET) 
== 0)
 aFormatCode = 0;
 else
 aFormatCode = 1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-09 Thread Marco Cecchetti
 sc/source/ui/view/gridwin4.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 88fa077b264a07e43fcac33607adba20e37e25a2
Author: Marco Cecchetti 
Date:   Sat Dec 2 17:19:33 2017 +0100

lok: calc: fix: CTRL+RIGHT => crash

Change-Id: I5c127aa4cbdca5e13d2329c1fb68f466464fe432
Reviewed-on: https://gerrit.libreoffice.org/45799
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx
index a25a62d3f81d..9387c1e6d79c 100644
--- a/sc/source/ui/view/gridwin4.cxx
+++ b/sc/source/ui/view/gridwin4.cxx
@@ -1066,7 +1066,8 @@ namespace {
 {
 long nTmp = 0; // row/col to render for nPosition
 long nLastScrPos = 0, nScrPos = 0;
-while (nScrPos <= nPosition && nTmp < MAXROW)
+const long nMaxIndex = bRowNotCol ? MAXROW : MAXCOL;
+while (nScrPos <= nPosition && nTmp < nMaxIndex)
 {
 long nSize = bRowNotCol ? pDoc->GetRowHeight( nTmp, nTabNo )
 : pDoc->GetColWidth( nTmp, nTabNo );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-08 Thread Jens Carl
 sc/source/ui/docshell/dbdocfun.cxx |1 -
 1 file changed, 1 deletion(-)

New commits:
commit a2d8f15fb70682931a3e8e6e64342fb98858ecf9
Author: Jens Carl 
Date:   Fri Dec 8 09:09:39 2017 +

Fix segfault when ScDBDocFunc::AddDBRange is called ...

multiple time with same name. ScDBCollection::NamedDBs::insert() use an
unique_ptr to hold ScDBData* and if the insert isn't a success we don't
have clean up with delete.

Change-Id: I9b24834ea2e2dfd67b07438e6c4789ad0c01b888
Reviewed-on: https://gerrit.libreoffice.org/46075
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 
(cherry picked from commit d51e7581d90d55b5fe9a0f175d3cbee32de51721)
Reviewed-on: https://gerrit.libreoffice.org/46091

diff --git a/sc/source/ui/docshell/dbdocfun.cxx 
b/sc/source/ui/docshell/dbdocfun.cxx
index 0d424c08282f..02090556c614 100644
--- a/sc/source/ui/docshell/dbdocfun.cxx
+++ b/sc/source/ui/docshell/dbdocfun.cxx
@@ -96,7 +96,6 @@ bool ScDBDocFunc::AddDBRange( const OUString& rName, const 
ScRange& rRange )
 
 if (!bOk)
 {
-delete pNew;
 delete pUndoColl;
 return false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-07 Thread Eike Rathke
 sc/source/ui/unoobj/chart2uno.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 2f4832a31d1e81ffbe043d9bb1d0816a03b8d137
Author: Eike Rathke 
Date:   Fri Dec 8 00:04:31 2017 +0100

Key must be sal_uInt32 instead of sal_Int16 SCCOL, tdf#113861 follow-up

FormulaTokenMapMap key is bit masked left shifted tab value plus
column value.

And as FormulaTokenMap key was changed from sal_uInt32 to SCROW
(which is correct), use that type when assigning.

Change-Id: I4c76330378e64cb7dc06a956cbf2c23f4428b658
(cherry picked from commit 78a3f7e10e650bc464202dacd131f9c3b0ddfcdf)
Reviewed-on: https://gerrit.libreoffice.org/46061
Reviewed-by: Eike Rathke 
Tested-by: Jenkins 

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 4728efe7ae3c..f42fd4f1fff6 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -242,7 +242,7 @@ vector TokenTable::getAllRanges() const
 }
 
 typedef std::map FormulaTokenMap;
-typedef std::map FormulaTokenMapMap;
+typedef std::map FormulaTokenMapMap;
 
 class Chart2PositionMap
 {
@@ -805,7 +805,7 @@ void Chart2Positioner::createPositionMap()
 FormulaTokenMap* pFirstCol = pCols->begin()->second;
 for (FormulaTokenMap::const_iterator it1 = pFirstCol->begin(); it1 
!= pFirstCol->end(); ++it1)
 {
-sal_uInt32 nKey = it1->first;
+SCROW nKey = it1->first;
 for (FormulaTokenMapMap::const_iterator it2 = pCols->begin(); 
it2 != pCols->end(); ++it2)
 {
 pCol = it2->second;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-07 Thread Caolán McNamara
 sc/source/ui/unoobj/chart2uno.cxx |   20 +---
 1 file changed, 13 insertions(+), 7 deletions(-)

New commits:
commit 83c1260a70b5b440522a1e9b88eb82456896c270
Author: Caolán McNamara 
Date:   Mon Dec 4 15:24:20 2017 +

assert on export of fdo69698-1.ods to pdf

since...

commit 3af8a4faf5e20ccae2386052697713da160afb16
Date:   Wed Nov 15 13:10:40 2017 +0300

tdf#113861: Less aggressive expansion of chart headers.

In this example

nAllColCount is 3, nAllRowCount is 5, the columns available are 0, 1, 4 and 
the
rows are 20, 21, 22, 25, 26. So I assume, comparing to the original version,
that its not the actual row and column we want, but the index of the 
row/column
into the range provided

Change-Id: I568c561a8c5f0b2ee84590293bed8e302d5dda75
Reviewed-on: https://gerrit.libreoffice.org/45811
Tested-by: Jenkins 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit 2074a3785371692dcfb86f45204f3707cbac1eec)
Reviewed-on: https://gerrit.libreoffice.org/45944
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 71c3c96f83c0..4728efe7ae3c 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -290,18 +290,24 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount,  
SCROW nAllRowCount,
 {
 //check whether there is more than one text column or row that should 
be added to the headers
 SCROW nMaxHeaderRow = nAllRowCount;
-for ( const auto & rCol : rCols )
+SCCOL nCol = 0;
+for (auto it = rCols.begin(); it != rCols.end(); ++it, ++nCol)
 {
 // Skip header columns
-if ( rCol.first < nHeaderColCount )
+if (nCol < nHeaderColCount)
 continue;
 
+const auto& rCol = *it;
+
 bool bFoundValuesInCol = false;
 bool bFoundAnythingInCol = false;
-for ( const auto & rCell : *rCol.second )
+SCROW nRow = 0;
+for (auto it2 = rCol.second->begin(); it2 != rCol.second->end(); 
++it2, ++nRow)
 {
+const auto& rCell = *it2;
+
 // Skip header rows
-if (rCell.first < nHeaderRowCount || !rCell.second)
+if (nRow < nHeaderRowCount || !rCell.second)
 continue;
 
 ScRange aRange;
@@ -319,7 +325,7 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount,  
SCROW nAllRowCount,
 {
 // Found some numeric data
 bFoundValuesInCol = true;
-nMaxHeaderRow = std::min(nMaxHeaderRow, nRow1);
+nMaxHeaderRow = std::min(nMaxHeaderRow, nRow);
 break;
 }
 if ( pDoc->HasData( nCol1, nRow1, nTab1 ) )
@@ -330,11 +336,11 @@ Chart2PositionMap::Chart2PositionMap(SCCOL nAllColCount,  
SCROW nAllRowCount,
 else
 {
 // If cell is empty, it belongs to data
-nMaxHeaderRow = std::min(nMaxHeaderRow, nRow1);
+nMaxHeaderRow = std::min(nMaxHeaderRow, nRow);
 }
 }
 
-if (nHeaderColCount && !bFoundValuesInCol && bFoundAnythingInCol 
&& rCol.first == nHeaderColCount)
+if (nHeaderColCount && !bFoundValuesInCol && bFoundAnythingInCol 
&& nCol == nHeaderColCount)
 {
 // There is no values in row, but some data. And this column 
is next to header
 // So lets put it to header
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-06 Thread Julien Nabet
 sc/source/ui/view/tabview3.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit b4e51cdaf859dfffee0561c51a72eb5c73ee23f4
Author: Julien Nabet 
Date:   Tue Dec 5 22:01:26 2017 +0100

tdf#114228: fix crash when deleting sheet in specific case

1. Create a brand new ods file
2. Select L12 (so cursor is obviously on sheet1 L12)
3. Create a brand new sheet (and cursor is on sheet2 A1)
4. Delete sheet2

It crashes with gtk3, see 
https://bugs.documentfoundation.org/attachment.cgi?id=138199
As indicated in 
https://bugs.documentfoundation.org/show_bug.cgi?id=114228#c5 the tab number
is wrong
Reporting cursor management later in ScTabView::SetTabNo prevents from the 
crash

Change-Id: Iea307267d2cdcf1c01f7e72f45b6a68aeef26fa1
Reviewed-on: https://gerrit.libreoffice.org/45976
Tested-by: Jenkins 
Reviewed-by: Julien Nabet 

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 84c945552677..6e93f5f5756a 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -1817,8 +1817,6 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool 
bExtendSelection, bool bSa
 // UpdateShow before SetCursor, so that UpdateAutoFillMark finds the 
correct
 // window  (is called from SetCursor)
 UpdateShow();
-aViewData.ResetOldCursor();
-SetCursor( aViewData.GetCurX(), aViewData.GetCurY(), true );
 
 SfxBindings& rBindings = aViewData.GetBindings();
 ScMarkData& rMark = aViewData.GetMarkData();
@@ -1874,6 +1872,9 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool 
bExtendSelection, bool bSa
 UpdateVisibleRange();
 
 aViewData.GetViewShell()->WindowChanged();  // if the active 
window has changed
+aViewData.ResetOldCursor();
+SetCursor( aViewData.GetCurX(), aViewData.GetCurY(), true );
+
 if ( !bUnoRefDialog )
 aViewData.GetViewShell()->DisconnectAllClients();   // important 
for floating frames
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-04 Thread Daniel
 sc/source/core/data/table4.cxx |   67 -
 1 file changed, 47 insertions(+), 20 deletions(-)

New commits:
commit 87efbdb1ae5a73d081667e10f1571f1e523c1b9c
Author: Daniel 
Date:   Sat Nov 25 01:48:18 2017 -0200

tdf#105268 - Auto Fill: Fix The Next Value for 001-001-001

Change-Id: If1d1a23afb6209c35092d7cd95235ea1699fe7fb
Reviewed-on: https://gerrit.libreoffice.org/45262
Tested-by: Jenkins 
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit 76c1e7287e29a2a2739fce895fbded3c04764bca)
Reviewed-on: https://gerrit.libreoffice.org/45742

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index f7bab382a76c..bd1d18d0443d 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -78,10 +78,10 @@ short lcl_DecompValueString( OUString& rValue, sal_Int32& 
nVal, sal_uInt16* pMin
 return 0;
 }
 const sal_Unicode* p = rValue.getStr();
-sal_Int32 nNeg = 0;
+sal_Int32 nSign = 0;
 sal_Int32 nNum = 0;
-if ( p[nNum] == '-' )
-nNum = nNeg = 1;
+if ( p[nNum] == '-' || p[nNum] == '+' )
+nNum = nSign = 1;
 while ( p[nNum] && CharClass::isAsciiNumeric( OUString(p[nNum]) ) )
 nNum++;
 
@@ -91,34 +91,37 @@ short lcl_DecompValueString( OUString& rValue, sal_Int32& 
nVal, sal_uInt16* pMin
 // #i5550# If there are numbers at the beginning and the end,
 // prefer the one at the beginning only if it's followed by a space.
 // Otherwise, use the number at the end, to enable things like IP 
addresses.
-if ( nNum > nNeg && ( cNext == 0 || cNext == ' ' || 
!CharClass::isAsciiNumeric(OUString(cLast)) ) )
+if ( nNum > nSign && ( cNext == 0 || cNext == ' ' || 
!CharClass::isAsciiNumeric(OUString(cLast)) ) )
 {   // number at the beginning
 nVal = rValue.copy( 0, nNum ).toInt32();
 //  any number with a leading zero sets the minimum number of digits
-if ( p[nNeg] == '0' && pMinDigits && ( nNum - nNeg > *pMinDigits ) )
-*pMinDigits = nNum - nNeg;
+if ( p[nSign] == '0' && pMinDigits && ( nNum - nSign > *pMinDigits ) )
+*pMinDigits = nNum - nSign;
 rValue = rValue.copy(nNum);
 return -1;
 }
 else
 {
-nNeg = 0;
+nSign = 0;
 sal_Int32 nEnd = nNum = rValue.getLength() - 1;
 while ( nNum && CharClass::isAsciiNumeric( OUString(p[nNum]) ) )
 nNum--;
-if ( p[nNum] == '-' )
+if ( p[nNum] == '-' || p[nNum] == '+' )
 {
 nNum--;
-nNeg = 1;
+nSign = 1;
 }
-if ( nNum < nEnd - nNeg )
+if ( nNum < nEnd - nSign )
 {   // number at the end
 nVal = rValue.copy( nNum + 1 ).toInt32();
 //  any number with a leading zero sets the minimum number of 
digits
-if ( p[nNum+1+nNeg] == '0' && pMinDigits && ( nEnd - nNum - nNeg > 
*pMinDigits ) )
-*pMinDigits = nEnd - nNum - nNeg;
+if ( p[nNum+1+nSign] == '0' && pMinDigits && ( nEnd - nNum - nSign 
> *pMinDigits ) )
+*pMinDigits = nEnd - nNum - nSign;
 rValue = rValue.copy(0, nNum + 1);
-return 1;
+if (nSign) // use the return value = 2 to put back the '+'
+return 2;
+else
+return 1;
 }
 }
 nVal = 0;
@@ -938,11 +941,19 @@ OUString ScTable::GetAutoFillPreview( const ScRange& 
rSource, SCCOL nEndX, SCROW
 {
 if (aValue == ScGlobal::GetOrdinalSuffix( 
nVal))
 aValue = ScGlobal::GetOrdinalSuffix( nVal 
+ nDelta);
-
 aValue = lcl_ValueString( nVal + nDelta, 
nCellDigits ) + aValue;
 }
 else if ( nFlag > 0 )
-aValue += lcl_ValueString( nVal + nDelta, 
nCellDigits );
+{
+sal_Int32 nNextValue;
+if ( nVal < 0 )
+nNextValue = nVal - nDelta;
+else
+nNextValue = nVal + nDelta;
+if ( nFlag == 2 && nNextValue >= 0 ) // Put 
back the '+'
+aValue += "+";
+aValue += lcl_ValueString( nNextValue, 
nCellDigits );
+}
 }
 }
 break;
@@ -1044,7 +1055,11 @@ OUString ScTable::GetAutoFillPreview( const ScRange& 
rSource, SCCOL nEndX, SCROW
 aValue = lcl_ValueString( (sal_Int32)nStart, 
nMinDigits ) + aValue;

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

2017-12-02 Thread Eike Rathke
 sc/source/core/tool/compiler.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 72b9756c1ef1cc5258fc124a9e0b2c2b8d522872
Author: Eike Rathke 
Date:   Sat Dec 2 15:32:06 2017 +0100

ofz#4484 another stab at mnRangeOpPosInSymbol

Commit cd0b749cc4b4f268d26639fb3c6cbf2128b2d7df still missed it by
one position behind string length.

Also move the check to end of i18n symbol parsing for all
constellations.

Change-Id: I7b5e1375fe711dcc3f659e558702de78893d25a5
Reviewed-on: https://gerrit.libreoffice.org/45718
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 dce7841b80cd..8f74f42276a4 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2672,9 +2672,9 @@ Label_MaskStateMachine:
 {
 SetError( FormulaError::StringOverflow );
 nLen = MAXSTRLEN;
-if (mnRangeOpPosInSymbol > nLen)
-mnRangeOpPosInSymbol = -1;
 }
+if (mnRangeOpPosInSymbol >= nLen)
+mnRangeOpPosInSymbol = -1;
 lcl_UnicodeStrNCpy( cSymbol, aSymbol.getStr(), nLen );
 pSym = [nLen];
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-01 Thread Caolán McNamara
 sc/source/filter/excel/xlescher.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 9f5788fec088afbbf9e3168dfdad40c747da0dd6
Author: Caolán McNamara 
Date:   Thu Nov 30 15:55:00 2017 +

ofz#4406 limit escher object cell area to calc's limits

Change-Id: I9b9b198f1f96c952692d052a9a527086e453779f
Reviewed-on: https://gerrit.libreoffice.org/45615
Tested-by: Jenkins 
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/filter/excel/xlescher.cxx 
b/sc/source/filter/excel/xlescher.cxx
index 8f2919b2f72b..eb70bc590ce7 100644
--- a/sc/source/filter/excel/xlescher.cxx
+++ b/sc/source/filter/excel/xlescher.cxx
@@ -146,10 +146,10 @@ tools::Rectangle XclObjAnchor::GetRect( const XclRoot& 
rRoot, SCTAB nScTab, MapU
 ScDocument& rDoc = rRoot.GetDoc();
 double fScale = lclGetTwipsScale( eMapUnit );
 tools::Rectangle aRect(
-lclGetXFromCol( rDoc, nScTab, maFirst.mnCol, mnLX, fScale ),
-lclGetYFromRow( rDoc, nScTab, maFirst.mnRow, mnTY, fScale ),
-lclGetXFromCol( rDoc, nScTab, maLast.mnCol,  mnRX + 1, fScale ),
-lclGetYFromRow( rDoc, nScTab, maLast.mnRow,  mnBY, fScale ) );
+lclGetXFromCol(rDoc, nScTab, std::min(maFirst.mnCol, MAXCOL), 
mnLX, fScale),
+lclGetYFromRow(rDoc, nScTab, std::min(maFirst.mnRow, MAXROW), 
mnTY, fScale),
+lclGetXFromCol(rDoc, nScTab, std::min(maLast.mnCol, MAXCOL),  
mnRX + 1, fScale),
+lclGetYFromRow(rDoc, nScTab, std::min(maLast.mnRow, MAXROW),  
mnBY, fScale));
 
 // adjust coordinates in mirrored sheets
 if( rDoc.IsLayoutRTL( nScTab ) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-01 Thread Caolán McNamara
 sc/source/core/tool/compiler.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 547230e672e179539b2477ff36acb00076149f55
Author: Caolán McNamara 
Date:   Wed Nov 29 17:05:07 2017 +

ofz#4484 don't set mnRangeOpPosInSymbol on StringOverflow case

Change-Id: I35d86c97e4fb082a676a5eeadf8375738cecd7bd
Reviewed-on: https://gerrit.libreoffice.org/45565
Reviewed-by: Eike Rathke 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 65780e5ad1e2..dce7841b80cd 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2214,14 +2214,16 @@ Label_MaskStateMachine:
 {
 // One range operator may form Sheet1.A:A, which we need to
 // pass as one entity to IsReference().
-mnRangeOpPosInSymbol = pSym - [0];
 if( pSym == [ MAXSTRLEN ] )
 {
 SetError(FormulaError::StringOverflow);
 eState = ssStop;
 }
 else
+{
+mnRangeOpPosInSymbol = pSym - [0];
 *pSym++ = c;
+}
 }
 else if ( 128 <= c || '\'' == c )
 {   // High values need reparsing with i18n,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-12-01 Thread Winfried Donkers
 sc/source/core/tool/interpr1.cxx |   18 +-
 1 file changed, 5 insertions(+), 13 deletions(-)

New commits:
commit 664d40fb24bf500a22efd1f1aff58a96b3c3cf2c
Author: Winfried Donkers 
Date:   Wed Nov 29 17:43:14 2017 +0100

tdf#97198 follow up: improve efficiency for Calc function RIGHT.

Change-Id: Ie2d5011f9ff73bd42a6f3ced1f709fab65d23c18
Reviewed-on: https://gerrit.libreoffice.org/45517
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit c5d0cffbf42f41349a8575ba52456d9cb07e91c7)
Reviewed-on: https://gerrit.libreoffice.org/45598

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 164c1185e1b8..d3b5829a5db8 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8901,23 +8901,15 @@ void ScInterpreter::ScRight()
 n = 1;
 OUString aStr = GetString().getString();
 sal_Int32 nLen = aStr.getLength();
-sal_Int32 nIdx = 0;
-sal_Int32 nCnt = 0;
-while ( nIdx < nLen )
-{
-aStr.iterateCodePoints(  );
-++nCnt;
-}
-if ( nCnt <= n )
+if ( nLen <= n )
 PushString( aStr );
 else
 {
-sal_Int32 nCLen = nCnt;
-nIdx = 0;
-nCnt = 0;
-while ( nIdx < nLen && n < ( nCLen - nCnt ) )
+sal_Int32 nIdx = nLen;
+sal_Int32 nCnt = 0;
+while ( nIdx > 0 && n > nCnt )
 {
-aStr.iterateCodePoints(  );
+aStr.iterateCodePoints( , -1 );
 ++nCnt;
 }
 aStr = aStr.copy( nIdx, nLen - nIdx );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2017-11-30 Thread Bartosz Kosiorek
 sc/source/filter/oox/stylesbuffer.cxx |   10 ++
 1 file changed, 6 insertions(+), 4 deletions(-)

New commits:
commit 5930033f050e933a134a1ff11974b8601d8a7f9a
Author: Bartosz Kosiorek 
Date:   Sat Nov 25 09:51:58 2017 +0100

tdf#113271 Fix order of color's attributes import.

The order of import color is very important in case of more than one color 
attributes was provided.
This order (theme -> rgb -> indexed -> auto) is not documented
and was gathered experimentally based on MS Excel 2013.

Information about :

https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.fonts(v=office.14).aspx

Information about font:
https://msdn.microsoft.com/en-us/library/ff531892(v=office.12).aspx

https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.font(v=office.14).aspx

More information about color class:

https://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.color(v=office.14).aspx
https://msdn.microsoft.com/en-us/library/ff532831(v=office.12).aspx

Example:
With indexed auto, colour, rgb and them,


The priority is as follows:
1. theme
2. rgb
3. indexed
4. auto

Change-Id: I7bb5ab7d7b7a52091f0130fd6f21bac44eca7408
Reviewed-on: https://gerrit.libreoffice.org/45281
Reviewed-by: Eike Rathke 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/stylesbuffer.cxx 
b/sc/source/filter/oox/stylesbuffer.cxx
index 7a33511ee449..15f1093b03a6 100644
--- a/sc/source/filter/oox/stylesbuffer.cxx
+++ b/sc/source/filter/oox/stylesbuffer.cxx
@@ -266,14 +266,16 @@ void Color::setIndexed( sal_Int32 nPaletteIdx, double 
fTint )
 
 void Color::importColor( const AttributeList& rAttribs )
 {
-if( rAttribs.getBool( XML_auto, false ) )
-setAuto();
+// tdf#113271 The order of import color is very important in case of more 
than one color attributes was provided.
+// This order (theme -> rgb -> indexed -> auto) is not documented and was 
gathered experimentally based on MS Excel 2013.
+if( rAttribs.hasAttribute( XML_theme ) )
+setTheme( rAttribs.getInteger( XML_theme, -1 ), rAttribs.getDouble( 
XML_tint, 0.0 ) );
 else if( rAttribs.hasAttribute( XML_rgb ) )
 setRgb( rAttribs.getIntegerHex( XML_rgb, API_RGB_TRANSPARENT ), 
rAttribs.getDouble( XML_tint, 0.0 ) );
-else if( rAttribs.hasAttribute( XML_theme ) )
-setTheme( rAttribs.getInteger( XML_theme, -1 ), rAttribs.getDouble( 
XML_tint, 0.0 ) );
 else if( rAttribs.hasAttribute( XML_indexed ) )
 setIndexed( rAttribs.getInteger( XML_indexed, -1 ), 
rAttribs.getDouble( XML_tint, 0.0 ) );
+else if( rAttribs.getBool( XML_auto, false ) )
+setAuto();
 else
 {
 OSL_FAIL( "Color::importColor - unknown color type" );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits