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

2020-04-17 Thread Julien Nabet (via logerrit)
 sc/source/core/tool/interpr8.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c30b664f910ed980b4bf7c96f0ed23fe1d8be8e9
Author: Julien Nabet 
AuthorDate: Thu Apr 16 12:47:46 2020 +0200
Commit: Eike Rathke 
CommitDate: Fri Apr 17 21:24:06 2020 +0200

tdf#130583: fix Switch in Calc

Don't set bFinished to true too soon if there are still some params to take 
into account

Change-Id: Ie7bdd6f316c08342d379d55bf3853774dd738e7d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92345
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit bb3ea0ae51bb943f7bb3dca80eee153f9c55c03e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92433

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 0fa198c6ebb6..0216ce337759 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1965,7 +1965,7 @@ void ScInterpreter::ScSwitch_MS()
 else
 aStr = GetString();
 nParamCount--;
-if ( nGlobalError != FormulaError::NONE || (( isValue && 
rtl::math::approxEqual( fRefVal, fVal ) ) ||
+if ( (nGlobalError != FormulaError::NONE && nParamCount < 2) || (( 
isValue && rtl::math::approxEqual( fRefVal, fVal ) ) ||
  ( !isValue && aRefStr.getDataIgnoreCase() == 
aStr.getDataIgnoreCase() )) )
 {
 // 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-3' - sc/source

2020-04-16 Thread Julien Nabet (via logerrit)
 sc/source/core/data/table6.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit fed70d60f7ea4b2fb9828c485ba4945343274ea8
Author: Julien Nabet 
AuthorDate: Tue Apr 14 14:28:55 2020 +0200
Commit: Xisco Faulí 
CommitDate: Thu Apr 16 18:59:09 2020 +0200

tdf#132097: fix Find Previous with direction columns crashes in specific 
case

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

nBlockPos vector is created with nLastCol + 1 elements,
so if we click on a cell in a column which is after last value,
the search will crash

Change-Id: I9de688a8a80a45c3e5ddea6d2f461926e9777052
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92165
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 2670e980c7dbadbdc20ff23d57ad892951edc254)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92298
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index 4daeb308bfd7..02e86cf2e6f1 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -328,8 +328,8 @@ bool ScTable::Search(const SvxSearchItem& rSearchItem, 
SCCOL& rCol, SCROW& rRow,
 bool bSkipFiltered = !rSearchItem.IsSearchFiltered();
 bool bSearchNotes = (rSearchItem.GetCellType() == SvxSearchCellType::NOTE);
 // We need to cache sc::ColumnBlockConstPosition per each column.
-std::vector< sc::ColumnBlockConstPosition > blockPos( nLastCol + 1 );
-for( SCCOL i = 0; i <= nLastCol; ++i )
+std::vector< sc::ColumnBlockConstPosition > blockPos( nLastCol + 2 );
+for( SCCOL i = 0; i <= nLastCol+1; ++i )
 aCol[ i ].InitBlockPosition( blockPos[ i ] );
 if (!bAll && rSearchItem.GetBackward())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-04-07 Thread Caolán McNamara (via logerrit)
 sc/source/ui/miscdlgs/crnrdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e1dbfeee796bb39766877526f5b45187f2721a9e
Author: Caolán McNamara 
AuthorDate: Mon Apr 6 21:15:55 2020 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Apr 7 15:29:43 2020 +0200

Resolves: tdf#131170 columns tagged as delimiter not column

Change-Id: I889c3ba38776a63587a68c7827956b6747c08e38
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91716
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx 
b/sc/source/ui/miscdlgs/crnrdlg.cxx
index ccd9076570a4..102a19f23729 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -404,7 +404,7 @@ void ScColRowNameRangesDlg::UpdateNames()
 //@008 Add string to listbox
 OUString aInsStr = aString + strShow.makeStringAndClear();
 aRangeMap.emplace( aInsStr, aRange );
-m_xLbRange->append(OUString::number(nEntryDataDelim), aInsStr);
+m_xLbRange->append(OUString::number(nEntryDataCol), aInsStr);
 }
 }
 aString = strDelim;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-04-03 Thread Julien Nabet (via logerrit)
 sc/source/ui/docshell/impex.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 41d90ebc2f53df095c8b66d3cd31adef2a5304c9
Author: Julien Nabet 
AuthorDate: Thu Mar 12 19:44:34 2020 +0100
Commit: Eike Rathke 
CommitDate: Fri Apr 3 17:17:14 2020 +0200

tdf#131273: fix crash when pasting quotes with fixed width

See bt https://bugs.documentfoundation.org/show_bug.cgi?id=131273#c2

Change-Id: I78f592bb2ee59b50e7301fe4e6f282e53c4eeb7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90438
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit cf3fec9e7cadd0a6c4f42a4015df429d9e32b7e8)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90398
Reviewed-by: Xisco Faulí 
(cherry picked from commit 3d264dc8742733a797a3e315033851d0bda3bffd)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90952
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 58d848a3095e..c7cdc06186b2 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1265,7 +1265,7 @@ static OUString lcl_GetFixed( const OUString& rLine, 
sal_Int32 nStart, sal_Int32
 bool bFits = (nSpace - nStart - 3 <= SAL_MAX_UINT16);
 OSL_ENSURE( bFits, "lcl_GetFixed: line doesn't fit into data");
 if (bFits)
-return rLine.copy(nStart+1, nSpace-nStart-2);
+return rLine.copy(nStart+1, std::max< sal_Int32 >(0, 
nSpace-nStart-2));
 else
 {
 rbOverflowCell = 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-3' - sc/source

2020-03-27 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr8.cxx |   41 +--
 1 file changed, 31 insertions(+), 10 deletions(-)

New commits:
commit cddb53f5678fde8ad247524561f423b6498b29eb
Author: Eike Rathke 
AuthorDate: Fri Mar 27 17:54:09 2020 +0100
Commit: Caolán McNamara 
CommitDate: Fri Mar 27 21:59:16 2020 +0100

Resolves: tdf#131096 Handle argument error and propagate

For etsPIAdd and etsPIMult also check if the fPILevel parameter
was actually specified (explicitly or missing/omitted) and do not
pop the 3rd parameter if not. GetDoubleWithDefault() can't handle
that as apparently was erroneously assumed.

Use IllegalArgument error instead of IllegalParameter in most
cases (the parameter is fine but the argument value is not).

Actually propagate ScETSForecastCalculation::mnErrorValue if set
as PushMatrix() does not, on purpose.

Change-Id: Ia2db5b0a7a388f0f40b73c6a4f66debbedec41e8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91232
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 811b36e4db240be3a21a4d184b085630efcc09b7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91182
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 5e3700ce5cff..0fa198c6ebb6 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -981,6 +981,12 @@ void ScETSForecastCalculation::GetETSPredictionIntervals( 
const ScMatrixRef& rTM
 if ( fmod( fMaxTarget, mfStepSize ) != 0.0 )
 nSize++;
 
+if (nSize == 0)
+{
+mnErrorValue = FormulaError::IllegalArgument;
+return;
+}
+
 std::unique_ptr< double[] > xScenRange( new double[nSize]);
 std::unique_ptr< double[] > xScenBase( new double[nSize]);
 std::unique_ptr< double[] > xScenTrend( new double[nSize]);
@@ -,6 +1117,12 @@ void 
ScETSForecastCalculation::GetEDSPredictionIntervals( const ScMatrixRef& rTM
 if ( fmod( fMaxTarget, mfStepSize ) != 0.0 )
 nSize++;
 
+if (nSize == 0)
+{
+mnErrorValue = FormulaError::IllegalArgument;
+return;
+}
+
 double z = ScInterpreter::gaussinv( ( 1.0 + fPILevel ) / 2.0 );
 double o = 1 - fPILevel;
 std::vector< double > c( nSize );
@@ -1181,7 +1193,7 @@ void ScInterpreter::ScForecast_Ets( ScETSType eETSType )
 nAggregation = 1;
 if ( nAggregation < 1 || nAggregation > 7 )
 {
-PushIllegalParameter();
+PushIllegalArgument();
 return;
 }
 
@@ -1195,7 +1207,7 @@ void ScInterpreter::ScForecast_Ets( ScETSType eETSType )
 bDataCompletion = nTemp;
 else
 {
-PushIllegalParameter();
+PushIllegalArgument();
 return;
 }
 }
@@ -1222,16 +1234,16 @@ void ScInterpreter::ScForecast_Ets( ScETSType eETSType )
 double fPILevel = 0.0;
 if ( nParamCount < 3 && !( nParamCount == 2 && eETSType == etsSeason ) )
 {
-PushIllegalArgument();
+PushParameterExpected();
 return;
 }
 
 if ( eETSType == etsPIAdd || eETSType == etsPIMult )
 {
-fPILevel = GetDoubleWithDefault( 0.95 );
+fPILevel = (nParamCount < 4 ? 0.95 : GetDoubleWithDefault( 0.95 ));
 if ( fPILevel < 0 || fPILevel > 1 )
 {
-PushIllegalParameter();
+PushIllegalArgument();
 return;
 }
 }
@@ -1249,7 +1261,7 @@ void ScInterpreter::ScForecast_Ets( ScETSType eETSType )
 if ( static_cast< int >( pTypeMat->GetDouble( j, i ) ) < 1 ||
  static_cast< int >( pTypeMat->GetDouble( j, i ) ) > 9 )
 {
-PushIllegalParameter();
+PushIllegalArgument();
 return;
 }
 }
@@ -1304,7 +1316,10 @@ void ScInterpreter::ScForecast_Ets( ScETSType eETSType )
 pTMat->GetDimensions( nC, nR );
 ScMatrixRef pFcMat = GetNewMat( nC, nR );
 aETSCalc.GetForecastRange( pTMat, pFcMat );
-PushMatrix( pFcMat );
+if (aETSCalc.GetError() != FormulaError::NONE)
+PushError( aETSCalc.GetError());// explicitly push 
error, PushMatrix() does not
+else
+PushMatrix( pFcMat );
 }
 break;
 case etsPIAdd :
@@ -1316,13 +1331,15 @@ void ScInterpreter::ScForecast_Ets( ScETSType eETSType )
 if ( nSmplInPrd == 0 )
 {
 aETSCalc.GetEDSPredictionIntervals( pTMat, pPIMat, 
fPILevel );
-PushMatrix( pPIMat );
 }
 else
 {
 aETSCalc.GetETSPredictionIntervals( pTMat, pPIMat, 
fPILevel );
-PushMatrix( pPIMat );
 }
+if 

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

2020-03-27 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/interpr8.cxx |7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

New commits:
commit 4fe6846e1d0c2d3953b36275d39f101839c90967
Author: Caolán McNamara 
AuthorDate: Thu Mar 26 15:46:07 2020 +
Commit: Eike Rathke 
CommitDate: Fri Mar 27 11:42:16 2020 +0100

tdf#131380 crash on loading specific xlsx document

mpPerIdx is null, because bEDS is true, assume 0 in this case

Change-Id: I44c2433b0de57a28cece6b9b01ba543bdc3cb8d3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91145
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 0f5e930fffbe2151ffadc8461449e55015617f65)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91167

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 759e5815ae0a..5e3700ce5cff 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -993,17 +993,18 @@ void ScETSForecastCalculation::GetETSPredictionIntervals( 
const ScMatrixRef& rTM
 // fill array with forecasts, with RandDev() added to xScenRange
 if ( bAdditive )
 {
+double nPIdx = !bEDS ? mpPerIdx[mnCount - mnSmplInPrd] : 0.0;
 // calculation based on additive model
 xScenRange[ 0 ] = mpBase[ mnCount - 1 ] + mpTrend[ mnCount - 1 ] +
-  mpPerIdx[ mnCount - mnSmplInPrd ] +
+  nPIdx +
   RandDev();
 aPredictions[ 0 ][ k ] = xScenRange[ 0 ];
-xScenBase[ 0 ] = mfAlpha * ( xScenRange[ 0 ] - mpPerIdx[ mnCount - 
mnSmplInPrd ] ) +
+xScenBase[ 0 ] = mfAlpha * ( xScenRange[ 0 ] - nPIdx ) +
  ( 1 - mfAlpha ) * ( mpBase[ mnCount - 1 ] + 
mpTrend[ mnCount - 1 ] );
 xScenTrend[ 0 ] = mfGamma * ( xScenBase[ 0 ] - mpBase[ mnCount - 1 
] ) +
   ( 1 - mfGamma ) * mpTrend[ mnCount - 1 ];
 xScenPerIdx[ 0 ] = mfBeta * ( xScenRange[ 0 ] - xScenBase[ 0 ] ) +
-   ( 1 - mfBeta ) * mpPerIdx[ mnCount - 
mnSmplInPrd ];
+   ( 1 - mfBeta ) * nPIdx;
 for ( SCSIZE i = 1; i < nSize; i++ )
 {
 double fPerIdx;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-23 Thread Noel Grandin (via logerrit)
 sc/source/filter/oox/workbookfragment.cxx |9 +
 1 file changed, 9 insertions(+)

New commits:
commit ff1588da212285122e4c4efdbfb723fe9c56caa8
Author: Noel Grandin 
AuthorDate: Tue Mar 3 09:23:30 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Mar 23 08:42:26 2020 +0100

tdf#93831 xlsx file full of pictures of numbers slow to open

Change-Id: I6c984c84c409519a986eacb265c943307a7b57af
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90245
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit edf13fe1247e7ef411a9ff5435385573fad01f56)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90044
(cherry picked from commit 6935465f9b56d99557ba627d845b9d1a2f2f2d07)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90815

diff --git a/sc/source/filter/oox/workbookfragment.cxx 
b/sc/source/filter/oox/workbookfragment.cxx
index 2f7eb767ec6f..49efb67e0568 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -50,6 +50,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -344,6 +345,12 @@ void importSheetFragments( WorkbookFragment& 
rWorkbookHandler, SheetFragmentVect
 
 void WorkbookFragment::finalizeImport()
 {
+// lock the model to prevent broadcasting, speeds up load a lot
+getScDocument().InitDrawLayer();
+auto pModel = getScDocument().GetDrawLayer();
+bool bWasLocked = pModel->isLocked();
+pModel->setLock(true);
+
 ISegmentProgressBarRef xGlobalSegment = getProgressBar().createSegment( 
PROGRESS_LENGTH_GLOBALS );
 
 // read the theme substream
@@ -505,6 +512,8 @@ void WorkbookFragment::finalizeImport()
 
 // attach macros to registered objects now that all objects have been 
created.
 getBaseFilter().getVbaProject().attachMacros();
+
+pModel->setLock(bWasLocked);
 }
 
 namespace {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-11 Thread Eike Rathke (via logerrit)
 sc/source/core/data/document10.cxx |9 ++---
 sc/source/core/tool/token.cxx  |6 --
 2 files changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 461824307d2ee701f3026f75a9ee5a7865cd6e7a
Author: Eike Rathke 
AuthorDate: Tue Feb 18 00:23:40 2020 +0100
Commit: Xisco Faulí 
CommitDate: Wed Mar 11 15:14:43 2020 +0100

Resolves: tdf#130370 Do not increment sheet-local name on cut / move

 This is a combination of 2 commits.

Resolves: tdf#130370 Increment sheet-local name only for moved cells

Probably that piece of code is not needed at all anymore since
moving entire sheets and their names is handled differently
nowadays. Needs further investigation.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88898
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 180fef2a54207555c39fb63ead5e66ba3a71a0cf)

Related: tdf#130370 Let cut/move of a sheet-local name reference ...

... reference the original sheet-local name instead of a same name
on the destination sheet.

In bugdoc https://bugs.documentfoundation.org/attachment.cgi?id=102780
that is the case when cutting Sheet2.B3 and pasting somewhere on Sheet3.
That yielded formula =value with result 3. (after the fix of commit
180fef2a54207555c39fb63ead5e66ba3a71a0cf, before it was #NAME?).
Now it yields the expected formula =Sheet2.value with result 2.

Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88939
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 0c6bf98cd94307ef7b0896e6643be6161691f9c9)

d92778ea41544583e885eaccfbf82c26762925a5

Change-Id: I2ac115c18354371d0abbfc6cc972d16edcb41021
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88946
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 
(cherry picked from commit bef90981e3f9f9dc3e4731c5bcbab315e52b9baf)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88955
Tested-by: Xisco Faulí 
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/document10.cxx 
b/sc/source/core/data/document10.cxx
index 877809901297..3fe63c768dac 100644
--- a/sc/source/core/data/document10.cxx
+++ b/sc/source/core/data/document10.cxx
@@ -737,10 +737,13 @@ bool ScDocument::CopyAdjustRangeName( SCTAB& rSheet, 
sal_uInt16& rIndex, ScRange
 ScDocument& rNewDoc, const ScAddress& rNewPos, const ScAddress& 
rOldPos, const bool bGlobalNamesToLocal,
 const bool bUsedByFormula ) const
 {
-const bool bSameDoc = (rNewDoc.GetPool() == 
const_cast(this)->GetPool());
-if (bSameDoc && ((rSheet < 0 && !bGlobalNamesToLocal) || (rSheet >= 0 && 
rSheet != rOldPos.Tab(
+ScDocument* pThis = const_cast(this);
+const bool bSameDoc = (rNewDoc.GetPool() == pThis->GetPool());
+if (bSameDoc && ((rSheet < 0 && !bGlobalNamesToLocal) || (rSheet >= 0
+&& (rSheet != rOldPos.Tab() || (IsClipboard() && 
pThis->IsCutMode())
 // Same doc and global name, if not copied to local name, or
-// sheet-local name on other sheet stays the same.
+// sheet-local name on other sheet stays the same. Sheet-local on
+// same sheet also in a clipboard cut / move operation.
 return false;
 
 // Ensure we don't fiddle with the references until exit.
diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index ccdec841233d..164e3f922273 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3375,12 +3375,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceOnMove(
 SCTAB nOldTab = (*pp)->GetSheet();
 if (isNameModified(rCxt.maUpdatedNames, nOldTab, 
**pp))
 aRes.mbNameModified = true;
-if (rCxt.mnTabDelta &&
-rCxt.maRange.aStart.Tab() <= nOldTab && 
nOldTab <= rCxt.maRange.aEnd.Tab())
-{
-aRes.mbNameModified = true;
-(*pp)->SetSheet( nOldTab + rCxt.mnTabDelta);
-}
 }
 break;
 case ocDBArea:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-03-04 Thread Noel Grandin (via logerrit)
 sc/source/ui/view/tabview2.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit c91d0dd01d884916c699bb70219c792aba704846
Author: Noel Grandin 
AuthorDate: Mon Mar 2 10:23:42 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 4 20:34:14 2020 +0100

tdf#126904 calc right arrow large unexpected column jump in protected sheet

regression from
commit 7282014e362a1529a36c88eb308df8ed359c2cfa
Date:   Fri Feb 1 15:15:16 2019 +0100
tdf#50916 Makes numbers of columns dynamic.

Change-Id: I3b6f6e5430c97ef52f63c406eb3c3b39b9dd578e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89809
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 7ae33e175007d04021f5e911e3f7f6cbd0966804)
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89959

diff --git a/sc/source/ui/view/tabview2.cxx b/sc/source/ui/view/tabview2.cxx
index 1551678717e9..0437a8b32785 100644
--- a/sc/source/ui/view/tabview2.cxx
+++ b/sc/source/ui/view/tabview2.cxx
@@ -745,6 +745,7 @@ void ScTabView::SkipCursorHorizontal(SCCOL& rCurX, SCROW& 
rCurY, SCCOL nOldX, SC
 
 bool bSkipCell = false;
 bool bHFlip = false;
+auto nMaxCol = pDoc->ClampToAllocatedColumns(nTab, MAXCOL);
 do
 {
 bSkipCell = pDoc->ColHidden(rCurX, nTab) || 
pDoc->IsHorOverlapped(rCurX, rCurY, nTab);
@@ -755,7 +756,7 @@ void ScTabView::SkipCursorHorizontal(SCCOL& rCurX, SCROW& 
rCurY, SCCOL nOldX, SC
 
 if (bSkipCell)
 {
-if (rCurX <= 0 || rCurX >= MAXCOL)
+if (rCurX <= 0 || rCurX >= nMaxCol)
 {
 if (bHFlip)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-27 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/token.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9e6fc988b6ef7420ba6cfa55aea0b48ec47462c3
Author: Eike Rathke 
AuthorDate: Tue Feb 25 18:00:29 2020 +0100
Commit: Xisco Faulí 
CommitDate: Thu Feb 27 09:42:01 2020 +0100

Resolves: tdf#130825 Compare exclusive end, not inclusive end sheet number

Change-Id: Id5c3056f4e4466ccb5ea3654e60869bf7788b7ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89471
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit f2b18667c1a8c6a002a229d4ae09dc418dc567e1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89523
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 906f170e810c..ccdec841233d 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -4155,7 +4155,7 @@ sc::RefUpdateResult 
ScTokenArray::AdjustReferenceOnDeletedTab( const sc::RefUpda
 if (rCxt.mnDeletePos <= nOldTab)
 {
 aRes.mbNameModified = true;
-if (rCxt.mnDeletePos + rCxt.mnSheets < nOldTab)
+if (rCxt.mnDeletePos + rCxt.mnSheets <= 
nOldTab)
 (*pp)->SetSheet( nOldTab - rCxt.mnSheets);
 else
 // Would point to a deleted sheet. 
Invalidate.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-02-05 Thread Noel Grandin (via logerrit)
 sc/source/core/data/postit.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0712202b5a62ccb095311b6610b92a19b8cb9f0a
Author: Noel Grandin 
AuthorDate: Tue Feb 4 13:59:14 2020 +0200
Commit: Noel Grandin 
CommitDate: Thu Feb 6 07:00:23 2020 +0100

tdf#129789 bitmap in comment lost on load

regression from
commit b4a1b89cc84086dfd6f471d7f23fecf0ec8f3331
tdf#119650 slow saving spreadsheet with comments, part 2

Change-Id: I8f6aa6b784b50b80311a420bdff9195ba88f5cff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87968
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 174ba963e05c9dedd57c2027f8656fe1f17030c2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88043

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index d2142f84747c..b48249ed787d 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -142,7 +142,7 @@ void ScCaptionUtil::SetDefaultItems( SdrCaptionObj& 
rCaption, ScDocument& rDoc,
 {
 /* Updates caption item set according to the passed item set while 
removing shadow items. */
 
-aItemSet.MergeValues(*pExtraItemSet);
+aItemSet.Put(*pExtraItemSet);
 // reset shadow items
 aItemSet.Put( makeSdrShadowItem( false ) );
 aItemSet.Put( makeSdrShadowXDistItem( 100 ) );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-29 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/dpobject.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 3572d3e594dd9b2710310820a0604129a0f6a835
Author: Caolán McNamara 
AuthorDate: Tue Jan 28 12:24:51 2020 +
Commit: Michael Stahl 
CommitDate: Wed Jan 29 10:42:57 2020 +0100

Resolves: tdf#130239 set an explicit parent for the message dialog

Change-Id: If6e4bdf674f1aa5ceaa7cda5715af1aa7ce6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87612
Tested-by: Jenkins
Reviewed-by: Michael Stahl 

diff --git a/sc/source/core/data/dpobject.cxx b/sc/source/core/data/dpobject.cxx
index 57c1b7723c71..3af2c8aa1866 100644
--- a/sc/source/core/data/dpobject.cxx
+++ b/sc/source/core/data/dpobject.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -3262,7 +3263,8 @@ uno::Reference 
ScDPCollection::DBCaches::createRowSet(
 catch ( const sdbc::SQLException& rError )
 {
 //! store error message
-std::unique_ptr 
xInfoBox(Application::CreateMessageDialog(nullptr,
+vcl::Window* pParent = ScDocShell::GetActiveDialogParent();
+std::unique_ptr 
xInfoBox(Application::CreateMessageDialog(pParent ? pParent->GetFrameWeld() : 
nullptr,
   VclMessageType::Info, 
VclButtonsType::Ok,
   rError.Message));
 xInfoBox->run();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-24 Thread Caolán McNamara (via logerrit)
 sc/source/ui/dbgui/tpsort.cxx |   13 ++---
 1 file changed, 10 insertions(+), 3 deletions(-)

New commits:
commit a34e4090b39852b6d44a0107f375ff48253cd077
Author: Caolán McNamara 
AuthorDate: Thu Jan 23 11:27:17 2020 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Jan 24 18:06:01 2020 +0100

Resolves: tdf#129158 freeze/thaw around bulk inserts

Change-Id: I0ba22cd262512b467abd383d2f932d2adf6ca1a5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87259
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 1bf89c164644..282d1bed2da1 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -326,10 +326,11 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 
nStartField )
 
 if ( pDoc )
 {
-for ( sal_uInt16 i=nStartField; im_xLbSort->clear();
-
m_aSortWin.m_aSortKeyItems[i]->m_xLbSort->append_text(aStrUndefined);
+m_aSortWin.m_aSortKeyItems[j]->m_xLbSort->clear();
+m_aSortWin.m_aSortKeyItems[j]->m_xLbSort->freeze();
+
m_aSortWin.m_aSortKeyItems[j]->m_xLbSort->append_text(aStrUndefined);
 }
 
 SCCOL   nFirstSortCol   = aSortData.nCol1;
@@ -381,6 +382,12 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 
nStartField )
 i++;
 }
 }
+
+for (sal_uInt16 j=nStartField; j < nSortKeyCount; ++j)
+{
+m_aSortWin.m_aSortKeyItems[j]->m_xLbSort->thaw();
+}
+
 nFieldCount = i;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-21 Thread Eike Rathke (via logerrit)
 sc/source/core/data/column.cxx |   12 +++-
 1 file changed, 11 insertions(+), 1 deletion(-)

New commits:
commit 92051303dce5efbc29b2afe426f9e076cee01736
Author: Eike Rathke 
AuthorDate: Tue Dec 17 23:51:54 2019 +0100
Commit: Eike Rathke 
CommitDate: Tue Jan 21 20:57:00 2020 +0100

Resolves: tdf#129396 Refresh shared formula group area listeners upon 
shifting

Regression from

commit 47230a036fe35b9a7a7c0609232849fcbb51efcc
CommitDate: Thu Feb 5 11:52:51 2015 +0100

Resolves: tdf#88792 do not hold a ScFormulaCell** in group area 
listener

where previously the listener position's column was taken from the
group's remembered top formula cell (then updated) position, which
holding the cell was wrong in other cases.

Change-Id: Ida1503daa7cbda2b41459ff5d63652a6febd91e0
Reviewed-on: https://gerrit.libreoffice.org/85347
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 491e8f60bf7f216a3bb3092b22334924b6c9aee1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/85353
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index 18132d2fc454..a8894521ca34 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2156,6 +2156,7 @@ class UpdateRefOnNonCopy
 // Run this before the position gets updated.
 sc::RefUpdateResult aRes = pCode->AdjustReferenceOnShift(*mpCxt, 
aOldPos);
 
+bool bGroupShifted = false;
 if (pTop->UpdatePosOnShift(*mpCxt))
 {
 ScAddress aErrorPos( ScAddress::UNINITIALIZED );
@@ -2171,6 +2172,15 @@ class UpdateRefOnNonCopy
 
 if (pCode->IsRecalcModeOnRefMove())
 aRes.mbValueChanged = true;
+
+// FormulaGroupAreaListener (contrary to ScBroadcastArea) is not
+// updated but needs to be re-setup, else at least its mpColumn
+// would indicate the old column to collect cells from. tdf#129396
+/* TODO: investigate if that could be short-cut to avoid all the
+ * EndListeningTo() / StartListeningTo() overhead and is really
+ * only necessary when shifting the column, not also when shifting
+ * rows. */
+bGroupShifted = true;
 }
 else if (aRes.mbReferenceModified && pCode->IsRecalcModeOnRefMove())
 {
@@ -2182,7 +2192,7 @@ class UpdateRefOnNonCopy
 if (aRes.mbNameModified)
 recompileTokenArray(*pTop);
 
-if (aRes.mbReferenceModified || aRes.mbNameModified)
+if (aRes.mbReferenceModified || aRes.mbNameModified || bGroupShifted)
 {
 sc::EndListeningContext aEndCxt(mpCxt->mrDoc, pOldCode.get());
 aEndCxt.setPositionDelta(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-21 Thread Julien Nabet (via logerrit)
 sc/source/ui/unoobj/PivotTableDataProvider.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit d6f34d4a84ac43889d0bf239e22d18ddcd874ba7
Author: Julien Nabet 
AuthorDate: Mon Jan 20 19:40:52 2020 +0100
Commit: Xisco Faulí 
CommitDate: Tue Jan 21 13:59:09 2020 +0100

tdf#129412: Crash when registered data source is not available

See bt here:
https://bugs.documentfoundation.org/show_bug.cgi?id=129412#c4

Regression from:

https://cgit.freedesktop.org/libreoffice/core/commit/?id=9009663deb8f0862f419fd99bf0b761c7f923eff

author  Tomaž Vajngerl  2017-02-26 22:48:06 
+0100
committer   Tomaž Vajngerl2017-04-04 13:39:29 
+
commit  9009663deb8f0862f419fd99bf0b761c7f923eff (patch)
treeea25976de0919f9d2161037d83be0eace4c1070b
parent  1931b5b01c6fdaa204d26ec4b9675dad16373cf2 (diff)
tdf#83257 [API-CHANGE] Pivot chart implementation

Change-Id: Ib4de665f6e5380baf51589c92473ad88e8c9b84e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87096
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl 
Signed-off-by: xisco 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87125

diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx 
b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
index 52c657e8d3db..1d1062394b84 100644
--- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx
+++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx
@@ -284,6 +284,8 @@ void PivotTableDataProvider::collectPivotTableData()
 m_aFieldOutputDescriptionMap.clear();
 
 uno::Reference 
xDPResults(pDPObject->GetSource(), uno::UNO_QUERY);
+if (!xDPResults.is())
+return;
 uno::Sequence> xDataResultsSequence = 
xDPResults->getResults();
 
 double fNan;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-15 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/documen6.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4c3bde3b4bddb6bcfe0ae5b269d3b0f50c23236f
Author: Luboš Luňák 
AuthorDate: Tue Jan 14 12:26:52 2020 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Jan 16 01:47:24 2020 +0100

do not ignore return value of a (confusing) function (tdf#126248)

The two ScCellFormat::GetString() overloads are lame API, one returns
the value normally and the other one returns void and uses a reference
parameter. I got confused by this in 6f810e3d7dafcd7d0101173a501
and didn't use the return value in one case.

Change-Id: I0b6c839f9d0299e14ea022813481802275df5ea6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86750
Tested-by: Jenkins
Reviewed-by: 锁琨珑 
Reviewed-by: Luboš Luňák 
(cherry picked from commit 5a211ba9f5f465c8c898ebce4cc37fa30581acac)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86838
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/core/data/documen6.cxx b/sc/source/core/data/documen6.cxx
index 9dd1f8b523a3..bc0f7aa11afa 100644
--- a/sc/source/core/data/documen6.cxx
+++ b/sc/source/core/data/documen6.cxx
@@ -120,7 +120,7 @@ SvtScriptType ScDocument::GetCellScriptType( const 
ScAddress& rPos, sal_uInt32 n
 if( pCell )
 ScCellFormat::GetString(*pCell, nNumberFormat, aStr, , 
*mxPoolHelper->GetFormTable(), this);
 else
-ScCellFormat::GetString(*this, rPos, nNumberFormat, , 
*mxPoolHelper->GetFormTable());
+aStr = ScCellFormat::GetString(*this, rPos, nNumberFormat, , 
*mxPoolHelper->GetFormTable());
 
 SvtScriptType nRet = GetStringScriptType( aStr );
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-15 Thread Noel Grandin (via logerrit)
 sc/source/core/data/markdata.cxx |   15 +++
 1 file changed, 11 insertions(+), 4 deletions(-)

New commits:
commit 22432848e99fddca20168f7637bbf3c579eea601
Author: Noel Grandin 
AuthorDate: Wed Jan 15 09:25:23 2020 +0200
Commit: Noel Grandin 
CommitDate: Wed Jan 15 11:25:52 2020 +0100

tdf#129393 Calc: cannot format whole row of unprotected cells

regression from
commit 3c3a371c799d00475deb13b4c3e0a8860c7e4fb3
tdf#125254 Performance: A spreadsheet opens too slow, part2

Change-Id: I87e06a58d6a4eb1a32bdf7e9267a4fe9d6dc4f2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86826
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86831

diff --git a/sc/source/core/data/markdata.cxx b/sc/source/core/data/markdata.cxx
index 60e7db0fb0ca..e37378d5b73e 100644
--- a/sc/source/core/data/markdata.cxx
+++ b/sc/source/core/data/markdata.cxx
@@ -366,10 +366,17 @@ ScMarkData::ScMarkData(const ScRangeList& rList)
 for (const ScRange& rRange : rList)
 maTabMarked.insert( rRange.aStart.Tab() );
 
-bMultiMarked = true;
-aMultiRange = rList.Combine();
-
-aMultiSel.Set( rList );
+if (rList.size() > 1)
+{
+bMultiMarked = true;
+aMultiRange = rList.Combine();
+aMultiSel.Set( rList );
+}
+else if (rList.size() == 1)
+{
+const ScRange& rRange = rList[ 0 ];
+SetMarkArea( rRange );
+}
 }
 
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-13 Thread Noel Grandin (via logerrit)
 sc/source/core/data/table2.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 94b6adc7eac7e5346c0432d606951ee0b1f9072e
Author: Noel Grandin 
AuthorDate: Mon Jan 13 15:03:10 2020 +0200
Commit: Noel Grandin 
CommitDate: Mon Jan 13 17:44:30 2020 +0100

tdf#129908 Crash at Data > Group and outlone > AutoOutline

regression from
commit 7282014e362a1529a36c88eb308df8ed359c2cfa
tdf#50916 Makes numbers of columns dynamic.

Change-Id: Ie0eff58c7db5a3c85cfea480ca1fea5767fd8cfb
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86683
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit b56e0d7f7fb9f1ca9295ac2ba540a3cf778324b9)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86693

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 1f62b1a9418d..f5143b703687 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -3682,6 +3682,8 @@ void ScTable::DoAutoOutline( SCCOL nStartCol, SCROW 
nStartRow, SCCOL nEndCol, SC
 bool bFound;
 ScRange aRef;
 
+nEndCol = ClampToAllocatedColumns(nEndCol);
+
 StartOutlineTable();
 
 // Rows
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-01-07 Thread Caolán McNamara (via logerrit)
 sc/source/ui/condformat/condformatdlgentry.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 0e536aa4b173b5e2a370333e50f822883923dffc
Author: Caolán McNamara 
AuthorDate: Mon Jan 6 15:50:13 2020 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Jan 7 10:53:47 2020 +0100

Resolves: tdf#129518 make colorboxes max width at 1/3 avail space

Change-Id: I4eef1f108078bc05f7755b5befb18437c30638ca
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/86285
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index 7d914952bbdb..b46fefc7ba84 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -731,6 +731,8 @@ 
ScColorScale2FrmtEntry::ScColorScale2FrmtEntry(ScCondFormatList* pParent, ScDocu
 mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
 mxLbEntryTypeMin->set_size_request(CommonWidgetWidth, -1);
 mxLbEntryTypeMax->set_size_request(CommonWidgetWidth, -1);
+mxLbColMin->get_widget().set_size_request(CommonWidgetWidth, -1);
+mxLbColMax->get_widget().set_size_request(CommonWidgetWidth, -1);
 
 mxFtMin->show();
 mxFtMax->show();
@@ -868,6 +870,9 @@ 
ScColorScale3FrmtEntry::ScColorScale3FrmtEntry(ScCondFormatList* pParent, ScDocu
 mxLbEntryTypeMin->set_size_request(CommonWidgetWidth, -1);
 mxLbEntryTypeMiddle->set_size_request(CommonWidgetWidth, -1);
 mxLbEntryTypeMax->set_size_request(CommonWidgetWidth, -1);
+mxLbColMin->get_widget().set_size_request(CommonWidgetWidth, -1);
+mxLbColMiddle->get_widget().set_size_request(CommonWidgetWidth, -1);
+mxLbColMax->get_widget().set_size_request(CommonWidgetWidth, -1);
 mxFtMin->show();
 mxFtMax->show();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-17 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/solvrdlg.hxx  |2 +
 sc/source/ui/miscdlgs/solvrdlg.cxx |   49 +
 2 files changed, 20 insertions(+), 31 deletions(-)

New commits:
commit 8a7e25d1320f5ea25e74af440810e10f8c02f65a
Author: Caolán McNamara 
AuthorDate: Fri Dec 13 13:31:57 2019 +
Commit: Xisco Faulí 
CommitDate: Tue Dec 17 12:09:05 2019 +0100

Resolves: tdf#128077 cancel goalseek subdialogs on forced removal

Change-Id: Ifd0d81d8b5e1b6bea68e74be1cebf082e24d6dde
Reviewed-on: https://gerrit.libreoffice.org/85116
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/inc/solvrdlg.hxx b/sc/source/ui/inc/solvrdlg.hxx
index 474d202c0a2b..d661d320928d 100644
--- a/sc/source/ui/inc/solvrdlg.hxx
+++ b/sc/source/ui/inc/solvrdlg.hxx
@@ -74,6 +74,8 @@ private:
 std::unique_ptr m_xBtnOk;
 std::unique_ptr m_xBtnCancel;
 
+std::shared_ptr m_xMessageBox;
+
 voidInit();
 boolCheckTargetValue( const OUString& rStrVal );
 voidRaiseError( ScSolverErr eError );
diff --git a/sc/source/ui/miscdlgs/solvrdlg.cxx 
b/sc/source/ui/miscdlgs/solvrdlg.cxx
index 25a36c30941d..b4a848671259 100644
--- a/sc/source/ui/miscdlgs/solvrdlg.cxx
+++ b/sc/source/ui/miscdlgs/solvrdlg.cxx
@@ -31,17 +31,6 @@
 #include 
 #include 
 
-namespace
-{
-void lclErrorDialog(weld::Window* pParent, const OUString& rString, const 
std::function& func)
-{
-std::shared_ptr 
xBox(Application::CreateMessageDialog(pParent,
-  VclMessageType::Warning, 
VclButtonsType::Ok,
-  rString));
-xBox->runAsync(xBox, func);
-}
-}
-
 ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* pCW, weld::Window* 
pParent,
   ScDocument* pDocument,
   const ScAddress& aCursorPos )
@@ -76,6 +65,9 @@ ScSolverDlg::ScSolverDlg( SfxBindings* pB, SfxChildWindow* 
pCW, weld::Window* pP
 
 ScSolverDlg::~ScSolverDlg()
 {
+if (m_xMessageBox)
+m_xMessageBox->response(RET_CANCEL);
+assert(!m_xMessageBox);
 }
 
 void ScSolverDlg::Init()
@@ -152,36 +144,31 @@ void ScSolverDlg::SetReference( const ScRange& rRef, 
ScDocument* pDocP )
 
 void ScSolverDlg::RaiseError( ScSolverErr eError )
 {
-switch ( eError )
+OUString sMessage;
+
+switch (eError)
 {
 case SOLVERR_NOFORMULA:
-lclErrorDialog(m_xDialog.get(), errMsgNoFormula,
-[this](sal_Int32 /*nResult*/) {
-m_xEdFormulaCell->GrabFocus();
-});
+sMessage = errMsgNoFormula;
 break;
-
 case SOLVERR_INVALID_FORMULA:
-lclErrorDialog(m_xDialog.get(), errMsgInvalidForm,
-[this](sal_Int32 /*nResult*/) {
-m_xEdFormulaCell->GrabFocus();
-});
+sMessage = errMsgInvalidForm;
 break;
-
 case SOLVERR_INVALID_VARIABLE:
-lclErrorDialog(m_xDialog.get(), errMsgInvalidVar,
-[this](sal_Int32 /*nResult*/) {
-m_xEdVariableCell->GrabFocus();
-});
+sMessage = errMsgInvalidVar;
 break;
-
 case SOLVERR_INVALID_TARGETVALUE:
-lclErrorDialog(m_xDialog.get(), errMsgInvalidVal,
-[this](sal_Int32 /*nResult*/) {
-m_xEdTargetVal->grab_focus();
-});
+sMessage = errMsgInvalidVal;
 break;
 }
+
+m_xMessageBox.reset(Application::CreateMessageDialog(m_xDialog.get(),
+ 
VclMessageType::Warning, VclButtonsType::Ok,
+ sMessage));
+m_xMessageBox->runAsync(m_xMessageBox, [this](sal_Int32 /*nResult*/) {
+m_xEdTargetVal->grab_focus();
+m_xMessageBox.reset();
+});
 }
 
 bool ScSolverDlg::IsRefInputMode() const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-12-09 Thread Caolán McNamara (via logerrit)
 sc/source/ui/pagedlg/tphfedit.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 7a0d7921dd1151427385e1b07398fffe1550c772
Author: Caolán McNamara 
AuthorDate: Thu Dec 5 10:19:19 2019 +
Commit: Xisco Faulí 
CommitDate: Mon Dec 9 13:06:57 2019 +0100

Resolves: tdf#129191 text properties in header/footer not set

EditEngine has a non-virtual void SetText( const EditTextObject& 
rTextObject );
ScEditEngineDefaulter inherits from EditEngine but does

using EditEngine::SetText
voidSetText( const EditTextObject& rTextObject );

so has another SetText with the same signature that does something 
different,
so calling via an EditEngine pointer gets the unwanted base version

Change-Id: I72e368e6698d5b9a205180cfd2c4f800be7846f8
Reviewed-on: https://gerrit.libreoffice.org/84545
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/pagedlg/tphfedit.cxx 
b/sc/source/ui/pagedlg/tphfedit.cxx
index 9a41ffdd5476..01c10d080080 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -161,7 +161,7 @@ void ScEditWindow::SetFont( const ScPatternAttr& rPattern )
 
 void ScEditWindow::SetText( const EditTextObject& rTextObject )
 {
-m_xEditEngine->SetText( rTextObject );
+GetEditEngine()->SetText( rTextObject );
 }
 
 void ScEditWindow::InsertField( const SvxFieldItem& rFld )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-29 Thread Caolán McNamara (via logerrit)
 sc/source/ui/miscdlgs/instbdlg.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a12038fd8f6c7f276b616093c613c4fc19f75a59
Author: Caolán McNamara 
AuthorDate: Thu Nov 28 15:07:37 2019 +
Commit: Michael Stahl 
CommitDate: Fri Nov 29 10:59:46 2019 +0100

Related: tdf#129082 set explicit parent for warning dialog

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

diff --git a/sc/source/ui/miscdlgs/instbdlg.cxx 
b/sc/source/ui/miscdlgs/instbdlg.cxx
index 303807299dc4..747cd524b70f 100644
--- a/sc/source/ui/miscdlgs/instbdlg.cxx
+++ b/sc/source/ui/miscdlgs/instbdlg.cxx
@@ -325,7 +325,7 @@ IMPL_LINK( ScInsertTableDlg, DialogClosedHdl, 
sfx2::FileDialogHelper*, _pFileDlg
 
 ErrCode nErr = pDocShTables->GetErrorCode();
 if ( nErr )
-ErrorHandler::HandleError( nErr );  // warnings, 
too
+ErrorHandler::HandleError(nErr, m_xDialog.get()); // warnings, 
too
 
 if ( !pDocShTables->GetError() )// errors only
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-26 Thread Caolán McNamara (via logerrit)
 sc/source/ui/formdlg/formula.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 95846782231096345e9a09b3fa35355316ef50fe
Author: Caolán McNamara 
AuthorDate: Thu Nov 21 20:43:11 2019 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Nov 27 00:43:00 2019 +0100

tdf#124513 let wizard reappear on tabbing back to document

where it was showing before tabbing away

Change-Id: Ia87aeb9789ae034611431983c6489569a59d47d3
Reviewed-on: https://gerrit.libreoffice.org/83434
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 
(cherry picked from commit f31d36966bceb90e261cbecd42634bde4448d527)
Reviewed-on: https://gerrit.libreoffice.org/83781
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/formdlg/formula.cxx b/sc/source/ui/formdlg/formula.cxx
index 56c406e2e306..5931b0ca4a66 100644
--- a/sc/source/ui/formdlg/formula.cxx
+++ b/sc/source/ui/formdlg/formula.cxx
@@ -287,6 +287,9 @@ ScInputHandler* ScFormulaDlg::GetNextInputHandler(const 
ScDocShell* pDocShell, S
 
 void ScFormulaDlg::Close()
 {
+if (IsClosing())
+return;
+
 DoEnter();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-22 Thread Dennis Francis (via logerrit)
 sc/source/filter/ftools/sharedformulagroups.cxx |   15 +--
 sc/source/filter/inc/sharedformulagroups.hxx|   22 +-
 sc/source/filter/oox/formulabuffer.cxx  |   23 +++
 3 files changed, 53 insertions(+), 7 deletions(-)

New commits:
commit 035fdc06f22420412b10b2f969706a45ab582a02
Author: Dennis Francis 
AuthorDate: Wed Nov 20 13:24:48 2019 +0530
Commit: Eike Rathke 
CommitDate: Fri Nov 22 14:45:22 2019 +0100

tdf#128894: xlsx-import : Do not share tokens between cells...

which are part of a xlsx-shared-formula along a *row*.
If we do, any reference-updates on these cells while editing
will mess things up.

For example a shared formula "=A30+1" used for a few cells in
the first row (say, A1, B1, C1 and D1) and on deleting a row,
say row#5, the reference update operation will decrement the
row index of all tokens in A1, B1, C1 and D1. But if they
share tokens, they all end up pointing to row#26 instead of
row#29 as each cell is updated which amounts to decrementing
4 times instead of once.

However shared formulas along columns are not affected by this
bug, when tokens are shared since we use formula-groups which
only keeps one copy of token array for the entire group and
reference-update code is designed to correctly work with
formula-groups.

Change-Id: Ic0fe84d12fef18fbf21658664e2b2b86409bca27
Reviewed-on: https://gerrit.libreoffice.org/83361
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Reviewed-by: Eike Rathke 
(cherry picked from commit b30251ca0d102ced36799ee18d4bbcd9e8530fa0)
Reviewed-on: https://gerrit.libreoffice.org/83477

diff --git a/sc/source/filter/ftools/sharedformulagroups.cxx 
b/sc/source/filter/ftools/sharedformulagroups.cxx
index 6844e9bf3181..9b028d9eb307 100644
--- a/sc/source/filter/ftools/sharedformulagroups.cxx
+++ b/sc/source/filter/ftools/sharedformulagroups.cxx
@@ -15,13 +15,24 @@ namespace sc {
 
 void SharedFormulaGroups::set( size_t nSharedId, std::unique_ptr 
pArray )
 {
-m_Store.insert(std::make_pair(nSharedId, std::move(pArray)));
+m_Store.try_emplace(nSharedId, std::move(pArray), 
ScAddress(ScAddress::INITIALIZE_INVALID));
+}
+
+void SharedFormulaGroups::set( size_t nSharedId, std::unique_ptr 
pArray, const ScAddress& rOrigin )
+{
+m_Store.try_emplace(nSharedId, std::move(pArray), rOrigin);
 }
 
 const ScTokenArray* SharedFormulaGroups::get( size_t nSharedId ) const
 {
 StoreType::const_iterator const it = m_Store.find(nSharedId);
-return it == m_Store.end() ? nullptr : it->second.get();
+return it == m_Store.end() ? nullptr : it->second.getTokenArray();
+}
+
+const SharedFormulaGroupEntry* SharedFormulaGroups::getEntry( size_t nSharedId 
) const
+{
+StoreType::const_iterator const it = m_Store.find(nSharedId);
+return it == m_Store.end() ? nullptr : &(it->second);
 }
 
 }
diff --git a/sc/source/filter/inc/sharedformulagroups.hxx 
b/sc/source/filter/inc/sharedformulagroups.hxx
index 745b5b14bdfa..540d1e901ef6 100644
--- a/sc/source/filter/inc/sharedformulagroups.hxx
+++ b/sc/source/filter/inc/sharedformulagroups.hxx
@@ -10,21 +10,41 @@
 #ifndef INCLUDED_SC_SOURCE_FILTER_INC_SHAREDFORMULAGROUPS_HXX
 #define INCLUDED_SC_SOURCE_FILTER_INC_SHAREDFORMULAGROUPS_HXX
 
+#include 
 #include 
 #include 
 class ScTokenArray;
 
 namespace sc {
 
+class SharedFormulaGroupEntry
+{
+private:
+std::unique_ptr mpArray;
+ScAddress maOrigin;
+
+public:
+SharedFormulaGroupEntry(std::unique_ptr pArray, const 
ScAddress& rOrigin)
+: mpArray(std::move(pArray))
+, maOrigin(rOrigin)
+{
+}
+
+const ScTokenArray* getTokenArray() const { return mpArray.get(); }
+const ScAddress& getOrigin() const { return maOrigin; }
+};
+
 class SharedFormulaGroups
 {
 private:
-typedef std::map> StoreType;
+typedef std::map StoreType;
 StoreType m_Store;
 
 public:
 void set( size_t nSharedId, std::unique_ptr pArray );
+void set( size_t nSharedId, std::unique_ptr pArray, const 
ScAddress& rOrigin );
 const ScTokenArray* get( size_t nSharedId ) const;
+const SharedFormulaGroupEntry* getEntry( size_t nSharedId ) const;
 };
 
 }
diff --git a/sc/source/filter/oox/formulabuffer.cxx 
b/sc/source/filter/oox/formulabuffer.cxx
index b7c537b21f0b..3f8c8db4169a 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -120,7 +120,7 @@ void applySharedFormulas(
 if (pArray)
 {
 aComp.CompileTokenArray(); // Generate RPN tokens.
-aGroups.set(nId, std::move(pArray));
+aGroups.set(nId, std::move(pArray), aPos);
 }
 }
 }
@@ -131,11 +131,26 @@ void applySharedFormulas(
 for (const FormulaBuffer::SharedFormulaDesc& rDesc : rCells)
 {
 const ScAddress& aPos = rDesc.maAddress;
-

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

2019-11-20 Thread Caolán McNamara (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   11 +++
 1 file changed, 11 insertions(+)

New commits:
commit 7f274c09e57af3b8e266e9b1a3a78c9f10de5e09
Author: Caolán McNamara 
AuthorDate: Mon Nov 18 20:55:54 2019 +
Commit: Xisco Faulí 
CommitDate: Wed Nov 20 12:08:35 2019 +0100

Related: tdf#125917 release mouse grab before showing warning dialog

Type text into the data validity dropdown cell and click elsewhere.
The warning dialog cannot be interacted with due to the active mouse
grab to its parent

Change-Id: I51702c828dee6ec88106f7d44d7e3440f2e61298
Reviewed-on: https://gerrit.libreoffice.org/83164
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index eb8142a913cf..ecbdfafbe1d3 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2658,8 +2658,19 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode )
 if (!bOk)
 {
 if ( pActiveViewSh )// If it came from 
MouseButtonDown
+{
 pActiveViewSh->StopMarking();   // (the InfoBox consumes 
the MouseButtonUp)
 
+// tdf#125917 Release the grab the a current mouse-down 
event being handled
+// by ScTabView has put on the mouse via its 
SelectionEngine.
+// Otherwise the warning box cannot interact with the mouse
+if (ScTabView* pView = 
pActiveViewSh->GetViewData().GetView())
+{
+if (ScViewSelectionEngine* pSelEngine = 
pView->GetSelEngine())
+pSelEngine->ReleaseMouse();
+}
+}
+
 vcl::Window* pParent = nullptr;
 if (pActiveViewSh)
 pParent = >GetViewFrame()->GetWindow();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-11-01 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr1.cxx |4 ++
 sc/source/core/tool/interpr3.cxx |   59 +--
 2 files changed, 37 insertions(+), 26 deletions(-)

New commits:
commit 2d23e19f7991405315bb1ab6a6461cb3e022ca5a
Author: Eike Rathke 
AuthorDate: Mon Oct 21 19:47:13 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Fri Nov 1 18:10:11 2019 +0100

Resolves: tdf#127982 SMALL()/LARGE() rank array can be larger than data 
array

 This is a combination of 4 commits.

Resolves: tdf#127982 SMALL()/LARGE() rank array can be larger than data 
array

Only set error for the positions where the requested rank is out
of bounds. This also includes zero or negative rank values,
instead of setting a global error.

Regression from

commit e22ab5e6f6b0ea49231ca454a567133996306116
CommitDate: Thu Nov 15 22:12:01 2018 +0100

Resolves: i#32345 Make LARGE()/SMALL() return an array

Where previously due to the iteration in the array case single
values were returned and assembled.

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

Related: tdf#127982 In JumpMatrix do not propagate individual errors as 
global

Which for
https://bugs.documentfoundation.org/attachment.cgi?id=154776
was the case in sheet1 МультиВПР.E6:E20 even in the to-be-fixed
SMALL() implementation.

The error is propagated as usual individual matrix element coded
double error.

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

-Wimplicit-int-float-conversion

with clang trunk

implicit conversion from 'unsigned long' to 'double' changes value from
18446744073709551615 to 18446744073709551616
[-Werror,-Wimplicit-int-float-conversion]
if (f < 1.0 || f > std::numeric_limits::max())
 ~ ^~

Reviewed-on: https://gerrit.libreoffice.org/81319
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 1b0cba8c2cd672b0d5a59a215961c5136a6e656b)

-Werror,-Wimplicit-int-float-conversion

> sc/source/core/tool/interpr3.cxx:3659:36: error: implicit conversion from 
'unsigned long' to 'double' changes value from 18446744073709551615 to 
18446744073709551616 [-Werror,-Wimplicit-int-float-conversion]
> if (f < 1.0 || f > std::numeric_limits::max())
>  ~ ^~

since 475165e431b5392e426db0de4cea50efc2513875 "Resolves: tdf#127982
SMALL()/LARGE() rank array can be larger than data array"

(This supersedes 1b0cba8c2cd672b0d5a59a215961c5136a6e656b
"-Wimplicit-int-float-conversion", which would have incurred UB if f is 
larger
than std::numeric_limits::max().)

Reviewed-on: https://gerrit.libreoffice.org/81309
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit f26178b17691ccc9d3da9c25cec9ef08a633b3a7)

Backported:
As there is no o3tl/float_int_conversion.hxx in 6.3 unfold the
check to

-if (f < 1.0 || !o3tl::convertsToAtMost(f, 
std::numeric_limits::max()))
+if (f < 1.0 || !(f < 
double(std::numeric_limits::max()) + 1.0))

5fc6fa3454b354a4017a51a640b96ec80f74f4a4
ef0eb55ed1ade9fb88f5749774790aebbb27e085
1eeb75d73169ac89ec4bf9562edcf99d9925f607

Change-Id: Ic992c56cb79e80269cc7200fac5b15cb8aca3566
Reviewed-on: https://gerrit.libreoffice.org/81346
Tested-by: Jenkins
Tested-by: Xisco Faulí 
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index b94d58cf7b0f..96abd6d9fd18 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -777,6 +777,10 @@ bool ScInterpreter::JumpMatrix( short nStackLevel )
 }
 else
 {
+// GetMatrix() does SetErrorInterpreter() at the
+// matrix, do not propagate an error from
+// matrix->GetValue() as global error.
+pMat->SetErrorInterpreter(nullptr);
 lcl_storeJumpMatResult(pMat.get(), pJumpMatrix, 
nC, nR);
 }
 lcl_AdjustJumpMatrix( pJumpMatrix, nCols, nRows );
diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index 85eb4b7167a4..414237b369b3 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -3642,48 

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

2019-11-01 Thread Caolán McNamara (via logerrit)
 sc/source/ui/navipi/navipi.cxx|1 +
 sd/source/ui/dlg/navigatr.cxx |1 +
 sw/source/uibase/utlui/navipi.cxx |1 +
 3 files changed, 3 insertions(+)

New commits:
commit 89521131b6f9e5c6aa7266312577877d5d324e8c
Author: Caolán McNamara 
AuthorDate: Fri Nov 1 09:02:47 2019 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Nov 1 13:41:35 2019 +0100

Resolves: tdf#128476 limit sidebar navigation panel file name combobox width

Change-Id: I81549ada6f6b736ad54e18a4fec6807b8d0412af
Reviewed-on: https://gerrit.libreoffice.org/81876
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 755856c6a961..cbb29b3d2183 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -491,6 +491,7 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, 
vcl::Window* pParent)
 aTbxCmd->InsertBreak(3);
 aTbxCmd->SetLineCount(2);
 aLbDocuments->SetDropDownLineCount(9);
+aLbDocuments->setMaxWidthChars(20);
 aLbDocuments->SetSelectHdl(LINK(this, ScNavigatorDlg, DocumentSelectHdl));
 aStrActive= " (" + ScResId(SCSTR_ACTIVE) + ")"; // " (active)"
 aStrNotActive = " (" + ScResId(SCSTR_NOTACTIVE) + ")";  // " (not active)"
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index f3170a445993..cc118c26b0b1 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -93,6 +93,7 @@ SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, 
SfxBindings* pInBindings)
 maTlbObjects->SetSdNavigator(this);
 
 // DragTypeListBox
+maLbDocs->setMaxWidthChars(20);
 maLbDocs->SetSelectHdl( LINK( this, SdNavigatorWin, SelectDocumentHdl ) );
 }
 
diff --git a/sw/source/uibase/utlui/navipi.cxx 
b/sw/source/uibase/utlui/navipi.cxx
index e946ab09e5b6..0fde7ddde1d3 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -631,6 +631,7 @@ SwNavigationPI::SwNavigationPI(SfxBindings* _pBindings,
 m_aGlobalToolBox->SetHelpId(HID_NAVIGATOR_GLOBAL_TOOLBOX);
 m_aDocListBox->SetHelpId(HID_NAVIGATOR_LISTBOX);
 m_aDocListBox->SetDropDownLineCount(9);
+m_aDocListBox->setMaxWidthChars(20);
 
 // Insert the numeric field in the toolbox.
 m_xEdit = VclPtr::Create(
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-30 Thread Eike Rathke (via logerrit)
 sc/source/core/data/patattr.cxx |   32 +---
 sc/source/ui/view/output2.cxx   |   10 +-
 2 files changed, 14 insertions(+), 28 deletions(-)

New commits:
commit 0b9e0f20763f0e723d66f31aee85205deec9f6f8
Author: Eike Rathke 
AuthorDate: Sun Oct 27 00:25:28 2019 +0200
Commit: Caolán McNamara 
CommitDate: Wed Oct 30 18:04:18 2019 +0100

Resolves: tdf#117715 Conditional format takes precedence; reverts tdf#93300

 This is a combination of 3 commits.

Resolves: tdf#128403 Use ScPatternAttr::GetNumberFormat()

... it does or will do the right thing.
See also https://bugs.documentfoundation.org/show_bug.cgi?id=117715#c12

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

Related: tdf#117715 tdf#128403 Couple ATTR_LANGUAGE_FORMAT ATTR_VALUE_FORMAT

Do not obtain ATTR_VALUE_FORMAT from hard attribute and
ATTR_LANGUAGE_FORMAT from conditional format. Though it doesn't
matter in the bugs' cases it's wrong. ATTR_LANGUAGE_FORMAT belongs
to the ATTR_VALUE_FORMAT if set.

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

Resolves: tdf#117715 Conditional format takes precedence; reverts tdf#93300

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

4ecaa6be8b2358d4ea4d84655cde74dce5319c2a
9ec2d7523e22a40c3fe4a655fe9082ab6158c376

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

diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx
index bf3d1dc115e2..92e91a42365c 100644
--- a/sc/source/core/data/patattr.cxx
+++ b/sc/source/core/data/patattr.cxx
@@ -1253,31 +1253,25 @@ sal_uInt32 ScPatternAttr::GetNumberFormat( 
SvNumberFormatter* pFormatter,
 if (!pCondSet)
 return GetNumberFormat(pFormatter);
 
-/* In the case of a conditional format we need to overwrite a cell style
- * but leave a hard cell formatting alone. So check first if the number
- * format is set in the cell format, then the conditional format and
- * finally in the style.
- *
- * The style is represented here if the name is empty.
- */
+// Conditional format takes precedence over style and even hard format.
 
 const SfxPoolItem* pFormItem;
-sal_uLong nFormat = 0;
-if (GetItemSet().GetItemState(ATTR_VALUE_FORMAT, false, ) == 
SfxItemState::SET)
-nFormat = static_cast(pFormItem)->GetValue();
-else if (pCondSet->GetItemState(ATTR_VALUE_FORMAT, true, ) == 
SfxItemState::SET )
-nFormat = getNumberFormatKey(*pCondSet);
-else
-nFormat = getNumberFormatKey(GetItemSet());
-
+sal_uInt32 nFormat;
 const SfxPoolItem* pLangItem;
 LanguageType eLang;
-if (GetItemSet().GetItemState(ATTR_LANGUAGE_FORMAT, false, ) == 
SfxItemState::SET)
-eLang = static_cast(pLangItem)->GetLanguage();
-else if (pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT, true, ) == 
SfxItemState::SET)
-eLang = getLanguageType(*pCondSet);
+if (pCondSet->GetItemState(ATTR_VALUE_FORMAT, true, ) == 
SfxItemState::SET )
+{
+nFormat = getNumberFormatKey(*pCondSet);
+if (pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT, true, ) == 
SfxItemState::SET)
+eLang = getLanguageType(*pCondSet);
+else
+eLang = getLanguageType(GetItemSet());
+}
 else
+{
+nFormat = getNumberFormatKey(GetItemSet());
 eLang = getLanguageType(GetItemSet());
+}
 
 return pFormatter->GetFormatForLanguageIfBuiltIn(nFormat, eLang);
 }
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index a3cc7609e310..89eee7648b9c 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -459,15 +459,7 @@ void ScDrawStringsVars::SetPatternSimple( const 
ScPatternAttr* pNew, const SfxIt
 // number format
 
 sal_uLong nOld = nValueFormat;
-const SfxPoolItem* pFormItem;
-if ( !pCondSet || 
pCondSet->GetItemState(ATTR_VALUE_FORMAT,true,) != SfxItemState::SET )
-pFormItem = >GetItem(ATTR_VALUE_FORMAT);
-const SfxPoolItem* pLangItem;
-if ( !pCondSet || 
pCondSet->GetItemState(ATTR_LANGUAGE_FORMAT,true,) != 
SfxItemState::SET )
-pLangItem = >GetItem(ATTR_LANGUAGE_FORMAT);
-nValueFormat = 
pOutput->mpDoc->GetFormatTable()->GetFormatForLanguageIfBuiltIn(
-static_cast(pFormItem)->GetValue(),
-static_cast(pLangItem)->GetLanguage() );
+

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

2019-10-30 Thread Caolán McNamara (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |5 +++--
 sc/source/ui/inc/checklistmenu.hxx   |2 +-
 sc/source/ui/view/gridwin.cxx|3 ++-
 3 files changed, 6 insertions(+), 4 deletions(-)

New commits:
commit e5b2c2c5b85a239bba332ca754eef5328949e7ee
Author: Caolán McNamara 
AuthorDate: Tue Oct 29 14:52:37 2019 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Oct 30 08:25:35 2019 +0100

tdf#49813 make autofilter popup at least the width of its column

Change-Id: Idbcf3cdb62fb2886c3b05da721e8d326e0187588
Reviewed-on: https://gerrit.libreoffice.org/81709
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 6a8a51a0328e..b9b5acca11c8 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -878,7 +878,7 @@ void ScCheckListMenuWindow::CancelButton::Click()
 ::CancelButton::Click();
 }
 
-ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* 
pDoc) :
+ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* 
pDoc, int nWidth) :
 ScMenuFloatingWindow(pParent, pDoc),
 maEdSearch(VclPtr::Create(this)),
 maChecks(VclPtr::Create(this)),
@@ -893,7 +893,8 @@ ScCheckListMenuWindow::ScCheckListMenuWindow(vcl::Window* 
pParent, ScDocument* p
 {
 float fScaleFactor = GetDPIScaleFactor();
 
-maWndSize = Size(200 * fScaleFactor, 330 * fScaleFactor);
+nWidth = std::max(nWidth, 200 * fScaleFactor);
+maWndSize = Size(nWidth, 330 * fScaleFactor);
 
 maTabStops.AddTabStop( this );
 maTabStops.AddTabStop( maEdSearch.get() );
diff --git a/sc/source/ui/inc/checklistmenu.hxx 
b/sc/source/ui/inc/checklistmenu.hxx
index f62e8f6dc13c..2ff574a15252 100644
--- a/sc/source/ui/inc/checklistmenu.hxx
+++ b/sc/source/ui/inc/checklistmenu.hxx
@@ -335,7 +335,7 @@ public:
 Config();
 };
 
-explicit ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc);
+explicit ScCheckListMenuWindow(vcl::Window* pParent, ScDocument* pDoc, int 
nWidth = -1);
 virtual ~ScCheckListMenuWindow() override;
 virtual void dispose() override;
 
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 1d573e977c50..e2b1815141ec 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -644,7 +644,8 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW 
nRow)
 ScDocument* pDoc = pViewData->GetDocument();
 
 mpAutoFilterPopup.disposeAndClear();
-mpAutoFilterPopup.reset(VclPtr::Create(this, pDoc));
+int nColWidth = ScViewData::ToPixel(pDoc->GetColWidth(nCol, nTab), 
pViewData->GetPPTX());
+mpAutoFilterPopup.reset(VclPtr::Create(this, pDoc, 
nColWidth));
 
 // Avoid flicker when hovering over the menu items.
 if (!IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-27 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr1.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit 75c1c58c4ae47dd0bad98dbe95e99d5d3de377de
Author: Eike Rathke 
AuthorDate: Fri Oct 25 00:31:52 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Oct 27 10:03:53 2019 +0100

Resolves: tdf#128218 Let RAND() return a scalar double instead of a 1x1 
matrix

... even if in array context, for FunctionAccess.callFunction()
compatibility.

Change-Id: Iddfb462dd1b5812c94a2f2061c593b4479faef24
Reviewed-on: https://gerrit.libreoffice.org/81482
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 445727d3bce84ef04719242745aac9446035c5bd)
Reviewed-on: https://gerrit.libreoffice.org/81492
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index e94bdab3f25b..b94d58cf7b0f 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1739,6 +1739,18 @@ void ScInterpreter::ScRandom()
 SCROW nRows = 0;
 if(pMyFormulaCell)
 pMyFormulaCell->GetMatColsRows( nCols, nRows);
+
+if (nCols == 1 && nRows == 1)
+{
+// For compatibility with existing
+// com.sun.star.sheet.FunctionAccess.callFunction() calls that per
+// default are executed in array context unless
+// FA.setPropertyValue("IsArrayFunction",False) was set, return a
+// scalar double instead of a 1x1 matrix object. tdf#128218
+PushDouble( comphelper::rng::uniform_real_distribution());
+return;
+}
+
 // ScViewFunc::EnterMatrix() might be asking for
 // ScFormulaCell::GetResultDimensions(), which here are none so create
 // a 1x1 matrix at least which exactly is the case when EnterMatrix()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-27 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/docfunc.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 07d470b1ec314cb74effecafab3b62935270c99b
Author: Eike Rathke 
AuthorDate: Fri Oct 25 20:14:32 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Oct 27 09:49:39 2019 +0100

Resolves: tdf#128359 Do nothing if Insert After can't be shifted to Before

Change-Id: I63bf24cda4d14857f9b5cf63a95d35b6438cead1
Reviewed-on: https://gerrit.libreoffice.org/81518
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 9b5adc3d9842303e00eba8ffd239a4015bf8355b)
Reviewed-on: https://gerrit.libreoffice.org/81549
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/docshell/docfunc.cxx 
b/sc/source/ui/docshell/docfunc.cxx
index a5a61830f0fc..c184cadf9e95 100644
--- a/sc/source/ui/docshell/docfunc.cxx
+++ b/sc/source/ui/docshell/docfunc.cxx
@@ -1692,7 +1692,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const 
ScMarkData* pTabMark,
 ScRange aErrorRange( ScAddress::UNINITIALIZED );
 if (!aTargetRange.Move(0, rRange.aEnd.Row() - rRange.aStart.Row() + 1, 
0, aErrorRange))
 {
-assert(!"can't move");
+return false;
 }
 }
 if ( eCmd == INS_INSCOLS_AFTER )
@@ -1700,7 +1700,7 @@ bool ScDocFunc::InsertCells( const ScRange& rRange, const 
ScMarkData* pTabMark,
 ScRange aErrorRange( ScAddress::UNINITIALIZED );
 if (!aTargetRange.Move(rRange.aEnd.Col() - rRange.aStart.Col() + 1, 0, 
0, aErrorRange))
 {
-assert(!"can't move");
+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-3' - sc/source

2019-10-25 Thread Noel Grandin (via logerrit)
 sc/source/filter/excel/xestyle.cxx |   79 +++--
 sc/source/filter/inc/xestyle.hxx   |   27 
 2 files changed, 85 insertions(+), 21 deletions(-)

New commits:
commit cb15e56dfd4e3443467c0b54522023bbe03505e9
Author: Noel Grandin 
AuthorDate: Fri Oct 25 08:55:51 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 25 12:01:50 2019 +0200

tdf#126021 speed up saving xls with lots of styles

extend the find-map so we can do partial-match searching.
Makes it 10x faster for me.

Change-Id: I1952a221a919707af078fac9fd1eb63781d9188d
Reviewed-on: https://gerrit.libreoffice.org/81488
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit c0b8be4d7eb9fa1a0d8abfb1d27c71ac34bffd1b)
Reviewed-on: https://gerrit.libreoffice.org/81489

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index 3ab025d0cb60..e4109a908468 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -2666,24 +2666,58 @@ void XclExpXFBuffer::SaveXFXml( XclExpXmlStream& rStrm, 
XclExpXF& rXF )
 sal_uInt32 XclExpXFBuffer::FindXF( const ScPatternAttr& rPattern,
 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont, bool 
bForceLineBreak ) const
 {
-auto it = maXFFindMap.find(());
-if (it == maXFFindMap.end())
-return EXC_XFID_NOTFOUND;
-for (auto const & nPos : it->second)
-if( maXFList.GetRecord( nPos )->Equals( rPattern, nForceScNumFmt, 
nForceXclFont, bForceLineBreak ) )
-return nPos;
+if (nForceScNumFmt != NUMBERFORMAT_ENTRY_NOT_FOUND && nForceXclFont == 
EXC_FONT_NOTFOUND)
+{
+FindKey key1 { /*mbCellXF*/true, (), 
nForceScNumFmt, 0 };
+FindKey key2 { /*mbCellXF*/true, (), 
nForceScNumFmt, EXC_FONT_NOTFOUND };
+auto it1 = maXFFindMap.lower_bound(key1);
+if (it1 != maXFFindMap.end())
+{
+auto it2 = maXFFindMap.upper_bound(key2);
+for (auto it = it1; it != it2; ++it)
+for (auto const & nPos : it->second)
+if( maXFList.GetRecord( nPos )->Equals( rPattern, 
nForceScNumFmt, nForceXclFont, bForceLineBreak ) )
+return nPos;
+}
+}
+else if (nForceScNumFmt == NUMBERFORMAT_ENTRY_NOT_FOUND || nForceXclFont 
== EXC_FONT_NOTFOUND)
+{
+FindKey key1 { /*mbCellXF*/true, (), 0, 0 };
+FindKey key2 { /*mbCellXF*/true, (), 
NUMBERFORMAT_ENTRY_NOT_FOUND, EXC_FONT_NOTFOUND };
+auto it1 = maXFFindMap.lower_bound(key1);
+if (it1 != maXFFindMap.end())
+{
+auto it2 = maXFFindMap.upper_bound(key2);
+for (auto it = it1; it != it2; ++it)
+for (auto const & nPos : it->second)
+if( maXFList.GetRecord( nPos )->Equals( rPattern, 
nForceScNumFmt, nForceXclFont, bForceLineBreak ) )
+return nPos;
+}
+}
+else
+{
+FindKey key { /*mbCellXF*/true, (), 
nForceScNumFmt, nForceXclFont };
+auto it = maXFFindMap.find(key);
+if (it == maXFFindMap.end())
+return EXC_XFID_NOTFOUND;
+for (auto const & nPos : it->second)
+if( maXFList.GetRecord( nPos )->Equals( rPattern, nForceScNumFmt, 
nForceXclFont, bForceLineBreak ) )
+return nPos;
+}
 return EXC_XFID_NOTFOUND;
 }
 
 sal_uInt32 XclExpXFBuffer::FindXF( const SfxStyleSheetBase& rStyleSheet ) const
 {
 const SfxItemSet* pItemSet = _cast< SfxStyleSheetBase& >( 
rStyleSheet ).GetItemSet();
-auto it = maXFFindMap.find(pItemSet);
-if (it == maXFFindMap.end())
-return EXC_XFID_NOTFOUND;
-for (auto const & nPos : it->second)
-if( maXFList.GetRecord( nPos )->Equals( rStyleSheet ) )
-return nPos;
+FindKey key1 { /*mbCellXF*/false, pItemSet, 0, 0 };
+FindKey key2 { /*mbCellXF*/false, pItemSet, NUMBERFORMAT_ENTRY_NOT_FOUND, 
EXC_FONT_NOTFOUND };
+auto it1 = maXFFindMap.lower_bound(key1);
+auto it2 = maXFFindMap.upper_bound(key2);
+for (auto it = it1; it != it2; ++it)
+for (auto const & nPos : it->second)
+if( maXFList.GetRecord( nPos )->Equals( rStyleSheet ) )
+return nPos;
 return EXC_XFID_NOTFOUND;
 }
 
@@ -2698,6 +2732,11 @@ sal_uInt32 XclExpXFBuffer::FindBuiltInXF( sal_uInt8 
nStyleId, sal_uInt8 nLevel )
 return EXC_XFID_NOTFOUND;
 }
 
+XclExpXFBuffer::FindKey XclExpXFBuffer::ToFindKey(XclExpXF const & rRec)
+{
+return { rRec.IsCellXF(), rRec.GetItemSet(), rRec.GetScNumFmt(), 
rRec.GetXclFont() };
+}
+
 sal_uInt32 XclExpXFBuffer::InsertCellXF( const ScPatternAttr* pPattern, 
sal_Int16 nScript,
 sal_uInt32 nForceScNumFmt, sal_uInt16 nForceXclFont, bool 
bForceLineBreak )
 {
@@ -2715,14 +2754,14 @@ sal_uInt32 XclExpXFBuffer::InsertCellXF( const 
ScPatternAttr* pPattern, sal_Int1
 if( rbPredefined )
 {
 // remove 

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

2019-10-23 Thread Eike Rathke (via logerrit)
 sc/source/ui/view/viewfun2.cxx |  136 +++--
 1 file changed, 90 insertions(+), 46 deletions(-)

New commits:
commit 09fb258853448b89d40a950df639d9a0fe06ebf5
Author: Eike Rathke 
AuthorDate: Fri Oct 18 15:44:12 2019 +0200
Commit: Caolán McNamara 
CommitDate: Wed Oct 23 11:08:24 2019 +0200

Resolves: tdf#126767 Overwriting autofill if data immediately below 
selection

Change-Id: Ibb11e7a8e1dc3d9d23a64073bde6250223220e3f
Reviewed-on: https://gerrit.libreoffice.org/81045
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 667287228143519f4a91109924787ad169676ab8)
Reviewed-on: https://gerrit.libreoffice.org/81055
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index b97b40b95068..c900d1eade9a 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1629,10 +1629,14 @@ void ScViewFunc::FillTab( InsertDeleteFlags nFlags, 
ScPasteFunc nFunction, bool
 
 /** Downward fill of selected cell(s) by double-clicking cross-hair cursor
 
-Extends a current selection down to the last non-empty cell of an adjacent
-column when the lower-right corner of the selection is double-clicked.  It
-uses a left-adjoining non-empty column as a guide if such is available,
-otherwise a right-adjoining non-empty column is used.
+Either, extends a current selection if non-empty cells exist immediately
+below the selection, overwriting cells below the selection up to the
+minimum row of already filled cells.
+
+Or, extends a current selection down to the last non-empty cell of an
+adjacent column when the lower-right corner of the selection is
+double-clicked. It uses a left-adjoining non-empty column as a guide if
+such is available, otherwise a right-adjoining non-empty column is used.
 
 @return No return value
 
@@ -1650,61 +1654,101 @@ void ScViewFunc::FillCrossDblClick()
 SCCOL nEndX   = aRange.aEnd.Col();
 SCROW nEndY   = aRange.aEnd.Row();
 
+if (nEndY >= MAXROW)
+// Nothing to fill.
+return;
+
 ScDocument* pDoc = GetViewData().GetDocument();
 
 // Make sure the selection is not empty
 if ( pDoc->IsBlockEmpty( nTab, nStartX, nStartY, nEndX, nEndY ) )
 return;
 
-if ( nEndY < MAXROW )
+// If there is data in all columns immediately below the selection then
+// switch to overwriting fill.
+SCROW nOverWriteEndRow = MAXROW;
+for (SCCOL nCol = nStartX; nCol <= nEndX; ++nCol)
 {
-const bool bDataLeft = (nStartX > 0);
-if (bDataLeft || nEndX < MAXCOL)
+if (pDoc->HasData( nCol, nEndY + 1, nTab))
 {
-// Check that there is
-// 1) data immediately left (preferred) or right of start (row) of 
selection
-// 2) data there below
-// 3) no data immediately below selection
-
-SCCOL nMovX = (bDataLeft ? nStartX - 1 : nEndX + 1);
-SCROW nMovY = nStartY;
-bool bDataFound = (pDoc->HasData( nMovX, nStartY, nTab) && 
pDoc->HasData( nMovX, nStartY + 1, nTab));
-if (!bDataFound && bDataLeft && nEndX < MAXCOL)
+// Determine the shortest data column to end the fill.
+SCROW nY = nEndY + 1;
+// FindAreaPos() returns the start row of the next data block if
+// the current row is the the last row of a data block and an empty
+// cell follows. Somewhat unexpected behaviour..
+// So check beforehand if there is one non-empty cell following.
+if (pDoc->HasData( nCol, nY + 1, nTab))
 {
-nMovX = nEndX + 1;  // check right
-bDataFound = (pDoc->HasData( nMovX, nStartY, nTab) && 
pDoc->HasData( nMovX, nStartY + 1, nTab));
+pDoc->FindAreaPos( nCol, nY, nTab, SC_MOVE_DOWN);
+if (nOverWriteEndRow > nY)
+nOverWriteEndRow = nY;
 }
-
-if (bDataFound && pDoc->IsBlockEmpty( nTab, nStartX, nEndY + 1, 
nEndX, nEndY + 1, true))
+else
 {
-// Get end of data left or right.
-pDoc->FindAreaPos( nMovX, nMovY, nTab, SC_MOVE_DOWN);
-// Find minimum end row of below empty area and data right.
-for (SCCOL nX = nStartX; nX <= nEndX; ++nX)
-{
-SCROW nY = nEndY + 1;
-// Get next row with data in this column.
-pDoc->FindAreaPos( nX, nY, nTab, SC_MOVE_DOWN);
-if (nMovY == MAXROW && nY == MAXROW)
-{
-// FindAreaPos() returns MAXROW also if there is no
-// data at all from the start, so check if that
-// contains data if the nearby (left or right) data
-   

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

2019-10-18 Thread Stephan Bergmann (via logerrit)
 sc/source/filter/qpro/qproform.cxx |   14 +-
 1 file changed, 9 insertions(+), 5 deletions(-)

New commits:
commit e31f35c892b282258bd4ece30175e4bc48b6b823
Author: Stephan Bergmann 
AuthorDate: Thu Oct 17 14:52:16 2019 +0200
Commit: Michael Stahl 
CommitDate: Fri Oct 18 11:06:19 2019 +0200

Don't use uninitialized memory when reading from the stream fails

Flathub arm builds (but not other arches) had often (but not always) failed 
when
processing sc/qa/unit/data/qpro/pass/ofz14090-1.wb2 in
CppunitTest_sc_filters_test (e.g.,
:

> Test name: ScFiltersTest::testCVEs
> equality assertion failed
> - Expected: 1
> - Actual  : 0
> - file:///run/build/libreoffice/sc/qa/unit/data/qpro/pass/ofz14090-1.wb2

)  Valgrind revealed that this was due to using unintialized memory when the
various maIn.Read... in QProToSc::Convert failed, starting with the use of
uninitialized nFmla[i] after

  maIn.ReadUChar( nFmla[i] );

At least make things deterministic by setting the relevant variables to 
zero.
(Another approach could be returning early with some ConvErr status.)

Change-Id: I4c06aa8da5f777170cdc7bbe3ca1d61b23d3f326
Reviewed-on: https://gerrit.libreoffice.org/80947
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann 
(cherry picked from commit 2704b9e3783aae9d8372f2e3ad3253a2cb49ae87)
Reviewed-on: https://gerrit.libreoffice.org/80956
Reviewed-by: Michael Stahl 

diff --git a/sc/source/filter/qpro/qproform.cxx 
b/sc/source/filter/qpro/qproform.cxx
index bd1ea7fc092a..53e8d06f90d5 100644
--- a/sc/source/filter/qpro/qproform.cxx
+++ b/sc/source/filter/qpro/qproform.cxx
@@ -191,15 +191,14 @@ do { \
 
 ConvErr QProToSc::Convert( std::unique_ptr& pArray )
 {
-sal_uInt8 nFmla[ nBufSize ], nArg;
+sal_uInt8 nFmla[ nBufSize ];
 sal_uInt8 nArgArray[ nBufSize ] = {0};
 sal_Int8 nCol, nPage;
-sal_uInt16 nInt, nIntCount = 0, nStringCount = 0, nFloatCount = 0, 
nDLLCount = 0, nArgCount = 0;
+sal_uInt16 nIntCount = 0, nStringCount = 0, nFloatCount = 0, nDLLCount = 
0, nArgCount = 0;
 sal_uInt16 nIntArray[ nBufSize ] = {0};
 OUString sStringArray[ nBufSize ];
-sal_uInt16 nDummy, nDLLId;
 sal_uInt16 nDLLArray[ nBufSize ] = {0};
-sal_uInt16 nNote, nRef, nRelBits;
+sal_uInt16 nNote, nRelBits;
 TokenId nPush;
 ScComplexRefData aCRD;
 ScSingleRefData aSRD;
@@ -210,16 +209,19 @@ ConvErr QProToSc::Convert( std::unique_ptr& 
pArray )
 
 aCRD.InitFlags();
 aSRD.InitFlags();
+sal_uInt16 nRef = 0;
 maIn.ReadUInt16( nRef );
 
 if( nRef < nBufSize )
 {
 for( sal_uInt16 i=0; i < nRef; i++)
 {
+nFmla[i] = 0;
 maIn.ReadUChar( nFmla[i] );
 
 if( nFmla[ i ] == 0x05 )
 {
+sal_uInt16 nInt = 0;
 maIn.ReadUInt16( nInt );
 nIntArray[ nIntCount ] = nInt;
 SAFEDEC_OR_RET(nRef, 2, ConvErr::Count);
@@ -228,7 +230,7 @@ ConvErr QProToSc::Convert( std::unique_ptr& 
pArray )
 
 if( nFmla[ i ] == 0x00 )
 {
-double nFloat;
+double nFloat = 0;
 maIn.ReadDouble( nFloat );
 nFloatArray[ nFloatCount ] = nFloat;
 SAFEDEC_OR_RET(nRef, 8, ConvErr::Count);
@@ -237,6 +239,8 @@ ConvErr QProToSc::Convert( std::unique_ptr& 
pArray )
 
 if( nFmla[ i ] == 0x1a )
 {
+sal_uInt8 nArg = 0;
+sal_uInt16 nDummy, nDLLId = 0;
 maIn.ReadUChar( nArg ).ReadUInt16( nDummy ).ReadUInt16( nDLLId 
);
 nArgArray[ nArgCount ] = nArg;
 nDLLArray[ nDLLCount ] = nDLLId;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-17 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/namedlg.hxx  |1 -
 sc/source/ui/inc/namemgrtable.hxx |   17 +
 sc/source/ui/namedlg/namedlg.cxx  |   10 ++
 sc/source/ui/namedlg/namemgrtable.cxx |   13 +++--
 4 files changed, 34 insertions(+), 7 deletions(-)

New commits:
commit 8f79126d4fb7014a81c799db776991d4c2d06fa2
Author: Caolán McNamara 
AuthorDate: Mon Oct 14 19:40:47 2019 +0100
Commit: Caolán McNamara 
CommitDate: Thu Oct 17 16:03:07 2019 +0200

Resolves: tdf#128137 cursor jumping during edit, etc.

The mbNeedUpdate hackery to block changes caused by the
user was subverted by the async handling of the treeview selection.

a) add a call to wait and process outstanding async events within
the protected block

b) move the needupdate down to the range manager to block updates during
this block in CheckForFormulaString too

c) when updating the visible rows, also update the selected rows even if 
they
are not visible.

Change-Id: I4c67d6cd2780f55d5eab5f856f6fda21703b4977
Reviewed-on: https://gerrit.libreoffice.org/80797
Tested-by: Jenkins
Tested-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/inc/namedlg.hxx b/sc/source/ui/inc/namedlg.hxx
index 09effbb234af..14149008dd90 100644
--- a/sc/source/ui/inc/namedlg.hxx
+++ b/sc/source/ui/inc/namedlg.hxx
@@ -46,7 +46,6 @@ private:
 ScDocument* mpDoc;
 const ScAddress maCursorPos;
 
-bool mbNeedUpdate;
 bool mbDataChanged;
 //ugly hack to call DefineNames from ManageNames
 bool mbCloseWithoutUndo;
diff --git a/sc/source/ui/inc/namemgrtable.hxx 
b/sc/source/ui/inc/namemgrtable.hxx
index 324ceef03657..d25a9e799d90 100644
--- a/sc/source/ui/inc/namemgrtable.hxx
+++ b/sc/source/ui/inc/namemgrtable.hxx
@@ -45,6 +45,8 @@ private:
 
 int m_nId;
 
+bool mbNeedUpdate;
+
 void GetLine(ScRangeNameLine& aLine, weld::TreeIter& rEntry);
 void Init();
 const ScRangeData* findRangeData(const ScRangeNameLine& rLine);
@@ -70,6 +72,21 @@ public:
 void GetCurrentLine(ScRangeNameLine& rLine);
 bool IsMultiSelection();
 std::vector GetSelectedEntries();
+
+void BlockUpdate()
+{
+mbNeedUpdate = false;
+}
+
+bool UpdatesBlocked() const
+{
+return !mbNeedUpdate;
+}
+
+void UnblockUpdate()
+{
+mbNeedUpdate = true;
+}
 };
 
 #endif
diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index de92dedaa9be..cdb9e5b18077 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -33,6 +33,7 @@
 #include 
 
 #include 
+#include 
 #include 
 #include 
 
@@ -55,7 +56,6 @@ ScNameDlg::ScNameDlg( SfxBindings* pB, SfxChildWindow* pCW, 
weld::Window* pParen
 , mpViewData(ptrViewData)
 , mpDoc(ptrViewData->GetDocument())
 , maCursorPos(aCursorPos)
-, mbNeedUpdate(true)
 , mbDataChanged(false)
 , mbCloseWithoutUndo(false)
 
@@ -379,7 +379,7 @@ void ScNameDlg::NameModified()
 sal_uInt16 nIndex = (aNewScope != aOldScope ? 0 : pData->GetIndex());
 
 pOldRangeName->erase(*pData);
-mbNeedUpdate = false;
+m_xRangeManagerTable->BlockUpdate();
 m_xRangeManagerTable->DeleteSelectedEntries();
 ScRangeData::Type nType = ScRangeData::Type::Name;
 if ( m_xBtnRowHeader->get_active() ) nType |= 
ScRangeData::Type::RowHeader;
@@ -395,7 +395,9 @@ void ScNameDlg::NameModified()
 aLine.aExpression = aExpr;
 aLine.aScope = aNewScope;
 m_xRangeManagerTable->addEntry(aLine, true);
-mbNeedUpdate = true;
+// tdf#128137 process pending async row change events while 
UpdatesBlocked in place
+Application::Reschedule(true);
+m_xRangeManagerTable->UnblockUpdate();
 mbDataChanged = true;
 }
 }
@@ -403,7 +405,7 @@ void ScNameDlg::NameModified()
 void ScNameDlg::SelectionChanged()
 {
 //don't update if we have just modified due to user input
-if (!mbNeedUpdate)
+if (m_xRangeManagerTable->UpdatesBlocked())
 {
 return;
 }
diff --git a/sc/source/ui/namedlg/namemgrtable.cxx 
b/sc/source/ui/namedlg/namemgrtable.cxx
index 9c4895a11a40..3567e9a94c72 100644
--- a/sc/source/ui/namedlg/namemgrtable.cxx
+++ b/sc/source/ui/namedlg/namemgrtable.cxx
@@ -60,6 +60,7 @@ 
ScRangeManagerTable::ScRangeManagerTable(std::unique_ptr xTreeVi
 , m_RangeMap(rRangeMap)
 , maPos( rPos )
 , m_nId(0)
+, mbNeedUpdate(true)
 {
 auto nColWidth = m_xTreeView->get_size_request().Width() / 7;
 std::vector aWidths;
@@ -91,7 +92,10 @@ const ScRangeData* ScRangeManagerTable::findRangeData(const 
ScRangeNameLine& rLi
 
 void ScRangeManagerTable::CheckForFormulaString()
 {
-m_xTreeView->visible_foreach([this](weld::TreeIter& rEntry){
+if (UpdatesBlocked())
+return;
+
+auto lambda = [this](weld::TreeIter& rEntry){
 

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

2019-10-17 Thread Jim Raykowski (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

New commits:
commit ca5701e9d4bb62c45920b6617de59bd9c6b529c7
Author: Jim Raykowski 
AuthorDate: Sun Sep 29 11:40:48 2019 -0800
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Oct 17 08:31:21 2019 +0200

tdf#122570 Make Enter key work in autofilter search items input

Fixes regression introduced by patch for tdf#122774

Change-Id: I24fc8a32cbb660027fb40fb017d03567e784aa77
Reviewed-on: https://gerrit.libreoffice.org/79815
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 
(cherry picked from commit d09dc224977c498356ab76738afe03136c98fabe)
Reviewed-on: https://gerrit.libreoffice.org/80880
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 413cf36704c0..6a8a51a0328e 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1343,12 +1343,7 @@ bool ScCheckListMenuWindow::EventNotify(NotifyEvent& 
rNEvt)
 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
 const sal_uInt16 nCode = rCode.GetCode();
-if (rCode.IsMod2()) // Hack to prevent tdf#122772
-{
-if (nCode == KEY_DOWN || nCode == KEY_RIGHT)
-return true;
-}
-else
+if (nCode != KEY_RETURN)
 {
 bool bShift = rCode.IsShift();
 if (nCode == KEY_TAB)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-05 Thread Caolán McNamara (via logerrit)
 sc/source/ui/formdlg/dwfunctr.cxx |   16 
 sc/source/ui/inc/dwfunctr.hxx |   20 +++-
 2 files changed, 35 insertions(+), 1 deletion(-)

New commits:
commit 2aa275bc5fd40bbd6e5ee06296481a4fcc276e45
Author: Caolán McNamara 
AuthorDate: Thu Oct 3 14:32:14 2019 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Oct 5 14:21:25 2019 +0200

Resolves: tdf#120209 reload names if setting for their language changes

Change-Id: I386a598ae680c90e7d31bf821e7fb58391e5d45c
Reviewed-on: https://gerrit.libreoffice.org/80131
Tested-by: Jenkins
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/formdlg/dwfunctr.cxx 
b/sc/source/ui/formdlg/dwfunctr.cxx
index bc99704c9dbc..76edb39ccd0d 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -47,6 +47,8 @@
 
 ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const 
css::uno::Reference )
 : PanelLayout(pParent, "FunctionPanel", 
"modules/scalc/ui/functionpanel.ui", rFrame)
+, xConfigListener(new 
comphelper::ConfigurationListener("/org.openoffice.Office.Calc/Formula/Syntax"))
+, 
xConfigChange(std::make_unique(xConfigListener, 
this))
 , pFuncDesc(nullptr)
 {
 get(aCatBox, "category");
@@ -99,6 +101,12 @@ ScFunctionWin::~ScFunctionWin()
 
 void ScFunctionWin::dispose()
 {
+if (xConfigChange)
+{
+xConfigChange.reset();
+xConfigListener->dispose();
+xConfigListener.clear();
+}
 aCatBox.clear();
 aFuncList.clear();
 aInsertButton.clear();
@@ -412,9 +420,17 @@ IMPL_LINK_NOARG( ScFunctionWin, SetSelectionClickHdl, 
Button*, void )
 {
 DoEnter();  // saves the input
 }
+
 IMPL_LINK_NOARG( ScFunctionWin, SetSelectionHdl, ListBox&, void )
 {
 DoEnter();  // saves the input
 }
 
+void EnglishFunctionNameChange::setProperty(const css::uno::Any )
+{
+ConfigurationListenerProperty::setProperty(rProperty);
+m_xFunctionWin->InitLRUList();
+m_xFunctionWin->UpdateFunctionList();
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx
index 2be013f2b9a7..3bf7158f5df7 100644
--- a/sc/source/ui/inc/dwfunctr.hxx
+++ b/sc/source/ui/inc/dwfunctr.hxx
@@ -19,6 +19,7 @@
 #ifndef INCLUDED_SC_SOURCE_UI_INC_DWFUNCTR_HXX
 #define INCLUDED_SC_SOURCE_UI_INC_DWFUNCTR_HXX
 
+#include 
 #include 
 #include 
 #include 
@@ -26,6 +27,21 @@
 class ScFuncDesc;
 namespace formula { class IFunctionDescription; }
 
+class ScFunctionWin;
+
+class EnglishFunctionNameChange : public 
comphelper::ConfigurationListenerProperty
+{
+VclPtr m_xFunctionWin;
+protected:
+virtual void setProperty(const css::uno::Any ) override;
+public:
+EnglishFunctionNameChange(const 
rtl::Reference , ScFunctionWin* 
pFunctionWin)
+: ConfigurationListenerProperty(rListener, "EnglishFunctionName")
+, m_xFunctionWin(pFunctionWin)
+{
+}
+};
+
 class ScFunctionWin : public PanelLayout
 {
 
@@ -35,12 +51,13 @@ private:
 
 VclPtr  aInsertButton;
 VclPtr   aFiFuncDesc;
+rtl::Reference xConfigListener;
+std::unique_ptr xConfigChange;
 const ScFuncDesc*   pFuncDesc;
 sal_uInt16  nArgs;
 
 ::std::vector< const formula::IFunctionDescription*> aLRUList;
 
-voidUpdateFunctionList();
 voidUpdateLRUList();
 voidDoEnter();
 voidSetDescription();
@@ -56,6 +73,7 @@ public:
 virtual voiddispose() override;
 
 voidInitLRUList();
+voidUpdateFunctionList();
 };
 
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-10-01 Thread Caolán McNamara (via logerrit)
 sc/source/ui/condformat/condformatdlgentry.cxx |   28 +
 1 file changed, 28 insertions(+)

New commits:
commit aace6e60b555740260a85ec90036b85d61ee4f06
Author: Caolán McNamara 
AuthorDate: Mon Sep 30 16:27:24 2019 +0100
Commit: Michael Weghorn 
CommitDate: Tue Oct 1 14:05:13 2019 +0200

Resolves: tdf#126781 force comboboxes to take 1/3 avail space

and not their natural size as this dialog is fixed width so we need
to make do. This brings the right border of the entry inside the
scrolled window area as expected

Change-Id: I60d6078436cbfacbbfda55838e4b0584da4bab1e
Reviewed-on: https://gerrit.libreoffice.org/79915
Tested-by: Jenkins
Reviewed-by: Michael Weghorn 

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index 6b2e29192761..7d914952bbdb 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -39,6 +39,10 @@
 
 #include 
 
+// set the widget width to something to override their auto-width calc and
+// force them to take a 1/3 of the available space
+#define CommonWidgetWidth 10
+
 ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, ScDocument* pDoc, 
const ScAddress& rPos)
 : mpParent(pParent)
 , mxBuilder(Application::CreateBuilder(pParent->GetContainer(), 
"modules/scalc/ui/conditionalentry.ui"))
@@ -52,6 +56,7 @@ ScCondFrmtEntry::ScCondFrmtEntry(ScCondFormatList* pParent, 
ScDocument* pDoc, co
 , mpDoc(pDoc)
 , maPos(rPos)
 {
+mxLbType->set_size_request(CommonWidgetWidth, -1);
 mxLbType->connect_changed(LINK(pParent, ScCondFormatList, TypeListHdl));
 mxGrid->connect_mouse_press(LINK(this, ScCondFrmtEntry, EntrySelectHdl));
 maClickHdl = LINK( pParent, ScCondFormatList, EntrySelectHdl );
@@ -152,6 +157,8 @@ 
ScConditionFrmtEntry::ScConditionFrmtEntry(ScCondFormatList* pParent, ScDocument
 , mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
 , mbIsInStyleCreate(false)
 {
+mxLbCondType->set_size_request(CommonWidgetWidth, -1);
+mxLbType->set_size_request(CommonWidgetWidth, -1);
 mxWdPreview->set_size_request(-1, 
mxLbStyle->get_preferred_size().Height());
 
 mxLbType->set_active(1);
@@ -491,6 +498,7 @@ ScFormulaFrmtEntry::ScFormulaFrmtEntry(ScCondFormatList* 
pParent, ScDocument* pD
 , mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
 , mxEdFormula(new formula::RefEdit(mxBuilder->weld_entry("formula")))
 {
+mxLbType->set_size_request(CommonWidgetWidth, -1);
 mxWdPreview->set_size_request(-1, 
mxLbStyle->get_preferred_size().Height());
 
 Init(pDialogParent);
@@ -720,6 +728,10 @@ 
ScColorScale2FrmtEntry::ScColorScale2FrmtEntry(ScCondFormatList* pParent, ScDocu
 , mxFtMin(mxBuilder->weld_label("Label_minimum"))
 , mxFtMax(mxBuilder->weld_label("Label_maximum"))
 {
+mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
+mxLbEntryTypeMin->set_size_request(CommonWidgetWidth, -1);
+mxLbEntryTypeMax->set_size_request(CommonWidgetWidth, -1);
+
 mxFtMin->show();
 mxFtMax->show();
 
@@ -852,6 +864,10 @@ 
ScColorScale3FrmtEntry::ScColorScale3FrmtEntry(ScCondFormatList* pParent, ScDocu
 , mxFtMin(mxBuilder->weld_label("Label_minimum"))
 , mxFtMax(mxBuilder->weld_label("Label_maximum"))
 {
+mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
+mxLbEntryTypeMin->set_size_request(CommonWidgetWidth, -1);
+mxLbEntryTypeMiddle->set_size_request(CommonWidgetWidth, -1);
+mxLbEntryTypeMax->set_size_request(CommonWidgetWidth, -1);
 mxFtMin->show();
 mxFtMax->show();
 
@@ -1054,6 +1070,10 @@ ScDataBarFrmtEntry::ScDataBarFrmtEntry(ScCondFormatList* 
pParent, ScDocument* pD
 , mxFtMin(mxBuilder->weld_label("Label_minimum"))
 , mxFtMax(mxBuilder->weld_label("Label_maximum"))
 {
+mxLbColorFormat->set_size_request(CommonWidgetWidth, -1);
+mxLbDataBarMinType->set_size_request(CommonWidgetWidth, -1);
+mxLbDataBarMaxType->set_size_request(CommonWidgetWidth, -1);
+
 // "min" selector doesn't need "max" entry, and vice versa
 removeType(*mxLbDataBarMinType, COLORSCALE_MAX);
 removeType(*mxLbDataBarMaxType, COLORSCALE_MIN);
@@ -1188,6 +1208,9 @@ ScDateFrmtEntry::ScDateFrmtEntry(ScCondFormatList* 
pParent, ScDocument* pDoc, co
 , mxWdPreview(new weld::CustomWeld(*mxBuilder, "preview", maWdPreview))
 , mbIsInStyleCreate(false)
 {
+mxLbDateEntry->set_size_request(CommonWidgetWidth, -1);
+mxLbStyle->set_size_request(CommonWidgetWidth, -1);
+
 mxWdPreview->set_size_request(mxLbStyle->get_preferred_size().Height(), 
-1);
 
 Init();
@@ -1307,6 +1330,8 @@ 
ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
 , mxLbEntryType(mxBuilder->weld_combo_box("listbox"))
 , mpContainer(pParent)
 {
+mxLbEntryType->set_size_request(CommonWidgetWidth, -1);
+
 

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

2019-10-01 Thread Caolán McNamara (via logerrit)
 sc/source/ui/condformat/condformatdlgentry.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit ee06f8497be65681df54b78157013e12afadfd27
Author: Caolán McNamara 
AuthorDate: Thu Sep 26 16:34:43 2019 +0100
Commit: Xisco Faulí 
CommitDate: Tue Oct 1 13:52:18 2019 +0200

Resolves: tdf#127416 unparent iconset block on dtor

otherwise gtk keeps the widgets around

Change-Id: I6227662e0a8a4d5a88f4ff6199d6fa06e5be8fe0
Reviewed-on: https://gerrit.libreoffice.org/79649
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/condformat/condformatdlgentry.cxx 
b/sc/source/ui/condformat/condformatdlgentry.cxx
index 89588a107412..6b2e29192761 100644
--- a/sc/source/ui/condformat/condformatdlgentry.cxx
+++ b/sc/source/ui/condformat/condformatdlgentry.cxx
@@ -1279,10 +1279,12 @@ private:
 std::unique_ptr mxFtEntry;
 std::unique_ptr mxEdEntry;
 std::unique_ptr mxLbEntryType;
+weld::Container* mpContainer;
 
 public:
 ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconSetType eType, 
ScDocument* pDoc,
 sal_Int32 i, const ScColorScaleEntry* pEntry = nullptr);
+~ScIconSetFrmtDataEntry();
 void Show() { mxGrid->show(); }
 void Hide() { mxGrid->hide(); }
 void set_grid_top_attach(int nTop)
@@ -1303,6 +1305,7 @@ 
ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
 , mxFtEntry(mxBuilder->weld_label("label"))
 , mxEdEntry(mxBuilder->weld_entry("entry"))
 , mxLbEntryType(mxBuilder->weld_combo_box("listbox"))
+, mpContainer(pParent)
 {
 mxImgIcon->set_from_icon_name(ScIconSetFormat::getIconName(eType, i));
 if(pEntry)
@@ -1335,6 +1338,11 @@ 
ScIconSetFrmtDataEntry::ScIconSetFrmtDataEntry(weld::Container* pParent, ScIconS
 }
 }
 
+ScIconSetFrmtDataEntry::~ScIconSetFrmtDataEntry()
+{
+mpContainer->move(mxGrid.get(), nullptr);
+}
+
 ScColorScaleEntry* ScIconSetFrmtDataEntry::CreateEntry(ScDocument* pDoc, const 
ScAddress& rPos) const
 {
 sal_Int32 nPos = mxLbEntryType->get_active();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-30 Thread Noel Grandin (via logerrit)
 sc/source/ui/Accessibility/AccessibleDocument.cxx |  171 ++
 1 file changed, 81 insertions(+), 90 deletions(-)

New commits:
commit 63b420264558ab2e4123666e4080dc4ee1b5b55c
Author: Noel Grandin 
AuthorDate: Thu Sep 26 15:31:50 2019 +0200
Commit: Noel Grandin 
CommitDate: Mon Sep 30 20:28:39 2019 +0200

tdf#76324 speedup copy operation with lots of comments in calc

avoid performing a sort in AddShape, and cache some data to speed up the
sort

Makes it about 3 times faster for me, but is still pretty slow for that
large test document

Change-Id: I5c847e43ad5dd66caefcf12b9a624214767371b1
Reviewed-on: https://gerrit.libreoffice.org/79630
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit e51a2917ab19156f5a5d2b9474a5a46a52e9e527)
Reviewed-on: https://gerrit.libreoffice.org/79838

diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index e909c5f3a2be..b1bf3cc48a33 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -87,15 +87,38 @@ using namespace ::com::sun::star::accessibility;
 
 struct ScAccessibleShapeData
 {
-ScAccessibleShapeData() : bSelected(false), bSelectable(true) {}
+ScAccessibleShapeData(css::uno::Reference< css::drawing::XShape > xShape_);
 ~ScAccessibleShapeData();
 mutable rtl::Reference< ::accessibility::AccessibleShape > pAccShape;
 mutable boost::optional xRelationCell; // if it is NULL this 
shape is anchored on the table
 css::uno::Reference< css::drawing::XShape > xShape;
 mutable boolbSelected;
 boolbSelectable;
+// cache these to make the sorting cheaper
+boost::optional mxLayerID;
+boost::optional mxZOrder;
 };
 
+ScAccessibleShapeData::ScAccessibleShapeData(css::uno::Reference< 
css::drawing::XShape > xShape_)
+: xShape(xShape_),
+bSelected(false), bSelectable(true)
+{
+static constexpr OUStringLiteral gsLayerId = "LayerID";
+static constexpr OUStringLiteral gsZOrder = "ZOrder";
+uno::Reference< beans::XPropertySet> xProps(xShape, uno::UNO_QUERY);
+if (xProps.is())
+{
+uno::Any aAny = xProps->getPropertyValue(gsLayerId);
+sal_Int16 nLayerID;
+if (aAny >>= nLayerID)
+mxLayerID = nLayerID;
+sal_Int32 nZOrder;
+aAny = xProps->getPropertyValue(gsZOrder);
+if (aAny >>= nZOrder)
+mxZOrder = nZOrder;
+}
+}
+
 ScAccessibleShapeData::~ScAccessibleShapeData()
 {
 if (pAccShape.is())
@@ -106,9 +129,6 @@ ScAccessibleShapeData::~ScAccessibleShapeData()
 
 struct ScShapeDataLess
 {
-static constexpr OUStringLiteral gsLayerId = "LayerID";
-static constexpr OUStringLiteral gsZOrder = "ZOrder";
-
 static void ConvertLayerId(sal_Int16& rLayerID) // changes the number of 
the LayerId so it the accessibility order
 {
 // note: MSVC 2017 ICE's if this is written as "switch" so use "if"
@@ -133,15 +153,10 @@ struct ScShapeDataLess
 {
 bool bResult(false);
 uno::Reference< beans::XPropertySet> xProps(pData->xShape, 
uno::UNO_QUERY);
-if (xProps.is())
+if (pData->mxLayerID)
 {
-uno::Any aPropAny = xProps->getPropertyValue(gsLayerId);
-sal_Int16 nLayerID = 0;
-if( aPropAny >>= nLayerID )
-{
-if (SdrLayerID(nLayerID) == SC_LAYER_BACK)
-bResult = true;
-}
+if (SdrLayerID(*pData->mxLayerID) == SC_LAYER_BACK)
+bResult = true;
 }
 return bResult;
 }
@@ -150,31 +165,20 @@ struct ScShapeDataLess
 bool bResult(false);
 if (pData1 && pData2)
 {
-uno::Reference< beans::XPropertySet> xProps1(pData1->xShape, 
uno::UNO_QUERY);
-uno::Reference< beans::XPropertySet> xProps2(pData2->xShape, 
uno::UNO_QUERY);
-if (xProps1.is() && xProps2.is())
+if( pData1->mxLayerID && pData2->mxLayerID )
 {
-uno::Any aPropAny1 = xProps1->getPropertyValue(gsLayerId);
-uno::Any aPropAny2 = xProps2->getPropertyValue(gsLayerId);
-sal_Int16 nLayerID1(0);
-sal_Int16 nLayerID2(0);
-if( (aPropAny1 >>= nLayerID1) && (aPropAny2 >>= nLayerID2) )
+sal_Int16 nLayerID1 = *pData1->mxLayerID;
+sal_Int16 nLayerID2 = *pData2->mxLayerID;
+if (nLayerID1 == nLayerID2)
 {
-if (nLayerID1 == nLayerID2)
-{
-uno::Any aAny1 = xProps1->getPropertyValue(gsZOrder);
-sal_Int32 nZOrder1 = 0;
-uno::Any aAny2 = xProps2->getPropertyValue(gsZOrder);
-sal_Int32 nZOrder2 = 0;
-

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

2019-09-26 Thread Julien Nabet (via logerrit)
 sc/source/ui/dataprovider/htmldataprovider.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit e4bd46ff51ccc9a5ff875796a5ad6afd3f8a6058
Author: Julien Nabet 
AuthorDate: Thu Jul 4 18:16:09 2019 +0200
Commit: Eike Rathke 
CommitDate: Thu Sep 26 13:59:24 2019 +0200

cid#1448425: Resource leak (sc/htmlprovider)

Change-Id: I3c23280da75e51be37c4b66f14f805ca49ebf3cf
Reviewed-on: https://gerrit.libreoffice.org/75095
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit 2f6ead197bbff5142199d00a30ab900ebb997754)
Reviewed-on: https://gerrit.libreoffice.org/78857
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/dataprovider/htmldataprovider.cxx 
b/sc/source/ui/dataprovider/htmldataprovider.cxx
index 6f7328bab06c..869cc44489c8 100644
--- a/sc/source/ui/dataprovider/htmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/htmldataprovider.cxx
@@ -208,7 +208,12 @@ void HTMLFetchThread::execute()
 }
 
 if (pXmlNodes->nodeNr == 0)
+{
+xmlXPathFreeNodeSet(pXmlNodes);
+xmlXPathFreeNodeSetList(pXmlXpathObj);
+xmlXPathFreeContext(pXmlXpathCtx);
 return;
+}
 
 xmlNodePtr pNode = pXmlNodes->nodeTab[0];
 handleTable(pNode);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-24 Thread Caolán McNamara (via logerrit)
 sc/source/ui/unoobj/docuno.cxx |   30 +++---
 1 file changed, 15 insertions(+), 15 deletions(-)

New commits:
commit d7bd0b2d010b4fa64dd6773ad63f864e13fffb29
Author: Caolán McNamara 
AuthorDate: Mon Sep 23 16:06:36 2019 +0100
Commit: Xisco Faulí 
CommitDate: Tue Sep 24 09:24:41 2019 +0200

Resolves: tdf#127682 out_of_range thrown on print empty calc doc

when odd/even pages requested and print is cancelled

the abort procedure will ask for page 0 to be rendered on cancel,
which doesn't exist since the odd/even support.

Let the print of an empty page to ahead in the abort scenario

Change-Id: Id8dfde57fca891ba3eb220cf6e495585abf4c918
Reviewed-on: https://gerrit.libreoffice.org/79414
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 7443bf3ba018..c2f3b3e97be5 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1837,16 +1837,16 @@ uno::Sequence SAL_CALL 
ScModelObj::getRenderer( sal_Int32
 }
 
 MultiSelection aPage;
-if ( nContent == 2 || nContent == 3 ) // even pages or odd pages
-{
-aPage.SetTotalRange( Range(0,RANGE_MAX) );
-aPage.Select( maValidPages.at( nRenderer ) );
-}
+aPage.SetTotalRange( Range(0,RANGE_MAX) );
+
+bool bOddOrEven = nContent == 2 || nContent == 3; // even pages or odd 
pages
+// tdf#127682 when odd/even allow nRenderer of 0 even when 
maValidPages is empty
+// to allow PrinterController::abortJob to spool an empty page as part 
of
+// its abort procedure
+if (bOddOrEven && !maValidPages.empty())
+aPage.Select( maValidPages.at(nRenderer) );
 else
-{
-aPage.SetTotalRange( Range(0,RANGE_MAX) );
 aPage.Select( nRenderer+1 );
-}
 
 long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
 long nTabStart = pPrintFuncCache->GetTabStart( nTab );
@@ -2021,16 +2021,16 @@ void SAL_CALL ScModelObj::render( sal_Int32 
nSelRenderer, const uno::Any& aSelec
 }
 
 MultiSelection aPage;
-if ( nContent == 2 || nContent == 3 ) // even pages or odd pages
-{
-aPage.SetTotalRange( Range(0,RANGE_MAX) );
+aPage.SetTotalRange( Range(0,RANGE_MAX) );
+
+bool bOddOrEven = nContent == 2 || nContent == 3; // even pages or odd 
pages
+// tdf#127682 when odd/even allow nRenderer of 0 even when maValidPages is 
empty
+// to allow PrinterController::abortJob to spool an empty page as part of
+// its abort procedure
+if (bOddOrEven && !maValidPages.empty())
 aPage.Select( maValidPages.at( nRenderer ) );
-}
 else
-{
-aPage.SetTotalRange( Range(0,RANGE_MAX) );
 aPage.Select( nRenderer+1 );
-}
 
 long nDisplayStart = pPrintFuncCache->GetDisplayStart( nTab );
 long nTabStart = pPrintFuncCache->GetTabStart( nTab );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-17 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr6.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 23640b11ef01840e4bf25134e18c7a0e80323099
Author: Eike Rathke 
AuthorDate: Fri Sep 6 13:53:28 2019 +0200
Commit: Xisco Faulí 
CommitDate: Tue Sep 17 10:55:43 2019 +0200

Resolves: tdf#98844 calculate as shown with SUM() again

Change-Id: I0032bdb9a8f54baa2e599861e45691a255f45275
Reviewed-on: https://gerrit.libreoffice.org/78708
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 4321d8c8b09fd880a18b4106cdd1f90acc18a861)
Reviewed-on: https://gerrit.libreoffice.org/78727
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/tool/interpr6.cxx b/sc/source/core/tool/interpr6.cxx
index cbeaa8a2443a..3a77be206acc 100644
--- a/sc/source/core/tool/interpr6.cxx
+++ b/sc/source/core/tool/interpr6.cxx
@@ -817,8 +817,12 @@ void ScInterpreter::IterateParameters( ScIterFunc eFunc, 
bool bTextAsZero )
 if ( nGlobalError != FormulaError::NONE )
 nGlobalError = FormulaError::NONE;
 }
-else if ( ( eFunc == ifSUM || eFunc == ifCOUNT ) && 
mnSubTotalFlags == SubtotalFlags::NONE )
+else if (((eFunc == ifSUM && !bCalcAsShown) || eFunc == 
ifCOUNT )
+&& mnSubTotalFlags == SubtotalFlags::NONE)
 {
+// Use fast span set array method.
+// ifSUM with bCalcAsShown has to use the slow bells and
+// whistles ScValueIterator below.
 sc::RangeColumnSpanSet aSet( aRange );
 
 if ( eFunc == ifSUM )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-17 Thread Caolán McNamara (via logerrit)
 sc/source/ui/miscdlgs/crnrdlg.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 7ee5b165e8089a19306be14478270236b38ada01
Author: Caolán McNamara 
AuthorDate: Mon Sep 16 15:38:18 2019 +0100
Commit: Xisco Faulí 
CommitDate: Tue Sep 17 10:02:04 2019 +0200

Resolves: tdf#127546 crash on clicking --Column-- or --Row--

Change-Id: I59cbcdf09b679521b54aa9752bfb15db89829993
Reviewed-on: https://gerrit.libreoffice.org/79017
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/miscdlgs/crnrdlg.cxx 
b/sc/source/ui/miscdlgs/crnrdlg.cxx
index 1a4414f992d4..ccd9076570a4 100644
--- a/sc/source/ui/miscdlgs/crnrdlg.cxx
+++ b/sc/source/ui/miscdlgs/crnrdlg.cxx
@@ -632,7 +632,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1SelectHdl, 
weld::TreeView&, void)
 while (nSelectPos != -1 && nSelectPos < nCnt && 
m_xLbRange->get_id(nSelectPos).toInt32() == nEntryDataDelim)
 {   // skip Delimiter
 ++nMoves;
-m_xLbRange->select( ++nSelectPos );
+++nSelectPos;
 }
 OUString aRangeStr = m_xLbRange->get_selected_text();
 if ( nMoves )
@@ -641,7 +641,7 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1SelectHdl, 
weld::TreeView&, void)
 {   // if entries exist before the " --- Row --- " Delimiter then
 // do not stop at the delimiter
 nSelectPos = nCnt - 2;
-m_xLbRange->select( nSelectPos );
+m_xLbRange->select(nSelectPos);
 aRangeStr = m_xLbRange->get_selected_text();
 }
 else if ( nSelectPos > 2 && nSelectPos < nCnt && !aRangeStr.isEmpty()
@@ -651,6 +651,8 @@ IMPL_LINK_NOARG(ScColRowNameRangesDlg, Range1SelectHdl, 
weld::TreeView&, void)
 m_xLbRange->select( nSelectPos );
 aRangeStr = m_xLbRange->get_selected_text();
 }
+else
+m_xLbRange->select(nSelectPos);
 }
 NameRangeMap::const_iterator itr = aRangeMap.find(aRangeStr);
 if ( itr != aRangeMap.end() )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-12 Thread Julien Nabet (via logerrit)
 sc/source/ui/dataprovider/htmldataprovider.cxx |   13 +
 1 file changed, 13 insertions(+)

New commits:
commit 07e1ad042f2dacff441129b1adbb1ed58dd6b16e
Author: Julien Nabet 
AuthorDate: Tue Sep 10 21:16:43 2019 +0200
Commit: Eike Rathke 
CommitDate: Thu Sep 12 23:12:06 2019 +0200

tdf#127461: fix data provider crashes

See bts provided in the bugtracker

Change-Id: I1cc38add93446f8372c80ca45962b04bfa627923
Reviewed-on: https://gerrit.libreoffice.org/78803
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit ec57f6eca37192ada29cda1d37ec192472c0d9ef)
Reviewed-on: https://gerrit.libreoffice.org/78813
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/dataprovider/htmldataprovider.cxx 
b/sc/source/ui/dataprovider/htmldataprovider.cxx
index d82fc76700f5..6f7328bab06c 100644
--- a/sc/source/ui/dataprovider/htmldataprovider.cxx
+++ b/sc/source/ui/dataprovider/htmldataprovider.cxx
@@ -192,8 +192,21 @@ void HTMLFetchThread::execute()
 OString aID = OUStringToOString(maID, RTL_TEXTENCODING_UTF8);
 xmlXPathContextPtr pXmlXpathCtx = xmlXPathNewContext(pHtmlPtr);
 xmlXPathObjectPtr pXmlXpathObj = 
xmlXPathEvalExpression(BAD_CAST(aID.getStr()), pXmlXpathCtx);
+
+if (!pXmlXpathObj)
+{
+xmlXPathFreeContext(pXmlXpathCtx);
+return;
+}
 xmlNodeSetPtr pXmlNodes = pXmlXpathObj->nodesetval;
 
+if (!pXmlNodes)
+{
+xmlXPathFreeNodeSetList(pXmlXpathObj);
+xmlXPathFreeContext(pXmlXpathCtx);
+return;
+}
+
 if (pXmlNodes->nodeNr == 0)
 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-3' - sc/source

2019-09-08 Thread Thorsten Wagner (via logerrit)
 sc/source/ui/app/inputwin.cxx |3 ---
 1 file changed, 3 deletions(-)

New commits:
commit cd28e8b36c95a8de71b9a8a0ac6702b8018eedac
Author: Thorsten Wagner 
AuthorDate: Mon Aug 26 15:18:51 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Sep 8 13:56:09 2019 +0200

tdf#127066 Font size of Calc input bar aligned to UI font size

Change-Id: I1f1aa4195c4b4be8987b0686d3f157ecea3fecce
Reviewed-on: https://gerrit.libreoffice.org/78140
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Tested-by: Heiko Tietze 
(cherry picked from commit e757a88f5141a2816d6c69bff5234c9f8802c79a)
Reviewed-on: https://gerrit.libreoffice.org/78764
Reviewed-by: Adolfo Jayme Barrientos 
Tested-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index e206a3506669..216a5bd6477e 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -74,7 +74,6 @@ namespace com::sun::star::accessibility { class XAccessible; }
 
 const long THESIZE = 100;// Should be more than enough!
 const long INPUTLINE_INSET_MARGIN = 2;   // Space between border and interior 
widgets of input line
-const long MIN_FONT_SIZE = 16;   // Minimum font size of input line in 
pixels
 const long LEFT_OFFSET = 5;  // Left offset of input line
 const long BUTTON_OFFSET = 2;// Space between input line and 
button to expand/collapse
 const long MULTILINE_BUTTON_WIDTH = 20;  // Width of the button which opens 
multiline dropdown
@@ -1434,8 +1433,6 @@ ScTextWnd::ScTextWnd(ScTextWndGroup* pParent, 
ScTabViewShell* pViewSh)
 vcl::Font aAppFont = GetFont();
 aTextFont = aAppFont;
 Size aFontSize = aAppFont.GetFontSize();
-if (aFontSize.Height() < MIN_FONT_SIZE)
-aFontSize.setHeight(MIN_FONT_SIZE);
 aTextFont.SetFontSize(PixelToLogic(aFontSize, MapMode(MapUnit::MapTwip)));
 
 const StyleSettings& rStyleSettings = 
Application::GetSettings().GetStyleSettings();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-05 Thread László Németh (via logerrit)
 sc/source/filter/excel/xeview.cxx |6 --
 sc/source/filter/inc/xeview.hxx   |1 +
 2 files changed, 5 insertions(+), 2 deletions(-)

New commits:
commit 09afdc89572202f100e5ab5112ae0878ae032fc1
Author: László Németh 
AuthorDate: Tue Sep 3 17:19:18 2019 +0200
Commit: Xisco Faulí 
CommitDate: Thu Sep 5 12:25:49 2019 +0200

tdf#127110 XLSX export: fix bad view position

Update SheetView attribute topLeftCell only
in the case of embedded OLE sheets.

Regression from commit 3707e2a7b8b05617b0afb75374f866c967593861
"tdf#122624 XLSX OLE in DOCX: export view positions".

Change-Id: I9ea57ff1531d710bff34df12fb7e0bb1e3edbea5
Reviewed-on: https://gerrit.libreoffice.org/78570
Tested-by: Jenkins
Reviewed-by: László Németh 
(cherry picked from commit 47aa9324e3d15fcc9d1195b9b0822b5568e6d96e)
Reviewed-on: https://gerrit.libreoffice.org/78577
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/filter/excel/xeview.cxx 
b/sc/source/filter/excel/xeview.cxx
index b83937452b1a..f6fb858dc77f 100644
--- a/sc/source/filter/excel/xeview.cxx
+++ b/sc/source/filter/excel/xeview.cxx
@@ -285,7 +285,8 @@ sal_uInt16 lclGetXclZoom( long nScZoom, sal_uInt16 
nDefXclZoom )
 
 XclExpTabViewSettings::XclExpTabViewSettings( const XclExpRoot& rRoot, SCTAB 
nScTab ) :
 XclExpRoot( rRoot ),
-mnGridColorId( XclExpPalette::GetColorIdFromIndex( EXC_COLOR_WINDOWTEXT ) )
+mnGridColorId( XclExpPalette::GetColorIdFromIndex( EXC_COLOR_WINDOWTEXT ) 
),
+mbHasTabSettings(false)
 {
 // *** sheet flags ***
 
@@ -304,6 +305,7 @@ XclExpTabViewSettings::XclExpTabViewSettings( const 
XclExpRoot& rRoot, SCTAB nSc
 
 if( const ScExtTabSettings* pTabSett = GetExtDocOptions().GetTabSettings( 
nScTab ) )
 {
+mbHasTabSettings = true;
 const ScExtTabSettings& rTabSett = *pTabSett;
 XclExpAddressConverter& rAddrConv = GetAddressConverter();
 
@@ -419,7 +421,7 @@ void XclExpTabViewSettings::SaveXml( XclExpXmlStream& rStrm 
)
 rWorksheet->startElement(XML_sheetViews);
 
 // handle missing viewdata at embedded XLSX OLE objects
-if (maData.mbSelected)
+if( !mbHasTabSettings && maData.mbSelected )
 {
 SCCOL nPosLeft = rStrm.GetRoot().GetDoc().GetPosLeft();
 SCROW nPosTop = rStrm.GetRoot().GetDoc().GetPosTop();
diff --git a/sc/source/filter/inc/xeview.hxx b/sc/source/filter/inc/xeview.hxx
index 4416417ea623..8d320177d8d0 100644
--- a/sc/source/filter/inc/xeview.hxx
+++ b/sc/source/filter/inc/xeview.hxx
@@ -159,6 +159,7 @@ private:
 private:
 XclTabViewData  maData; /// All view settings for a sheet.
 sal_uInt32  mnGridColorId;  /// Color identifier for grid 
color.
+boolmbHasTabSettings;   /// It's false for embedded OLE 
spreadsheets.
 };
 
 #endif
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-09-03 Thread Caolán McNamara (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 6aade14148e3d56706b074392ca3569b2a2a8376
Author: Caolán McNamara 
AuthorDate: Tue Sep 3 09:41:12 2019 +0100
Commit: Michael Stahl 
CommitDate: Tue Sep 3 15:03:08 2019 +0200

Resolves: tdf#127168 dismiss menu before executing sort

so any error dialog which are parented to the calc window are not
hidden by the menu which is destined to be dismissed after the
sort anyway

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

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 43553d305f38..413cf36704c0 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -452,8 +452,9 @@ void ScMenuFloatingWindow::executeMenuItem(size_t nPos)
 // no action is defined.
 return;
 
-maMenuItems[nPos].mpAction->execute();
 terminateAllPopupMenus();
+
+maMenuItems[nPos].mpAction->execute();
 }
 
 void ScMenuFloatingWindow::setSelectedMenuItem(size_t nPos, bool 
bSubMenuTimer, bool bEnsureSubMenu)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-28 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/docsh.cxx  |   13 --
 sc/source/ui/docshell/docsh4.cxx |   67 ---
 sc/source/ui/docshell/externalrefmgr.cxx |8 +++
 sc/source/ui/inc/docsh.hxx   |2 
 4 files changed, 56 insertions(+), 34 deletions(-)

New commits:
commit 14825a8b7f00ee4c148f2583856e5102312cabbd
Author: Eike Rathke 
AuthorDate: Fri Aug 16 15:36:15 2019 +0200
Commit: Michael Stahl 
CommitDate: Wed Aug 28 19:01:54 2019 +0200

Resolves: tdf#126928 allow link updates in an intermediate linked document

... if link updates are allowed in the current document and that
intermediate document resides in a trusted location.

This works with both, the "Always (from trusted locations)" and
the "On request" settings under Tools -> Options -> Calc ->
General. It can't work with documents residing in a non-trusted
location as there is no way to allow updates on demand for a such
loaded document (hidden via formulas).

Change-Id: Ie483f7743db7c6d5cf947dc16a9c3660855f3423
Reviewed-on: https://gerrit.libreoffice.org/77588
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 54bf84746a2a9a2e2aaf0df9e429b0cfd538f640)
Reviewed-on: https://gerrit.libreoffice.org/77604
Reviewed-by: Michael Stahl 

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 372686daacbc..024a34701a5b 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -584,15 +584,22 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 bool bRet = SfxObjectShell::Load(rMedium);
 if (bRet)
 {
-comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
-rEmbeddedObjectContainer.setUserAllowsLinkUpdate(false);
-
 if (GetMedium())
 {
 const SfxUInt16Item* pUpdateDocItem = 
SfxItemSet::GetItem(rMedium.GetItemSet(), SID_UPDATEDOCMODE, 
false);
 m_nCanUpdate = pUpdateDocItem ? pUpdateDocItem->GetValue() : 
css::document::UpdateDocMode::NO_UPDATE;
 }
 
+// GetLinkUpdateModeState() evaluates m_nCanUpdate so that must have
+// been set first. Do not override an already forbidden LinkUpdate (the
+// default is allow).
+comphelper::EmbeddedObjectContainer& rEmbeddedObjectContainer = 
getEmbeddedObjectContainer();
+if (rEmbeddedObjectContainer.getUserAllowsLinkUpdate())
+{
+// For anything else than LM_ALWAYS we need user confirmation.
+rEmbeddedObjectContainer.setUserAllowsLinkUpdate( 
GetLinkUpdateModeState() == LM_ALWAYS);
+}
+
 {
 //  prepare a valid document for XML filter
 //  (for ConvertFrom, InitNew is called before)
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 8d220ec0e3bf..19a49af4b65e 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -144,6 +144,41 @@ IMPL_LINK_NOARG( ScDocShell, ReloadAllLinksHdl, Button*, 
void )
 SAL_WARN_IF(!pViewFrame, "sc", "expected there to be a ViewFrame");
 }
 
+ScLkUpdMode ScDocShell::GetLinkUpdateModeState() const
+{
+const ScDocument& rDoc = GetDocument();
+
+ScLkUpdMode nSet = rDoc.GetLinkMode();
+
+if (nSet == LM_UNKNOWN)
+{
+ScAppOptions aAppOptions = SC_MOD()->GetAppOptions();
+nSet = aAppOptions.GetLinkMode();
+}
+
+if (m_nCanUpdate == css::document::UpdateDocMode::NO_UPDATE)
+nSet = LM_NEVER;
+else if (m_nCanUpdate == css::document::UpdateDocMode::FULL_UPDATE)
+nSet = LM_ALWAYS;
+
+if (nSet == LM_ALWAYS
+&& !(SvtSecurityOptions().isTrustedLocationUriForUpdatingLinks(
+GetMedium() == nullptr ? OUString() : 
GetMedium()->GetName())
+|| (IsDocShared()
+&& 
SvtSecurityOptions().isTrustedLocationUriForUpdatingLinks(
+GetSharedFileURL()
+{
+nSet = LM_ON_DEMAND;
+}
+if (m_nCanUpdate == css::document::UpdateDocMode::QUIET_UPDATE
+&& nSet == LM_ON_DEMAND)
+{
+nSet = LM_NEVER;
+}
+
+return nSet;
+}
+
 void ScDocShell::Execute( SfxRequest& rReq )
 {
 const SfxItemSet* pReqArgs = rReq.GetArgs();
@@ -441,37 +476,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
 break;
 case SID_UPDATETABLINKS:
 {
-ScDocument& rDoc = GetDocument();
-
-ScLkUpdMode nSet = rDoc.GetLinkMode();
-
-if(nSet==LM_UNKNOWN)
-{
-ScAppOptions aAppOptions=SC_MOD()->GetAppOptions();
-nSet=aAppOptions.GetLinkMode();
-}
-
-if (m_nCanUpdate == css::document::UpdateDocMode::NO_UPDATE)
-nSet = LM_NEVER;
-else if (m_nCanUpdate == 

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

2019-08-22 Thread Julien Nabet (via logerrit)
 sc/source/ui/docshell/docsh.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bc19862ab3b13f55e9364ba5cfe8547bf30adac7
Author: Julien Nabet 
AuthorDate: Wed Aug 21 22:13:58 2019 +0200
Commit: Kohei Yoshida 
CommitDate: Thu Aug 22 15:55:17 2019 +0200

Fix full url for calc/styles by adding missing '/'

warn:sc:1272:1272:sc/source/filter/orcus/orcusfiltersimpl.cxx:149: Unable 
to load styles from xml file! boost::filesystem::file_size: Aucun fichier ou 
dossier de ce type
Thread 1 "soffice.bin" hit Breakpoint 2, (anonymous namespace)::lookup 
(file=0x556435a0, mode=(anonymous namespace)::LOOKUP_MODE_NORMAL, 
override=false, key="BRAND_BASE_DIRshare", requestStack=0x0)
at /home/julien/lo/libreoffice/sal/rtl/bootstrap.cxx:860
860OUString v;
(gdb) bt
0  0x77f2ae45 in (anonymous namespace)::lookup(Bootstrap_Impl 
const*, (anonymous namespace)::LookupMode, bool, rtl::OUString const&, 
(anonymous namespace)::ExpandRequestLink const*)
(file=0x556435a0, mode=(anonymous namespace)::LOOKUP_MODE_NORMAL, 
override=false, key="BRAND_BASE_DIRshare", requestStack=0x0) at 
/home/julien/lo/libreoffice/sal/rtl/bootstrap.cxx:860
1  0x77f2b7f6 in (anonymous namespace)::expandMacros(Bootstrap_Impl 
const*, rtl::OUString const&, (anonymous namespace)::LookupMode, (anonymous 
namespace)::ExpandRequestLink const*)
(file=0x556435a0, text="$BRAND_BASE_DIRshare/calc/styles.xml", 
mode=(anonymous namespace)::LOOKUP_MODE_NORMAL, requestStack=0x0) at 
/home/julien/lo/libreoffice/sal/rtl/bootstrap.cxx:995
2  0x77f2aa0d in 
rtl_bootstrap_expandMacros_from_handle(rtlBootstrapHandle, rtl_uString**) 
(handle=0x556435a0, macro=0x7ffefb90) at 
/home/julien/lo/libreoffice/sal/rtl/bootstrap.cxx:791
3  0x77f2aa60 in rtl_bootstrap_expandMacros(rtl_uString**) 
(macro=0x7ffefb90) at /home/julien/lo/libreoffice/sal/rtl/bootstrap.cxx:797
4  0x7fffde89e675 in rtl::Bootstrap::expandMacros(rtl::OUString&) 
(macro="$BRAND_BASE_DIRshare/calc/styles.xml") at 
/home/julien/lo/libreoffice/include/rtl/bootstrap.hxx:131
5  0x7fffde890d5f in ScDocShell::Load(SfxMedium&) (this=0x58034760, 
rMedium=...) at /home/julien/lo/libreoffice/sc/source/ui/docshell/docsh.cxx:613

Change-Id: I5e4019c730f25d32b431dbd01c5668189be6cc66
Reviewed-on: https://gerrit.libreoffice.org/77936
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida 
(cherry picked from commit 86d55aaad49a3f83b61894afd81f195b37a142af)
Reviewed-on: https://gerrit.libreoffice.org/77955

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 48b0532f73a7..372686daacbc 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -604,7 +604,7 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 {
 /* Create styles that are imported through Orcus */
 
-OUString aURL("$BRAND_BASE_DIR" LIBO_SHARE_FOLDER 
"/calc/styles.xml");
+OUString aURL("$BRAND_BASE_DIR/" LIBO_SHARE_FOLDER 
"/calc/styles.xml");
 rtl::Bootstrap::expandMacros(aURL);
 
 OUString aPath;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-20 Thread Caolán McNamara (via logerrit)
 sc/source/ui/pagedlg/tphfedit.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 4e123492d8d63d04a1c215c17981f0149df2f634
Author: Caolán McNamara 
AuthorDate: Mon Aug 19 10:34:56 2019 +0100
Commit: Xisco Faulí 
CommitDate: Tue Aug 20 10:43:00 2019 +0200

Resolves: tdf#127003 explicit grab focus needs explicit link callback

Change-Id: I5131e5c49e7f7c2ef9bac8943420643ad8afef38
Reviewed-on: https://gerrit.libreoffice.org/77709
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/pagedlg/tphfedit.cxx 
b/sc/source/ui/pagedlg/tphfedit.cxx
index 60af30694826..ff01ce68e606 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -279,8 +279,11 @@ bool ScEditWindow::MouseMove( const MouseEvent& rMEvt )
 
 bool ScEditWindow::MouseButtonDown( const MouseEvent& rMEvt )
 {
-if ( !HasFocus() )
+if (!HasFocus())
+{
 GrabFocus();
+GetFocus();
+}
 
 return pEdView->MouseButtonDown( rMEvt );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-19 Thread Caolán McNamara (via logerrit)
 sc/source/ui/pagedlg/tphfedit.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit ed2c73a6b7857e97cd3a10c9f96daf95ff354c0a
Author: Caolán McNamara 
AuthorDate: Sun Aug 18 19:57:14 2019 +0100
Commit: Xisco Faulí 
CommitDate: Mon Aug 19 12:07:14 2019 +0200

Resolves: tdf#127002 keystrokes in edit engine passed on to dialog

when they should stop at the edit engine

Change-Id: I4079af7ed53ab4036e99c129d9e58fa530cf566b
Reviewed-on: https://gerrit.libreoffice.org/77675
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/pagedlg/tphfedit.cxx 
b/sc/source/ui/pagedlg/tphfedit.cxx
index b515ab70d415..60af30694826 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -309,7 +309,7 @@ bool ScEditWindow::KeyInput( const KeyEvent& rKEvt )
 aObjectSelectLink.Call(*this);
 return true;
 }
-return false;
+return true;
 }
 
 void ScEditWindow::GetFocus()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-19 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/table2.cxx |  115 +
 1 file changed, 82 insertions(+), 33 deletions(-)

New commits:
commit 7a42bf4caa46093ced87a4db54b94f6b4c4decd0
Author: Mike Kaganski 
AuthorDate: Tue Jul 16 16:14:49 2019 +1000
Commit: Noel Grandin 
CommitDate: Mon Aug 19 10:25:45 2019 +0200

tdf#126418: add some more checks for allocated columns

Change-Id: Ia91f0f11c9d7bcec5b9ecc2f8a28d9e4f6212dc5
Reviewed-on: https://gerrit.libreoffice.org/75671
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 159db459418a2c831bf00dca5a2c5087d65e9ab6)
Reviewed-on: https://gerrit.libreoffice.org/77442
Reviewed-by: Noel Grandin 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 98f316424cbd..1f62b1a9418d 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -534,15 +534,39 @@ void ScTable::CopyToClip(
 void ScTable::CopyStaticToDocument(
 SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow2, const 
SvNumberFormatterMergeMap& rMap, ScTable* pDestTab )
 {
-if (nCol1 > nCol2)
+if (nCol1 > nCol2 || nRow1 > nRow2)
 return;
 
-for (SCCOL i = nCol1; i <= nCol2; ++i)
+const SCCOL nFirstUnallocated = 
std::clamp(GetAllocatedColumnsCount(), nCol1, nCol2 + 1);
+if (nFirstUnallocated > nCol1)
+pDestTab->CreateColumnIfNotExists(nFirstUnallocated - 1);
+
+for (SCCOL i = nCol1; i < nFirstUnallocated; ++i)
 {
 ScColumn& rSrcCol = aCol[i];
 ScColumn& rDestCol = pDestTab->aCol[i];
 rSrcCol.CopyStaticToDocument(nRow1, nRow2, rMap, rDestCol);
 }
+
+// Maybe copy this table's default attrs to dest not limiting to already 
allocated in dest?
+const SCCOL nLastInDest = 
std::min(pDestTab->GetAllocatedColumnsCount() - 1, nCol2);
+for (SCCOL i = nFirstUnallocated; i <= nLastInDest; ++i)
+{
+ScColumn& rDestCol = pDestTab->aCol[i];
+rDestCol.maCellTextAttrs.set_empty(nRow1, nRow2);
+rDestCol.maCells.set_empty(nRow1, nRow2);
+for (SCROW nRow = nRow1; nRow <= nRow2; ++nRow)
+{
+sal_uInt32 nNumFmt = 
aDefaultColAttrArray.GetPattern(nRow)->GetNumberFormat(
+pDocument->GetNonThreadedContext().GetFormatTable());
+SvNumberFormatterMergeMap::const_iterator itNum = 
rMap.find(nNumFmt);
+if (itNum != rMap.end())
+nNumFmt = itNum->second;
+
+rDestCol.SetNumberFormat(nRow, nNumFmt);
+}
+rDestCol.CellStorageModified();
+}
 }
 
 void ScTable::CopyCellToDocument(SCCOL nSrcCol, SCROW nSrcRow, SCCOL nDestCol, 
SCROW nDestRow, ScTable& rDestTab )
@@ -550,8 +574,21 @@ void ScTable::CopyCellToDocument(SCCOL nSrcCol, SCROW 
nSrcRow, SCCOL nDestCol, S
 if (!ValidColRow(nSrcCol, nSrcRow) || !ValidColRow(nDestCol, nDestRow))
 return;
 
+if (nSrcCol >= GetAllocatedColumnsCount())
+{
+if (nDestCol < rDestTab.GetAllocatedColumnsCount())
+{
+ScColumn& rDestCol = rDestTab.aCol[nDestCol];
+rDestCol.maCells.set_empty(nDestRow, nDestRow);
+rDestCol.maCellTextAttrs.set_empty(nDestRow, nDestRow);
+rDestCol.maCellNotes.set_empty(nDestRow, nDestRow);
+rDestCol.CellStorageModified();
+}
+return;
+}
+
 ScColumn& rSrcCol = aCol[nSrcCol];
-ScColumn& rDestCol = rDestTab.aCol[nDestCol];
+ScColumn& rDestCol = rDestTab.CreateColumnIfNotExists(nDestCol);
 rSrcCol.CopyCellToDocument(nSrcRow, nDestRow, rDestCol);
 }
 
@@ -1055,7 +1092,7 @@ ScColumn* ScTable::FetchColumn( SCCOL nCol )
 
 const ScColumn* ScTable::FetchColumn( SCCOL nCol ) const
 {
-if (!ValidCol(nCol))
+if (!ValidCol(nCol) || nCol >= GetAllocatedColumnsCount())
 return nullptr;
 
 return [nCol];
@@ -1084,6 +1121,7 @@ void ScTable::StartListeners( sc::StartListeningContext& 
rCxt, bool bAll )
 void ScTable::AttachFormulaCells(
 sc::StartListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
 {
+nCol2 = ClampToAllocatedColumns(nCol2);
 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
 aCol[nCol].AttachFormulaCells(rCxt, nRow1, nRow2);
 }
@@ -1091,6 +1129,7 @@ void ScTable::AttachFormulaCells(
 void ScTable::DetachFormulaCells(
 sc::EndListeningContext& rCxt, SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 
SCROW nRow2 )
 {
+nCol2 = ClampToAllocatedColumns(nCol2);
 for (SCCOL nCol = nCol1; nCol <= nCol2; ++nCol)
 aCol[nCol].DetachFormulaCells(rCxt, nRow1, nRow2, nullptr);
 }
@@ -1438,7 +1477,7 @@ void ScTable::SetEditText( SCCOL nCol, SCROW nRow, const 
EditTextObject& rEditTe
 if (!ValidColRow(nCol, nRow))
 return;
 
-aCol[nCol].SetEditText(nRow, rEditText, pEditPool);
+CreateColumnIfNotExists(nCol).SetEditText(nRow, rEditText, pEditPool);
 }
 
 SCROW ScTable::GetFirstEditTextRow( SCCOL nCol1, SCROW nRow1, SCCOL nCol2, 

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

2019-08-14 Thread Xisco Fauli (via logerrit)
 sc/source/ui/view/gridwin2.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit f6c78ee996e87c8f7f0d162e06bc2ce6c7633481
Author: Xisco Fauli 
AuthorDate: Tue Aug 13 13:38:04 2019 +0200
Commit: Miklos Vajna 
CommitDate: Wed Aug 14 09:04:37 2019 +0200

tdf#126848: sc pivot table popup: avoid flicker

Follow-up of 4dadbff74eff5f8ad00df99c659f8a2b914e09a1

Regression from commit a4cb27f61376d8f2d8faed0022c291af68d437bd

Change-Id: I4d0cd2ad2d7d239307c48c9bc8c1f1ced6597f47
Reviewed-on: https://gerrit.libreoffice.org/77408
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 
(cherry picked from commit 1352b1fcfa1668081c3197a12d5362286f8f9710)
Reviewed-on: https://gerrit.libreoffice.org/77427
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/ui/view/gridwin2.cxx b/sc/source/ui/view/gridwin2.cxx
index aef8160eedc7..18477202d8af 100644
--- a/sc/source/ui/view/gridwin2.cxx
+++ b/sc/source/ui/view/gridwin2.cxx
@@ -469,6 +469,12 @@ void ScGridWindow::DPLaunchFieldPopupMenu(const Point& 
rScrPos, const Size& rScr
 
 mpDPFieldPopup.disposeAndClear();
 mpDPFieldPopup.reset(VclPtr::Create(this, 
pViewData->GetDocument()));
+
+// Avoid flicker when hovering over the menu items.
+if (!IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus))
+// If NWF renders the focus rects itself, that breaks double-buffering.
+mpDPFieldPopup->RequestDoubleBuffering(true);
+
 mpDPFieldPopup->setName("DataPilot field member popup");
 mpDPFieldPopup->setExtendedData(std::move(pDPData));
 mpDPFieldPopup->setOKAction(new DPFieldPopupOKAction(this));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-09 Thread Mike Kaganski (via logerrit)
 sc/source/filter/excel/xepivotxml.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit 5608074fa6cb1ebfbe8de5189bbe8d74606d088a
Author: Mike Kaganski 
AuthorDate: Wed Aug 7 16:03:34 2019 +0300
Commit: Caolán McNamara 
CommitDate: Fri Aug 9 17:30:29 2019 +0200

tdf#126748: temporary hack to avoid crash when several pivot tables ...

... reference a single cache, and have different sets of group fields.

The problem is getting group field names from the tables referencing
the cache; so when a table referencing not all group fields happens
to be first in the reference list, the returned name is empty.

The hack just stops writing group fields as soon as it finds an empty
name; this naturally leaves bad cache data behind, but at least doen't
crash. The retrieval of the names should be reimplemented using a
different source, to not depend on tables referencing the cache.

Regression after commit b082998401e37e6c7534906601bc481423a6ded0.

Change-Id: Ib2e92f8acf93a801861c6ba5c68fab3bebe3672c
Reviewed-on: https://gerrit.libreoffice.org/77110
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit f5c27036ad63c8bc3d9b86f2e4e772c01490d883)
Reviewed-on: https://gerrit.libreoffice.org/77124
Tested-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/excel/xepivotxml.cxx 
b/sc/source/filter/excel/xepivotxml.cxx
index 3143f3b1b04a..57abfd60b3b7 100644
--- a/sc/source/filter/excel/xepivotxml.cxx
+++ b/sc/source/filter/excel/xepivotxml.cxx
@@ -511,6 +511,16 @@ void XclExpXmlPivotCaches::SavePivotCacheXml( 
XclExpXmlStream& rStrm, const Entr
 for (size_t i = nCount; pDPObject && i < nCount + nGroupFieldCount; ++i)
 {
 const OUString aName = pDPObject->GetDimName(i, 
o3tl::temporary(bool()));
+// tdf#126748: DPObject might not reference all group fields, when 
there are several
+// DPObjects referencing this cache. Trying to get a dimension data 
for a field not used
+// in a given DPObject will give nullptr, and dereferencing it then 
will crash. To avoid
+// the crash, until there's a correct method to find the names of 
group fields in cache,
+// just skip the fields, creating bad cache data, which is of course a 
temporary hack.
+// TODO: reimplement the whole block to get the names from another 
source, not from first
+// cache reference.
+if (aName.isEmpty())
+break;
+
 ScDPSaveData* pSaveData = pDPObject->GetSaveData();
 assert(pSaveData);
 const ScDPSaveGroupDimension* pDim = 
pSaveData->GetDimensionData()->GetNamedGroupDim(aName);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-08-07 Thread Noel Grandin (via logerrit)
 sc/source/core/data/documen8.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 0f6c33bdf691cc5ea048e7fb5e5ee7ee539eb643
Author: Noel Grandin 
AuthorDate: Wed Aug 7 14:04:15 2019 +0200
Commit: Xisco Faulí 
CommitDate: Wed Aug 7 21:12:15 2019 +0200

tdf#126685 CRASH: selecting all in sheet

regression from
commit 7282014e362a1529a36c88eb308df8ed359c2cfa
Date:   Fri Feb 1 15:15:16 2019 +0100
tdf#50916 Makes numbers of columns dynamic.

We need to clamp the columns whenever we change sheet/table

Change-Id: I5cf22b2a7cf2f6473b8340289bcddd75ed0ad70b
Reviewed-on: https://gerrit.libreoffice.org/77105
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit d1cddc4775f03a52bb8fa2229dc5624d8cc5a3ce)
Reviewed-on: https://gerrit.libreoffice.org/77125
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index aefbcb293d70..546b3b015c3f 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -648,13 +648,12 @@ bool ScDocument::IdleCalcTextWidth()// true = 
try next again
 bNewTab = true;
 }
 
-aScope.setCol(pTab->ClampToAllocatedColumns(aScope.Col()));
-
 if ( nRestart < 2 )
 {
 if ( bNewTab )
 {
 pTab = maTabs[aScope.Tab()].get();
+aScope.setCol(pTab->ClampToAllocatedColumns(aScope.Col()));
 pStyle = 
static_cast(aScope.getStylePool()->Find(
 pTab->aPageStyle, SfxStyleFamily::Page));
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-31 Thread Aron Budea (via logerrit)
 sc/source/core/data/table2.cxx |2 +-
 sc/source/ui/unoobj/fmtuno.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit d9957993160b8775e3f763fa7239dd82086e19ef
Author: Aron Budea 
AuthorDate: Sun Jul 28 05:51:40 2019 +0200
Commit: Xisco Faulí 
CommitDate: Wed Jul 31 11:43:26 2019 +0200

tdf#125800: accessing cond format props in UNO throws error

These conditions were always evaluated to true: OR should
become AND when negated.

Regression from 8c637b47d9de4b3a64c33a9c2ffe7ed220be2467

Change-Id: I87038319ed27eff2bed2412da49e01f73ec0a79c
Reviewed-on: https://gerrit.libreoffice.org/76493
Reviewed-by: Gülşah Köse 
Reviewed-by: Aron Budea 
Tested-by: Aron Budea 
(cherry picked from commit 9ad8f83912e6cf14d7b3b3e1cb2a79d819247c82)
Reviewed-on: https://gerrit.libreoffice.org/76703
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 5edff4b4889b..98f316424cbd 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2190,7 +2190,7 @@ void ScTable::FindMaxRotCol( RowInfo* pRowInfo, SCSIZE 
nArrCount, SCCOL nX1, SCC
 for (size_t nEntry=0; nEntryGetEntry(nEntry);
-if(pEntry->GetType() != 
ScFormatEntry::Type::Condition ||
+if(pEntry->GetType() != 
ScFormatEntry::Type::Condition &&
pEntry->GetType() != 
ScFormatEntry::Type::ExtCondition)
 continue;
 
diff --git a/sc/source/ui/unoobj/fmtuno.cxx b/sc/source/ui/unoobj/fmtuno.cxx
index 4cd31ca6aae9..46f4c227e424 100644
--- a/sc/source/ui/unoobj/fmtuno.cxx
+++ b/sc/source/ui/unoobj/fmtuno.cxx
@@ -162,7 +162,7 @@ ScTableConditionalFormat::ScTableConditionalFormat(
 {
 ScCondFormatEntryItem aItem;
 const ScFormatEntry* pFrmtEntry = pFormat->GetEntry(i);
-if(pFrmtEntry->GetType() != ScFormatEntry::Type::Condition 
||
+if(pFrmtEntry->GetType() != ScFormatEntry::Type::Condition 
&&
pFrmtEntry->GetType() != 
ScFormatEntry::Type::ExtCondition)
 continue;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-29 Thread Jim Raykowski (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |   31 ++-
 1 file changed, 26 insertions(+), 5 deletions(-)

New commits:
commit f111aba46cbb037bd82d7246bb0a111b87931f03
Author: Jim Raykowski 
AuthorDate: Mon Jul 15 23:41:55 2019 -0800
Commit: Xisco Faulí 
CommitDate: Mon Jul 29 19:33:24 2019 +0200

tdf#122774 Make all ScCheckListMenuWindow items keyboard accessible

This patch provides keyboard tab navigation to the menu window menu
items.

In addition to the Ok button being already disabled when search is empty
the patch disables the check list box, toggle all check box select,
single button and unselect single button. This prevents keyboard focus
from being trapped in the check list box and from tab navigation visting
useless controls when search is empty.

This patch also provides a hack fix for tdf#122772

Change-Id: I7677d544ae63acc8eca08877ecd001d394fcfaca
Reviewed-on: https://gerrit.libreoffice.org/75684
Tested-by: Jenkins
Reviewed-by: Jim Raykowski 
(cherry picked from commit 3e50aea3c723e82ea4acf32aae8d72e875d4b321)
Reviewed-on: https://gerrit.libreoffice.org/76532
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 2b74bfd3d605..43553d305f38 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1210,6 +1210,7 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, TriStateHdl, 
Button*, void)
 }
 
 mePrevToggleAllState = maChkToggleAll->GetState();
+maTabStops.SetTabStop(maChkToggleAll); // Needed for when accelerator is 
used
 }
 
 IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, Edit&, void)
@@ -1285,7 +1286,14 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, 
Edit&, void)
 maChkToggleAll->SetState( TRISTATE_INDET );
 
 if ( !maConfig.mbAllowEmptySet )
-maBtnOk->Enable( nSelCount != 0);
+{
+const bool bEmptySet( nSelCount == 0 );
+maChecks->Enable( !bEmptySet );
+maChkToggleAll->Enable( !bEmptySet );
+maBtnSelectSingle->Enable( !bEmptySet );
+maBtnUnselectSingle->Enable( !bEmptySet );
+maBtnOk->Enable( !bEmptySet );
+}
 }
 
 IMPL_LINK( ScCheckListMenuWindow, CheckHdl, SvTreeListBox*, pChecks, void )
@@ -1323,14 +1331,27 @@ void ScCheckListMenuWindow::MouseMove(const MouseEvent& 
rMEvt)
 
 bool ScCheckListMenuWindow::EventNotify(NotifyEvent& rNEvt)
 {
-if (rNEvt.GetType() == MouseNotifyEvent::KEYUP)
+MouseNotifyEvent nType = rNEvt.GetType();
+if (HasFocus() && nType == MouseNotifyEvent::GETFOCUS)
+{
+setSelectedMenuItem( 0 , false, false );
+return true;
+}
+if (nType == MouseNotifyEvent::KEYINPUT)
 {
 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
-bool bShift = rCode.IsShift();
-if (rCode.GetCode() == KEY_TAB)
+const sal_uInt16 nCode = rCode.GetCode();
+if (rCode.IsMod2()) // Hack to prevent tdf#122772
+{
+if (nCode == KEY_DOWN || nCode == KEY_RIGHT)
+return true;
+}
+else
 {
-maTabStops.CycleFocus(bShift);
+bool bShift = rCode.IsShift();
+if (nCode == KEY_TAB)
+maTabStops.CycleFocus(bShift);
 return 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-3' - sc/source

2019-07-24 Thread Miklos Vajna (via logerrit)
 sc/source/ui/drawfunc/futext3.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit f5f894e1608a75dffc07ddb3644b566fee1b6848
Author: Miklos Vajna 
AuthorDate: Mon Jul 22 13:58:57 2019 +0200
Commit: Caolán McNamara 
CommitDate: Wed Jul 24 21:35:47 2019 +0200

tdf#106000 sc ui: fix missing invalidation when cancelling note creation

Regression from commit dca01def7885ad69cf66edd75cf8207a5adb64f9
(refactor ListBox/ComboBox to use RenderContext, 2015-05-07),
invalidating the area of note anchors worked like this in the past:

- user ended text edit of a new, empty comment
- the Calc shell was updated from shape text edit to the tab view, which
  called ImplListBoxWindow::SelectEntry()
- this called ImplPaint(), which invoked maUserDrawHdl (if it was set)
- and at the end this invoked ScViewFunc::UpdateSelectionArea(), all
  triggered by the font name and font size listboxes

So the update of the cell of the former note depended on the presence of
font name/size listboxes, by accident.

This broke, because ImplListBoxWindow::SelectEntry() now calls
Invalidate(), and Paint() calls ImplDoPaint(), which doesn't invoke
maUserDrawHdl anymore. Fix the problem by invalidating the cell
explicitly, so in case the user customizes the toolbar to not have these
listboxes, the behavior is still correct.

Do this in FuText::StopEditMode(), because there we know the position of
the deleted note and that's where we delete the matching SdrCaptionObj
(via the RemoveLastUndoAction()).

(cherry picked from commit d001492faddb0b95356c7744aa4d193aacb38d7d)

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

diff --git a/sc/source/ui/drawfunc/futext3.cxx 
b/sc/source/ui/drawfunc/futext3.cxx
index 5c1d3a6ed00b..cbdcefb7d893 100644
--- a/sc/source/ui/drawfunc/futext3.cxx
+++ b/sc/source/ui/drawfunc/futext3.cxx
@@ -157,6 +157,11 @@ void FuText::StopEditMode()
 if( bNewNote && bDeleteNote )
 {
 pUndoMgr->RemoveLastUndoAction();
+
+// Make sure the former area of the note anchor is invalidated.
+ScRangeList aRangeList(aNotePos);
+ScMarkData aMarkData(aRangeList);
+rViewShell.UpdateSelectionArea(aMarkData);
 }
 else if( bNewNote || bDeleteNote )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-18 Thread Noel Grandin (via logerrit)
 sc/source/ui/Accessibility/AccessibleDocument.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 4d285cd1dd8155ca41e5f3b94dbe4142bff8972d
Author: Noel Grandin 
AuthorDate: Wed Jul 17 12:54:05 2019 +0200
Commit: Christian Lohmaier 
CommitDate: Thu Jul 18 12:05:21 2019 +0200

fix "tdf#119388 calc, slow removing column, improve ScChildrenShapes"

forgot to add the code to actually update the map, which would be bad
for accessibility

Change-Id: I5d93dd84649ce27a37c9035622f94fff3237b778
Reviewed-on: https://gerrit.libreoffice.org/75773
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit aab10bb21f230a0d0d6acf59ccab50dd3c2c3d0a)
Reviewed-on: https://gerrit.libreoffice.org/75819

diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index f293dbe95928..e909c5f3a2be 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1181,6 +1181,7 @@ void ScChildrenShapes::AddShape(const 
uno::Reference& xShape, b
 ScAccessibleShapeData* pShape = new ScAccessibleShapeData();
 pShape->xShape = xShape;
 SortedShapes::iterator aNewItr = maZOrderedShapes.insert(aFindItr, 
pShape);
+maShapesMap[xShape] = pShape;
 SetAnchor(xShape, pShape);
 
 uno::Reference< beans::XPropertySet > xShapeProp(xShape, 
uno::UNO_QUERY);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-18 Thread Caolán McNamara (via logerrit)
 sc/source/filter/excel/xecontent.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 778359cceebb5aa60db05a44106868e855b6fcfc
Author: Caolán McNamara 
AuthorDate: Wed Jul 17 09:06:39 2019 +0100
Commit: Christian Lohmaier 
CommitDate: Thu Jul 18 12:03:32 2019 +0200

crashtesting: assert on export of fdo63407-3.ods to xls

since...

commit 3cdc1b35b9d86bcfa1277e3e94925ae7b18b8fde
Date:   Tue Jul 2 10:07:24 2019 +0200

tdf#126177 XLSX export: fix hyperlinks to documents

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

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index 3237ff1fca75..6cdd0ad7ad27 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -447,7 +447,7 @@ XclExpHyperlink::XclExpHyperlink( const XclExpRoot& rRoot, 
const SvxURLField& rU
 mnFlags |= EXC_HLINK_MARK;
 
 OUString location = XclXmlUtils::ToOUString(*mxTextMark);
-if (msTarget.endsWith(location))
+if (!location.isEmpty() && msTarget.endsWith("#" + location))
 msTarget = msTarget.copy(0, msTarget.getLength() - 
location.getLength() - 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-3' - sc/source

2019-07-16 Thread Xisco Fauli (via logerrit)
 sc/source/ui/view/gridwin.cxx |6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 5f48428533e928868c11ddd00cc449a54d0cdfd9
Author: Xisco Fauli 
AuthorDate: Tue Jul 9 15:35:03 2019 +0200
Commit: Xisco Faulí 
CommitDate: Wed Jul 17 00:36:43 2019 +0200

tdf#126306: ignore Top10, Empty and NonEmpty in fix for tdf#117276

Regression from 4e7e3670c31329d60f5cc782abc4568c2aba33a7

Change-Id: I034f4f087580aa7c54b92909736af712047251a6
Reviewed-on: https://gerrit.libreoffice.org/75304
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 9bd7e2cdf7d2b247ae99a2ce71449d9f265032d1)
Reviewed-on: https://gerrit.libreoffice.org/75732

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 178db0157efb..1d573e977c50 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -805,9 +805,11 @@ void ScGridWindow::UpdateAutoFilterFromMenu(AutoFilterMode 
eMode)
 pViewData->GetDispatcher().Execute(SID_FILTER, 
SfxCallMode::SLOT|SfxCallMode::RECORD);
 return;
 }
-
-// do not recreate auto-filter rules if there is no any changes from the 
user
+if (eMode != AutoFilterMode::Top10
+&& eMode != AutoFilterMode::Empty
+&& eMode != AutoFilterMode::NonEmpty)
 {
+// do not recreate auto-filter rules if there is no any changes from 
the user
 ScCheckListMenuWindow::ResultType aResult;
 mpAutoFilterPopup->getResult(aResult);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-07-12 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/externalrefmgr.cxx |   52 ---
 1 file changed, 34 insertions(+), 18 deletions(-)

New commits:
commit c357d5fbb0f2191577a1eae0a03f68e4cf51e0ba
Author: Eike Rathke 
AuthorDate: Thu Jul 11 15:50:07 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri Jul 12 13:55:03 2019 +0200

Postpone loading of all external references, including INDIRECT()

... which can be constructed with an arbitrary URI text string not
an svExternal* token type, until link updates are allowed.

Change-Id: I2ce4de415ff99ace04c083c36c1383d76a4ef40d
Reviewed-on: https://gerrit.libreoffice.org/75422
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit b824b23860b2cf533d4f2428d4a750bd72576181)
Reviewed-on: https://gerrit.libreoffice.org/75432
Reviewed-by: Mike Kaganski 

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index f53c93c3cf22..61ea86d3c93b 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -132,11 +132,12 @@ struct UpdateFormulaCell
 {
 void operator() (ScFormulaCell* pCell) const
 {
-// Check to make sure the cell really contains ocExternalRef.
+// Check to make sure the cell really contains svExternal*.
 // External names, external cell and range references all have a
-// ocExternalRef token.
+// token of svExternal*. Additionally check for INDIRECT() that can be
+// called with any constructed URI string.
 ScTokenArray* pCode = pCell->GetCode();
-if (!pCode->HasExternalRef())
+if (!pCode->HasExternalRef() && !pCode->HasOpCode(ocIndirect))
 return;
 
 if (pCode->GetCodeError() != FormulaError::NONE)
@@ -1619,6 +1620,17 @@ static std::unique_ptr 
lcl_fillEmptyMatrix(const ScRange& rRange)
 return pArray;
 }
 
+namespace {
+bool isLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+if (!pDocShell)
+return false;
+
+return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+}
+
 ScExternalRefManager::ScExternalRefManager(ScDocument* pDoc) :
 mpDoc(pDoc),
 mbInReferenceMarking(false),
@@ -1907,8 +1919,17 @@ ScExternalRefCache::TokenRef 
ScExternalRefManager::getSingleRefToken(
 pSrcDoc = getSrcDocument(nFileId);
 if (!pSrcDoc)
 {
-// Source document not reachable.  Throw a reference error.
-pToken.reset(new FormulaErrorToken(FormulaError::NoRef));
+// Source document not reachable.
+if (!isLinkUpdateAllowedInDoc(*mpDoc))
+{
+// Indicate with specific error.
+pToken.reset(new 
FormulaErrorToken(FormulaError::LinkFormulaNeedingCheck));
+}
+else
+{
+// Throw a reference error.
+pToken.reset(new FormulaErrorToken(FormulaError::NoRef));
+}
 return pToken;
 }
 
@@ -2115,15 +2136,6 @@ void insertRefCellByIterator(
 }
 }
 
-bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
-{
-SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
-if (!pDocShell)
-return false;
-
-return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
-}
-
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& 
rCell)
@@ -2330,8 +2342,8 @@ ScDocument* 
ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
 if (!pFileName)
 return nullptr;
 
-// Do not load document until it was allowed
-if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+// Do not load document until it was allowed.
+if (!isLinkUpdateAllowedInDoc(*mpDoc))
 return nullptr;
 
 ScDocument* pSrcDoc = nullptr;
@@ -2440,6 +2452,10 @@ SfxObjectShellRef 
ScExternalRefManager::loadSrcDocument(sal_uInt16 nFileId, OUSt
 if (!isFileLoadable(aFile))
 return nullptr;
 
+// Do not load document until it was allowed.
+if (!isLinkUpdateAllowedInDoc(*mpDoc))
+return nullptr;
+
 OUString aOptions = pFileData->maFilterOptions;
 if ( !pFileData->maFilterName.isEmpty() )
 rFilter = pFileData->maFilterName;  // don't overwrite stored 
filter with guessed filter
@@ -2578,9 +2594,9 @@ void ScExternalRefManager::maybeLinkExternalFile( 
sal_uInt16 nFileId, bool bDefe
 aOptions = pFileData->maFilterOptions;
 }
 
-// Filter detection may access external links; defer it until we are 
allowed
+// Filter detection may access external links; defer it until we are 
allowed.
 if (!bDeferFilterDetection)
-bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+bDeferFilterDetection = !isLinkUpdateAllowedInDoc(*mpDoc);
 
 // If a filter was already set (for example, loading the cached table),
 // don't call GetFilterName which has to access the source file.

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

2019-07-10 Thread Mike Kaganski (via logerrit)
 sc/source/ui/docshell/externalrefmgr.cxx |   23 ---
 1 file changed, 16 insertions(+), 7 deletions(-)

New commits:
commit 97585591eea9fa7af20c051d2ffb95240ce3d8c6
Author: Mike Kaganski 
AuthorDate: Tue Jul 9 18:44:42 2019 +1000
Commit: Eike Rathke 
CommitDate: Wed Jul 10 15:05:18 2019 +0200

Postpone filter detection until link update is allowed

Change-Id: I85b2185e550f2a133ceb485241ef513b40593e34
Reviewed-on: https://gerrit.libreoffice.org/75301
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 03c708bf085f91480c014d7fa31e7a317b2c7b8f)
Reviewed-on: https://gerrit.libreoffice.org/75330
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/docshell/externalrefmgr.cxx 
b/sc/source/ui/docshell/externalrefmgr.cxx
index 36b4aac3fc79..f53c93c3cf22 100644
--- a/sc/source/ui/docshell/externalrefmgr.cxx
+++ b/sc/source/ui/docshell/externalrefmgr.cxx
@@ -2115,6 +2115,15 @@ void insertRefCellByIterator(
 }
 }
 
+bool IsLinkUpdateAllowedInDoc(const ScDocument& rDoc)
+{
+SfxObjectShell* pDocShell = rDoc.GetDocumentShell();
+if (!pDocShell)
+return false;
+
+return pDocShell->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate();
+}
+
 }
 
 void ScExternalRefManager::insertRefCell(sal_uInt16 nFileId, const ScAddress& 
rCell)
@@ -2322,13 +2331,8 @@ ScDocument* 
ScExternalRefManager::getInMemorySrcDocument(sal_uInt16 nFileId)
 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;
-}
+if (!IsLinkUpdateAllowedInDoc(*mpDoc))
+return nullptr;
 
 ScDocument* pSrcDoc = nullptr;
 ScDocShell* pShell = 
static_cast(SfxObjectShell::GetFirst(checkSfxObjectShell,
 false));
@@ -2573,6 +2577,11 @@ void ScExternalRefManager::maybeLinkExternalFile( 
sal_uInt16 nFileId, bool bDefe
 aFilter = pFileData->maFilterName;
 aOptions = pFileData->maFilterOptions;
 }
+
+// Filter detection may access external links; defer it until we are 
allowed
+if (!bDeferFilterDetection)
+bDeferFilterDetection = !IsLinkUpdateAllowedInDoc(*mpDoc);
+
 // If a filter was already set (for example, loading the cached table),
 // don't call GetFilterName which has to access the source file.
 // If filter detection is deferred, the next successful loadSrcDocument()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-28 Thread Noel Grandin (via logerrit)
 sc/source/ui/Accessibility/AccessibleDocument.cxx |  104 +++---
 1 file changed, 71 insertions(+), 33 deletions(-)

New commits:
commit d28b76a7fd88dcd9d8d601ba1d4b31d2d91b96ac
Author: Noel Grandin 
AuthorDate: Wed Jun 26 09:15:34 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Jun 28 15:08:57 2019 +0200

tdf#119388 calc, slow removing column, improve ScChildrenShapes

sorting the child list of shapes when we have a large list is expensive,
especially when we do it on every Notify call, so defer that.

Change-Id: I54e5807b697feb0ed578631e470f8d6fdd884cef
Reviewed-on: https://gerrit.libreoffice.org/74726
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 8fb35f06ddec551a6de887ce269d9196d9fe2337)
Reviewed-on: https://gerrit.libreoffice.org/74839

diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index b7876c1a6f61..f293dbe95928 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -241,8 +241,11 @@ public:
 void VisAreaChanged() const;
 private:
 typedef std::vector SortedShapes;
+typedef std::unordered_map, 
ScAccessibleShapeData*> ShapesMap;
 
 mutable SortedShapes maZOrderedShapes; // a null pointer represents the 
sheet in the correct order
+mutable ShapesMap maShapesMap;
+mutable bool mbShapesNeedSorting; // set if maZOrderedShapes needs sorting
 
 mutable ::accessibility::AccessibleShapeTreeInfo maShapeTreeInfo;
 mutable css::uno::Reference 
xSelectionSupplier;
@@ -257,7 +260,6 @@ private:
 
 boost::optional GetAnchor(const 
uno::Reference& xShape) const;
 uno::Reference GetRelationSet(const 
ScAccessibleShapeData* pData) const;
-void CheckWhetherAnchorChanged(const uno::Reference& 
xShape) const;
 void SetAnchor(const uno::Reference& xShape, 
ScAccessibleShapeData* pData) const;
 void AddShape(const uno::Reference& xShape, bool 
bCommitChange) const;
 void RemoveShape(const uno::Reference& xShape) const;
@@ -373,8 +375,10 @@ void ScChildrenShapes::Notify(SfxBroadcaster&, const 
SfxHint& rHint)
 uno::Reference xShape (pObj->getUnoShape(), 
uno::UNO_QUERY);
 if (xShape.is())
 {
-std::sort(maZOrderedShapes.begin(), 
maZOrderedShapes.end(), ScShapeDataLess()); // sort, because the z index or 
layer could be changed
-CheckWhetherAnchorChanged(xShape);
+mbShapesNeedSorting = true; // sort, because the z index 
or layer could be changed
+auto it = maShapesMap.find(xShape);
+if (it != maShapesMap.end())
+SetAnchor(xShape, it->second);
 }
 }
 break;
@@ -417,13 +421,12 @@ bool ScChildrenShapes::ReplaceChild 
(::accessibility::AccessibleShape* pCurrentC
 if (pReplacement.is())
 {
 OSL_ENSURE(pCurrentChild->GetXShape().get() == 
pReplacement->GetXShape().get(), "XShape changes and should be inserted 
sorted");
-SortedShapes::iterator aItr;
-
-if (FindShape(pCurrentChild->GetXShape(), aItr) || (aItr != 
maZOrderedShapes.end() && (*aItr)))
+auto it = maShapesMap.find(pCurrentChild->GetXShape());
+if (it != maShapesMap.end())
 {
-if ((*aItr)->pAccShape.is())
+if (it->second->pAccShape.is())
 {
-OSL_ENSURE((*aItr)->pAccShape == pCurrentChild, "wrong child 
found");
+OSL_ENSURE(it->second->pAccShape == pCurrentChild, "wrong 
child found");
 AccessibleEventObject aEvent;
 aEvent.EventId = AccessibleEventId::CHILD;
 aEvent.Source = uno::Reference< XAccessibleContext 
>(mpAccessibleDocument);
@@ -433,7 +436,7 @@ bool ScChildrenShapes::ReplaceChild 
(::accessibility::AccessibleShape* pCurrentC
 
 pCurrentChild->dispose();
 }
-(*aItr)->pAccShape = pReplacement;
+it->second->pAccShape = pReplacement;
 AccessibleEventObject aEvent;
 aEvent.EventId = AccessibleEventId::CHILD;
 aEvent.Source = uno::Reference< XAccessibleContext 
>(mpAccessibleDocument);
@@ -448,10 +451,9 @@ bool ScChildrenShapes::ReplaceChild 
(::accessibility::AccessibleShape* pCurrentC
 
 ::accessibility::AccessibleControlShape * 
ScChildrenShapes::GetAccControlShapeFromModel(css::beans::XPropertySet* pSet)
 {
-sal_Int32 count = GetCount();
-for (sal_Int32 index=0;index 
pAccShape(pShape->pAccShape);
@@ -469,17 +471,14 @@ bool ScChildrenShapes::ReplaceChild 
(::accessibility::AccessibleShape* pCurrentC
 css::uno::Reference < css::accessibility::XAccessible >
 ScChildrenShapes::GetAccessibleCaption (const css::uno::Reference < 
css::drawing::XShape>& xShape)
 {
-sal_Int32 count = GetCount();
-for 

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

2019-06-27 Thread Eike Rathke (via logerrit)
 sc/source/core/data/column3.cxx |   22 +-
 1 file changed, 17 insertions(+), 5 deletions(-)

New commits:
commit f800f73d8d115e05134fd3cd25573e2d5acaddd3
Author: Eike Rathke 
AuthorDate: Thu Jun 27 14:12:32 2019 +0200
Commit: Eike Rathke 
CommitDate: Thu Jun 27 17:10:08 2019 +0200

Resolves: tdf#126116 keep original date format if detected type is identical

Regression from

commit 478e051f4ea13b15120fdf74faf94a6c2cfcb50c
CommitDate: Tue May 21 15:35:07 2019 +0200

Resolves: tdf#125109 prefer edit format's acceptance patterns and 
YMD order

Change-Id: If1240f75ca7c4d46c156966a72b6a98c83448770
Reviewed-on: https://gerrit.libreoffice.org/74803
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit e6a1bbe6690474e752416c81e1ca8c82b2843539)
Reviewed-on: https://gerrit.libreoffice.org/74806

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 26096767906e..96a077b410c4 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -2072,11 +2072,23 @@ bool ScColumn::ParseString(
 if (!bIsNumberFormat)
 break;
 
-// convert back to the original language if a built-in format 
was detected
-if (!pOldFormat)
-pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex );
-if ( pOldFormat )
-nIndex = 
aParam.mpNumFormatter->GetFormatForLanguageIfBuiltIn( nIndex, 
pOldFormat->GetLanguage() );
+// If we have bForceFormatDate, the pOldFormat was/is of
+// nOldIndex date(+time) type already, if detected type is
+// compatible keep the original format.
+if (bForceFormatDate && SvNumberFormatter::IsCompatible(
+eNumFormatType, aParam.mpNumFormatter->GetType( 
nIndex)))
+{
+nIndex = nOldIndex;
+}
+else
+{
+// convert back to the original language if a built-in 
format was detected
+if (!pOldFormat)
+pOldFormat = aParam.mpNumFormatter->GetEntry( 
nOldIndex );
+if (pOldFormat)
+nIndex = 
aParam.mpNumFormatter->GetFormatForLanguageIfBuiltIn(
+nIndex, pOldFormat->GetLanguage());
+}
 
 rCell.set(nVal);
 if ( nIndex != nOldIndex)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-26 Thread Eike Rathke (via logerrit)
 sc/source/core/data/conditio.cxx |   14 +++---
 1 file changed, 11 insertions(+), 3 deletions(-)

New commits:
commit 7b0f65cbfa3ef0b3cb698247429f445574ba3a64
Author: Eike Rathke 
AuthorDate: Wed Jun 26 18:33:07 2019 +0200
Commit: Eike Rathke 
CommitDate: Thu Jun 27 01:39:48 2019 +0200

Resolves: tdf#117899 update condition entries' source position on inter-copy

Otherwise in the bug case it resulted in a source position
pointing to the second sheet, which didn't exist in the clipboard
target and thus writing the ODF format resulted in an empty
base-cell-address which when read was source position 0,0,0 and
with the [.$E3] reference yielded a relative row+2 offset instead
of row+0 for a 2,0,0 base cell source position, effectively on row
3 then referencing $E5 instead of $E3.

Change-Id: I4d7b373aa69363bc5eeefc3987087972fcad1393
Reviewed-on: https://gerrit.libreoffice.org/74747
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 50cd4c73eba1ae2802a4897410bd3f75516d0dcb)
Reviewed-on: https://gerrit.libreoffice.org/74764

diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx
index ae29cb2d8dd3..fc91c6d343e7 100644
--- a/sc/source/core/data/conditio.cxx
+++ b/sc/source/core/data/conditio.cxx
@@ -1873,13 +1873,21 @@ void ScConditionalFormat::CompileXML()
 
 void ScConditionalFormat::UpdateReference( sc::RefUpdateContext& rCxt, bool 
bCopyAsMove )
 {
-for(auto& rxEntry : maEntries)
-rxEntry->UpdateReference(rCxt);
-
 if (rCxt.meMode == URM_COPY && bCopyAsMove)
+{
+// ScConditionEntry::UpdateReference() obtains its aSrcPos from
+// maRanges and does not update it on URM_COPY, but it's needed later
+// for the moved position, so update maRanges beforehand.
 maRanges.UpdateReference(URM_MOVE, pDoc, rCxt.maRange, 
rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta);
+for (auto& rxEntry : maEntries)
+rxEntry->UpdateReference(rCxt);
+}
 else
+{
+for (auto& rxEntry : maEntries)
+rxEntry->UpdateReference(rCxt);
 maRanges.UpdateReference(rCxt.meMode, pDoc, rCxt.maRange, 
rCxt.mnColDelta, rCxt.mnRowDelta, rCxt.mnTabDelta);
+}
 }
 
 void ScConditionalFormat::InsertRow(SCTAB nTab, SCCOL nColStart, SCCOL 
nColEnd, SCROW nRowPos, SCSIZE nSize)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-26 Thread Dennis Francis (via logerrit)
 sc/source/core/data/document.cxx |6 --
 sc/source/core/data/table2.cxx   |4 
 2 files changed, 4 insertions(+), 6 deletions(-)

New commits:
commit e4553dbf3d4c47c10326c9d2f0bedfe69922d3d4
Author: Dennis Francis 
AuthorDate: Sun Jun 23 21:15:18 2019 +0530
Commit: Xisco Faulí 
CommitDate: Wed Jun 26 14:21:18 2019 +0200

tdf#125661 : Move the delayed-grouping logic...

introduced in commit

169a1b542165f3444791fd6e672d56d3fe48bd66
avoid possible expensive repetitive formula-group
changes (tdf#102364)

to ScTable::CopyToTable() from ScDocument::CopyToDocument()

Rationale :
In tdf#125661 a delayed-grouping is needed but
ScDocument::CopyTab() is directly called which makes it
skip the delayed-grouping logic in ScDocument::CopyToDocument().
One option is to clone the delayed-grouping logic to CopyTab() too.
But doing this triggers the assert

!pDoc->IsDelayedFormulaGrouping() in
bool ScBroadcastAreaSlot::StartListeningArea()

when running the unit test testCondCopyPasteSheet() in
ucalc_condformat.cxx. This seems to be due to calling
ScTable::CopyConditionalFormat() towards the end in
ScTable::CopyToTable(). So having delayed-grouping
"block" that contains a call(s) to ScTable::CopyToTable() is
not safe. So lets move this inside ScTable::CopyToTable()
covering just the ScColumn::CopyToColumn() calls.

With this patch, sheet copy on the bug-document completes
in about 1m40s.

Change-Id: I5272f495aadab5f93f2698aba11cf2701a604c23
Reviewed-on: https://gerrit.libreoffice.org/74607
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 46c8ebe3d352c39bbba1a8099717fbeba384bd1a)
Reviewed-on: https://gerrit.libreoffice.org/74734
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 106ca902534e..3a65ae04aad7 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2110,11 +2110,6 @@ void ScDocument::CopyToDocument(const ScRange& rRange,
 
 sc::AutoCalcSwitch aACSwitch(rDestDoc, false); // avoid multiple 
calculations
 
-// tdf#102364 - in some pathological cases CopyToDocument() replacing 
cells with new cells
-// can lead to repetitive splitting and rejoining of the same formula 
group, which can get
-// quadratically expensive with large groups. So do the grouping just once 
at the end.
-sc::DelayFormulaGroupingSwitch delayGrouping( rDestDoc, true );
-
 sc::CopyToDocContext aCxt(rDestDoc);
 aCxt.setStartListening(false);
 
@@ -2132,7 +2127,6 @@ void ScDocument::CopyToDocument(const ScRange& rRange,
 /*bGlobalNamesToLocal*/false, /*bCopyCaptions*/true);
 }
 
-delayGrouping.reset(); // groups need to be updated before setting up 
listeners
 rDestDoc.StartAllListeners(aNewRange);
 }
 
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 27127d42d08a..2aee672f8ad2 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1128,6 +1128,10 @@ void ScTable::CopyToTable(
 {
 InsertDeleteFlags nTempFlags( nFlags &
 ~InsertDeleteFlags( InsertDeleteFlags::NOTE | 
InsertDeleteFlags::ADDNOTES));
+// tdf#102364 - in some pathological cases CopyToTable() replacing 
cells with new cells
+// can lead to repetitive splitting and rejoining of the same formula 
group, which can get
+// quadratically expensive with large groups. So do the grouping just 
once at the end.
+sc::DelayFormulaGroupingSwitch delayGrouping( *pDestTab->pDocument, 
true );
 for (SCCOL i = nCol1; i <= ClampToAllocatedColumns(nCol2); i++)
 aCol[i].CopyToColumn(rCxt, nRow1, nRow2, bIsUndoDoc ? nFlags : 
nTempFlags, bMarked,
  pDestTab->CreateColumnIfNotExists(i), 
pMarkData, bAsLink, bGlobalNamesToLocal);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-21 Thread Caolán McNamara (via logerrit)
 sc/source/ui/Accessibility/AccessibleDocument.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 49c92a3b46b8f4c3303ea17a508f91a0c87d54f6
Author: Caolán McNamara 
AuthorDate: Fri Jun 21 14:56:19 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 21 21:42:28 2019 +0200

remove then dispose, not dispose then remove

asserts seen in inline spelling in calc otherwise

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

diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index f9ea7367a6bb..b7876c1a6f61 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1495,6 +1495,10 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, 
const SfxHint& rHint )
 if (mpTempAccEdit)
 {
 mpTempAccEdit->LostFocus();
+}
+RemoveChild(mxTempAcc, true);
+if (mpTempAccEdit)
+{
 // tdf#125982 a11y use-after-free of editengine by
 // ScAccessibleEditObjectTextData living past the
 // the editengine of the editview passed in above
@@ -1502,7 +1506,6 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, 
const SfxHint& rHint )
 mpTempAccEdit->dispose();
 mpTempAccEdit = nullptr;
 }
-RemoveChild(mxTempAcc, true);
 if (mpAccessibleSpreadsheet.is() && mpViewShell && 
mpViewShell->IsActive())
 mpAccessibleSpreadsheet->GotFocus();
 else if( mpViewShell && mpViewShell->IsActive())
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-21 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/dociter.cxx |   18 +-
 1 file changed, 13 insertions(+), 5 deletions(-)

New commits:
commit b9518dc46fdc6bd4e3c656e51bdc9c54f99f80fa
Author: Caolán McNamara 
AuthorDate: Thu May 9 14:08:44 2019 +0100
Commit: Caolán McNamara 
CommitDate: Fri Jun 21 14:35:47 2019 +0200

crashtesting: failure importing gnome545630-1.xlsx

with bt of...

 #18 0x7fb7734e3a9b in ScColContainer::operator[] (this=0x6571840, 
nIndex=234) at sc/inc/colcontainer.hxx:44
 #19 0x7fb77352daf7 in ScValueIterator::GetFirst (this=0x7fb7629205b0, 
rValue=@0x7fb762920320: 0, rErr=@0x7fb762920570: NONE)
 at sc/source/core/data/dociter.cxx:295
 #20 0x7fb773a04130 in ScInterpreter::GetStVarParams (this=0x35d30d0, 
bTextAsZero=false, VarResult=
 0x7fb773a04dfb ::_FUN(double, 
size_t)>) at sc/source/core/tool/interpr1.cxx:4040
 #21 0x7fb773a04e85 in ScInterpreter::ScStDev (this=0x35d30d0, 
bTextAsZero=false) at sc/source/core/tool/interpr1.cxx:4180
 #22 0x7fb773a7152d in ScInterpreter::Interpret (this=0x35d30d0) at 
sc/source/core/tool/interpr4.cxx:4142
 #23 0x7fb77378cbbf in ScFormulaCell::InterpretTail (this=0x6dcf7a0, 
rContext=..., eTailParam=ScFormulaCell::SCITP_NORMAL)
 at sc/source/core/data/formulacell.cxx:1905
 #24 0x7fb77378b8ab in ScFormulaCell::Interpret (this=0x6dcf7a0, 
nStartOffset=-1, nEndOffset=-1)
 at sc/source/core/data/formulacell.cxx:1611
 #25 0x7fb7733f82fe in (anonymous 
namespace)::CalcAllHandler::operator() (this=0x7fb762920e67, pCell=0x6dcf7a0)
 #26 0x7fb773404240 in 
sc::EachElem, 
__gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator > >, 
std::__debug::vector >, 
mdds::detail::mtv::iterator_value_node, (anonymous namespace)::CalcAllHandler> 
(rNode=..., rFuncElem=...)
 at sc/inc/mtvfunctions.hxx:120
 #27 0x7fb773400dd6 in 
sc::ProcessElements1, mdds::mtv::noncopyable_managed_element_block<53, 
EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, 
ScFormulaCell> >, sc::CellStoreEvent>, 
mdds::mtv::noncopyable_managed_element_block<54, ScFormulaCell>, (anonymous 
namespace)::CalcAllHandler, sc::FuncElseNoOp > (rStore=..., 
rFuncElem=...,
 rFuncElse=...) at sc/inc/mtvfunctions.hxx:310
 #28 0x7fb7733fd4df in sc::ProcessFormula<(anonymous 
namespace)::CalcAllHandler> (rStore=..., rFunc=...)
 at sc/inc/mtvcellfunc.hxx:24
 #29 0x7fb7733faf4f in ScColumn::CalcAll (this=0x6340910) at 
sc/source/core/data/column.cxx:3482
 #30 0x7fb77384a213 in ScTable::CalcAll (this=0x6571840) at 
sc/source/core/data/table2.cxx:1882
 #31 0x7fb7735cf141 in ScDocument::CalcAll (this=0x6241ee0) at 
sc/source/core/data/document.cxx:3955
 #32 0x7fb774062aeb in ScDocShell::DoHardRecalc (this=0x6241e80) at 
sc/source/ui/docshell/docsh4.cxx:1379
 #33 0x7fb77437a66c in ScModelObj::calculateAll (this=0x3654970) at 
sc/source/ui/unoobj/docuno.cxx:2254
 #34 0x7fb77b1099ac in gcc3::callVirtualMethod (pThis=0x3654af8, 
nVtableIndex=4, pRegisterReturn=0x0, pReturnTypeRef=0x1ccf710, 
bSimpleReturn=true,
pStack=0x7fb7629212f0, nStack=0, pGPR=0x7fb762921420, 
pFPR=0x7fb762921450)
at bridges/source/cpp_uno/gcc3_linux_x86-64/callvirtualmethod.cxx:133

Change-Id: Ica4c9e9860768d9c84be89be36644126095f62f3
Reviewed-on: https://gerrit.libreoffice.org/74492
Tested-by: Jenkins
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 be38db769be4..9772d7e82073 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -152,15 +152,17 @@ bool ScValueIterator::GetThis(double& rValue, 
FormulaError& rErr)
 {
 while (true)
 {
-bool bNextColumn = maCurPos.first == mpCells->end();
+bool bNextColumn = !mpCells || maCurPos.first == mpCells->end();
 if (!bNextColumn)
 {
 if (GetRow() > maEndPos.Row())
 bNextColumn = true;
 }
 
-ScColumn* pCol = &(pDoc->maTabs[mnTab])->aCol[mnCol];
-if (bNextColumn)
+ScColumn* pCol;
+if (!bNextColumn)
+pCol = &(pDoc->maTabs[mnTab])->aCol[mnCol];
+else
 {
 // Find the next available column.
 do
@@ -292,8 +294,14 @@ bool ScValueIterator::GetFirst(double& rValue, 
FormulaError& rErr)
 pAttrArray = nullptr;
 nAttrEndRow = 0;
 
-mpCells = >aCol[maStartPos.Col()].maCells;
-maCurPos = mpCells->position(maStartPos.Row());
+auto nCol = maStartPos.Col();
+if (nCol < pTab->GetAllocatedColumnsCount())
+{
+mpCells = >aCol[nCol].maCells;
+maCurPos = mpCells->position(maStartPos.Row());
+}
+else
+mpCells = nullptr;
 return GetThis(rValue, rErr);
 }
 
___
Libreoffice-commits mailing 

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

2019-06-20 Thread Caolán McNamara (via logerrit)
 sc/source/ui/Accessibility/AccessibleDocument.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit b4e1b145ff9cccd4d91798c5da2e32ffa9b267ec
Author: Caolán McNamara 
AuthorDate: Wed Jun 19 20:45:12 2019 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jun 20 16:15:16 2019 +0200

tdf#125982 a11y use-after-free of editengine

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

diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx 
b/sc/source/ui/Accessibility/AccessibleDocument.cxx
index 565de0e65fec..f9ea7367a6bb 100644
--- a/sc/source/ui/Accessibility/AccessibleDocument.cxx
+++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx
@@ -1493,9 +1493,15 @@ void ScAccessibleDocument::Notify( SfxBroadcaster& rBC, 
const SfxHint& rHint )
 if (mxTempAcc.is())
 {
 if (mpTempAccEdit)
+{
 mpTempAccEdit->LostFocus();
-
-mpTempAccEdit = nullptr;
+// tdf#125982 a11y use-after-free of editengine by
+// ScAccessibleEditObjectTextData living past the
+// the editengine of the editview passed in above
+// in ScAccEnterEditMode
+mpTempAccEdit->dispose();
+mpTempAccEdit = nullptr;
+}
 RemoveChild(mxTempAcc, true);
 if (mpAccessibleSpreadsheet.is() && mpViewShell && 
mpViewShell->IsActive())
 mpAccessibleSpreadsheet->GotFocus();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-20 Thread Caolán McNamara (via logerrit)
 sc/source/ui/docshell/docsh4.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e19cd99e7cc0414ec6fc5bc5844c87d1e80bc03a
Author: Caolán McNamara 
AuthorDate: Thu Jun 20 09:33:10 2019 +0100
Commit: Caolán McNamara 
CommitDate: Thu Jun 20 14:03:54 2019 +0200

dispose on all responses, not just OK

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

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index e2d14daf4220..8d220ec0e3bf 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1862,8 +1862,8 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& 
rCaller,
 
 SetDocumentModified();
 xRequest->Done();
-pDlg->disposeOnce();
 }
+pDlg->disposeOnce();
 });
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-20 Thread Tünde Tóth (via logerrit)
 sc/source/ui/view/gridwin.cxx |   15 ---
 1 file changed, 12 insertions(+), 3 deletions(-)

New commits:
commit 547dfdd56f52e779a795aefc56c78836fdb01ca4
Author: Tünde Tóth 
AuthorDate: Fri Jun 14 11:18:23 2019 +0200
Commit: Xisco Faulí 
CommitDate: Thu Jun 20 13:28:43 2019 +0200

tdf#125309 XLSX editing: fix hyperlink at numeric data

Long Cell-level hyperlink was clickable in neighboring cells.

Change-Id: I3e2a4db170975d997f3fe471188fd0ead593ad6e
Reviewed-on: https://gerrit.libreoffice.org/74033
Reviewed-by: László Németh 
Tested-by: László Németh 
(cherry picked from commit 711ccfbac1ef28fdf03ceea820be8d3e9f8a4009)
Reviewed-on: https://gerrit.libreoffice.org/74420
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index e043cfc4d857..178db0157efb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5252,7 +5252,17 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
 if (sURL.isEmpty())
 pTextObj = aCell.mpFormula->CreateURLObject();
 else
-pTextObj = ScEditUtil::CreateURLObjectFromURL(rDoc, sURL, sURL);
+{
+OUString aRepres = sURL;
+
+// TODO: text content of formatted numbers can be different
+if (aCell.hasNumeric())
+aRepres = OUString::number(aCell.getValue());
+else if (aCell.meType == CELLTYPE_FORMULA)
+aRepres = aCell.mpFormula->GetString().getString();
+
+pTextObj = ScEditUtil::CreateURLObjectFromURL(rDoc, sURL, aRepres);
+}
 
 if (pTextObj)
 pEngine->SetText(*pTextObj);
@@ -5277,8 +5287,7 @@ bool ScGridWindow::GetEditUrl( const Point& rPos,
 // There is one glitch when dealing with a hyperlink cell and
 // the cell content is NUMERIC. This defaults to right aligned and
 // we need to adjust accordingly.
-if (aCell.meType == CELLTYPE_FORMULA && aCell.mpFormula->IsValue() &&
-eHorJust == SvxCellHorJustify::Standard)
+if (aCell.hasNumeric() && eHorJust == SvxCellHorJustify::Standard)
 {
 aLogicEdit.SetRight( aLogicEdit.Left() + nThisColLogic - 1 );
 aLogicEdit.SetLeft(  aLogicEdit.Right() - nTextWidth );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-19 Thread Noel Grandin (via logerrit)
 sc/source/core/data/markmulti.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 2528c62283a834ae44f9d0f34db9493c4957b2d7
Author: Noel Grandin 
AuthorDate: Wed Jun 19 13:11:41 2019 +0200
Commit: Noel Grandin 
CommitDate: Wed Jun 19 15:10:16 2019 +0200

fix memory usage regression when loading files with lots of marks

regression from

commit 3c3a371c799d00475deb13b4c3e0a8860c7e4fb3
Author: Noel Grandin 
Date:   Wed May 15 15:35:51 2019 +0200
tdf#125254 Performance: A spreadsheet opens too slow, part2

without this fix, the file from the above bug chews up more than 16G and
crashes my box. With the fix, it loads, and requires about 2G.

Change-Id: I87063196e56b49eab52e77126347bf8d421b1e0f
Reviewed-on: https://gerrit.libreoffice.org/74352
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 64362b2e10ad5cbe88374bcafa6d5f120d27fe5b)
Reviewed-on: https://gerrit.libreoffice.org/74358

diff --git a/sc/source/core/data/markmulti.cxx 
b/sc/source/core/data/markmulti.cxx
index a4a66933dba6..644dfad21f6c 100644
--- a/sc/source/core/data/markmulti.cxx
+++ b/sc/source/core/data/markmulti.cxx
@@ -277,10 +277,10 @@ void ScMultiSel::Set( ScRangeList const & rList )
 auto & rMarkEntries = aMarkEntriesPerCol[nCol];
 int nEntries = rMarkEntries.size();
 if (nEntries > 1 && nStartRow >= 
rMarkEntries[nEntries-2].nRow+1
-   && nStartRow <= rMarkEntries[nEntries-1].nRow)
+   && nStartRow <= rMarkEntries[nEntries-1].nRow+1)
 {
-// overlaps previous range
-rMarkEntries.back().nRow = nEndRow;
+// overlaps or directly adjacent previous range
+rMarkEntries.back().nRow = std::max(nEndRow, 
rMarkEntries.back().nRow);
 }
 else
 {
@@ -298,7 +298,10 @@ void ScMultiSel::Set( ScRangeList const & rList )
 aMultiSelContainer.resize(nMaxCol+1);
 for (SCCOL nCol = 0; nCol<=nMaxCol; ++nCol)
 if (!aMarkEntriesPerCol[nCol].empty())
+{
 aMultiSelContainer[nCol].Set( aMarkEntriesPerCol[nCol] );
+aMarkEntriesPerCol[nCol].clear(); // reduce peak memory usage
+}
 }
 
 bool ScMultiSel::IsRowMarked( SCROW nRow ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-14 Thread Eike Rathke (via logerrit)
 sc/source/core/data/global.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit e2f7211e9ef70ef9696175e9447edc3e779b3cc6
Author: Eike Rathke 
AuthorDate: Fri Jun 14 21:53:18 2019 +0200
Commit: Eike Rathke 
CommitDate: Fri Jun 14 23:54:46 2019 +0200

Resolves: tdf#124251 do not treat internal "URI" as real path URI

Change-Id: I754704b0a979e8449b7ec799cbda58b14ab17098
Reviewed-on: https://gerrit.libreoffice.org/74067
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit ca08ec9292410c28713fd2d92920a7af09883e97)
Reviewed-on: https://gerrit.libreoffice.org/74069

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index f0a3715f36b0..33e4ffb13eef 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -812,7 +812,14 @@ void ScGlobal::OpenURL(const OUString& rURL, const 
OUString& rTarget)
 }
 
 // Don't fiddle with fragments pointing into current document.
-if (!aUrlName.startsWith("#"))
+// Also don't mess around with a vnd.sun.star.script or service or other
+// internal "URI".
+if (!aUrlName.startsWith("#")
+&& !aUrlName.startsWithIgnoreAsciiCase("vnd.sun.star.script:")
+&& !aUrlName.startsWithIgnoreAsciiCase("macro:")
+&& !aUrlName.startsWithIgnoreAsciiCase("slot:")
+&& !aUrlName.startsWithIgnoreAsciiCase("service:")
+&& !aUrlName.startsWithIgnoreAsciiCase(".uno:"))
 {
 // Any relative reference would fail with "not an absolute URL"
 // error, try to construct an absolute URI with the path relative
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-13 Thread Luboš Luňák (via logerrit)
 sc/source/core/opencl/formulagroupcl.cxx |6 ++
 1 file changed, 2 insertions(+), 4 deletions(-)

New commits:
commit 2a041b97b6452aebb695d564ceb5925c1d525ee0
Author: Luboš Luňák 
AuthorDate: Wed Jun 12 15:51:25 2019 +0200
Commit: Miklos Vajna 
CommitDate: Thu Jun 13 13:39:04 2019 +0200

Intel OpenCL also has broken nan() that ignores the argument

And since whether this works correctly is tested by cl-test.ods,
without this OpenCL gets disabled on Intel machines.

Change-Id: I8d5c9b1298a08f2e2cb6dfdf183f542315372889
Reviewed-on: https://gerrit.libreoffice.org/73887
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 5b6128699dbe94590629c43cc8f78d95f68330bb)
Reviewed-on: https://gerrit.libreoffice.org/73944
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 9c00e4d42490..27c981758b8a 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -51,14 +51,12 @@ static const char* const publicFunc =
  "\n"
  "double CreateDoubleError(ulong nErr)\n"
  "{\n"
- // nVidia OpenCL, at least on Linux, seems to ignore the argument to nan(),
+ // At least nVidia on Linux and Intel on Windows seem to ignore the argument 
to nan(),
  // so using that would not propagate the type of error, work that around
  // by directly constructing the proper IEEE double NaN value
  // TODO: maybe use a better way to detect such systems?
- "#ifdef cl_nv_pragma_unroll\n"
  "return as_double(0x7FF8+nErr);\n"
- "#endif\n"
- "return nan(nErr);\n"
+// "return nan(nErr);\n"
  "}\n"
  "\n"
  "uint GetDoubleErrorValue(double fVal)\n"
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-13 Thread Miklos Vajna (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 3028480ca720283bdab2878d348c29698d0ace16
Author: Miklos Vajna 
AuthorDate: Wed Jun 12 10:35:43 2019 +0200
Commit: Miklos Vajna 
CommitDate: Thu Jun 13 08:44:02 2019 +0200

tdf#125791 sc autofilter popup: make sure menu item text uses the label font

It happened that the first and subsequent paints used a different font
size, standardize on the label font.

E.g. the linux gen backend used either 11 or 12 pt font height, now it
always uses 12pt, matching the gtk3 behavior. (No cutoff of text with
Windows gdi 125% text size this way, either.)

(cherry picked from commit 47dbbe214641b9a28871d0c82f71b2afb9c5943c)

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

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 8383738967a5..2b74bfd3d605 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -360,9 +360,14 @@ void 
ScMenuFloatingWindow::drawMenuItem(vcl::RenderContext& rRenderContext, size
 DecorationView aDecoView();
 long const nXOffset = 5;
 long nYOffset = (aSize.Height() - maLabelFont.GetFontHeight())/2;
+
+// Make sure the label font is used for the menu item text.
+rRenderContext.Push(PushFlags::FONT);
+rRenderContext.SetFont(maLabelFont);
 rRenderContext. DrawCtrlText(Point(aPos.X()+nXOffset, aPos.Y() + 
nYOffset), maMenuItems[nPos].maText, 0,
  maMenuItems[nPos].maText.getLength(),
  maMenuItems[nPos].mbEnabled ? 
DrawTextFlags::Mnemonic : DrawTextFlags::Disable);
+rRenderContext.Pop();
 
 if (maMenuItems[nPos].mpSubMenuWin)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-04 Thread Miklos Vajna (via logerrit)
 sc/source/ui/cctrl/checklistmenu.cxx |3 +++
 sc/source/ui/view/gridwin.cxx|6 ++
 2 files changed, 9 insertions(+)

New commits:
commit a92dd896b003ded7f5c4347a8370624ee9d77dbd
Author: Miklos Vajna 
AuthorDate: Tue Jun 4 14:11:33 2019 +0200
Commit: Miklos Vajna 
CommitDate: Tue Jun 4 19:39:57 2019 +0200

tdf#101086 sc autofilter popup: avoid flicker

Regression from commit a4cb27f61376d8f2d8faed0022c291af68d437bd
(refactor ScMenuFloatingWindow to use RenderContext, 2015-05-14), the
problem was that the change had two effects:

1) It removed incremental rendering that now causes flicker.

2) It added support for painting into a rendercontext, not on the window
itself.

Given that here a hierarchy of widgets have to be painted at once (to
avoid flicker), use vcl::Window::RequestDoubleBuffering() instead of the
much simpler vcl::BufferDevice.

This improves the situation on Windows, but explicitly blacklist the
focus rectangle case (gtk3) which is currently not compatible with this
higher level double-buffering (and there we already have lower-level
double-buffering anyway, similar to OpenGL).

(cherry picked from commit 4dadbff74eff5f8ad00df99c659f8a2b914e09a1)

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

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index e735ad62f7e6..8383738967a5 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1164,6 +1164,9 @@ void ScCheckListMenuWindow::selectCurrentMemberOnly(bool 
bSet)
 if (!pEntry)
 return;
 maChecks->CheckEntry(pEntry, bSet );
+
+// Make sure all checkboxes are invalidated.
+Invalidate();
 }
 
 IMPL_LINK( ScCheckListMenuWindow, ButtonHdl, Button*, pBtn, void )
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index ea51223772ec..e043cfc4d857 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -645,6 +645,12 @@ void ScGridWindow::LaunchAutoFilterMenu(SCCOL nCol, SCROW 
nRow)
 
 mpAutoFilterPopup.disposeAndClear();
 mpAutoFilterPopup.reset(VclPtr::Create(this, pDoc));
+
+// Avoid flicker when hovering over the menu items.
+if (!IsNativeControlSupported(ControlType::Pushbutton, ControlPart::Focus))
+// If NWF renders the focus rects itself, that breaks double-buffering.
+mpAutoFilterPopup->RequestDoubleBuffering(true);
+
 if (comphelper::LibreOfficeKit::isActive())
 mpAutoFilterPopup->SetLOKNotifier(SfxViewShell::Current());
 mpAutoFilterPopup->setOKAction(new AutoFilterAction(this, 
AutoFilterMode::Normal));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-04 Thread Noel Grandin (via logerrit)
 sc/source/core/data/compressedarray.cxx |4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit cabaadf278ba099c53ed2b7a32f1e11bc632ad3a
Author: Noel Grandin 
AuthorDate: Mon Jun 3 16:52:02 2019 +0200
Commit: Xisco Faulí 
CommitDate: Tue Jun 4 13:15:01 2019 +0200

tdf#121094 Opening xlxs with many rows takes several minutes

Use a more useful expansion strategy when re-sizing the array, we use
this 150% in a lot of other places.

This takes the opening time from more than 4m (I lost patience) to under
5s.

Change-Id: I8511662947d737c26ec49503a75af8d4cf447f67
Reviewed-on: https://gerrit.libreoffice.org/73394
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 79927a934b8a27bd4dee7a263171981e6ca22f8a)
Reviewed-on: https://gerrit.libreoffice.org/73433
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/compressedarray.cxx 
b/sc/source/core/data/compressedarray.cxx
index f02956b6a27d..2016478d9194 100644
--- a/sc/source/core/data/compressedarray.cxx
+++ b/sc/source/core/data/compressedarray.cxx
@@ -20,8 +20,6 @@
 #include 
 #include 
 
-static const size_t nScCompressedArrayDelta = 4;
-
 template< typename A, typename D >
 ScCompressedArray::ScCompressedArray( A nMaxAccessP, const D& rValue )
 : nCount(1)
@@ -84,7 +82,7 @@ void ScCompressedArray::SetValue( A nStart, A nEnd, 
const D& rValue )
 size_t nNeeded = nCount + 2;
 if (nLimit < nNeeded)
 {
-nLimit += nScCompressedArrayDelta;
+nLimit *= 1.5;
 if (nLimit < nNeeded)
 nLimit = nNeeded;
 std::unique_ptr pNewData(new DataEntry[nLimit]);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-04 Thread Noel Grandin (via logerrit)
 sc/source/filter/orcus/filterdetect.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6e4513e2b4e32926354d745ecf08fdf440392a75
Author: Noel Grandin 
AuthorDate: Mon Jun 3 10:04:58 2019 +0200
Commit: Noel Grandin 
CommitDate: Tue Jun 4 09:35:11 2019 +0200

tdf#67538 XTypeDetection::queryTypeByDescriptor poor performance, part3

Size the OUStringBuffer in OrcusFormatDetect::detect better at
construction, to avoid re-alloc.

This is specifically fixing the performance of queryTypeByDescriptor
when called from a basic macro on a local test file.

This takes my test macro from 9s to 8s

Change-Id: Id4c2bf386de172b1deed98efece8c1f040c599a5
Reviewed-on: https://gerrit.libreoffice.org/73376
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 7bf2515fc48ed0d4c436aef298fa9c35e573352b)
Reviewed-on: https://gerrit.libreoffice.org/73400

diff --git a/sc/source/filter/orcus/filterdetect.cxx 
b/sc/source/filter/orcus/filterdetect.cxx
index a9b064b01fbb..fb142d86b579 100644
--- a/sc/source/filter/orcus/filterdetect.cxx
+++ b/sc/source/filter/orcus/filterdetect.cxx
@@ -68,11 +68,11 @@ OUString 
OrcusFormatDetect::detect(css::uno::Sequence
 return OUString();
 
 css::uno::Reference 
xInputStream(aMediaDescriptor[utl::MediaDescriptor::PROP_INPUTSTREAM()], 
css::uno::UNO_QUERY );
+OStringBuffer aContent(xInputStream->available());
 
 static const sal_Int32 nBytes = 4096;
 css::uno::Sequence aSeq(nBytes);
 bool bEnd = false;
-OStringBuffer aContent;
 while(!bEnd)
 {
 sal_Int32 nReadBytes = xInputStream->readBytes(aSeq, nBytes);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-31 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr4.cxx |   27 +--
 1 file changed, 25 insertions(+), 2 deletions(-)

New commits:
commit 4831e2e8dd746e491edf47cae769b56a8925e2ee
Author: Eike Rathke 
AuthorDate: Sat Jun 1 00:18:46 2019 +0200
Commit: Eike Rathke 
CommitDate: Sat Jun 1 02:27:06 2019 +0200

Resolves: tdf#101473 handle volatile Add-In results without formula cell

... while temporarily interpreting from within the Function Wizard.

Change-Id: I88e7e062989ed395accd50ed9bfe1b76b3b297ea
Reviewed-on: https://gerrit.libreoffice.org/73290
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7272b9f752cb74757d6ed504202eefccc589f804)
Reviewed-on: https://gerrit.libreoffice.org/73299
Tested-by: Eike Rathke 

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 8cd191c6e00b..bb6583a2c460 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -3023,12 +3023,21 @@ void ScInterpreter::ScExternal()
 rArr.AddRecalcMode( ScRecalcMode::ONLOAD_LENIENT );
 uno::Reference xRes = 
aCall.GetVarRes();
 ScAddInListener* pLis = ScAddInListener::Get( xRes );
+// In case there is no pMyFormulaCell, i.e. while interpreting
+// temporarily from within the Function Wizard, try to obtain a
+// valid result from an existing listener for that volatile, or
+// create a new and hope for an immediate result. If none
+// available that should lead to a void result and thus #N/A.
+bool bTemporaryListener = false;
 if ( !pLis )
 {
 pLis = ScAddInListener::CreateListener( xRes, pDok );
-pMyFormulaCell->StartListening( *pLis );
+if (pMyFormulaCell)
+pMyFormulaCell->StartListening( *pLis );
+else
+bTemporaryListener = true;
 }
-else
+else if (pMyFormulaCell)
 {
 pMyFormulaCell->StartListening( *pLis );
 if ( !pLis->HasDocument( pDok ) )
@@ -3038,6 +3047,20 @@ void ScInterpreter::ScExternal()
 }
 
 aCall.SetResult( pLis->GetResult() );   // use result from 
async
+
+if (bTemporaryListener)
+{
+try
+{
+// EventObject can be any, not evaluated by
+// ScAddInListener::disposing()
+css::lang::EventObject aEvent;
+pLis->disposing(aEvent);// pLis is dead hereafter
+}
+catch (const uno::Exception&)
+{
+}
+}
 }
 
 if ( aCall.GetErrCode() != FormulaError::NONE )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits