[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-10-20 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr8.cxx |   15 ++-
 1 file changed, 6 insertions(+), 9 deletions(-)

New commits:
commit 045b1137b855b59c166212dcad10dce9c067dd00
Author: Eike Rathke 
AuthorDate: Wed Oct 20 13:41:03 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Oct 20 18:27:11 2021 +0200

Resolves: tdf#145235 TEXTJOIN() clear last string also for referenced empty

Change-Id: If6d20a1629e001708c700c5c25bef8a75fa34e25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123889
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit f4f2c94513e7d06691a73d9f12707c33d131d537)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123865
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/tool/interpr8.cxx b/sc/source/core/tool/interpr8.cxx
index 19cdd7eac3cb..6cc239d9f7ec 100644
--- a/sc/source/core/tool/interpr8.cxx
+++ b/sc/source/core/tool/interpr8.cxx
@@ -1740,17 +1740,14 @@ void ScInterpreter::ScTextJoin_MS()
 aAdr.SetRow( nRow );
 aAdr.SetCol( nCol );
 ScRefCellValue aCell( mrDoc, aAdr );
-if ( !aCell.isEmpty() )
+if (aCell.hasEmptyValue())
+aStr.clear();
+else
 {
-if ( !aCell.hasEmptyValue() )
-{
-svl::SharedString aSS;
-GetCellString( aSS, aCell);
-aStr = aSS.getString();
-}
+svl::SharedString aSS;
+GetCellString( aSS, aCell);
+aStr = aSS.getString();
 }
-else
-aStr.clear();
 if ( !aStr.isEmpty() || !bSkipEmpty )
 {
 if ( !bFirst )


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-08-31 Thread Xisco Fauli (via logerrit)
 sc/source/filter/xml/xmlexprt.cxx |   12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 476ad4fe6f62e7b5880f70aa67bfba702fbdef4e
Author: Xisco Fauli 
AuthorDate: Thu Aug 26 19:10:58 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Aug 31 13:46:16 2021 +0200

tdf#143940: the style index might be -1

Similar to 52aebe6986bcec07071adb3f94d6c09fea147044
< tdf#138466 Crash when creating different scenarios >

ExportColumns calls GetStyleNameIndex which might return -1
so check the index is different than -1 as it's already done
when calling ScFormatRangeStyles::GetStyleNameByIndex

Also move fix for tdf#138466 down the stack to be consistent

Debug builds will still assert, see coverity#1438402

Since 5e777f23fd0118f6649f0d9e30eb77a72f1099e4
< loplugin:useuniqueptr in ScColumnRowStylesBase >
where the nIndex < 0 check in
ScColumnRowStylesBase::GetStyleNameByIndex was removed

Change-Id: I084bfa04c39f37cb325c3b3df76801b3abdea994
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121128
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 7246759822aff30e4e4e1bca7949eae3b0d960ef)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121069
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 6e6f60d72d6d..3aeefa2a3c51 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -737,7 +737,9 @@ void ScXMLExport::WriteSingleColumn(const sal_Int32 
nRepeatColumns, const sal_In
 const sal_Int32 nIndex, const bool bIsAutoStyle, const bool bIsVisible)
 {
 CheckAttrList();
-AddAttribute(sAttrStyleName, 
pColumnStyles->GetStyleNameByIndex(nStyleIndex));
+// tdf#138466
+if (nStyleIndex != -1)
+AddAttribute(sAttrStyleName, 
pColumnStyles->GetStyleNameByIndex(nStyleIndex));
 if (!bIsVisible)
 AddAttribute(XML_NAMESPACE_TABLE, XML_VISIBILITY, XML_COLLAPSE);
 if (nRepeatColumns > 1)
@@ -870,9 +872,7 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, 
const ScRange& aColumnHe
 nColsRepeated = 1;
 }
 }
-// tdf#138466
-if (nPrevIndex != -1)
-WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
+WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
 if (!bIsClosed)
 CloseHeaderColumn();
 if (pGroupColumns->IsGroupEnd(nColumn - 1))
@@ -1351,7 +1351,9 @@ void ScXMLExport::WriteRowStartTag(
 const sal_Int32 nIndex, const sal_Int32 nEqualRows,
 bool bHidden, bool bFiltered)
 {
-AddAttribute(sAttrStyleName, pRowStyles->GetStyleNameByIndex(nIndex));
+// tdf#143940
+if (nIndex != -1)
+AddAttribute(sAttrStyleName, pRowStyles->GetStyleNameByIndex(nIndex));
 if (bHidden)
 {
 if (bFiltered)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-08-30 Thread Caolán McNamara (via logerrit)
 sc/source/filter/lotus/lotimpop.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 50c4082b4c71173badd7641ea9b87e2e8a08b62f
Author: Caolán McNamara 
AuthorDate: Sat Aug 28 09:56:52 2021 +0100
Commit: Xisco Fauli 
CommitDate: Mon Aug 30 13:43:38 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/sc/source/filter/lotus/lotimpop.cxx 
b/sc/source/filter/lotus/lotimpop.cxx
index 159b13786f6b..3970ac93a4d6 100644
--- a/sc/source/filter/lotus/lotimpop.cxx
+++ b/sc/source/filter/lotus/lotimpop.cxx
@@ -72,6 +72,9 @@ void ImportLotus::Bof()
 Skip( 1 );
 Read( nFlags );
 
+if (!pIn->good())
+return;
+
 if( nFileSub == 0x0004 )
 {
 if( nFileCode == 0x1000 )
@@ -87,7 +90,7 @@ void ImportLotus::Bof()
 
 bool ImportLotus::BofFm3()
 {
-sal_uInt16  nFileCode, nFileSub;
+sal_uInt16 nFileCode(0), nFileSub(0);
 
 Read( nFileCode );
 Read( nFileSub );


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-08-30 Thread Caolán McNamara (via logerrit)
 sc/source/filter/xml/XMLConverter.hxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit 3bc4beb1254df9e68339aad6f4f9646f2c5a1b9f
Author: Caolán McNamara 
AuthorDate: Sat Aug 28 10:07:49 2021 +0100
Commit: Michael Stahl 
CommitDate: Mon Aug 30 11:46:08 2021 +0200

ofz: MemorySanitizer: use-of-uninitialized-value

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

diff --git a/sc/source/filter/xml/XMLConverter.hxx 
b/sc/source/filter/xml/XMLConverter.hxx
index 2f8c08383353..cbe5ec8b4b0f 100644
--- a/sc/source/filter/xml/XMLConverter.hxx
+++ b/sc/source/filter/xml/XMLConverter.hxx
@@ -128,6 +128,14 @@ struct ScXMLConditionParseResult
 OUStringmaOperand1; /// First operand of the token or 
comparison value.
 OUStringmaOperand2; /// Second operand of 'between' 
conditions.
 sal_Int32   mnEndIndex; /// Index of first character 
following the condition.
+
+ScXMLConditionParseResult()
+: meToken(XML_COND_INVALID)
+, meValidation(css::sheet::ValidationType_ANY)
+, meOperator(css::sheet::ConditionOperator_NONE)
+, mnEndIndex(-1)
+{
+}
 };
 
 namespace ScXMLConditionHelper


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-08-23 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/table2.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit e2100a4f6927d3e441881033cf20d6034719a5fb
Author: Mike Kaganski 
AuthorDate: Mon Aug 23 12:28:18 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon Aug 23 16:43:53 2021 +0200

tdf#144022: make sure to create missing columns if needed

Change-Id: I1a0771fbe8023859ab29d8114303b62f6a3d539c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120731
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 23c1ec0d498124fbe275145d236db455f83cd850)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120873
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 02a9ad19cbaf..c63e71e78946 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -2904,20 +2904,20 @@ bool ScTable::RemoveFlags( SCCOL nStartCol, SCROW 
nStartRow, SCCOL nEndCol, SCRO
 void ScTable::SetPattern( const ScAddress& rPos, const ScPatternAttr& rAttr )
 {
 if (ValidColRow(rPos.Col(),rPos.Row()))
-aCol[rPos.Col()].SetPattern( rPos.Row(), rAttr );
+CreateColumnIfNotExists(rPos.Col()).SetPattern(rPos.Row(), rAttr);
 }
 
 const ScPatternAttr* ScTable::SetPattern( SCCOL nCol, SCROW nRow, 
std::unique_ptr pAttr )
 {
 if (ValidColRow(nCol,nRow))
-return aCol[nCol].SetPattern( nRow, std::move(pAttr) );
+return CreateColumnIfNotExists(nCol).SetPattern(nRow, 
std::move(pAttr));
 return nullptr;
 }
 
 void ScTable::SetPattern( SCCOL nCol, SCROW nRow, const ScPatternAttr& rAttr )
 {
 if (ValidColRow(nCol,nRow))
-aCol[nCol].SetPattern( nRow, rAttr );
+CreateColumnIfNotExists(nCol).SetPattern(nRow, rAttr);
 }
 
 void ScTable::ApplyAttr( SCCOL nCol, SCROW nRow, const SfxPoolItem& rAttr )


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-08-17 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/impex.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit c061dc196a30dc14acba5aba5bf538edb3d4fcc4
Author: Eike Rathke 
AuthorDate: Mon Aug 16 21:46:44 2021 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 17 10:52:36 2021 +0200

Resolves: tdf#96561 Include embedded null-characters while assembling CSV 
line

... instead of prematurely ending analysis and skipping the
remainder that is still part of data read.

Change-Id: I8f34bc9672e37f9c1c1ae81ddeba464360add7c2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120555
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7bd03074ae7362d8fffe5182529626a0b43a0ed1)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120572
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 3f86cc86edb7..7233b14ad640 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -2476,8 +2476,17 @@ Label_RetryWithNewSep:
 while (!rStream.eof() && aStr.getLength() < nArbitraryLineLengthLimit)
 {
 const sal_Unicode * p = aStr.getStr() + nLastOffset;
-while (*p)
+const sal_Unicode * const pStop = aStr.getStr() + aStr.getLength();
+while (p < pStop)
 {
+if (!*p)
+{
+// Skip embedded null-characters. They don't change
+// anything and are handled at a higher level.
+++p;
+continue;
+}
+
 if (nQuotes)
 {
 if (*p == cFieldQuote)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-08-08 Thread Eike Rathke (via logerrit)
 sc/source/core/data/table6.cxx |8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit f20c91fe2c997bd5966c902ee28f95531435ec26
Author: Eike Rathke 
AuthorDate: Sun Aug 8 18:39:39 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Aug 8 22:50:31 2021 +0200

Resolves: tdf#143759 Limit empty search's empty column to actual search 
range

... instead of the non-/filtered last row.

Change-Id: I9b941af688a8083d472a793a6bc6b6dbb7b916ea
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120176
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 15960931988cfd898e14a12d6b9cddaf6d8b0ade)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120135
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/core/data/table6.cxx b/sc/source/core/data/table6.cxx
index b52247f35e14..fca6dea1c61b 100644
--- a/sc/source/core/data/table6.cxx
+++ b/sc/source/core/data/table6.cxx
@@ -1081,10 +1081,14 @@ bool ScTable::SearchRangeForAllEmptyCells(
 if (aCol[nCol].IsEmptyData())
 {
 // The entire column is empty.
-for (SCROW nRow = rRange.aStart.Row(); nRow <= rRange.aEnd.Row(); 
++nRow)
+const SCROW nEndRow = rRange.aEnd.Row();
+for (SCROW nRow = rRange.aStart.Row(); nRow <= nEndRow; ++nRow)
 {
 SCROW nLastRow;
-if (!RowFiltered(nRow, nullptr, ))
+const bool bFiltered = RowFiltered(nRow, nullptr, );
+if (nLastRow > nEndRow)
+nLastRow = nEndRow;
+if (!bFiltered)
 {
 rMatchedRanges.Join(ScRange(nCol, nRow, nTab, nCol, 
nLastRow, nTab));
 if (bReplace)


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-08-03 Thread Eike Rathke (via logerrit)
 sc/source/filter/oox/excelfilter.cxx |8 ++-
 sc/source/filter/xml/xmlimprt.cxx|3 +
 sc/source/ui/docshell/arealink.cxx   |3 +
 sc/source/ui/docshell/docsh.cxx  |   25 +
 sc/source/ui/docshell/docsh4.cxx |   90 +--
 sc/source/ui/inc/docsh.hxx   |1 
 6 files changed, 71 insertions(+), 59 deletions(-)

New commits:
commit 75a88761b70a098e77c73a0ba716d0e78a6d4659
Author: Eike Rathke 
AuthorDate: Sun Aug 1 21:40:15 2021 +0200
Commit: Caolán McNamara 
CommitDate: Tue Aug 3 12:39:55 2021 +0200

Consolidate link update handling

Have it at one central place and identical for all document
loading paths.

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

 Conflicts:
sc/source/ui/docshell/docsh4.cxx

Change-Id: Ib00153a9f5831e223d0129df0538353a7e20961e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119837
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/excelfilter.cxx 
b/sc/source/filter/oox/excelfilter.cxx
index 4c59a0e9393b..b015f82500c2 100644
--- a/sc/source/filter/oox/excelfilter.cxx
+++ b/sc/source/filter/oox/excelfilter.cxx
@@ -109,14 +109,18 @@ bool ExcelFilter::importDocument()
 if (xBookGlob)
 {
 rtl::Reference xWorkbookFragment( new 
WorkbookFragment(*xBookGlob, aWorkbookPath));
+
+const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
+const ScDocument& rDoc = pWF->getScDocument();
+if (ScDocShell* pDocSh = 
static_cast(rDoc.GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 bool bRet = importFragment( xWorkbookFragment);
 if (bRet)
 {
-const WorkbookFragment* pWF = static_cast(xWorkbookFragment.get());
 const AddressConverter& rAC = pWF->getAddressConverter();
 if (rAC.isTabOverflow() || rAC.isColOverflow() || 
rAC.isRowOverflow())
 {
-const ScDocument& rDoc = pWF->getScDocument();
 if (rDoc.IsUserInteractionEnabled())
 {
 // Show data loss warning.
diff --git a/sc/source/filter/xml/xmlimprt.cxx 
b/sc/source/filter/xml/xmlimprt.cxx
index e29112fab2b1..1fff4f1c3a32 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1308,6 +1308,9 @@ void SAL_CALL ScXMLImport::setTargetDocument( const 
css::uno::Reference< css::la
 if (!pDoc)
 throw lang::IllegalArgumentException();
 
+if (ScDocShell* pDocSh = 
static_cast(pDoc->GetDocumentShell()))
+pDocSh->SetInitialLinkUpdate( pDocSh->GetMedium());
+
 mpDocImport.reset(new ScDocumentImport(*pDoc));
 mpComp.reset(new ScCompiler(*pDoc, ScAddress(), 
formula::FormulaGrammar::GRAM_ODFF));
 
diff --git a/sc/source/ui/docshell/arealink.cxx 
b/sc/source/ui/docshell/arealink.cxx
index 2920ca6ad08d..0d3c51116b0b 100644
--- a/sc/source/ui/docshell/arealink.cxx
+++ b/sc/source/ui/docshell/arealink.cxx
@@ -227,6 +227,9 @@ bool ScAreaLink::Refresh( const OUString& rNewFile, const 
OUString& rNewFilter,
 if (rNewFile.isEmpty() || rNewFilter.isEmpty())
 return false;
 
+if (!m_pDocSh->GetEmbeddedObjectContainer().getUserAllowsLinkUpdate())
+return false;
+
 OUString aNewUrl( ScGlobal::GetAbsDocName( rNewFile, m_pDocSh ) );
 bool bNewUrlName = (aNewUrl != aFileName);
 
diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index 91020db0b2e0..e588494e3055 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -583,21 +583,7 @@ bool ScDocShell::Load( SfxMedium& rMedium )
 bool bRet = SfxObjectShell::Load(rMedium);
 if (bRet)
 {
-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);
-}
+SetInitialLinkUpdate();
 
 {
 //  prepare a valid document for XML filter
@@ -1087,11 +1073,7 @@ bool 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-07-08 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/interpr1.cxx |2 --
 1 file changed, 2 deletions(-)

New commits:
commit 79523008fba5765d27e6a3d214362f68ca46b1db
Author: Caolán McNamara 
AuthorDate: Wed Dec 2 13:31:59 2020 +
Commit: Eike Rathke 
CommitDate: Thu Jul 8 12:25:35 2021 +0200

cid#1468696 Logically dead code

bool bTryXlA1 = (eConv == FormulaGrammar::CONV_A1_XL_A1);

if (...)
eConv = FormulaGrammar::CONV_XL_R1C1;

if (bTryXlA1 || eConv == FormulaGrammar::CONV_OOO)
{
if (...)
{
bExternalName = true;
eConv = FormulaGrammar::CONV_OOO;
}
}

if (!bExternalName && (bTryXlA1 || eConv != FormulaGrammar::CONV_OOO))
{
if (...)
{
if (eConv == FormulaGrammar::CONV_OOO)
{
// this condition can only be reached if bTryXlA1 is true
// but bTryXlA1 is only true if eConv was originally
// CONV_A1_XL_A1. The only things eConv can be changed to
// in this function are CONV_XL_R1C1 or CONV_OOO. If it
// was changed to CONV_OOO then bExternalName was also
// set to true and the block isn't entered if that is true
}
}
}

maybe an unconditional assignment of
eConv = FormulaGrammar::CONV_XL_A1
is a better solution

Change-Id: I45f9947c21662369474048acf2d648733a9b9a6d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107076
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 22c7ad49679c2abcac4409c93d32b20746b16904)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118602

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 4204215d8d97..4f2789160a1c 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8241,8 +8241,6 @@ void ScInterpreter::ScIndirect()
 if (nIndex >= 3 && sRefStr[nIndex-1] == '\'')
 {
 bExternalName = true;
-if (eConv == FormulaGrammar::CONV_OOO)
-eConv = FormulaGrammar::CONV_XL_A1;
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-07-02 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/compiler.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit c7d6a4dcfa82387d4ea2445b7af109101f0c365b
Author: Eike Rathke 
AuthorDate: Thu Jul 1 15:46:01 2021 +0200
Commit: Caolán McNamara 
CommitDate: Fri Jul 2 11:47:38 2021 +0200

Resolves: tdf#138432 Use locale's CharClass to parse numeric i18n context

Change-Id: I1828f1b6f93228cd517a6a7bd9ae36584bd801a1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118226
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit d703131d063c41b8baca01830c4c9806f99ab7d2)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118190
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 7dd0ca5374a7..274205f5734b 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2751,6 +2751,10 @@ Label_MaskStateMachine:
 cGroupSep != cArrayColSep && cGroupSep != cArrayRowSep &&
 cGroupSep != cDecSep && cGroupSep != cDecSepAlt &&
 cGroupSep != cSheetPrefix && cGroupSep != cSheetSep);
+// If a numeric context triggered bi18n then use the default locale's
+// CharClass, this may accept group separator as well.
+const CharClass* pMyCharClass = (ScGlobal::getCharClassPtr()->isDigit( 
OUString(pStart[nSrcPos]), 0) ?
+ScGlobal::getCharClassPtr() : pCharClass);
 OUStringBuffer aSymbol;
 mnRangeOpPosInSymbol = -1;
 FormulaError nErr = FormulaError::NONE;
@@ -2761,7 +2765,7 @@ Label_MaskStateMachine:
 if ( pStart[nSrcPos] == cSheetPrefix && pStart[nSrcPos+1] == '\'' )
 aSymbol.append(pStart[nSrcPos++]);
 
-ParseResult aRes = pConv->parseAnyToken( aFormula, nSrcPos, 
pCharClass, bGroupSeparator);
+ParseResult aRes = pConv->parseAnyToken( aFormula, nSrcPos, 
pMyCharClass, bGroupSeparator);
 
 if ( !aRes.TokenType )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-06-24 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/impex.cxx |   32 +++-
 1 file changed, 31 insertions(+), 1 deletion(-)

New commits:
commit 62f01b4c91d402e1828f8ad6b007d0a3594d2d3e
Author: Eike Rathke 
AuthorDate: Wed Jun 23 19:41:46 2021 +0200
Commit: Michael Stahl 
CommitDate: Thu Jun 24 10:56:39 2021 +0200

Resolves: tdf#143008 Evaluate AM/PM for type date+time text-to-column and 
CSV

Change-Id: Ib760b9a103ab4b8ce7f5a158b09fbe11c6617f2a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117747
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit d81775f5b12080676ebaf659c5a4c10d64a9074b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117720
Reviewed-by: Michael Stahl 

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 43d77256a08a..3f86cc86edb7 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1036,7 +1036,7 @@ static bool lcl_PutString(
 else if ( nColFormat != SC_COL_STANDARD ) // Datumformats
 {
 const sal_uInt16 nMaxNumberParts = 7; // Y-M-D h:m:s.t
-sal_Int32 nLen = rStr.getLength();
+const sal_Int32 nLen = rStr.getLength();
 sal_Int32 nStart[nMaxNumberParts];
 sal_Int32 nEnd[nMaxNumberParts];
 
@@ -1193,6 +1193,36 @@ static bool lcl_PutString(
 if (eStatus == rtl_math_ConversionStatus_Ok)
 fFrac = fV / 86400.0;
 }
+sal_Int32 nPos;
+if (nFound > 3 && 1 <= nHour && nHour <= 12  // nHour 0 and 
>=13 can't be AM/PM
+&& (nPos = nEnd[nFound-1] + 1) < nLen)
+{
+// Dreaded AM/PM may be following.
+while (nPos < nLen && rStr[nPos] == ' ')
+++nPos;
+if (nPos < nLen)
+{
+sal_Int32 nStop = nPos;
+while (nStop < nLen && rStr[nStop] != ' ')
+++nStop;
+OUString aAmPm = rStr.copy( nPos, nStop - nPos);
+// For AM only 12 needs to be treated, whereas for PM
+// it must not. Check both, locale and second/English
+// strings.
+if (nHour == 12 &&
+(rTransliteration.isEqual( aAmPm, 
pFormatter->GetLocaleData()->getTimeAM()) ||
+ (pSecondTransliteration && 
pSecondTransliteration->isEqual( aAmPm, "AM"
+{
+nHour = 0;
+}
+else if (nHour < 12 &&
+(rTransliteration.isEqual( aAmPm, 
pFormatter->GetLocaleData()->getTimePM()) ||
+ (pSecondTransliteration && 
pSecondTransliteration->isEqual( aAmPm, "PM"
+{
+nHour += 12;
+}
+}
+}
 pCalendar->setValue( i18n::CalendarFieldIndex::HOUR, nHour );
 pCalendar->setValue( i18n::CalendarFieldIndex::MINUTE, nMinute 
);
 pCalendar->setValue( i18n::CalendarFieldIndex::SECOND, nSecond 
);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-06-22 Thread Julien Nabet (via logerrit)
 sc/source/core/data/table7.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0a8131d098e24842480c9c42b5e47accc7c59ce0
Author: Julien Nabet 
AuthorDate: Sat Jun 19 13:51:28 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Jun 22 21:45:18 2021 +0200

tdf#142932: fix crash when pasting cells with comments+"skip empty cells"

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

4  0x7fc4b0cdbb3d in ScColContainer::operator[](unsigned long) 
(this=0x872e1e0, nIndex=64) at sc/inc/colcontainer.hxx:43
5  0x7fc4b120d82b in 
ScTable::DeleteBeforeCopyFromClip(sc::CopyFromClipContext&, ScTable const&, 
sc::ColumnSpanSet&) (this=0x872e1e0, rCxt=..., rClipTab=..., 
rBroadcastSpans=...)
   at sc/source/core/data/table7.cxx:118
6  0x7fc4b0e42939 in 
ScDocument::DeleteBeforeCopyFromClip(sc::CopyFromClipContext&, ScMarkData 
const&, sc::ColumnSpanSet&) (this=0x3bffa60, rCxt=..., rMark=..., 
rBroadcastSpans=...)
   at sc/source/core/data/document10.cxx:75
7  0x7fc4b0e0b67b in ScDocument::CopyFromClip(ScRange const&, 
ScMarkData const&, InsertDeleteFlags, ScDocument*, ScDocument*, bool, bool, 
bool, bool, ScRangeList const*)
   (this=0x3bffa60, rDestRange=..., rMark=..., nInsFlag=7, pRefUndoDoc=0x0, 
pClipDoc=0x7d3bb40, bResetCut=true, bAsLink=false, bIncludeFiltered=false, 
bSkipAttrForEmpty=true, pDestRanges=0x7fff4a3da4b0)
   at sc/source/core/data/document.cxx:2916
8  0x7fc4b2412dc3 in ScViewFunc::PasteFromClip(InsertDeleteFlags, 
ScDocument*, ScPasteFunc, bool, bool, bool, InsCellCmd, InsertDeleteFlags, 
bool) (this=
   0x41a29e0, nFlags=7, pClipDoc=0x7d3bb40, nFunction=ScPasteFunc::NONE, 
bSkipEmpty=true, bTranspose=false, bAsLink=false, eMoveMode=INS_NONE, 
nUndoExtraFlags=InsertDeleteFlags::NONE, bAllowDialogs=true)
   at sc/source/ui/view/viewfun3.cxx:1312

Change-Id: Ic119cb5d414a35a9ba18b0564d7adf83154eb9d7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117497
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit a6d269ed9478b20f611912bf9711c2683e7bc924)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117632
Reviewed-by: Xisco Fauli 
(cherry picked from commit bb59b4165456d13eda800098be8b875d93b093d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/117637

diff --git a/sc/source/core/data/table7.cxx b/sc/source/core/data/table7.cxx
index fc821133ef65..b75751ff7de4 100644
--- a/sc/source/core/data/table7.cxx
+++ b/sc/source/core/data/table7.cxx
@@ -108,7 +108,8 @@ void ScTable::DeleteBeforeCopyFromClip(
 ScRange aClipRange = rCxt.getClipDoc()->GetClipParam().getWholeRange();
 SCCOL nClipCol = aClipRange.aStart.Col();
 {
-for (SCCOL nCol = aRange.mnCol1; nCol <= aRange.mnCol2; ++nCol, 
++nClipCol)
+const SCCOL nMaxCol2 = std::min( aRange.mnCol2, aCol.size() - 1 
);
+for (SCCOL nCol = aRange.mnCol1; nCol <= nMaxCol2; ++nCol, ++nClipCol)
 {
 if (nClipCol > aClipRange.aEnd.Col())
 nClipCol = aClipRange.aStart.Col(); // loop through columns.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-06-14 Thread Eike Rathke (via logerrit)
 sc/source/ui/inc/tpformula.hxx|2 
 sc/source/ui/optdlg/tpformula.cxx |   87 ++
 2 files changed, 61 insertions(+), 28 deletions(-)

New commits:
commit 304d64cc27a729646522c7e16ad3d1d0aa2b1a12
Author: Eike Rathke 
AuthorDate: Fri Jun 11 19:02:24 2021 +0200
Commit: Michael Stahl 
CommitDate: Mon Jun 14 11:15:02 2021 +0200

Resolves: tdf#127013 differentiate non-/array separators and restrict

 This is a combination of 2 commits.

Resolves: tdf#127013 differentiate non-/array separators and restrict

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

Related: tdf#127013 Check loaded separators for validity

... not only if something is present at all.
That way future restrictions can reset separators.

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

I738bcb9e052e8dbecb0a6cd07bbae8f4a8ea1c35

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

diff --git a/sc/source/ui/inc/tpformula.hxx b/sc/source/ui/inc/tpformula.hxx
index 78d93c798f05..25077921b15c 100644
--- a/sc/source/ui/inc/tpformula.hxx
+++ b/sc/source/ui/inc/tpformula.hxx
@@ -44,7 +44,7 @@ private:
 void UpdateCustomCalcRadioButtons(bool bDefault);
 void LaunchCustomCalcSettings();
 
-bool IsValidSeparator(const OUString& rSep) const;
+bool IsValidSeparator(const OUString& rSep, bool bArray) const;
 
 DECL_LINK(ButtonHdl, weld::Button&, void);
 DECL_LINK(SepInsertTextHdl, OUString&, bool);
diff --git a/sc/source/ui/optdlg/tpformula.cxx 
b/sc/source/ui/optdlg/tpformula.cxx
index 440a509f853d..b4c0045d6469 100644
--- a/sc/source/ui/optdlg/tpformula.cxx
+++ b/sc/source/ui/optdlg/tpformula.cxx
@@ -129,40 +129,73 @@ void ScTpFormulaOptions::LaunchCustomCalcSettings()
 }
 }
 
-bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep) const
+bool ScTpFormulaOptions::IsValidSeparator(const OUString& rSep, bool bArray) 
const
 {
 if (rSep.getLength() != 1)
 // Must be one-character long.
 return false;
 
-if (rSep.compareToAscii("a") >= 0 && rSep.compareToAscii("z") <= 0)
+const sal_Unicode c = rSep[0];
+
+if (c == mnDecSep)
+// decimal separator is not allowed.
+return false;
+
+if (c <= 0x20 || c == 0x7f)
+// Disallow non-printables including space and DEL.
 return false;
 
-if (rSep.compareToAscii("A") >= 0 && rSep.compareToAscii("Z") <= 0)
+if (('a' <= c && c <= 'z') || ('A' <= c && c <= 'Z') || ('0' <= c && c <= 
'9'))
+// Disallow alphanumeric.
 return false;
 
-sal_Unicode c = rSep[0];
-switch (c)
+if (bArray)
 {
-case '+':
-case '-':
-case '/':
-case '*':
-case '<':
-case '>':
-case '[':
-case ']':
-case '(':
-case ')':
-case '"':
-case '\'':
-// Disallowed characters.  Anything else we want to disallow ?
-return false;
+switch (c)
+{
+case '+':
+case '-':
+case '{':
+case '}':
+case '"':
+// All following just to prevent confusion, they are not
+// evaluated in inline arrays and theoretically would be
+// possible.
+case '%':
+case '/':
+case '*':
+case '=':
+case '<':
+case '>':
+case '[':
+case ']':
+case '(':
+case ')':
+case '\'':
+// Disallowed characters.  Anything else we want to disallow ?
+return false;
+}
 }
-
-if (c == mnDecSep)
-// decimal separator is not allowed.
+else if (c <= 0x7f)
+{
+switch (c)
+{
+default:
+// Anything bad except the knowns.
+return false;
+case ';':
+case ',':
+; // nothing
+}
+}
+else
+{
+// Any Unicode character, would have to ask the compiler's localized
+// symbol map whether it's a known symbol but not a separator
+// (ocSep,ocArrayRowSep,ocArrayColSep), which we're about to set here.
+// But really..
 return false;
+}
 
 return true;
 }
@@ -181,7 +214,7 @@ IMPL_LINK( ScTpFormulaOptions, ButtonHdl, weld::Button&, 
rBtn, void )
 
 IMPL_LINK(ScTpFormulaOptions, SepInsertTextHdl, OUString&, rTest, bool)
 {
-if (!IsValidSeparator(rTest) && 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-06-10 Thread Noel Grandin (via logerrit)
 sc/source/ui/cctrl/tbzoomsliderctrl.cxx |   45 
 sc/source/ui/inc/tbzoomsliderctrl.hxx   |2 -
 2 files changed, 30 insertions(+), 17 deletions(-)

New commits:
commit 8619e743564a241eb951866616aec82e1ab3965f
Author: Noel Grandin 
AuthorDate: Thu Jun 10 14:04:17 2021 +0200
Commit: Xisco Fauli 
CommitDate: Thu Jun 10 23:01:14 2021 +0200

tdf#136766 Zoom slider in calc print preview has white background

I cannot figure out any way to make transparent stuff on the toolbar
behave under all rendering backends, so just revert this

this reverts
commit 00cffc20e40b2412c7e9867eed24c9834504e24f
Date:   Mon Sep 7 13:28:33 2020 +0200
tdf#135181 Calc print preview zoom slider print preview not
transparent (gen)

commit 444c7c736be7545344298a9cbb3a69886edc5ecb
Date:   Mon May 18 18:23:13 2020 +0200
tdf#125538 fix background of zoom control

Change-Id: I7c351796b2c0778c1520fc8177d05567b2ae8a48
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116982
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit d693223b84b518701d308678801ccc50877490dc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116904
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx 
b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
index 12d12c19beda..b7a6781dcd07 100644
--- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
+++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx
@@ -97,9 +97,8 @@ struct ScZoomSlider::ScZoomSliderWnd_Impl
 ImagemaIncreaseButton;
 ImagemaDecreaseButton;
 bool mbOmitPaint;
-VclPtr  mxParentWindow;
 
-explicit ScZoomSliderWnd_Impl( sal_uInt16 nCurrentZoom, vcl::Window* 
parentWindow ) :
+explicit ScZoomSliderWnd_Impl( sal_uInt16 nCurrentZoom ) :
 mnCurrentZoom( nCurrentZoom ),
 mnMinZoom( 10 ),
 mnMaxZoom( 400 ),
@@ -108,8 +107,7 @@ struct ScZoomSlider::ScZoomSliderWnd_Impl
 maSliderButton(),
 maIncreaseButton(),
 maDecreaseButton(),
-mbOmitPaint( false ),
-mxParentWindow(parentWindow)
+mbOmitPaint( false )
 {
 }
 };
@@ -209,7 +207,7 @@ ScZoomSliderWnd::ScZoomSliderWnd( vcl::Window* pParent,
 const css::uno::Reference< css::frame::XDispatchProvider >& 
rDispatchProvider,
 sal_uInt16 nCurrentZoom ):
 InterimItemWindow(pParent, "modules/scalc/ui/zoombox.ui", 
"ZoomBox"),
-mxWidget(new ScZoomSlider(rDispatchProvider, nCurrentZoom, 
pParent)),
+mxWidget(new ScZoomSlider(rDispatchProvider, nCurrentZoom)),
 mxWeld(new weld::CustomWeld(*m_xBuilder, "zoom", *mxWidget))
 {
 Size aLogicalSize( 115, 40 );
@@ -233,8 +231,8 @@ void ScZoomSliderWnd::dispose()
 }
 
 ScZoomSlider::ScZoomSlider(const css::uno::Reference< 
css::frame::XDispatchProvider>& rDispatchProvider,
-   sal_uInt16 nCurrentZoom, vcl::Window* parentWindow)
-: mpImpl(new ScZoomSliderWnd_Impl(nCurrentZoom, parentWindow))
+   sal_uInt16 nCurrentZoom)
+: mpImpl(new ScZoomSliderWnd_Impl(nCurrentZoom))
 , m_xDispatchProvider(rDispatchProvider)
 {
 mpImpl->maSliderButton  = Image(StockImage::Yes, 
RID_SVXBMP_SLIDERBUTTON);
@@ -277,8 +275,9 @@ bool ScZoomSlider::MouseButtonDown( const MouseEvent& rMEvt 
)
 if( nOldZoom == mpImpl->mnCurrentZoom )
 return true;
 
-// need to invalidate parent since we rely on the toolbox drawing it's 
fancy gradient background
-mpImpl->mxParentWindow->Invalidate();
+tools::Rectangle aRect( Point( 0, 0 ), aSliderWindowSize );
+
+Invalidate(aRect);
 mpImpl->mbOmitPaint = true;
 
 SvxZoomSliderItem   aZoomSliderItem( mpImpl->mnCurrentZoom );
@@ -312,8 +311,8 @@ bool ScZoomSlider::MouseMove( const MouseEvent& rMEvt )
 {
 mpImpl->mnCurrentZoom = Offset2Zoom( aPoint.X() );
 
-// need to invalidate parent since we rely on the toolbox drawing 
it's fancy gradient background
-mpImpl->mxParentWindow->Invalidate();
+tools::Rectangle aRect(Point(0, 0), aSliderWindowSize);
+Invalidate(aRect);
 
 mpImpl->mbOmitPaint = true; // optimization: paint before 
executing command,
 
@@ -379,9 +378,11 @@ void ScZoomSlider::UpdateFromItem(const SvxZoomSliderItem* 
pZoomSliderItem)
 }
 }
 
+Size aSliderWindowSize = GetOutputSizePixel();
+tools::Rectangle aRect(Point(0, 0), aSliderWindowSize);
+
 if ( !mpImpl->mbOmitPaint )
-// need to invalidate parent since we rely on the toolbox drawing it's 
fancy gradient background
-mpImpl->mxParentWindow->Invalidate();
+   Invalidate(aRect);
 }
 
 void ScZoomSlider::Paint(vcl::RenderContext& rRenderContext, const 
tools::Rectangle& /*rRect*/)
@@ -399,9 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-06-10 Thread Caolán McNamara (via logerrit)
 sc/source/ui/Accessibility/AccessibleEditObject.cxx |9 +
 sc/source/ui/app/inputwin.cxx   |2 +-
 sc/source/ui/inc/AccessibleEditObject.hxx   |8 
 3 files changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 4b6af3412f72be85706fc5355a36bd8364726c13
Author: Caolán McNamara 
AuthorDate: Wed Jun 9 14:31:05 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Jun 10 21:13:37 2021 +0200

tdf#141769 ScTextWnd has to be available before the editview is created

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

diff --git a/sc/source/ui/Accessibility/AccessibleEditObject.cxx 
b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
index d0afd2c8196c..ea6787478abd 100644
--- a/sc/source/ui/Accessibility/AccessibleEditObject.cxx
+++ b/sc/source/ui/Accessibility/AccessibleEditObject.cxx
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -595,4 +596,12 @@ OutputDevice* 
ScAccessibleEditControlObject::GetOutputDeviceForView()
 return _pController->GetDrawingArea()->get_ref_device();
 }
 
+ScAccessibleEditLineObject::ScAccessibleEditLineObject(ScTextWnd* pTextWnd)
+: ScAccessibleEditControlObject(pTextWnd, ScAccessibleEditObject::EditLine)
+{
+// tdf#141769 set this early so its always available, even before the 
on-demand
+// editview is created
+mpTextWnd = pTextWnd;
+}
+
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2846ca43dc54..6307eee3edd7 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -2075,7 +2075,7 @@ void ScTextWnd::SetDrawingArea(weld::DrawingArea* 
pDrawingArea)
 
 css::uno::Reference< css::accessibility::XAccessible > 
ScTextWnd::CreateAccessible()
 {
-pAcc = new ScAccessibleEditControlObject(this, 
ScAccessibleEditObject::EditLine);
+pAcc = new ScAccessibleEditLineObject(this);
 return pAcc;
 }
 
diff --git a/sc/source/ui/inc/AccessibleEditObject.hxx 
b/sc/source/ui/inc/AccessibleEditObject.hxx
index 83dedda9b387..9244964cfae3 100644
--- a/sc/source/ui/inc/AccessibleEditObject.hxx
+++ b/sc/source/ui/inc/AccessibleEditObject.hxx
@@ -175,7 +175,9 @@ private:
 std::unique_ptr mpTextHelper;
 EditView*  mpEditView;
 VclPtr mpWindow;
+protected:
 ScTextWnd* mpTextWnd;
+private:
 EditObjectType meObjectType;
 bool   mbHasFocus;
 
@@ -222,6 +224,12 @@ public:
 virtual void SAL_CALL disposing() override;
 };
 
+class ScAccessibleEditLineObject : public ScAccessibleEditControlObject
+{
+public:
+ScAccessibleEditLineObject(ScTextWnd* pTextWnd);
+};
+
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-05-26 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/docsh4.cxx |   10 ++
 1 file changed, 10 insertions(+)

New commits:
commit bdcf20ada557ef85297869014e678743f41d0815
Author: Eike Rathke 
AuthorDate: Tue May 25 22:33:46 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed May 26 08:56:40 2021 +0200

Related: tdf#81757 Do not even try to re-enter ScDocShell::Do*Recalc()

That happened when loading bug doc
https://bugs.documentfoundation.org/attachment.cgi?id=103462
where form selection events fire asynchronous recalcul() and
BASIC Main also calls recalcul.

Change-Id: Ic27fb340c7b5019453723c7cabe2122905d400f5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116133
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 807f3508c9319d7f94820ea1282e306594418fce)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116152
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 111fb8262234..32e14f99eff4 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1421,6 +1421,11 @@ bool ScDocShell::ExecuteChangeProtectionDialog( bool 
bJustQueryIfProtected )
 
 void ScDocShell::DoRecalc( bool bApi )
 {
+if (m_aDocument.IsInDocShellRecalc())
+{
+SAL_WARN("sc","ScDocShell::DoRecalc tries re-entering while in Recalc; 
probably Forms->BASIC->Dispatcher.");
+return;
+}
 ScDocShellRecalcGuard aGuard(m_aDocument);
 bool bDone = false;
 ScTabViewShell* pSh = GetBestViewShell();
@@ -1467,6 +1472,11 @@ void ScDocShell::DoRecalc( bool bApi )
 
 void ScDocShell::DoHardRecalc()
 {
+if (m_aDocument.IsInDocShellRecalc())
+{
+SAL_WARN("sc","ScDocShell::DoHardRecalc tries re-entering while in 
Recalc; probably Forms->BASIC->Dispatcher.");
+return;
+}
 auto start = std::chrono::steady_clock::now();
 ScDocShellRecalcGuard aGuard(m_aDocument);
 weld::WaitObject aWaitObj( GetActiveDialogParent() );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-05-24 Thread Eike Rathke (via logerrit)
 sc/source/ui/inc/viewdata.hxx  |   10 +++
 sc/source/ui/view/cellsh.cxx   |   14 ++-
 sc/source/ui/view/viewdata.cxx |   52 +
 sc/source/ui/view/viewfun3.cxx |2 -
 4 files changed, 70 insertions(+), 8 deletions(-)

New commits:
commit 29e74f1ef0a608ce37cbc2a3dd527b4b22e77cca
Author: Eike Rathke 
AuthorDate: Mon May 24 01:29:19 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon May 24 15:09:50 2021 +0200

Resolves: tdf#134675 Allow unrestricted pastes of same size in one dimension

So copy-paste of for example one entire column onto more than 23
columns is possible as that does not create multiple repetitions.

Change-Id: I2b035afa1c04522db55569396a36b1bac57c590c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116031
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116039

diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx
index 4026c175e13e..6e11410272bd 100644
--- a/sc/source/ui/inc/viewdata.hxx
+++ b/sc/source/ui/inc/viewdata.hxx
@@ -480,7 +480,15 @@ public:
 
 boolIsMultiMarked() const;
 
-/** Disallow cell fill (Paste,Fill,...) on Ctrl+A all
+/** Disallow Paste on Ctrl+A all selected or another high
+amount of selected cells that is not the same size in
+one direction as the clipboard source.
+To prevent DOOM.
+ */
+boolSelectionForbidsPaste( ScDocument* pClipDoc = nullptr );
+boolSelectionForbidsPaste( SCCOL nSrcCols, SCROW nSrcRows );
+
+/** Disallow cell fill (Fill,Enter,...) on Ctrl+A all
 selected or another high amount of selected cells.
 We'd go DOOM.
  */
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index cd46db595914..fc24d18a56be 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -223,7 +223,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
 case SID_PASTE_ONLY_TEXT:
 case SID_PASTE_ONLY_FORMULA:
 case SID_PASTE_TEXTIMPORT_DIALOG:
-bDisable = GetViewData()->SelectionForbidsCellFill();
+bDisable = GetViewData()->SelectionForbidsPaste();
 break;
 
 case FID_INS_ROW:
@@ -543,12 +543,11 @@ bool checkDestRanges(ScViewData& rViewData)
 return false;
 }
 
-if (rViewData.SelectionForbidsCellFill())
-return false;
-
 // Multiple destination ranges.
 
-ScDocument& rDoc = rViewData.GetDocument();
+// Same as ScViewData::SelectionForbidsPaste() in
+// sc/source/ui/view/viewdata.cxx but different return details.
+
 vcl::Window* pWin = rViewData.GetActiveWin();
 if (!pWin)
 return false;
@@ -566,12 +565,15 @@ bool checkDestRanges(ScViewData& rViewData)
 SCROW nRowSize = aSrcRange.aEnd.Row() - aSrcRange.aStart.Row() + 1;
 SCCOL nColSize = aSrcRange.aEnd.Col() - aSrcRange.aStart.Col() + 1;
 
+if (rViewData.SelectionForbidsPaste( nColSize, nRowSize))
+return false;
+
 ScMarkData aMark = rViewData.GetMarkData();
 ScRangeList aRanges;
 aMark.MarkToSimple();
 aMark.FillRangeListWithMarks(, false);
 
-return ScClipUtil::CheckDestRanges(rDoc, nColSize, nRowSize, aMark, 
aRanges);
+return ScClipUtil::CheckDestRanges(rViewData.GetDocument(), nColSize, 
nRowSize, aMark, aRanges);
 }
 
 }
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index 2d30a3504f75..40ed99d170a0 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -55,6 +55,8 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 #include 
 #include 
@@ -1255,6 +1257,56 @@ bool ScViewData::IsMultiMarked() const
 return (eType & SC_MARK_SIMPLE) != SC_MARK_SIMPLE;
 }
 
+bool ScViewData::SelectionForbidsPaste( ScDocument* pClipDoc )
+{
+if (!pClipDoc)
+{
+// Same as checkDestRanges() in sc/source/ui/view/cellsh.cxx but
+// different return details.
+
+vcl::Window* pWin = GetActiveWin();
+if (!pWin)
+// No window doesn't mean paste would be forbidden.
+return false;
+
+const ScTransferObj* pOwnClip = 
ScTransferObj::GetOwnClipboard(ScTabViewShell::GetClipData(pWin));
+if (!pOwnClip)
+// Foreign content does not get repeatedly replicated.
+return false;
+
+pClipDoc = pOwnClip->GetDocument();
+if (!pClipDoc)
+// No clipdoc doesn't mean paste would be forbidden.
+return false;
+}
+
+const ScRange aSrcRange = pClipDoc->GetClipParam().getWholeRange();
+const SCROW nRowSize = aSrcRange.aEnd.Row() - 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-05-22 Thread Mike Kaganski (via logerrit)
 sc/source/ui/docshell/impex.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit c55f64f1f4bcd37f071225c8fedca4265f2a59e3
Author: Mike Kaganski 
AuthorDate: Fri May 21 00:03:43 2021 +0200
Commit: Xisco Fauli 
CommitDate: Sat May 22 08:33:07 2021 +0200

tdf#142395: properly handle "no string delimiter" case

In this case, the delimiter character value would be '\0'.

Change-Id: Idb0f01756991b3ea35a92f11b78fddd56c25265a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115839
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 6155689bb6f1d72f29b43ac5ae94b32522ef9b42)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115851
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 4db43588af50..43d77256a08a 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1553,7 +1553,7 @@ const sal_Unicode* 
ScImportExport::ScanNextFieldFromString( const sal_Unicode* p
 rbIsQuoted = false;
 rField.clear();
 const sal_Unicode cBlank = ' ';
-if (!ScGlobal::UnicodeStrChr( pSeps, cBlank))
+if (cStr && !ScGlobal::UnicodeStrChr(pSeps, cBlank))
 {
 // Cope with broken generators that put leading blanks before a quoted
 // field, like "field1", "field2", "..."
@@ -1564,7 +1564,7 @@ const sal_Unicode* 
ScImportExport::ScanNextFieldFromString( const sal_Unicode* p
 if (*pb == cStr)
 p = pb;
 }
-if ( *p == cStr )   // String in quotes
+if (cStr && *p == cStr) // String in quotes
 {
 rbIsQuoted = true;
 const sal_Unicode* p1;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-05-11 Thread Mike Kaganski (via logerrit)
 sc/source/ui/view/tabview3.cxx |   10 --
 1 file changed, 8 insertions(+), 2 deletions(-)

New commits:
commit 8bdbc928cb2d79e161aaa6a5ac1cd816ab6c591b
Author: Mike Kaganski 
AuthorDate: Tue May 11 21:03:19 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed May 12 02:42:48 2021 +0200

tdf#139241: partially revert 059f07f9f33460c809a93e0fda1165f5c6f6d805

And instead normalize the start and end values before creating
rectangle.

Change-Id: Ib9921f1a537ca88a70cedf989d2f696180ad68e7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115284
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 05f8f239d49bd66145e736b4e2e28ad073ef6f2f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115285
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx
index 214f5a02ca3d..bdb78e9c2e98 100644
--- a/sc/source/ui/view/tabview3.cxx
+++ b/sc/source/ui/view/tabview3.cxx
@@ -65,6 +65,8 @@
 #include 
 #include 
 
+#include 
+
 #include 
 
 namespace
@@ -2684,9 +2686,11 @@ void ScTabView::PaintTopArea( SCCOL nStartCol, SCCOL 
nEndCol )
 tools::Long nStartX = aViewData.GetScrPos( nStartCol, 0, eWhich 
).X();
 tools::Long nEndX;
 if (nEndCol >= rDoc.MaxCol())
-nEndX = nStartX + (bLayoutRTL ? 0 : ( aWinSize.Width()-1 ));
+nEndX = bLayoutRTL ? 0 : ( aWinSize.Width()-1 );
 else
 nEndX = aViewData.GetScrPos( nEndCol+1, 0, eWhich ).X() - 
nLayoutSign;
+if (nStartX > nEndX)
+std::swap(nStartX, nEndX);
 pColBar[eWhich]->Invalidate(
 tools::Rectangle( nStartX, 0, nEndX, aWinSize.Height()-1 ) 
);
 }
@@ -2737,9 +2741,11 @@ void ScTabView::PaintLeftArea( SCROW nStartRow, SCROW 
nEndRow )
 tools::Long nStartY = aViewData.GetScrPos( 0, nStartRow, eWhich 
).Y();
 tools::Long nEndY;
 if (nEndRow >= rDoc.MaxRow())
-nEndY = nStartY + aWinSize.Height() - 1;
+nEndY = aWinSize.Height() - 1;
 else
 nEndY = aViewData.GetScrPos( 0, nEndRow+1, eWhich ).Y() - 1;
+if (nStartY > nEndY)
+std::swap(nStartY, nEndY);
 pRowBar[eWhich]->Invalidate(
 tools::Rectangle( 0, nStartY, aWinSize.Width()-1, nEndY ) 
);
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-05-10 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/view/viewfun2.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit b2fc048cb2d5f5bd1095a8110fa4a16a305a8acc
Author: Andreas Heinisch 
AuthorDate: Tue May 4 10:51:21 2021 +0200
Commit: Xisco Fauli 
CommitDate: Mon May 10 09:25:29 2021 +0200

tdf#43175 - Adjust chart references on every copied sheet

Change-Id: I92fcfeecb9aa10bf8974de953399d780ffe02176
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115058
Tested-by: Jenkins
Tested-by: Xisco Fauli 
Reviewed-by: Noel Grandin 
(cherry picked from commit d55bf8aab008d84fac673f3cd907f5199347ce77)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/115210
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 9bad80bb01d0..c68f2586c3f0 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -3060,6 +3060,16 @@ void ScViewFunc::MoveTable(
 }
 pDocShell->MoveTable( nMovTab, nDestTab1, bCopy, false );   // 
Undo is here
 
+// tdf#43175 - Adjust chart references on every copied sheet
+if (bCopy)
+{
+// New position of source table after moving
+SCTAB nSrcTab = (nDestTab1 <= nMovTab) ? nMovTab + 1 : nMovTab;
+//#i29848# adjust references to data on the copied sheet
+ScChartHelper::AdjustRangesOfChartsOnDestinationPage(rDoc, 
rDestDoc, nSrcTab,
+ 
nDestTab1);
+}
+
 if(bCopy && rDoc.IsScenario(nMovTab))
 {
 OUString aComment;
@@ -3132,10 +3142,6 @@ void ScViewFunc::MoveTable(
 nNewTab--;
 
 SetTabNo( nNewTab, true );
-
-//#i29848# adjust references to data on the copied sheet
-if( bCopy )
-ScChartHelper::AdjustRangesOfChartsOnDestinationPage( rDoc, 
rDestDoc, nTab, nNewTab );
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-29 Thread Mike Kaganski (via logerrit)
 sc/source/core/data/table4.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 80d111c948d1553e9e0015738289b471cfe137f1
Author: Mike Kaganski 
AuthorDate: Thu Apr 29 13:19:43 2021 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 29 21:31:58 2021 +0200

tdf#141970 Revert "tdf#129606: Round the mean of the two subtractions"

This reverts commit d5ebe7c3089ab9f4d3fe0707169fc1ce024cdb70, and
brings number of inexact values in testing back to lower numbers
(see test document in the bug).

Change-Id: I5cfb34b7260fc6e4866585af6a2a50e79696eea2
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114861
Tested-by: Mike Kaganski 
Reviewed-by: Mike Kaganski 
(cherry picked from commit aa096331ba468f19951e43e2550105d4dcf50053)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114865
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index 392eb8847028..37f88e218193 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -208,8 +208,7 @@ double approxDiff( double a, double b )
 // tdf#129606: Limit precision to the 16th significant digit of the least 
precise argument.
 // Cf. mnMaxGeneralPrecision in sc/source/core/data/column3.cxx.
 const int nExpArg = static_cast(floor(log10(std::max(aa, ab - 15;
-// Round the mean of the two subtractions
-return rtl::math::round((c + d) / 2, -std::max(nExp, nExpArg));
+return rtl::math::round(c, -std::max(nExp, nExpArg));
 }
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-29 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/content.hxx|4 +++-
 sc/source/ui/inc/navipi.hxx |1 +
 sc/source/ui/navipi/content.cxx |   10 +-
 sc/source/ui/navipi/navipi.cxx  |   17 ++---
 4 files changed, 27 insertions(+), 5 deletions(-)

New commits:
commit 5f5cf0d66d14ff246a4fce681459eb605d6c5f39
Author: Caolán McNamara 
AuthorDate: Mon Apr 26 10:44:55 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 29 14:57:08 2021 +0200

Related: tdf#130326 skip calling Refresh if its already just called

Change-Id: I80d3ae7f10b56dfe53a4ab5101ae771b47848092
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114877
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index f91636802901..985b4665dfc8 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -151,7 +151,9 @@ public:
 voidSetRootType( ScContentId nNew );
 ScContentId  GetRootType() const { return nRootType; }
 
-voidActiveDocChanged();
+// return true if Refresh was called to allow detecting that the navigator
+// tree is now up to date
+boolActiveDocChanged();
 voidResetManualDoc();
 voidSetManualDoc(const OUString& rName);
 voidLoadFile(const OUString& rUrl);
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index 43d48dc74f59..61c4e6da4f4f 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -142,6 +142,7 @@ private:
 voidSetCurrentObject( const OUString& rName );
 voidSetCurrentDoc( const OUString& rDocName );
 voidUpdateSelection();
+voidContentUpdated(); // stop aContentIdle because content is up to 
date
 
 static ScTabViewShell*  GetTabViewShell();
 static ScNavigatorSettings* GetNavigatorSettings();
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 692894ec8270..1fb9697c6fca 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -1409,10 +1409,15 @@ void ScContentTree::ResetManualDoc()
 ActiveDocChanged();
 }
 
-void ScContentTree::ActiveDocChanged()
+bool ScContentTree::ActiveDocChanged()
 {
+bool bRefreshed = false;
+
 if ( !bHiddenDoc && aManualDoc.isEmpty() )
+{
 Refresh();  // content only if 
automatic
+bRefreshed = true;
+}
 
 //  if flag active Listbox must be updated
 
@@ -1430,12 +1435,15 @@ void ScContentTree::ActiveDocChanged()
 
 aManualDoc.clear(); // again automatically
 Refresh();
+bRefreshed = true;
 pSh = GetManualOrCurrent(); // should be active now
 if (pSh)
 aCurrent = pSh->GetTitle();
 }
 }
 pParentWindow->GetDocNames(  );// select
+
+return bRefreshed;
 }
 
 void ScContentTree::SetManualDoc(const OUString& rName)
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index f9f196d3717b..16e546b8d1c9 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -484,8 +484,14 @@ void ScNavigatorDlg::Notify( SfxBroadcaster&, const 
SfxHint& rHint )
 if (pHint->GetEventId() == SfxEventHintId::ActivateDoc)
 {
 UpdateSheetLimits();
-m_xLbEntries->ActiveDocChanged();
-UpdateAll();
+bool bRefreshed = m_xLbEntries->ActiveDocChanged();
+// UpdateAll just possibly calls Refresh (and always
+// ContentUpdated) so if ActiveDocChanged already called Refresh
+// skip re-calling it
+if (bRefreshed)
+ContentUpdated();
+else
+UpdateAll();
 }
 }
 else
@@ -750,7 +756,12 @@ void ScNavigatorDlg::UpdateAll()
 break;
 }
 
-aContentIdle.Stop();   // not again
+ContentUpdated();   // not again
+}
+
+void ScNavigatorDlg::ContentUpdated()
+{
+aContentIdle.Stop();
 }
 
 void ScNavigatorDlg::SetListMode(NavListMode eMode)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source sw/source

2021-04-29 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/content.hxx   |2 -
 sc/source/ui/navipi/content.cxx|   55 +
 sc/source/ui/navipi/navipi.cxx |5 ---
 sw/source/uibase/utlui/content.cxx |4 +-
 4 files changed, 4 insertions(+), 62 deletions(-)

New commits:
commit f275e019199baa931f1e4681e1bf29d68aae7a32
Author: Caolán McNamara 
AuthorDate: Mon Apr 26 09:36:14 2021 +0100
Commit: Caolán McNamara 
CommitDate: Thu Apr 29 14:32:09 2021 +0200

Related: tdf#130326 drop ScContentTree::ObjectFresh

this was introduced as part of the large IA2 integration

commit b41332475783c31136673fb44cf4c411bb0148f8
Author: Steve Yin 
Date:   Mon Dec 2 15:54:29 2013 +

Integrate branch of IAccessible2

Both calc and writer gained the feature that "space" in the navigator
for drawing objects selects the highlighted object, extending the
selection of another one is already selected. (notably impress was
left unchanged)

In calc, but not writer, an ObjectFresh was added which fires
on every SfxHintId::ScKillEditView which is broadcast on every
exit of the cursor from a cell. Its purpose seems to be primarily to
re-highlight the last selected-by-keyboard entry on a content refresh.

As far as I can tell this doesn't seem necessary and we already refresh
content on SfxHintId::ScDrawChanged events so we shouldn't need to
additionally refresh on ScKillEditView and refreshing on every
ScKillEditView is very slow on navigating through a calc document with a
lot of drawing objects.

Change-Id: I64b2840f8510d474314d108e657fc3367f8ab6c0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114876
Reviewed-by: Noel Grandin 
Reviewed-by: Caolán McNamara 
Tested-by: Jenkins

diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 1c0d2c27c4d5..f91636802901 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -55,7 +55,6 @@ class ScContentTree
 ScDocument* pHiddenDocument;// temporary
 boolbisInNavigatoeDlg;
 boolm_bFreeze;
-OUStringsKeyString;
 ImplSVEvent*m_nAsyncMouseReleaseId;
 
 o3tl::enumarray pPosList; // for the sequence
@@ -124,7 +123,6 @@ public:
 ScContentTree(std::unique_ptr xTreeView, ScNavigatorDlg* 
pNavigatorDlg);
 ~ScContentTree();
 
-void ObjectFresh(ScContentId nType, const weld::TreeIter* pEntry = 
nullptr);
 void SetNavigatorDlgFlag(bool isInNavigateDlg){ 
bisInNavigatoeDlg=isInNavigateDlg;};
 
 voidset_selection_mode(SelectionMode eMode)
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 9ec35128176b..692894ec8270 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -451,7 +451,8 @@ IMPL_LINK(ScContentTree, KeyInputHdl, const KeyEvent&, 
rKEvt, bool)
 break;
 }
 }
-//Make KEY_SPACE has same function as DoubleClick
+//Make KEY_SPACE has same function as DoubleClick, and realize
+//multi-selection.
 if ( bisInNavigatoeDlg )
 {
 if(aCode.GetCode() == KEY_SPACE )
@@ -469,7 +470,6 @@ IMPL_LINK(ScContentTree, KeyInputHdl, const KeyEvent&, 
rKEvt, bool)
 if ( bHiddenDoc )
 return true;//! later...
 OUString aText(m_xTreeView->get_text(*xEntry));
-sKeyString = aText;
 if (!aManualDoc.isEmpty())
 pParentWindow->SetCurrentDoc( aManualDoc );
 switch (nType)
@@ -503,7 +503,6 @@ IMPL_LINK(ScContentTree, KeyInputHdl, const KeyEvent&, 
rKEvt, bool)
 }
 if (!bHasMakredObject && pScTabViewShell)
 pScTabViewShell->SetDrawShell(false);
-ObjectFresh(nType, xEntry.get());
 }
 break;
 }
@@ -663,56 +662,6 @@ ScDocument* ScContentTree::GetSourceDocument()
 return nullptr;
 }
 
-//Move along and draw "*" sign .
-void ScContentTree::ObjectFresh(ScContentId nType, const weld::TreeIter* 
pEntry)
-{
-if (bHiddenDoc && !pHiddenDocument)
-return; // other document displayed
-
-if (!(nType == ScContentId::GRAPHIC || nType == ScContentId::OLEOBJECT || 
nType == ScContentId::DRAWING))
-return;
-
-auto nOldChildren = m_aRootNodes[nType] ? 
m_xTreeView->iter_n_children(*m_aRootNodes[nType]) : 0;
-auto nOldPos = m_xTreeView->vadjustment_get_value();
-
-freeze();
-ClearType( nType );
-GetDrawNames( nType/*, nId*/ );
-thaw();
-
-auto nNewChildren = m_aRootNodes[nType] ? 
m_xTreeView->iter_n_children(*m_aRootNodes[nType]) : 0;
-bool bRestorePos = nOldChildren == nNewChildren;
-
-if (!pEntry)
-

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-25 Thread scito (via logerrit)
 sc/source/core/data/document.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 06d5d625e1dc8489e51b962353ac423669e61fed
Author: scito 
AuthorDate: Fri Apr 23 11:07:46 2021 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Apr 26 02:30:43 2021 +0200

tdf#95554 fix ScDocument::GetClipArea() for rows: use > instead of <

I did not write any tests, as the multi range copying to system clipboard
has another issue, see  tdf#141847

Change-Id: I3af58d68370038274a07d753809fb4ceca9016f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114534
Reviewed-by: Mike Kaganski 
Tested-by: Jenkins
(cherry picked from commit 7c1e22152ed1a1837782a55fc9997f8e7801681b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114510
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index 820676d56cc6..b3cac25303af 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -3134,7 +3134,7 @@ void ScDocument::GetClipArea(SCCOL& nClipX, SCROW& 
nClipY, bool bIncludeFiltered
 nStartRow = rRange2.aStart.Row();
 if (rRange2.aEnd.Col() > nEndCol)
 nEndCol = rRange2.aEnd.Col();
-if (rRange2.aEnd.Row() < nEndRow)
+if (rRange2.aEnd.Row() > nEndRow)
 nEndRow = rRange2.aEnd.Row();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-25 Thread Caolán McNamara (via logerrit)
 sc/source/ui/navipi/content.cxx |   21 ++---
 1 file changed, 10 insertions(+), 11 deletions(-)

New commits:
commit 59ec383c75837b017cd593adb2a85fba9b2970c5
Author: Caolán McNamara 
AuthorDate: Fri Apr 23 17:15:57 2021 +0100
Commit: Noel Grandin 
CommitDate: Sun Apr 25 16:41:05 2021 +0200

Related: tdf#130326: GetDrawNames doesn't do anything when 
!bisInNavigatoeDlg

so return early instead of looping to do nothing

Change-Id: Ibb8fe1409a8e66d37d51d9a1b99ce135f36b9522
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114589
Tested-by: Jenkins
Reviewed-by: Noel Grandin 

diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 9383f343bfc0..9ec35128176b 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -863,6 +863,9 @@ bool ScContentTree::IsPartOfType( ScContentId nContentType, 
sal_uInt16 nObjIdent
 
 void ScContentTree::GetDrawNames( ScContentId nType )
 {
+if (!bisInNavigatoeDlg)
+return;
+
 if ( nRootType != ScContentId::ROOT && nRootType != nType )  
// hidden ?
 return;
 
@@ -894,19 +897,15 @@ void ScContentTree::GetDrawNames( ScContentId nType )
 OUString aName = ScDrawLayer::GetVisibleName( pObject );
 if (!aName.isEmpty())
 {
-if( bisInNavigatoeDlg )
+weld::TreeIter* pParent = m_aRootNodes[nType].get();
+if (pParent)
 {
-weld::TreeIter* pParent = 
m_aRootNodes[nType].get();
-if (pParent)
-{
-m_xTreeView->insert(pParent, -1, , 
nullptr, nullptr, nullptr, false, m_xScratchIter.get());
-m_xTreeView->set_sensitive(*m_xScratchIter, 
true);
-}//end if parent
-else
-SAL_WARN("sc", "InsertContent without parent");
-}
+m_xTreeView->insert(pParent, -1, , nullptr, 
nullptr, nullptr, false, m_xScratchIter.get());
+m_xTreeView->set_sensitive(*m_xScratchIter, true);
+}//end if parent
+else
+SAL_WARN("sc", "InsertContent without parent");
 }
-
 }
 
 pObject = aIter.Next();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-22 Thread Julien Nabet (via logerrit)
 sc/source/ui/unoobj/chartuno.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 613a80b855406d180a663a4aec974c40be195395
Author: Julien Nabet 
AuthorDate: Wed Apr 7 22:26:30 2021 +0200
Commit: Xisco Fauli 
CommitDate: Thu Apr 22 10:19:55 2021 +0200

tdf#141537: UNO Object Inspector: Crash while inspecting file

See bt:
6  0x7f276e146773 in ScChartsObj::getByName(rtl::OUString const&) 
(this=0x7738e00, aName="Object 1") at sc/source/ui/unoobj/chartuno.cxx:345
7  0x7f276e146865 in non-virtual thunk to 
ScChartsObj::getByName(rtl::OUString const&) () at 
sc/source/ui/unoobj/chartuno.cxx:348
8  0x7f27a1d87b7f in (anonymous 
namespace)::NameAccessTreeEntry::fill(std::unique_ptr >&, weld::TreeIter const&)
   (this=0x6d463e0, pDocumentModelTree=std::unique_ptr = {...}, rParent=...) at 
sfx2/source/devtools/DocumentModelTreeHandler.cxx:139
9  0x7f27a1d87905 in (anonymous 
namespace)::ChartsEntry::fill(std::unique_ptr >&, weld::TreeIter const&)
   (this=0x6d463e0, pDocumentModelTree=std::unique_ptr = {...}, rParent=...) at 
sfx2/source/devtools/DocumentModelTreeHandler.cxx:596
10 0x7f27a1d842e5 in 
DocumentModelTreeHandler::ExpandingHandler(weld::TreeIter const&) 
(this=0x76e3850, rParent=...) at sfx2/source/devtools/DocumentModelTreeHandl

chart isn't retrieved from there:
0  sc::tools::findChartsByName(ScDocShell*, short, 
std::basic_string_view >, 
sc::tools::ChartSourceType)
   (pDocShell=0x351baa0, nTab=0, rName=u"Object 1", 
eChartSourceType=sc::tools::ChartSourceType::CELL_RANGE) at 
sc/source/ui/unoobj/ChartTools.cxx:106
1  0x7f6297305323 in ScChartsObj::GetObjectByName_Impl(rtl::OUString 
const&) const (this=0x77ce370, aName="Object 1") at 
sc/source/ui/unoobj/chartuno.cxx:126
2  0x7f62973076b4 in ScChartsObj::getByName(rtl::OUString const&) 
(this=0x77ce370, aName="Object 1") at sc/source/ui/unoobj/chartuno.cxx:343

Indeed, if graph hasn't type ChartSourceType::CELL_RANGE, it could be 
ChartSourceType::PIVOT_TABLE

Change-Id: Id5a248535b214ad5f114671c52e4592d87c9f54a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113777
Reviewed-by: Julien Nabet 
(cherry picked from commit 42e0ea0a6e4f48967d58fa95081c8ba5a6b08bc6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114361
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/unoobj/chartuno.cxx b/sc/source/ui/unoobj/chartuno.cxx
index 638d517b4083..ac10a2ad35ef 100644
--- a/sc/source/ui/unoobj/chartuno.cxx
+++ b/sc/source/ui/unoobj/chartuno.cxx
@@ -125,6 +125,8 @@ ScChartObj* ScChartsObj::GetObjectByName_Impl(const 
OUString& aName) const
 {
 if (sc::tools::findChartsByName(pDocShell, nTab, aName, 
sc::tools::ChartSourceType::CELL_RANGE))
 return new ScChartObj( pDocShell, nTab, aName );
+if (sc::tools::findChartsByName(pDocShell, nTab, aName, 
sc::tools::ChartSourceType::PIVOT_TABLE))
+return new ScChartObj( pDocShell, nTab, aName );
 return nullptr;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-20 Thread Tünde Tóth (via logerrit)
 sc/source/ui/view/gridwin.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 77da04eb2ff83fe79e3ed8d79bc4f5f81af9119f
Author: Tünde Tóth 
AuthorDate: Tue Apr 13 14:16:26 2021 +0200
Commit: Xisco Fauli 
CommitDate: Tue Apr 20 21:14:16 2021 +0200

tdf#93664 sc: fix filtering clicking on cells merged horizontally

Click on the filter button of cells merged horizontally
showed the "Empty" entry instead of the filter list.

Pressing Alt-Down (.uno:DataSelect) worked correctly here,
so only mouse handling was broken. This was a regression
from commit aaab3a79dfd762a64fa4c1d19dd29ae46c0b9dd0
"Resolves: #i120017, filter button is not shown in merged cell"
(which fixed filtering clicking on cells merged vertically).
Partial revert of that commit sets the correct
first column in the merged range again instead of the last one.

Change-Id: I83724f18580134868867bc829cad0739f0932733
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114050
Tested-by: László Németh 
Reviewed-by: László Németh 
(cherry picked from commit b7d8ee083230964de2e1580c4639ee4cd307207f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/114353
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index cf781d0319b4..d794e1c9bcdb 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -1734,14 +1734,17 @@ void ScGridWindow::HandleMouseButtonDown( const 
MouseEvent& rMEvt, MouseEventSta
 SCCOL nRealPosX;
 SCROW nRealPosY;
 mrViewData.GetPosFromPixel( aPos.X(), aPos.Y(), eWhich, nRealPosX, 
nRealPosY, false );//the real row/col
-const ScMergeFlagAttr* pRealPosAttr = rDoc.GetAttr( nRealPosX, 
nRealPosY, nTab, ATTR_MERGE_FLAG );
-const ScMergeFlagAttr* pAttr = rDoc.GetAttr( nPosX, nPosY, nTab, 
ATTR_MERGE_FLAG );
+
+// show in the merged cells the filter of the first cell (nPosX 
instead of nRealPosX)
+const ScMergeFlagAttr* pRealPosAttr = rDoc.GetAttr(nPosX, nRealPosY, 
nTab, ATTR_MERGE_FLAG);
 if( pRealPosAttr->HasAutoFilter() )
 {
 SC_MOD()->InputEnterHandler();
-if (DoAutoFilterButton( nRealPosX, nRealPosY, rMEvt))
+if (DoAutoFilterButton(nPosX, nRealPosY, rMEvt))
 return;
 }
+
+const ScMergeFlagAttr* pAttr = rDoc.GetAttr(nPosX, nPosY, nTab, 
ATTR_MERGE_FLAG);
 if (pAttr->HasAutoFilter())
 {
 if (DoAutoFilterButton(nPosX, nPosY, rMEvt))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-10 Thread Xisco Fauli (via logerrit)
 sc/source/filter/oox/workbookfragment.cxx |9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 77e95e208c9d22eb1350d75135e09426c16a6726
Author: Xisco Fauli 
AuthorDate: Thu Apr 8 17:27:41 2021 +0200
Commit: Noel Grandin 
CommitDate: Sat Apr 10 10:38:09 2021 +0200

tdf#141416: partial revert of the fix for tdf#81396

d4743045a0b320449d07a957463a76bb8b13f939 < the cells need to
be imported before we handle charts, tdf#81396 >

Import time of sample file in tdf#141416 goes from more than an hour
to 1 minute while keeping tdf#81396 fixed
Unittest for tdf#81396 added in 9a59068fc31d7150e255ada91c59b8299636f185

Change-Id: Ic15d57945069397076c483b6ef8f3070057db317
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113818
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 
(cherry picked from commit 30f222c91fa816a7863bf4bfc4a36e503e0bf2d3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113768
Reviewed-by: Noel Grandin 

diff --git a/sc/source/filter/oox/workbookfragment.cxx 
b/sc/source/filter/oox/workbookfragment.cxx
index ac92e96d6e41..7b6a5c2f17a3 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -481,13 +481,10 @@ void WorkbookFragment::finalizeImport()
 
 // final conversions, e.g. calculation settings and view settings
 finalizeWorkbookImport();
-//
+
 //stop preventing establishment of listeners as is done in
 //ScDocShell::AfterXMLLoading() for ods
 getScDocument().SetInsertingFromOtherDoc(false);
-getDocImport().finalize();
-
-recalcFormulaCells();
 
 for( WorksheetHelper* pHelper : aHelpers )
 {
@@ -501,6 +498,10 @@ void WorkbookFragment::finalizeImport()
 rxSheetGlob.reset();
 }
 
+getDocImport().finalize();
+
+recalcFormulaCells();
+
 OUString aRevHeadersPath = 
getFragmentPathFromFirstType(CREATE_OFFICEDOC_RELATION_TYPE("revisionHeaders"));
 if (!aRevHeadersPath.isEmpty())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-07 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/compiler.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit f987d7d7ce97bb40d571ec2f4248149e7f261ee2
Author: Eike Rathke 
AuthorDate: Tue Apr 6 20:58:25 2021 +0200
Commit: Caolán McNamara 
CommitDate: Wed Apr 7 12:31:21 2021 +0200

Resolves: tdf#128334 Reset mnCurrentSheetEndPos, mnCurrentSheetTab in all 
cases

Encountered for a single decimal separator not being a value
either, but could be for any condition within IsReference()
returning false up to the IsSingleReference() call.

Change-Id: I6222adf2a2d06904001175da8798b2ba9fdef99c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113697
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 4d4fd4cc57a37a5f24178cf8bac63d979f4323da)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113647
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 85ceb6a0d8f3..7dd0ca5374a7 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -,6 +,12 @@ bool ScCompiler::IsSingleReference( const OUString& 
rName, const OUString* pErrR
 bool ScCompiler::IsReference( const OUString& rName, const OUString* pErrRef )
 {
 // Has to be called before IsValue
+
+// A later IsNamedRange() relies on these, being set in IsSingleReference()
+// if so, reset in all cases.
+mnCurrentSheetEndPos = 0;
+mnCurrentSheetTab = -1;
+
 sal_Unicode ch1 = rName[0];
 sal_Unicode cDecSep = ( mxSymbols->isEnglish() ? '.' : 
ScGlobal::getLocaleDataPtr()->getNumDecimalSep()[0] );
 if ( ch1 == cDecSep )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-04-06 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/compiler.cxx |9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit cc7cdddac7b8e2317d300120cc5b359394a9d310
Author: Caolán McNamara 
AuthorDate: Fri Apr 2 14:28:37 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Apr 6 12:13:41 2021 +0200

ofz: Segv on unknown address

Change-Id: I6c69375a89781fc0b87230203335c861efb562f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113481
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index eb8706596910..85ceb6a0d8f3 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2643,7 +2643,14 @@ Label_MaskStateMachine:
 if (eState != ssSkipReference)
 {
 *pSym++ = c;
-*pSym++ = *pSrc++;
+
+if( pSym == [ MAXSTRLEN ] )
+{
+SetError( 
FormulaError::StringOverflow);
+eState = ssStop;
+}
+else
+*pSym++ = *pSrc++;
 }
 bAddToSymbol = false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-03-30 Thread Caolán McNamara (via logerrit)
 sc/source/ui/condformat/condformatdlg.cxx |9 +
 sc/source/ui/inc/condformatdlgentry.hxx   |1 +
 2 files changed, 10 insertions(+)

New commits:
commit f2cae3f0febc6f1909e14a4fd5060977fd096f00
Author: Caolán McNamara 
AuthorDate: Thu Mar 18 14:21:22 2021 +
Commit: Michael Stahl 
CommitDate: Tue Mar 30 11:35:25 2021 +0200

tdf#118482 set a scroll step of the height of a collapsed entry

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

diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 09432d8f6454..4744b99e1125 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -177,6 +177,8 @@ void ScCondFormatList::RecalcAll()
 if (mbFrozen)
 return;
 
+int nWheelScroll = SAL_MAX_INT32;
+
 sal_Int32 nIndex = 1;
 for (const auto& item : maEntries)
 {
@@ -184,8 +186,15 @@ void ScCondFormatList::RecalcAll()
 continue;
 item->SetIndex(nIndex);
 item->set_grid_top_attach(nIndex - 1);
+nWheelScroll = std::min(nWheelScroll, item->get_preferred_height());
 ++nIndex;
 }
+
+if (nWheelScroll != SAL_MAX_INT32)
+{
+// tdf#118482 set a scroll step of the height of a collapsed entry
+mxScrollWindow->vadjustment_set_step_increment(nWheelScroll);
+}
 }
 
 IMPL_LINK(ScCondFormatList, ColFormatTypeHdl, weld::ComboBox&, rBox, void)
diff --git a/sc/source/ui/inc/condformatdlgentry.hxx 
b/sc/source/ui/inc/condformatdlgentry.hxx
index bf2d80fba2e0..aed63be47729 100644
--- a/sc/source/ui/inc/condformatdlgentry.hxx
+++ b/sc/source/ui/inc/condformatdlgentry.hxx
@@ -77,6 +77,7 @@ public:
 void Show() { mxGrid->show(); }
 
 void set_grid_top_attach(int nAttach) { 
mxBorder->set_grid_top_attach(nAttach); }
+int get_preferred_height() const { return 
mxBorder->get_preferred_size().Height(); }
 
 void SetPos(const ScAddress& rPos) { maPos = rPos; };
 bool IsSelected() const { return mbActive;}
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-03-26 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/interpr1.cxx |  109 ++-
 1 file changed, 73 insertions(+), 36 deletions(-)

New commits:
commit a08afaadb6249482a9ca448bde60c618c7eda3bd
Author: Eike Rathke 
AuthorDate: Thu Mar 25 12:04:22 2021 +0100
Commit: Xisco Fauli 
CommitDate: Fri Mar 26 12:19:54 2021 +0100

Resolves: tdf#141146 Fix LOOKUP in array with result scalar / single 
reference

The returns are identical to the cell range search.

Also, the single reference case is just a special case of range
reference and acts as row vector (as number of rows is not greater
than number of columns), equally extending the passed "range" if
found position is greater than 1.

Extending a result range such leads to the result cell not being
listened to and not acting on its changes, this was always the case for
results of an extended range, and Excel seems to have the same problem.
This is logical because the range cell is unknown in advance, and
certainly we don't want to make LOOKUP() a volatile function being
executed on each change everywhere.

Solutions to this could be:
- create a single cell broadcaster/listener on the fly while pushing the
  out-of-band cell result
  - this is nasty and modifying the model while interpreting is ugly and
error prone and it's unclear who should destroy such broadcaster if
the query or data range/array changed
- so this is a no-go
- create a range broadcaster/listener for the entire row right of the
  cell
  - would mean to inspect during listener setup to which parameter of
which OpCode a reference belongs
- really? ...no
  - which also doesn't help if a given range is too short and is
extended
- would mean to always extend the listener either as row or column
* doubtable if it is really worth it for this one time off fouled up
  Excel behaviour
* or should we rather return an error for out-of-band results?
  - but then again for ranges it always worked this like
+ do not advertise, or strongly deprecate such use
  + a result range should have the same length as the search
range/array

Change-Id: Ie903f4491844306d3768ee40bd16786ebe648461
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113085
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 042dbf83122b14fd1dd32705c8f8b7d65c22f21b)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113113
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 507a7aeb2eef..4204215d8d97 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -6583,10 +6583,9 @@ void ScInterpreter::ScLookup()
 SCSIZE nLenMajor = 0;   // length of major direction
 bool bVertical = true;  // whether to lookup vertically or horizontally
 
-// The third parameter, result array, for double, string and single 
reference.
+// The third parameter, result array, double, string and reference.
 double fResVal = 0.0;
 svl::SharedString aResStr;
-ScAddress aResAdr;
 StackVar eResArrayType = svUnknown;
 
 if (nParamCount == 3)
@@ -6608,6 +6607,11 @@ void ScInterpreter::ScLookup()
 }
 }
 break;
+case svSingleRef:
+PopSingleRef( nResCol1, nResRow1, nResTab);
+nResCol2 = nResCol1;
+nResRow2 = nResRow1;
+break;
 case svMatrix:
 case svExternalSingleRef:
 case svExternalDoubleRef:
@@ -6634,9 +6638,6 @@ void ScInterpreter::ScLookup()
 case svString:
 aResStr = GetString();
 break;
-case svSingleRef:
-PopSingleRef( aResAdr );
-break;
 default:
 PushIllegalParameter();
 return;
@@ -6782,13 +6783,12 @@ void ScInterpreter::ScLookup()
 PushString( aResStr );
 break;
 case svDoubleRef:
-aResAdr.Set( nResCol1, nResRow1, nResTab);
-[[fallthrough]];
 case svSingleRef:
-PushCellResultToken( true, aResAdr, nullptr, nullptr);
+PushCellResultToken( true, ScAddress( nResCol1, nResRow1, 
nResTab), nullptr, nullptr);
 break;
 default:
-OSL_FAIL( "ScInterpreter::ScLookup: unhandled 
eResArrayType, single value data");
+assert(!"ScInterpreter::ScLookup: unhandled eResArrayType, 
single value data");
+PushIllegalParameter();
 }
 }
 else
@@ -6805,7 +6805,8 @@ void ScInterpreter::ScLookup()
 PushCellResultToken( true, aDataAdr, nullptr, nullptr);
  

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-03-24 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/content.hxx|2 +-
 sc/source/ui/navipi/content.cxx |   14 +-
 2 files changed, 14 insertions(+), 2 deletions(-)

New commits:
commit 3c8c4d4976e977ab110b0b59941cce7b36603e55
Author: Caolán McNamara 
AuthorDate: Mon Mar 22 16:58:59 2021 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Mar 24 12:53:55 2021 +0100

tdf#133159 store current config before changing sheet

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

diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index 53f234fdd145..1c0d2c27c4d5 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -165,7 +165,7 @@ public:
 /** Applies the navigator settings to the listbox. */
 void ApplyNavigatorSettings(bool bRestoreScrollPos = false, int nScrollPos 
= 0);
 /** Stores the current listbox state in the navigator settings. */
-void StoreNavigatorSettings() const;
+void StoreNavigatorSettings();
 };
 
 #endif // INCLUDED_SC_SOURCE_UI_INC_CONTENT_HXX
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 423bef3ef8a1..9383f343bfc0 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -333,7 +333,13 @@ IMPL_LINK_NOARG(ScContentTree, ContentDoubleClickHdl, 
weld::TreeView&, bool)
 switch( nType )
 {
 case ScContentId::TABLE:
+{
+// tdf#133159 store current config before changing sheet
+// plausible that this should be done for all cases, but this
+// is the known case that needs it
+StoreNavigatorSettings();
 pParentWindow->SetCurrentTableStr( aText );
+}
 break;
 
 case ScContentId::RANGENAME:
@@ -1628,8 +1634,14 @@ void ScContentTree::ApplyNavigatorSettings(bool 
bRestorePos, int nScrollPos)
 }
 }
 
-void ScContentTree::StoreNavigatorSettings() const
+void ScContentTree::StoreNavigatorSettings()
 {
+if (m_nAsyncMouseReleaseId)
+{
+Application::RemoveUserEvent(m_nAsyncMouseReleaseId);
+m_nAsyncMouseReleaseId = nullptr;
+}
+
 ScNavigatorSettings* pSettings = ScNavigatorDlg::GetNavigatorSettings();
 if( !pSettings )
 return;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-03-17 Thread Noel Grandin (via logerrit)
 sc/source/ui/view/hintwin.cxx |   15 +++
 1 file changed, 15 insertions(+)

New commits:
commit b6e705ec690b9911ce44f3e6cb1273737449f186
Author: Noel Grandin 
AuthorDate: Sat Mar 13 20:35:12 2021 +0200
Commit: Noel Grandin 
CommitDate: Wed Mar 17 08:25:05 2021 +0100

tdf#140986 hang in validity message

this doesn't fix the root of the problem (something generating an
insanely long validation message).
It just prevents that problem from locking up the UI.

Change-Id: I334729a30eca4a11d0150e3c89ff11c92a862061
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112461
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 924733c65902d0b17764aded56c88c99d4b9a568)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112529

diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx
index d690ab33d002..047b3be2dc3e 100644
--- a/sc/source/ui/view/hintwin.cxx
+++ b/sc/source/ui/view/hintwin.cxx
@@ -31,6 +31,7 @@
 #include 
 #include 
 #include 
+#include 
 
 #define HINT_LINESPACE  2
 #define HINT_INDENT 3
@@ -104,9 +105,16 @@ drawinglayer::primitive2d::Primitive2DContainer 
ScOverlayHint::createOverlaySequ
 
 sal_Int32 nIndex = 0;
 Point aLineStart = aTextStart;
+sal_Int32 nLineCount = 0;
 while (nIndex != -1)
 {
 OUString aLine = m_aMessage.getToken( 0, '\r', nIndex );
+if (aLine.getLength() > 255)
+{
+// prevent silliness higher up from hanging up the program
+SAL_WARN("sc", "ridiculously long line, truncating, len=" << 
aLine.getLength());
+aLine = aLine.copy(0,255);
+}
 
 aTextMatrix = basegfx::utils::createScaleTranslateB2DHomMatrix(
 aFontSize.getX(), aFontSize.getY(),
@@ -125,6 +133,13 @@ drawinglayer::primitive2d::Primitive2DContainer 
ScOverlayHint::createOverlaySequ
 aSeq.push_back(aMessage);
 
 aLineStart.AdjustY(nLineHeight );
+nLineCount++;
+if (nLineCount > 50)
+{
+// prevent silliness higher up from hanging up the program
+SAL_WARN("sc", "ridiculously long message, bailing out");
+break;
+}
 }
 
 rRange.expand(basegfx::B2DTuple(rRange.getMaxX() + aHintMargin.Width(),
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source sd/source svx/source

2021-03-16 Thread Samuel Mehrbrodt (via logerrit)
 sc/source/ui/inc/gridwin.hxx   |2 +-
 sc/source/ui/view/gridwin.cxx  |2 +-
 sc/source/ui/view/gridwin3.cxx |7 ++-
 sd/source/ui/view/drviews4.cxx |4 ++--
 svx/source/form/fmview.cxx |   28 
 5 files changed, 38 insertions(+), 5 deletions(-)

New commits:
commit ea9fff260129ccfa4755e96c08432252efbe5621
Author: Samuel Mehrbrodt 
AuthorDate: Wed Mar 3 07:47:43 2021 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Mar 16 09:00:23 2021 +0100

tdf#139804 Focus form controls inside document with Alt-

Change-Id: I710a23a53ca0eb256a477a78ce1b7ae01129f717
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111865
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit 67ad205404211a2ae17c430a17ede6e9d04d0b7e)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112431
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/inc/gridwin.hxx b/sc/source/ui/inc/gridwin.hxx
index 2202b3647563..afcfe268b95f 100644
--- a/sc/source/ui/inc/gridwin.hxx
+++ b/sc/source/ui/inc/gridwin.hxx
@@ -263,7 +263,7 @@ class SAL_DLLPUBLIC_RTTI ScGridWindow : public vcl::Window, 
public DropTargetHel
 boolDrawMouseButtonDown(const MouseEvent& rMEvt);
 boolDrawMouseButtonUp(const MouseEvent& rMEvt);
 boolDrawMouseMove(const MouseEvent& rMEvt);
-boolDrawKeyInput(const KeyEvent& rKEvt);
+boolDrawKeyInput(const KeyEvent& rKEvt, vcl::Window* pWin);
 boolDrawCommand(const CommandEvent& rCEvt);
 boolDrawHasMarkedObj();
 voidDrawEndAction();
diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index fa8b2a4e1b64..cf781d0319b4 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -3289,7 +3289,7 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt)
 if (mrViewData.GetDocShell()->GetProgress())
 return;
 
-if (DrawKeyInput(rKEvt))
+if (DrawKeyInput(rKEvt, this))
 {
 const vcl::KeyCode& rLclKeyCode = rKEvt.GetKeyCode();
 if (rLclKeyCode.GetCode() == KEY_DOWN
diff --git a/sc/source/ui/view/gridwin3.cxx b/sc/source/ui/view/gridwin3.cxx
index e78a97cd5e3f..948f388ca866 100644
--- a/sc/source/ui/view/gridwin3.cxx
+++ b/sc/source/ui/view/gridwin3.cxx
@@ -167,10 +167,15 @@ bool ScGridWindow::DrawCommand(const CommandEvent& rCEvt)
 return false;
 }
 
-bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt)
+bool ScGridWindow::DrawKeyInput(const KeyEvent& rKEvt, vcl::Window* pWin)
 {
 ScDrawView* pDrView = mrViewData.GetScDrawView();
 FuPoor* pDraw = mrViewData.GetView()->GetDrawFuncPtr();
+
+
+if (pDrView && pDrView->KeyInput(rKEvt, pWin))
+return true;
+
 if (pDrView && pDraw && !mrViewData.IsRefMode())
 {
 pDraw->SetWindow( this );
diff --git a/sd/source/ui/view/drviews4.cxx b/sd/source/ui/view/drviews4.cxx
index b6a9d424a8db..e1c7831e11a7 100644
--- a/sd/source/ui/view/drviews4.cxx
+++ b/sd/source/ui/view/drviews4.cxx
@@ -147,9 +147,9 @@ void DrawViewShell::DeleteActualLayer()
 
 bool DrawViewShell::KeyInput (const KeyEvent& rKEvt, ::sd::Window* pWin)
 {
-bool bRet = false;
+bool bRet = GetView()->KeyInput(rKEvt, pWin);
 
-if ( !IsInputLocked() || ( rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE ) )
+if (!bRet && (!IsInputLocked() || (rKEvt.GetKeyCode().GetCode() == 
KEY_ESCAPE)))
 {
 if(KEY_RETURN == rKEvt.GetKeyCode().GetCode()
 && rKEvt.GetKeyCode().IsMod1()
diff --git a/svx/source/form/fmview.cxx b/svx/source/form/fmview.cxx
index aec343857f75..3a4b443f4541 100644
--- a/svx/source/form/fmview.cxx
+++ b/svx/source/form/fmview.cxx
@@ -41,11 +41,14 @@
 #include 
 #include 
 #include 
+#include 
 #include 
+#include 
 #include 
 #include 
 #include 
 #include 
+#include 
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -493,6 +496,31 @@ bool FmFormView::KeyInput(const KeyEvent& rKEvt, 
vcl::Window* pWin)
 
 }
 
+// tdf#139804 Allow selecting form controls with Alt-
+if (rKeyCode.IsMod2() && rKeyCode.GetCode())
+{
+FmFormPage* pCurPage = GetCurPage();
+for (size_t a = 0; a < pCurPage->GetObjCount(); ++a)
+{
+SdrObject* pObj = pCurPage->GetObj(a);
+FmFormObj* pFormObject = FmFormObj::GetFormObject(pObj);
+if (!pFormObject)
+continue;
+
+Reference xControl = 
pFormObject->GetUnoControl(*this, *pWin);
+if (!xControl.is())
+continue;
+const vcl::I18nHelper& rI18nHelper = 
Application::GetSettings().GetUILocaleI18nHelper();
+VclPtr pWindow = 
VCLUnoHelper::GetWindow(xControl->getPeer());
+if (rI18nHelper.MatchMnemonic(pWindow->GetText(), 
rKEvt.GetCharCode()))
+{
+pWindow->GrabFocus();
+   

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-03-11 Thread Andreas Heinisch (via logerrit)
 sc/source/core/data/table4.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 1982768ba3db819b84445830ae24e55ecd373d9a
Author: Andreas Heinisch 
AuthorDate: Sat Mar 6 10:38:43 2021 +0100
Commit: Xisco Fauli 
CommitDate: Fri Mar 12 00:23:17 2021 +0100

tdf#89754 - don't increment non different consecutive date cells

Change-Id: I6fedc0fe286ebe8b0110360391e8d3325fc2ca25
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112054
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 3ba901f050d262cdeccefa5b21b0d32aa7332dc7)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112295
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/table4.cxx b/sc/source/core/data/table4.cxx
index a777aca898ae..ede354eead8c 100644
--- a/sc/source/core/data/table4.cxx
+++ b/sc/source/core/data/table4.cxx
@@ -587,6 +587,13 @@ void ScTable::FillAnalyse( SCCOL nCol1, SCROW nRow1, SCCOL 
nCol2, SCROW nRow2,
 rInc = nCmpInc;
 }
 }
+else
+{
+// tdf#89754 - don't increment non different consecutive 
date cells
+rCmd = FILL_DATE;
+rDateCmd = FILL_DAY;
+rInc = 0.0;
+}
 }
 else// single date -> increment by days
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-03-08 Thread Caolán McNamara (via logerrit)
 sc/source/ui/inc/hdrcont.hxx  |6 +
 sc/source/ui/view/hdrcont.cxx |   44 +++---
 2 files changed, 39 insertions(+), 11 deletions(-)

New commits:
commit f410d6826e86d55314dfbd4bcf6b0e78ef0ef2a2
Author: Caolán McNamara 
AuthorDate: Sat Mar 6 21:34:22 2021 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Mar 8 22:35:53 2021 +0100

tdf#140833 show ScHeaderControl help tip after double click time has expired

so under gtk the popover isn't active when the double click is processed
by gtk because under load on wayland the double click is getting handled
by something else and getting sent to the the window underneath our
window

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

diff --git a/sc/source/ui/inc/hdrcont.hxx b/sc/source/ui/inc/hdrcont.hxx
index 3bb0e4223ce5..03b14af70c98 100644
--- a/sc/source/ui/inc/hdrcont.hxx
+++ b/sc/source/ui/inc/hdrcont.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SC_SOURCE_UI_INC_HDRCONT_HXX
 
 #include 
+#include 
 #include 
 #include 
 
@@ -36,6 +37,7 @@ class ScHeaderControl : public vcl::Window
 {
 private:
 SelectionEngine*pSelEngine;
+Timer   aShowHelpTimer;
 vcl::Font   aNormFont;
 vcl::Font   aBoldFont;
 boolbBoldSet;
@@ -67,9 +69,12 @@ private:
 SCCOLROWGetMousePos( const MouseEvent& rMEvt, bool& rBorder ) 
const;
 boolIsSelectionAllowed(SCCOLROW nPos) const;
 voidShowDragHelp();
+voidHideDragHelp();
 
 voidDoPaint( SCCOLROW nStart, SCCOLROW nEnd );
 
+DECL_LINK(ShowDragHelpHdl, Timer*, void);
+
 protected:
 ScTabView*  pTabView;
 
@@ -105,6 +110,7 @@ protected:
 
 virtual voidDrawInvert( tools::Long nDragPos );
 virtual voidCommand( const CommandEvent& rCEvt ) override;
+virtual voiddispose() override;
 
 public:
 ScHeaderControl( vcl::Window* pParent, SelectionEngine* 
pSelectionEngine,
diff --git a/sc/source/ui/view/hdrcont.cxx b/sc/source/ui/view/hdrcont.cxx
index 12f4ad7c0a4b..78214cb9be68 100644
--- a/sc/source/ui/view/hdrcont.cxx
+++ b/sc/source/ui/view/hdrcont.cxx
@@ -48,6 +48,7 @@ ScHeaderControl::ScHeaderControl( vcl::Window* pParent, 
SelectionEngine* pSelect
   SCCOLROW nNewSize, bool bNewVertical, 
ScTabView* pTab ) :
 Window  ( pParent ),
 pSelEngine  ( pSelectionEngine ),
+aShowHelpTimer("sc HeaderControl Popover Timer"),
 bVertical   ( bNewVertical ),
 nSize   ( nNewSize ),
 nMarkStart  ( 0 ),
@@ -88,9 +89,18 @@ ScHeaderControl::ScHeaderControl( vcl::Window* pParent, 
SelectionEngine* pSelect
 nWidth = nSmallWidth = aSize.Width();
 nBigWidth = LogicToPixel( Size( GetTextWidth("888"), 0 ) ).Width() + 5;
 
+aShowHelpTimer.SetInvokeHandler(LINK(this, ScHeaderControl, 
ShowDragHelpHdl));
+
aShowHelpTimer.SetTimeout(GetSettings().GetMouseSettings().GetDoubleClickTime());
+
 SetBackground();
 }
 
+void ScHeaderControl::dispose()
+{
+aShowHelpTimer.Stop();
+vcl::Window::dispose();
+}
+
 void ScHeaderControl::SetWidth( tools::Long nNew )
 {
 OSL_ENSURE( bVertical, "SetWidth works only on row headers" );
@@ -652,7 +662,11 @@ void ScHeaderControl::MouseButtonDown( const MouseEvent& 
rMEvt )
 else
 nDragStart = rMEvt.GetPosPixel().X();
 nDragPos = nDragStart;
-ShowDragHelp();
+// tdf#140833 launch help tip to show after the double click time 
has expired
+// so under gtk the popover isn't active when the double click is 
processed
+// by gtk because under load on wayland the double click is 
getting handled
+// by something else and getting sent to the the window underneath 
our window
+aShowHelpTimer.Start();
 DrawInvert( nDragPos );
 
 StartTracking();
@@ -713,11 +727,7 @@ void ScHeaderControl::MouseButtonUp( const MouseEvent& 
rMEvt )
 {
 DrawInvert( nDragPos );
 ReleaseMouse();
-if (nTipVisible)
-{
-Help::HidePopover(this, nTipVisible);
-nTipVisible = nullptr;
-}
+HideDragHelp();
 bDragging = false;
 
 tools::Long nScrPos= GetScrPos( nDragNo );
@@ -885,11 +895,7 @@ void ScHeaderControl::StopMarking()
 if ( bDragging )
 {
 DrawInvert( nDragPos );
-if (nTipVisible)
-{
-Help::HidePopover(this, nTipVisible);
-nTipVisible = nullptr;
-}
+HideDragHelp();
 bDragging = false;
 }
 
@@ -902,8 +908,14 @@ void ScHeaderControl::StopMarking()
 ReleaseMouse();
 }
 
+IMPL_LINK_NOARG(ScHeaderControl, 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-03-08 Thread Mike Kaganski (via logerrit)
 sc/source/ui/app/seltrans.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f5f5582fa065000a187a92b47ca44498d1f30c09
Author: Mike Kaganski 
AuthorDate: Sun Feb 14 11:24:42 2021 +0100
Commit: Xisco Fauli 
CommitDate: Mon Mar 8 13:55:37 2021 +0100

tdf#140700 nullptr dereference

Change-Id: I6a2ffddfd67784ddc2194dafba7d3eaeb6e4e12e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110854
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit 20305894243e24eb383ab9feefebf4a0e9f2644f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112083
Tested-by: Michael Weghorn 
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/app/seltrans.cxx b/sc/source/ui/app/seltrans.cxx
index b725eb7d3c52..193113429fb8 100644
--- a/sc/source/ui/app/seltrans.cxx
+++ b/sc/source/ui/app/seltrans.cxx
@@ -149,7 +149,7 @@ ScSelectionTransferObj::ScSelectionTransferObj( ScTabView* 
pSource, ScSelectionT
 ScSelectionTransferObj::~ScSelectionTransferObj()
 {
 ScModule* pScMod = SC_MOD();
-if ( pScMod->GetSelectionTransfer() == this )
+if (pScMod && pScMod->GetSelectionTransfer() == this)
 {
 //  this is reached when the object wasn't really copied to the 
selection
 //  (CopyToSelection has no effect under Windows)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-02-24 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/column3.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit cbfc211c50daef5b9b477d0731d48982898d40b7
Author: Luboš Luňák 
AuthorDate: Tue Feb 23 13:54:10 2021 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 24 09:46:35 2021 +0100

delete from mdds in reverse order (tdf#139820)

This is a more elegant solution from Noel, compared to my previous
commit. Deleting in reverse order means the underlying std::vector
used by mdds does not have possible to-be-deleted items to move
around that forward order would have.

Change-Id: I31f0774e302308bcb70595cb899c977ee5966c7e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111395
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111438

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f1a621a985b5..69213b7fedbc 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -979,7 +979,8 @@ void ScColumn::DeleteCells(
 aFunc.getSpans().getSpans(aSpans);
 
 // Delete the cells for real.
-std::for_each(aSpans.begin(), aSpans.end(), EmptyCells(rBlockPos, *this));
+// tdf#139820: Deleting in reverse order is more efficient.
+std::for_each(aSpans.rbegin(), aSpans.rend(), EmptyCells(rBlockPos, 
*this));
 CellStorageModified();
 
 aFunc.getSpans().swap(rDeleted);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-02-24 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/column3.cxx |   35 +--
 1 file changed, 1 insertion(+), 34 deletions(-)

New commits:
commit 57782b9a56309dcc3bb402b17691d4f46706ca73
Author: Luboš Luňák 
AuthorDate: Tue Feb 23 13:52:56 2021 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 24 09:46:18 2021 +0100

Revert ""delete" also empty Calc cells if it helps mdds (tdf#139820)"

It's much simpler to just delete in reverse order.

This reverts commit 2ac0ab976f814e97a38a9685bc23b7255cfef2f2.

Change-Id: I310ebb7d517cbfbb7a22206d3c04660097d4ae1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111394
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111437

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index a72619bd1a3a..f1a621a985b5 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -812,11 +812,6 @@ class DeleteAreaHandler
 bool mbDateTime:1;
 ScColumn& mrCol;
 
-SCROW mLastToDeleteRow1;
-SCROW mLastToDeleteRow2;
-SCROW mLastEmptyRow1;
-SCROW mLastEmptyRow2;
-
 public:
 DeleteAreaHandler(ScDocument& rDoc, InsertDeleteFlags nDelFlag, ScColumn& 
rCol) :
 mrDoc(rDoc),
@@ -825,12 +820,7 @@ public:
 mbString(nDelFlag & InsertDeleteFlags::STRING),
 mbFormula(nDelFlag & InsertDeleteFlags::FORMULA),
 mbDateTime(nDelFlag & InsertDeleteFlags::DATETIME),
-mrCol(rCol),
-mLastToDeleteRow1(-1),
-mLastToDeleteRow2(-1),
-mLastEmptyRow1(-1),
-mLastEmptyRow2(-1)
-{}
+mrCol(rCol) {}
 
 void operator() (const sc::CellStoreType::value_type& node, size_t 
nOffset, size_t nDataSize)
 {
@@ -868,20 +858,6 @@ public:
 }
 break;
 case sc::element_type_empty:
-{
-// See usage below.
-if( mLastToDeleteRow1 >= 0 )
-{
-SCROW nRow1 = node.position + nOffset;
-SCROW nRow2 = nRow1 + nDataSize - 1;
-if( nRow1 == mLastToDeleteRow2 + 1 )
-{
-mLastEmptyRow1 = nRow1;
-mLastEmptyRow2 = nRow2;
-}
-}
-return;
-}
 default:
 return;
 }
@@ -889,16 +865,7 @@ public:
 // Tag these cells for deletion.
 SCROW nRow1 = node.position + nOffset;
 SCROW nRow2 = nRow1 + nDataSize - 1;
-// tdf#139820: Decide whether to include 'empty' cells in the range to 
delete.
-// This may make sense because if the column contains a mix of empty 
and non-empty
-// cells, then deleting a range of those cells would normally make 
mdds operate
-// on ranges of such cells, event though it could simply delete them 
all in one go.
-if( mLastEmptyRow1 >= 0 && nRow1 == mLastEmptyRow2 + 1 )
-nRow1 = mLastEmptyRow1;
 maDeleteRanges.set(nRow1, nRow2, true);
-mLastToDeleteRow1 = nRow1;
-mLastToDeleteRow2 = nRow2;
-mLastEmptyRow1 = mLastEmptyRow2 = -1;
 }
 
 void deleteNumeric(const sc::CellStoreType::value_type& node, size_t 
nOffset, size_t nDataSize)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-02-23 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/column3.cxx |   35 ++-
 1 file changed, 34 insertions(+), 1 deletion(-)

New commits:
commit e5440ba8a0f19bbb354b284cec77702fa58bf505
Author: Luboš Luňák 
AuthorDate: Thu Feb 18 15:28:14 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Feb 23 09:26:22 2021 +0100

"delete" also empty Calc cells if it helps mdds (tdf#139820)

With mixed non-empty and empty cells, deleting a range would normally
mean deleting just the non-empty cell ranges, which would make
mdds repeatedly move parts of the underlying vector. Including
empty cells in the range to delete may result in just one pass.

Change-Id: Ia2ebcaba054c6e46f3cf6c964ba883bb600d6ee0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/25
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit b9921adae997579915b4600c688719620f9adaf6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index f1a621a985b5..a72619bd1a3a 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -812,6 +812,11 @@ class DeleteAreaHandler
 bool mbDateTime:1;
 ScColumn& mrCol;
 
+SCROW mLastToDeleteRow1;
+SCROW mLastToDeleteRow2;
+SCROW mLastEmptyRow1;
+SCROW mLastEmptyRow2;
+
 public:
 DeleteAreaHandler(ScDocument& rDoc, InsertDeleteFlags nDelFlag, ScColumn& 
rCol) :
 mrDoc(rDoc),
@@ -820,7 +825,12 @@ public:
 mbString(nDelFlag & InsertDeleteFlags::STRING),
 mbFormula(nDelFlag & InsertDeleteFlags::FORMULA),
 mbDateTime(nDelFlag & InsertDeleteFlags::DATETIME),
-mrCol(rCol) {}
+mrCol(rCol),
+mLastToDeleteRow1(-1),
+mLastToDeleteRow2(-1),
+mLastEmptyRow1(-1),
+mLastEmptyRow2(-1)
+{}
 
 void operator() (const sc::CellStoreType::value_type& node, size_t 
nOffset, size_t nDataSize)
 {
@@ -858,6 +868,20 @@ public:
 }
 break;
 case sc::element_type_empty:
+{
+// See usage below.
+if( mLastToDeleteRow1 >= 0 )
+{
+SCROW nRow1 = node.position + nOffset;
+SCROW nRow2 = nRow1 + nDataSize - 1;
+if( nRow1 == mLastToDeleteRow2 + 1 )
+{
+mLastEmptyRow1 = nRow1;
+mLastEmptyRow2 = nRow2;
+}
+}
+return;
+}
 default:
 return;
 }
@@ -865,7 +889,16 @@ public:
 // Tag these cells for deletion.
 SCROW nRow1 = node.position + nOffset;
 SCROW nRow2 = nRow1 + nDataSize - 1;
+// tdf#139820: Decide whether to include 'empty' cells in the range to 
delete.
+// This may make sense because if the column contains a mix of empty 
and non-empty
+// cells, then deleting a range of those cells would normally make 
mdds operate
+// on ranges of such cells, event though it could simply delete them 
all in one go.
+if( mLastEmptyRow1 >= 0 && nRow1 == mLastEmptyRow2 + 1 )
+nRow1 = mLastEmptyRow1;
 maDeleteRanges.set(nRow1, nRow2, true);
+mLastToDeleteRow1 = nRow1;
+mLastToDeleteRow2 = nRow2;
+mLastEmptyRow1 = mLastEmptyRow2 = -1;
 }
 
 void deleteNumeric(const sc::CellStoreType::value_type& node, size_t 
nOffset, size_t nDataSize)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-02-16 Thread Andreas Heinisch (via logerrit)
 sc/source/ui/dbgui/tpsort.cxx   |3 ++-
 sc/source/ui/unoobj/datauno.cxx |5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

New commits:
commit 1c89de1ffce80e228eafca327d4f90a5c5487e55
Author: Andreas Heinisch 
AuthorDate: Fri Jan 8 18:05:16 2021 +0100
Commit: Xisco Fauli 
CommitDate: Tue Feb 16 11:58:20 2021 +0100

tdf#105301 - increase the size of the sorting keys

During the import of a document, increase the number of shown sorting
keys to match the actual size accordingly.

Change-Id: I24ab596f47fadf33d0358f162d26b12c24615fa8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108987
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
Reviewed-by: Andreas Heinisch 
(cherry picked from commit 788c777c6cdf2254e8bba05321f4a9de309b15b5)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110916

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index f8c2a996bd22..b70b8b591a84 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -82,7 +82,8 @@ ScTabPageSortFields::ScTabPageSortFields(weld::Container* 
pPage, weld::DialogCon
rArgSet.Get( nWhichSort )).
 GetSortData() ),
 nFieldCount ( 0 ),
-nSortKeyCount   ( DEFSORT ),
+// show actual size of the sorting keys without limiting them to the 
default size
+nSortKeyCount(std::max(aSortData.GetSortKeyCount(), 
static_cast(DEFSORT))),
 bHasHeader  ( false ),
 bSortByRows ( false )
 
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index 2f2bdae144a4..68c1c2da8cd7 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -320,7 +320,7 @@ void ScSortDescriptor::FillProperties( 
uno::Sequence& rSeq
 
 void ScSortDescriptor::FillSortParam( ScSortParam& rParam, const 
uno::Sequence& rSeq )
 {
-sal_Int16 nSortSize = rParam.GetSortKeyCount();
+sal_Int32 nSortSize = static_cast(rParam.GetSortKeyCount());
 
 for (const beans::PropertyValue& rProp : rSeq)
 {
@@ -357,7 +357,8 @@ void ScSortDescriptor::FillSortParam( ScSortParam& rParam, 
const uno::Sequence static_cast( rParam.GetSortKeyCount() 
) )
 {
-nCount = nSortSize;
+// tdf#105301 - increase the size of the sorting keys
+nSortSize = nCount;
 rParam.maKeyState.resize(nCount);
 }
 const util::SortField* pFieldArray = aSeq.getConstArray();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-02-11 Thread Caolán McNamara (via logerrit)
 sc/source/ui/view/gridwin.cxx |7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

New commits:
commit 055fddbca0efb85e031fbabdf88211fa28bab27e
Author: Caolán McNamara 
AuthorDate: Wed Feb 10 19:52:52 2021 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Thu Feb 11 17:41:33 2021 +0100

tdf#140006 don't limit dropdown width to 300pixels

let it use the full width of the cell. Keep that 300 pixel limit
if we are expanding the widget width beyond its size request.

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

diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx
index 34d3ed07be21..fa8b2a4e1b64 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -959,10 +959,9 @@ void ScGridWindow::ShowFilterMenu(const tools::Rectangle& 
rCellRect, bool bLayou
 auto nHeight = rFilterBox.get_height_rows(nEntryCount);
 rFilterBox.set_size_request(-1, nHeight);
 Size aSize(rFilterBox.get_preferred_size());
-if (aSize.Width() < nSizeX)
-aSize.setWidth(nSizeX);
-if (aSize.Width() > 300)
-aSize.setWidth(300); // do not over do it (Pixel)
+auto nMaxToExpandTo = std::min(nSizeX, 
static_cast(300)); // do not over do it (Pixel)
+if (aSize.Width() < nMaxToExpandTo)
+aSize.setWidth(nMaxToExpandTo);
 
 aSize.AdjustWidth(4); // add a little margin
 nSizeX += 4;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-02-10 Thread Regina Henschel (via logerrit)
 sc/source/core/data/drwlayer.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f21595cb5d9f978e11b23471671f11736c42e99d
Author: Regina Henschel 
AuthorDate: Fri Feb 5 14:15:30 2021 +0100
Commit: Christian Lohmaier 
CommitDate: Wed Feb 10 14:35:11 2021 +0100

cid#1472783 avoid null pointer dereference

The target was created, but the pointer was not updated.

Change-Id: I2e19ae3c84769de493f712f3189a2a506f173c0f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110476
Tested-by: Jenkins
Reviewed-by: Regina Henschel 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110658
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index b89db024a4a3..497ad478b146 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -2026,6 +2026,8 @@ void ScDrawLayer::MirrorRTL( SdrObject* pObj )
   *pDoc, pData->maStart.Tab());
 aNoRotateAnchor.mbResizeWithCell = pData->mbResizeWithCell;
 SetNonRotatedAnchor(*pObj, aNoRotateAnchor);
+pNoRotatedAnchor = GetNonRotatedObjData(pObj);
+assert(pNoRotatedAnchor);
 }
 // Mirror object at vertical axis
 Point aRef1( 0, 0 );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-02-03 Thread Noel Grandin (via logerrit)
 sc/source/core/data/dociter.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 7f921fb690005a21bbc1c2e24d5142a0eae9af50
Author: Noel Grandin 
AuthorDate: Wed Feb 3 15:19:20 2021 +0200
Commit: Xisco Fauli 
CommitDate: Wed Feb 3 21:56:02 2021 +0100

tdf#140014 calc crash on COUNTIF

regression from jumbo-sheets work

Change-Id: I207cf3cc4c6d295688936ea3b672b32f9c09d89a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110349
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit c4540f86925609a54d473051ceb8dcf46d0e22aa)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110357
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 9597fcedbbfd..50ab34540265 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1460,6 +1460,8 @@ ScCountIfCellIterator::ScCountIfCellIterator(ScDocument& 
rDocument, const ScInte
 mrContext( rContext ),
 nTab( nTable)
 {
+maParam.nCol1 = 
rDoc.maTabs[nTable]->ClampToAllocatedColumns(maParam.nCol1);
+maParam.nCol2 = 
rDoc.maTabs[nTable]->ClampToAllocatedColumns(maParam.nCol2);
 nCol = maParam.nCol1;
 nRow = maParam.nRow1;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-02-03 Thread Ouyang Leyan (via logerrit)
 sc/source/core/data/column.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit d03f68526a9fc6f6c26257d58166480397d285c8
Author: Ouyang Leyan 
AuthorDate: Fri Jan 8 22:16:41 2021 +0100
Commit: Xisco Fauli 
CommitDate: Wed Feb 3 20:34:12 2021 +0100

tdf#120348: Avoid data loss when copying chart with error in formulas

During a chart copy in Calc, when skipping cells with ERR:502 in values,
the rest of the column was skipped as well, including valid values.

Change-Id: I2578dfdefe9d006de572f8faa3a8cc32e9f55010
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109025
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 318d384c596c1593667d6c936f55bf6ebd0c5db6)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110354
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index fe968e85a23d..791352304533 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -1148,7 +1148,7 @@ void ScColumn::CopyStaticToDocument(
 
 if (rFC.GetErrCode() != FormulaError::NONE)
 // Skip cells with error.
-break;
+continue;
 
 if (rFC.IsValue())
 aDestPos.miCellPos = 
rDestCol.maCells.set(aDestPos.miCellPos, nRow, rFC.GetValue());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-01-25 Thread Caolán McNamara (via logerrit)
 sc/source/ui/app/inputwin.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 2988bd19eff4053d557ef9d1e70aa7b75665cbcb
Author: Caolán McNamara 
AuthorDate: Mon Jan 25 11:43:17 2021 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Mon Jan 25 22:11:40 2021 +0100

tdf#139857 release mouse on launch context menu

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

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2be36193748a..2846ca43dc54 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1696,6 +1696,8 @@ bool ScTextWnd::Command( const CommandEvent& rCEvt )
 Size aSize = GetOutputSizePixel();
 aPos = Point(aSize.Width() / 2, aSize.Height() / 2);
 }
+if (IsMouseCaptured())
+ReleaseMouse();
 pViewFrm->GetDispatcher()->ExecutePopup("formulabar", 
(), );
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-01-25 Thread Michael Weghorn (via logerrit)
 sc/source/core/data/dociter.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit e680ba7e15adc76a1a7fc7e5e0be06be9e5b5e73
Author: Michael Weghorn 
AuthorDate: Wed Jan 20 12:41:47 2021 +0100
Commit: Xisco Fauli 
CommitDate: Mon Jan 25 10:20:23 2021 +0100

Related tdf#139782 sc: Make sure column exists before accessing it

While the first fix (Change-Id
I12a780bf52024cef31188651813d3a93cc2b5ddd,
"tdf#139782 sc: Don't try to access unallocated column") makes
opening the simplified bugdoc I had attached to tdf#139782 work,
the original document I was given (which I can't share as is, but
from which the simplified bugdoc was created) had more formulas and
managed to hit another similar issue related to the fact that columns
are now dynamically allocated, and crashed trying to access one that
wasn't yet allocated.

Fix this place as well by making sure the column exists.

Backtrace:

"#0  __GI_raise (sig=sig@entry=6) at 
../sysdeps/unix/sysv/linux/raise.c:50\n"
"#1  0x77aa7537 in __GI_abort () at abort.c:79\n"
"#2  0x7794beb1 in std::__throw_bad_exception() () at 
/lib/x86_64-linux-gnu/libstdc++.so.6\n"
"#3  0x7fffa0b161dc in 
std::__debug::vector 
>, std::allocator > > 
>::operator[](unsigned long) (this=0x58827250, __n=84) at 
/usr/include/c++/10/debug/vector:427\n"
"#4  0x7fffa0c23935 in ScColContainer::operator[](unsigned long) 
(this=0x58827250, nIndex=84) at 
.../libreoffice/sc/inc/colcontainer.hxx:44\n"
"#5  0x7fffa0c76275 in ScQueryCellIterator::InitPos() 
(this=0x7fff8040) at .../libreoffice/sc/source/core/data/dociter.cxx:1082\n"
"#6  0x7fffa0c76c28 in ScQueryCellIterator::GetFirst() 
(this=0x7fff8040) at .../libreoffice/sc/source/core/data/dociter.cxx:1233\n"
"#7  0x7fffa0c76fb6 in 
ScQueryCellIterator::FindEqualOrSortedLastInRange(short&, int&) 
(this=0x7fff8040, nFoundCol=@0x7fff7f58: 1024, 
nFoundRow=@0x7fff7fb0: 1048576) at 
.../libreoffice/sc/source/core/data/dociter.cxx:1304\n"
"#8  0x7fffa11b1529 in ScInterpreter::ScMatch() 
(this=0x619f7fd0) at 
.../libreoffice/sc/source/core/tool/interpr1.cxx:5050\n"
"#9  0x7fffa121f653 in ScInterpreter::Interpret() 
(this=0x619f7fd0) at 
.../libreoffice/sc/source/core/tool/interpr4.cxx:4247\n"
"#10 0x7fffa0f03bf5 in 
ScFormulaCell::InterpretTail(ScInterpreterContext&, 
ScFormulaCell::ScInterpretTailParameter) (this=0x5e793030, rContext=..., 
eTailParam=ScFormulaCell::SCITP_NORMAL) at 
.../libreoffice/sc/source/core/data/formulacell.cxx:1952\n"
"#11 0x7fffa0f028b2 in ScFormulaCell::Interpret(int, int) 
(this=0x5e793030, nStartOffset=-1, nEndOffset=-1) at 
.../libreoffice/sc/source/core/data/formulacell.cxx:1644\n"
"#12 0x7fffa0be0274 in ScFormulaCell::MaybeInterpret() 
(this=0x5e793030) at .../libreoffice/sc/inc/formulacell.hxx:445\n"
"#13 0x7fffa0f07b34 in ScFormulaCell::GetErrCode() 
(this=0x5e793030) at 
.../libreoffice/sc/source/core/data/formulacell.cxx:2974\n"
"#14 0x7fffa10bac28 in ScCellFormat::GetString(ScRefCellValue 
const&, unsigned int, rtl::OUString&, Color const**, SvNumberFormatter&, 
ScDocument const&, bool, bool, bool) (rCell=..., nFormat=0, rString=\"\", 
ppColor=0x7fff87e8, rFormatter=..., rDoc=..., bNullVals=true, 
bFormula=false, bUseStarFormat=false) at 
.../libreoffice/sc/source/core/tool/cellform.cxx:77\n"
"#15 0x7fffa0bcb8f8 in 
ScColumn::UpdateScriptType(sc::CellTextAttr&, int, 
mdds::detail::mtv::iterator_base, mdds::mtv::noncopyable_managed_element_block<53, 
EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, 
ScFormulaCell> >, sc::CellStoreEvent>::iterator_trait, 
mdds::detail::mtv::private_data_forward_update > >&) (this=0x5e793330, rAttr=..., 
nRow=1, itr=...) at .../libreoffice/sc/source/core/data/column3.cxx:794\n"
"#16 0x7fffa0b9e315 in 
ScColumn::GetRangeScriptType(mdds::detail::mtv::iterator_base >, mdds::detail::mtv::event_func>::iterator_trait, 
mdds::detail::mtv::private_data_forward_update > >&, int, int, 
mdds::detail::mtv::iterator_base, mdds::mtv::noncopyable_managed_element_block<53, 
EditTextObject>, mdds::mtv::noncopyable_managed_element_block<54, 
ScFormulaCell> >, sc::CellStoreEvent>::iterator_trait, 
mdds::detail::mtv::private_data_forward_update > > const&) (this=0x5e793330, 
itPos=..., nRow1=1, nRow2=1, itrCells_=...) at 
.../libreoffice/sc/source/core/data/column2.cxx:2089\n"
"#17 0x7fffa0b27563 in (anonymous 
namespace)::FindEditCellsHandler::operator()(size_t, ScFormulaCell const*) 
(this=0x7fff9180, nRow=1, p=0x5e793030) at 
.../libreoffice/sc/source/core/data/column.cxx:3091\n"
"#18 0x7fffa0b31267 in 
sc::CheckElem, 
mdds::multi_type_vector, 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-01-23 Thread Michael Weghorn (via logerrit)
 sc/source/core/data/dociter.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 0a11bb94ce129dabd19078e07ff793d4ed1c
Author: Michael Weghorn 
AuthorDate: Wed Jan 20 12:21:43 2021 +0100
Commit: Caolán McNamara 
CommitDate: Sat Jan 23 22:07:51 2021 +0100

tdf#139782 sc: Don't try to access unallocated column

This fixes a regression from

commit 7282014e362a1529a36c88eb308df8ed359c2cfa
Date:   Fri Feb 1 15:15:16 2019 +0100

tdf#50916 Makes numbers of columns dynamic.

Change-Id: I12a780bf52024cef31188651813d3a93cc2b5ddd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109704
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 3032cf9df042f50511a15c6a627c50f708a34238)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109748
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index d4e565edf80e..686e426c8d52 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -1798,6 +1798,10 @@ bool ScQueryCellIterator::BinarySearch()
 
 assert(nTab < rDoc.GetTableCount() && "index out of bounds, FIX IT");
 nCol = maParam.nCol1;
+
+if (nCol >= rDoc.maTabs[nTab]->GetAllocatedColumnsCount())
+return false;
+
 ScColumn* pCol = &(rDoc.maTabs[nTab])->aCol[nCol];
 if (pCol->IsEmptyData())
 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-7-1' - sc/source

2021-01-19 Thread Caolán McNamara (via logerrit)
 sc/source/ui/navipi/content.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit e5773d383ac4ab43c03b88dfe8deb4f16515feba
Author: Caolán McNamara 
AuthorDate: Wed Jan 13 10:15:19 2021 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Jan 19 18:27:43 2021 +0100

Resolves: tdf#138972 dnd is moving instead of copying the data

Change-Id: Icb2a3882704bf38c14b7a46154d51c3171268ca6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109220
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 1095b7bdf1bb33b3dc0fb5ae73342ae6ca0396fc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109521
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 31fce4ea8bb8..423bef3ef8a1 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -144,7 +144,7 @@ 
ScContentTree::ScContentTree(std::unique_ptr xTreeView, ScNaviga
 m_xTreeView->connect_query_tooltip(LINK(this, ScContentTree, 
QueryTooltipHdl));
 
 rtl::Reference xHelper(m_xTransferObj.get());
-m_xTreeView->enable_drag_source(xHelper, DND_ACTION_COPYMOVE | 
DND_ACTION_LINK);
+m_xTreeView->enable_drag_source(xHelper, DND_ACTION_COPY | 
DND_ACTION_LINK);
 
 m_xTreeView->connect_drag_begin(LINK(this, ScContentTree, DragBeginHdl));
 }
@@ -1177,7 +1177,7 @@ static bool lcl_DoDragObject( ScDocShell* pSrcShell, 
const OUString& rName, ScCo
 SC_MOD()->SetDragObject( nullptr, pTransferObj.get() );
 
 rtl::Reference xHelper(pTransferObj.get());
-rTreeView.enable_drag_source(xHelper, DND_ACTION_COPYMOVE | 
DND_ACTION_LINK);
+rTreeView.enable_drag_source(xHelper, DND_ACTION_COPY | 
DND_ACTION_LINK);
 
 bDisallow = false;
 }
@@ -1217,7 +1217,7 @@ static bool lcl_DoDragCells( ScDocShell* pSrcShell, const 
ScRange& rRange, ScDra
 SC_MOD()->SetDragObject( pTransferObj.get(), nullptr );  // for 
internal D
 
 rtl::Reference xHelper(pTransferObj.get());
-rTreeView.enable_drag_source(xHelper, DND_ACTION_COPYMOVE | 
DND_ACTION_LINK);
+rTreeView.enable_drag_source(xHelper, DND_ACTION_COPY | 
DND_ACTION_LINK);
 
 bDisallow = false;
 }
@@ -1371,7 +1371,7 @@ IMPL_LINK(ScContentTree, DragBeginHdl, bool&, 
rUnsetDragIcon, bool)
 m_xTransferObj->SetLinkURL(aLinkURL, aLinkText);
 
 rtl::Reference 
xHelper(m_xTransferObj.get());
-m_xTreeView->enable_drag_source(xHelper, DND_ACTION_COPYMOVE | 
DND_ACTION_LINK);
+m_xTreeView->enable_drag_source(xHelper, DND_ACTION_COPY | 
DND_ACTION_LINK);
 
 bDisallow = false;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2021-01-14 Thread Caolán McNamara (via logerrit)
 sc/source/ui/dbgui/sortkeydlg.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 1052c9c8bb763866ba6b2cb9b86063f22d6fb9ee
Author: Caolán McNamara 
AuthorDate: Thu Jan 14 11:30:05 2021 +
Commit: Xisco Fauli 
CommitDate: Thu Jan 14 16:37:01 2021 +0100

tdf#136155 let the other elements in the dialog determine the final width

Change-Id: Ib47db4f47a331b1f3754ca4974a9f3e5b14efc95
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/109277
Tested-by: Jenkins
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/ui/dbgui/sortkeydlg.cxx 
b/sc/source/ui/dbgui/sortkeydlg.cxx
index ec81bda34fc1..a5cf6e8f4e66 100644
--- a/sc/source/ui/dbgui/sortkeydlg.cxx
+++ b/sc/source/ui/dbgui/sortkeydlg.cxx
@@ -19,6 +19,9 @@ ScSortKeyItem::ScSortKeyItem(weld::Container* pParent)
 , m_xBtnDown(m_xBuilder->weld_radio_button("down"))
 , m_pParent(pParent)
 {
+// tdf#136155 let the other elements in the dialog determine the width of 
the
+// combobox
+m_xLbSort->set_size_request(m_xLbSort->get_approximate_digit_width() * 12, 
-1);
 }
 
 ScSortKeyItem::~ScSortKeyItem()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-20 Thread Noel Grandin (via logerrit)
 sc/source/core/data/table1.cxx |5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

New commits:
commit 8403a434b93c0a22f9e6b3b7e92ebe920a26874e
Author: Noel Grandin 
AuthorDate: Sat Dec 19 13:36:57 2020 +0200
Commit: Noel Grandin 
CommitDate: Sun Dec 20 09:13:55 2020 +0100

fix crash inserting chart

regression from
commit bf4bbc3c2174b21577b8878bc3197923ba44a029
Author: Noel 
Date:   Thu Nov 12 15:38:13 2020 +0200
replace std::max(std::min()) with std::clamp

Thanks to Leyan Ouyang for debugging this.

Change-Id: Iafd6d47c1974be2cd55f76aa1fc5f4f614a8d093
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108020
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit a37f29983f3fee58bde40967667ebae84a6c7537)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108001

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index d0451b4f2542..19ddf61770de 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1164,7 +1164,10 @@ void ScTable::LimitChartArea( SCCOL& rStartCol, SCROW& 
rStartRow, SCCOL& rEndCol
 SCROW lastDataPos = 0;
 for (SCCOL i=rStartCol; i<=rEndCol; i++)
 lastDataPos = std::max(lastDataPos, aCol[i].GetLastDataPos());
-rEndRow = std::clamp( rEndRow, rStartRow, lastDataPos );
+// reduce EndRow to the last row with data
+rEndRow = std::min(rEndRow, lastDataPos);
+// but make sure EndRow is >= StartRow
+rEndRow = std::max(rStartRow, rEndRow);
 }
 
 SCCOL ScTable::FindNextVisibleCol( SCCOL nCol, bool bRight ) const
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-18 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/token.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit abecbc3eb6d6d9fa6b51c45a52c24a2001ded195
Author: Eike Rathke 
AuthorDate: Fri Dec 18 20:27:34 2020 +0100
Commit: Eike Rathke 
CommitDate: Sat Dec 19 02:48:07 2020 +0100

Resolves: tdf#138710 Do not push an out-of-bounds bound to boundaries

... if a virtual non-existent row is being shifted in for
MAXROWCOUNT (MAXROW+1), so sc/source/core/tool/sharedformula.cxx
SharedFormulaUtil::splitFormulaCellGroups() is not triggered to
split a group there, which would throw an exception. Instead of
returning false ...

CellStoreType::position_type aPos = rCells.position(nRow);
if (aPos.first == rCells.end())
return false;

However, avoiding the cause is the solution.

Change-Id: I8f9adcb62bb78bc98092677b5d4fdc7fc3baf150
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107979
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 121d4f610a2b4caa871aa0132eccbd4e12d13b3f)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107994

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 859b44327a78..3cb4a8836d61 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -4538,7 +4538,8 @@ void checkBounds(
 // No intersections.
 return;
 
-if (aAbs.aStart.Row() <= rCheckRange.aStart.Row())
+// rCheckRange may be a virtual non-existent row being shifted in.
+if (aAbs.aStart.Row() <= rCheckRange.aStart.Row() && 
rCheckRange.aStart.Row() < rLimits.GetMaxRowCount())
 {
 //+-+ < top
 //| |
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-17 Thread Julien Nabet (via logerrit)
 sc/source/ui/namedlg/namedlg.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit ccff3cc5830ff5780123722f809bbe748cc7e5fd
Author: Julien Nabet 
AuthorDate: Sat Dec 12 12:16:27 2020 +0100
Commit: Xisco Fauli 
CommitDate: Thu Dec 17 12:39:45 2020 +0100

tdf#138822: really undo when clicking Cancel in managing Named Ranges

Change-Id: Ib4d15e7e5287221ea51eb3e20dd1811c97999306
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107635
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 1790ed500f3033581ee4a3ef43428d7fda4692cc)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107806

diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index 314cb42fbbfa..799e94a2e0e7 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -460,6 +460,7 @@ IMPL_LINK_NOARG(ScNameDlg, OkBtnHdl, weld::Button&, void)
 
 IMPL_LINK_NOARG(ScNameDlg, CancelBtnHdl, weld::Button&, void)
 {
+mbCloseWithoutUndo = true;
 response(RET_CANCEL);
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-14 Thread Julien Nabet (via logerrit)
 sc/source/ui/namedlg/namedlg.cxx |   15 ---
 1 file changed, 8 insertions(+), 7 deletions(-)

New commits:
commit 4fe34da54b5e561f17cebcccbebc76d504fee0f1
Author: Julien Nabet 
AuthorDate: Sat Dec 12 13:43:48 2020 +0100
Commit: Caolán McNamara 
CommitDate: Mon Dec 14 09:39:31 2020 +0100

tdf#138851: Named range manager always display "Document (Global)" at 
launching

In Init() method, call SelectionChanged() at the end so we're sure
everything is up-to-date.

Change-Id: I1bd8c44e172cd9f739650a6f76478214c0a31ac0
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107627
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx
index bff39913e504..314cb42fbbfa 100644
--- a/sc/source/ui/namedlg/namedlg.cxx
+++ b/sc/source/ui/namedlg/namedlg.cxx
@@ -109,13 +109,6 @@ void ScNameDlg::Init()
 xTreeView->get_height_rows(10));
 m_xRangeManagerTable.reset(new ScRangeManagerTable(std::move(xTreeView), 
m_RangeMap, maCursorPos));
 
-if (m_xRangeManagerTable->n_children())
-{
-m_xRangeManagerTable->set_cursor(0);
-m_xRangeManagerTable->CheckForFormulaString();
-SelectionChanged();
-}
-
 m_xRangeManagerTable->connect_changed( LINK( this, ScNameDlg, 
SelectionChangedHdl_Impl ) );
 
 m_xBtnOk->connect_clicked( LINK( this, ScNameDlg, OkBtnHdl ) );
@@ -143,6 +136,14 @@ void ScNameDlg::Init()
 }
 
 CheckForEmptyTable();
+
+if (m_xRangeManagerTable->n_children())
+{
+m_xRangeManagerTable->set_cursor(0);
+m_xRangeManagerTable->CheckForFormulaString();
+SelectionChanged();
+}
+
 }
 
 bool ScNameDlg::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-7-1' - sc/source

2020-12-08 Thread Roman Kuznetsov (via logerrit)
 sc/source/ui/dbgui/validate.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 0037b68dc6c2208af6760a0b86c59f871a2ce80a
Author: Roman Kuznetsov 
AuthorDate: Fri Dec 4 19:12:23 2020 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Dec 8 12:52:53 2020 +0100

tdf#131815 Reduce Validity dialog height

Change-Id: I90ec0a85bd8cf0761459e61bc26e619153597088
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107209
Tested-by: Jenkins
Reviewed-by: Roman Kuznetsov 
(cherry picked from commit 9cb1c7e5d7434a64ada279ad264182286f907d7c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107303
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx
index e4f9e93cd617..0ee9b69ab83a 100644
--- a/sc/source/ui/dbgui/validate.cxx
+++ b/sc/source/ui/dbgui/validate.cxx
@@ -376,7 +376,7 @@ ScTPValidationValue::ScTPValidationValue(weld::Container* 
pPage, weld::DialogCon
 m_xEdMin->SetReferences(nullptr, m_xFtMin.get());
 
 Size aSize(m_xEdList->get_approximate_digit_width() * 40,
-   m_xEdList->get_height_rows(25));
+   m_xEdList->get_height_rows(10));
 m_xEdList->set_size_request(aSize.Width(), aSize.Height());
 m_xEdMax->SetReferences(nullptr, m_xFtMax.get());
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-08 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/documen8.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 39adc2759753113604e0a7c628a4a4ef05db8b8e
Author: Luboš Luňák 
AuthorDate: Mon Dec 7 19:26:40 2020 +0100
Commit: Caolán McNamara 
CommitDate: Tue Dec 8 09:41:18 2020 +0100

avoid possible nullptr dereference

e.g. 
https://dev-builds.libreoffice.org/crashtest/9c98bf224d1dc8c5cb91d49273836eeb6111d697/backtraces/task1202-core.backtrace.txt

Regression from cb25771fedd12725a72a1eb4f532698d8221c0f2.

Change-Id: I6e00f43438882b9c96005ce921fbfd419ca634c7
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107358
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 6265cfca9d775198e81166b914f5dcaea58802db)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107309
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx
index ee2383a6fad1..7dfab834661a 100644
--- a/sc/source/core/data/documen8.cxx
+++ b/sc/source/core/data/documen8.cxx
@@ -425,7 +425,8 @@ void ScDocument::CalculateInColumnInThread( 
ScInterpreterContext& rContext, cons
 // If any of the thread_local data would cause problems if they stay 
around for too long
 // (and e.g. outlive the ScDocument), clean them up here, they cannot be 
cleaned up
 // later from the main thread.
-maThreadSpecific.xRecursionHelper->Clear();
+if(maThreadSpecific.xRecursionHelper)
+maThreadSpecific.xRecursionHelper->Clear();
 }
 
 void ScDocument::HandleStuffAfterParallelCalculation( SCCOL nColStart, SCCOL 
nColEnd, SCROW nRow, size_t nLen, SCTAB nTab, ScInterpreter* pInterpreter )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-03 Thread Stephan Bergmann (via logerrit)
 sc/source/core/data/drwlayer.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit bb3ffb40af7f191248f3ee823a95ee40c5c3bb6c
Author: Stephan Bergmann 
AuthorDate: Thu Dec 3 10:54:18 2020 +0100
Commit: Stephan Bergmann 
CommitDate: Thu Dec 3 19:50:01 2020 +0100

Fix wrong downcast

...that was presumably a typo in d0921aa753c43600272865602df3c7c2a8f13196
"tdf#137576 Improve cell anchored measure line in Calc".  As seen during
CppunitTest_sc_shapetest ():

> /sc/source/core/data/drwlayer.cxx:2234:9: runtime error: downcast of 
address 0x616000395480 which does not point to an object of type 
'SdrObjCustomShape'
> 0x616000395480: note: object is of type 'SdrMeasureObj'
>  29 02 00 36  f0 e2 c2 8f ba 2a 00 00  00 00 00 00 00 00 00 00  00 00 00 
00 00 00 00 00  01 00 00 00
>   ^~~
>   vptr for 'SdrMeasureObj'
> #0 0x2aba6ae92f02 in 
ScDrawLayer::SetCellAnchoredFromPosition(SdrObject&, ScDocument const&, short, 
bool) /sc/source/core/data/drwlayer.cxx:2234:9
> #1 0x2aba618db69b in 
sc_apitest::ScShapeTest::testTdf137576_LogicRectInDefaultMeasureline() 
/sc/qa/unit/scshapetest.cxx:164:5

Change-Id: I7e44ef6abb5704a3aa5841564ce989ff69960f30
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107149
Reviewed-by: Regina Henschel 
Reviewed-by: Stephan Bergmann 
Tested-by: Jenkins
(cherry picked from commit 520a2819fa6030ec11175d82dd42cfcdb2e92634)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107110

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 033602c4e43b..f041c5d776b6 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -2233,7 +2233,7 @@ void ScDrawLayer::SetCellAnchoredFromPosition( SdrObject 
, const ScDocument
 {
 // tdf#137576. A SdrMeasureObj might have a wrong logic rect here. 
TakeUnrotatedSnapRect
 // calculates the current unrotated snap rectangle, sets logic 
rectangle and returns it.
-
static_cast()->TakeUnrotatedSnapRect(aObjRect2);
+static_cast()->TakeUnrotatedSnapRect(aObjRect2);
 }
 else
 aObjRect2 = rObj.GetLogicRect();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-02 Thread Caolán McNamara (via logerrit)
 sc/source/ui/app/inputhdl.cxx |   37 ++---
 sc/source/ui/app/inputwin.cxx |   53 +++---
 sc/source/ui/inc/inputwin.hxx |   11 +++-
 3 files changed, 82 insertions(+), 19 deletions(-)

New commits:
commit dee8f1aff762bdec03c7a0fa9b4107d86580ec35
Author: Caolán McNamara 
AuthorDate: Wed Dec 2 11:42:51 2020 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 2 16:58:53 2020 +0100

tdf#138540 formula popover in the wrong place

since...

commit e087e25f05e689091cbf1c4f91b6e93878ac17ec
Date:   Mon Oct 5 14:19:05 2020 +0100

weld InputBar

Change-Id: Ib19aa088e9f593046e611d8ec4afe33b65c1b7fd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107030
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 7027f8317535..5b236f0394ea 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1245,15 +1245,19 @@ void ScInputHandler::ShowTip( const OUString& rText )
 
 Point aPos;
 if (pInputWin && pInputWin->GetEditView() == pActiveView)
-pTipVisibleParent = pInputWin;
+{
+pTipVisibleParent = pInputWin->GetEditWindow();
+aPos = pInputWin->GetCursorScreenPixelPos();
+}
 else
+{
 pTipVisibleParent = pActiveView->GetWindow();
-vcl::Cursor* pCur = pActiveView->GetCursor();
-if (pCur)
-aPos = pTipVisibleParent->LogicToPixel( pCur->GetPos() );
-aPos = pTipVisibleParent->OutputToScreenPixel( aPos );
-tools::Rectangle aRect( aPos, aPos );
+if (vcl::Cursor* pCur = pActiveView->GetCursor())
+aPos = pTipVisibleParent->LogicToPixel( pCur->GetPos() );
+aPos = pTipVisibleParent->OutputToScreenPixel( aPos );
+}
 
+tools::Rectangle aRect( aPos, aPos );
 QuickHelpFlags const nAlign = QuickHelpFlags::Left|QuickHelpFlags::Bottom;
 nTipVisible = Help::ShowPopover(pTipVisibleParent, aRect, rText, nAlign);
 pTipVisibleParent->AddEventListener( LINK( this, ScInputHandler, 
ShowHideTipVisibleParentListener ) );
@@ -1269,17 +1273,22 @@ void ScInputHandler::ShowTipBelow( const OUString& 
rText )
 
 Point aPos;
 if (pInputWin && pInputWin->GetEditView() == pActiveView)
-pTipVisibleSecParent = pInputWin;
+{
+pTipVisibleSecParent = pInputWin->GetEditWindow();
+aPos = pInputWin->GetCursorScreenPixelPos(true);
+}
 else
-pTipVisibleSecParent = pActiveView->GetWindow();
-vcl::Cursor* pCur = pActiveView->GetCursor();
-if ( pCur )
 {
-Point aLogicPos = pCur->GetPos();
-aLogicPos.AdjustY(pCur->GetHeight() );
-aPos = pTipVisibleSecParent->LogicToPixel( aLogicPos );
+pTipVisibleSecParent = pActiveView->GetWindow();
+if (vcl::Cursor* pCur = pActiveView->GetCursor())
+{
+Point aLogicPos = pCur->GetPos();
+aLogicPos.AdjustY(pCur->GetHeight() );
+aPos = pTipVisibleSecParent->LogicToPixel( aLogicPos );
+}
+aPos = pTipVisibleSecParent->OutputToScreenPixel( aPos );
 }
-aPos = pTipVisibleSecParent->OutputToScreenPixel( aPos );
+
 tools::Rectangle aRect( aPos, aPos );
 QuickHelpFlags const nAlign = QuickHelpFlags::Left | QuickHelpFlags::Top | 
QuickHelpFlags::NoEvadePointer;
 nTipVisibleSec = Help::ShowPopover(pTipVisibleSecParent, aRect, rText, 
nAlign);
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 2a1a5d20102c..2be36193748a 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -646,6 +646,16 @@ EditView* ScInputWindow::GetEditView()
 return mxTextWindow->GetEditView();
 }
 
+vcl::Window* ScInputWindow::GetEditWindow()
+{
+return mxTextWindow;
+}
+
+Point ScInputWindow::GetCursorScreenPixelPos(bool bBelow)
+{
+return mxTextWindow->GetCursorScreenPixelPos(bBelow);
+}
+
 void ScInputWindow::MakeDialogEditView()
 {
 mxTextWindow->MakeDialogEditView();
@@ -885,6 +895,11 @@ ScInputBarGroup::ScInputBarGroup(vcl::Window* pParent, 
ScTabViewShell* pViewSh)
 mxButtonDown->show();
 }
 
+Point ScInputBarGroup::GetCursorScreenPixelPos(bool bBelow)
+{
+return mxTextWndGroup->GetCursorScreenPixelPos(bBelow);
+}
+
 ScInputBarGroup::~ScInputBarGroup()
 {
 disposeOnce();
@@ -1096,7 +,7 @@ void ScInputBarGroup::TextGrabFocus()
 mxTextWndGroup->TextGrabFocus();
 }
 
-constexpr tools::Long gnBorderWidth = INPUTLINE_INSET_MARGIN + 1;
+constexpr tools::Long gnBorderWidth = (INPUTLINE_INSET_MARGIN + 1) * 2;
 constexpr tools::Long gnBorderHeight = INPUTLINE_INSET_MARGIN + 1;
 
 ScTextWndGroup::ScTextWndGroup(ScInputBarGroup& rParent, ScTabViewShell* 
pViewSh)
@@ -1108,6 +1123,28 @@ ScTextWndGroup::ScTextWndGroup(ScInputBarGroup& rParent, 
ScTabViewShell* pViewSh
 mxScrollWin->connect_vadjustment_changed(LINK(this, ScTextWndGroup, 
Impl_ScrollHdl));

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source svx/source

2020-12-02 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/postit.cxx |   11 ---
 svx/source/svdraw/svdotxat.cxx |7 +--
 2 files changed, 5 insertions(+), 13 deletions(-)

New commits:
commit 49f0410cafcc2bd3b417427d3d17de8abb8ea3b4
Author: Caolán McNamara 
AuthorDate: Tue Dec 1 09:09:45 2020 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Dec 2 14:18:08 2020 +0100

Resolves: tdf#138549 use GetSpecialTextBoxShadow to identify ScPostIt

instead of a 'special' name which causes undo-related causes side effects

Change-Id: Id36b0b5360ddde3469721a7c837fe3942af08209
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106924
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
(cherry picked from commit 9c94bae963ef5019f6ca0394d076b1288969aa53)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107024
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index 7bb1b96eb2b4..bafd2e9e901b 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -382,17 +382,6 @@ void ScCaptionCreator::CreateCaption( bool bShown, bool 
bTailFront )
 *mrDoc.GetDrawLayer(), //  should ret a ref?
 aTextRect,
 aTailPos));
-
-// tdf#114956 a way to recognize that this SdrCaption is for a ScPostit in
-// SdrTextObj::AdjustTextFrameWidthAndHeight
-SdrModel& rModel = mxCaption->getSdrModelFromSdrObject();
-const bool bUndoEnabled = rModel.IsUndoEnabled();
-if (bUndoEnabled)
-rModel.EnableUndo(false);
-mxCaption->SetName("ScPostIt");
-if (bUndoEnabled)
-rModel.EnableUndo(true);
-
 // basic caption settings
 ScCaptionUtil::SetBasicCaptionSettings( *mxCaption, bShown );
 }
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx
index 4b96bb04c12a..5ba5ec6a82cc 100644
--- a/svx/source/svdraw/svdotxat.cxx
+++ b/svx/source/svdraw/svdotxat.cxx
@@ -263,8 +263,12 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight()
 if (auto pRectObj = dynamic_cast(this)) { // this is a 
hack
 pRectObj->SetXPolyDirty();
 }
+bool bScPostIt = false;
 if (auto pCaptionObj = dynamic_cast(this)) { // this 
is a hack
 pCaptionObj->ImpRecalcTail();
+// tdf#114956, tdf#138549 use GetSpecialTextBoxShadow to recognize
+// that this SdrCaption is for a ScPostit
+bScPostIt = pCaptionObj->GetSpecialTextBoxShadow();
 }
 
 // to not slow down EditView visualization on Overlay (see
@@ -278,8 +282,7 @@ bool SdrTextObj::AdjustTextFrameWidthAndHeight()
 GetTextEditOutliner() &&
 GetTextEditOutliner()->hasEditViewCallbacks());
 
-// tdf#114956 always broadcast change for ScPostIts
-if (!bSuppressChangeWhenEditOnOverlay || GetName() == "ScPostIt")
+if (!bSuppressChangeWhenEditOnOverlay || bScPostIt)
 {
 SetChanged();
 BroadcastObjectChange();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-02 Thread Caolán McNamara (via logerrit)
 sc/source/core/tool/inputopt.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 358f2ce190dcebb185f18bc23953f99f81c3b940
Author: Caolán McNamara 
AuthorDate: Tue Dec 1 10:14:19 2020 +
Commit: Caolán McNamara 
CommitDate: Wed Dec 2 09:46:14 2020 +0100

cid#1470370 Uninitialized scalar field

Change-Id: I024c78d528dd966b30bd8a222153bc75081c9850
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106952
Tested-by: Caolán McNamara 
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/tool/inputopt.cxx b/sc/source/core/tool/inputopt.cxx
index 380c4391f307..73b25c297203 100644
--- a/sc/source/core/tool/inputopt.cxx
+++ b/sc/source/core/tool/inputopt.cxx
@@ -51,6 +51,7 @@ void ScInputOptions::SetDefaults()
 bTextWysiwyg= false;
 bReplCellsWarn  = true;
 bLegacyCellSelection = false;
+bEnterPasteMode = false;
 }
 
 //  Config Item containing input options
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-12-01 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/table3.cxx |   48 ++---
 1 file changed, 40 insertions(+), 8 deletions(-)

New commits:
commit 8d29d0cee0b16df71134cd82d3fc0dbcdcd3dde3
Author: Luboš Luňák 
AuthorDate: Tue Nov 24 15:23:22 2020 +0100
Commit: Luboš Luňák 
CommitDate: Tue Dec 1 14:30:12 2020 +0100

bring back optimized calc querying by value (tdf#133878)

When filtering, if the filtered value was a number, Calc used
to convert the string value from the autofilter dialog to a number,
since querying by numerical value is much faster then comparing
strings. Commit 42e472b5870278058537d43d03d457dc80b16166 tried
to fix a problem with filtering time values (that are internally
also represented as a float) by moving this optimization elsewhere,
but that had 2 problems: 1) the problem was with the time value
getting rounded to seconds for display and then converting back
to float value for querying, so the move would not have fixed
anything, 2) the move "fixed" the problem by essentially disabling
the optimization (the new code doesn't get called with the doc
from tdf#105629).
This commit reverts that (actually, it does the optimization in both
places, since at least the unittest requires it in the other place,
and it seems to make sense to keep it there too). As a fix
for the original problem, this this optimization is allowed
only for number formats where this problem should not occur.

Change-Id: I2fb56dea9577c59b870c29e26bb5f09ef9ddec82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106594
Tested-by: Jenkins
Reviewed-by: Kohei Yoshida 
Reviewed-by: Luboš Luňák 
(cherry picked from commit 85cb9262644ebe376f9c5af1f01a0216a51a6d6d)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106941

diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index a528117f1d74..b4967a9a31dd 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2978,6 +2978,29 @@ void ScTable::TopTenQuery( ScQueryParam& rParam )
 
 namespace {
 
+bool CanOptimizeQueryStringToNumber( SvNumberFormatter* pFormatter, sal_uInt32 
nFormatIndex )
+{
+// tdf#105629: ScQueryEntry::ByValue queries are faster than 
ScQueryEntry::ByString.
+// The problem with this optimization is that the autofilter dialog 
apparently converts
+// the value to text and then converts that back to a number for filtering.
+// If that leads to any change of value (such as when time is rounded to 
seconds),
+// even matching values will be filtered out. Therefore query by value 
only for formats
+// where no such change should occur.
+if(const SvNumberformat* pEntry = pFormatter->GetEntry(nFormatIndex))
+{
+switch(pEntry->GetType())
+{
+case SvNumFormatType::NUMBER:
+case SvNumFormatType::FRACTION:
+case SvNumFormatType::SCIENTIFIC:
+return true;
+default:
+break;
+}
+}
+return false;
+}
+
 class PrepareQueryItem
 {
 const ScDocument& mrDoc;
@@ -2986,15 +3009,26 @@ public:
 
 void operator() (ScQueryEntry::Item& rItem)
 {
-// Double-check if the query by date is really appropriate.
-
-if (rItem.meType != ScQueryEntry::ByDate)
+if (rItem.meType != ScQueryEntry::ByString && rItem.meType != 
ScQueryEntry::ByDate)
 return;
 
 sal_uInt32 nIndex = 0;
 bool bNumber = mrDoc.GetFormatTable()->
 IsNumberFormat(rItem.maString.getString(), nIndex, rItem.mfVal);
 
+// Advanced Filter creates only ByString queries that need to be
+// converted to ByValue if appropriate. rItem.mfVal now holds the value
+// if bNumber==true.
+
+if (rItem.meType == ScQueryEntry::ByString)
+{
+if (bNumber && CanOptimizeQueryStringToNumber( 
mrDoc.GetFormatTable(), nIndex ))
+rItem.meType = ScQueryEntry::ByValue;
+return;
+}
+
+// Double-check if the query by date is really appropriate.
+
 if (bNumber && ((nIndex % SV_COUNTRY_LANGUAGE_OFFSET) != 0))
 {
 const SvNumberformat* pEntry = 
mrDoc.GetFormatTable()->GetEntry(nIndex);
@@ -3360,19 +3394,17 @@ bool ScTable::CreateQueryParam(SCCOL nCol1, SCROW 
nRow1, SCCOL nCol2, SCROW nRow
 
 SvNumberFormatter* pFormatter = rDocument.GetFormatTable();
 nCount = rQueryParam.GetEntryCount();
-
 if (bValid)
 {
-//  bQueryByString must be set
+//  query type must be set
 for (i=0; i < nCount; i++)
 {
 ScQueryEntry::Item& rItem = rQueryParam.GetEntry(i).GetQueryItem();
-
 sal_uInt32 nIndex = 0;
 bool bNumber = pFormatter->IsNumberFormat(
 rItem.maString.getString(), nIndex, rItem.mfVal);
-
-rItem.meType = bNumber ? ScQueryEntry::ByValue : 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-11-28 Thread Noel Grandin (via logerrit)
 sc/source/filter/xml/xmlexprt.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit f92ea2dfaacc63a7a1721652d68faefd34395847
Author: Noel Grandin 
AuthorDate: Sat Nov 28 08:43:54 2020 +0200
Commit: Xisco Fauli 
CommitDate: Sat Nov 28 15:51:49 2020 +0100

tdf#138466 Crash when creating different scenarios

apparently this is a regression from
commit 4176beb7ef831152ce92ac3fa31314438635ec2c
Author: Noel Grandin 
Date:   Sat Sep 12 18:21:44 2020 +0200
tdf#133327 fix calc loading background color with many cols

but I have no idea how or why, so just fix the crash.

Change-Id: Ia2f056fc53527338c431d3b34bb64e6eedc8e955
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106799
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 52aebe6986bcec07071adb3f94d6c09fea147044)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106747
Reviewed-by: Xisco Fauli 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 1f31e5d52c6d..6df4093cc8eb 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -869,8 +869,9 @@ void ScXMLExport::ExportColumns(const sal_Int32 nTable, 
const ScRange& aColumnHe
 nColsRepeated = 1;
 }
 }
-assert(nPrevIndex >= 0 && "coverity#1438402");
-WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
+// tdf#138466
+if (nPrevIndex != -1)
+WriteColumn(nPrevColumn, nColsRepeated, nPrevIndex, bPrevIsVisible);
 if (!bIsClosed)
 CloseHeaderColumn();
 if (pGroupColumns->IsGroupEnd(nColumn - 1))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2020-11-26 Thread Rafael Lima (via logerrit)
 sc/source/ui/inc/optsolver.hxx  |1 
 sc/source/ui/miscdlgs/optsolver.cxx |   25 +++
 sc/uiconfig/scalc/ui/solverdlg.ui   |   46 +++-
 3 files changed, 56 insertions(+), 16 deletions(-)

New commits:
commit 8795ae5e992e05dbd24cf03560dddb1fee061522
Author: Rafael Lima 
AuthorDate: Tue Nov 17 17:59:50 2020 -0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Fri Nov 27 01:09:55 2020 +0100

tdf#134528 Add "Reset All" button to Calc Solver dialog

Change-Id: I27a2fb4dddf3da31801bc2283ee58a24a921d7ff
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106030
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit e1b05b134e43d3186ddc5b8cfbbacb62ee4af483)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106442
Reviewed-by: Rafael Lima 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/inc/optsolver.hxx b/sc/source/ui/inc/optsolver.hxx
index ed9860e8b652..410f513375ee 100644
--- a/sc/source/ui/inc/optsolver.hxx
+++ b/sc/source/ui/inc/optsolver.hxx
@@ -177,6 +177,7 @@ private:
 std::unique_ptr m_xBtnOpt;
 std::unique_ptr m_xBtnCancel;
 std::unique_ptr m_xBtnSolve;
+std::unique_ptr m_xBtnResetAll;
 
 std::unique_ptr m_xResultFT;
 std::unique_ptr m_xContents;
diff --git a/sc/source/ui/miscdlgs/optsolver.cxx 
b/sc/source/ui/miscdlgs/optsolver.cxx
index e3c6b1d751e9..8fc81893e26c 100644
--- a/sc/source/ui/miscdlgs/optsolver.cxx
+++ b/sc/source/ui/miscdlgs/optsolver.cxx
@@ -202,6 +202,7 @@ ScOptSolverDlg::ScOptSolverDlg(SfxBindings* pB, 
SfxChildWindow* pCW, weld::Windo
 , m_xBtnOpt(m_xBuilder->weld_button("options"))
 , m_xBtnCancel(m_xBuilder->weld_button("close"))
 , m_xBtnSolve(m_xBuilder->weld_button("ok"))
+, m_xBtnResetAll(m_xBuilder->weld_button("resetall"))
 , m_xResultFT(m_xBuilder->weld_label("result"))
 , m_xContents(m_xBuilder->weld_widget("grid"))
 {
@@ -273,6 +274,7 @@ void ScOptSolverDlg::Init(const ScAddress& rCursorPos)
 m_xBtnOpt->connect_clicked( LINK( this, ScOptSolverDlg, BtnHdl ) );
 m_xBtnCancel->connect_clicked( LINK( this, ScOptSolverDlg, BtnHdl ) );
 m_xBtnSolve->connect_clicked( LINK( this, ScOptSolverDlg, BtnHdl ) );
+m_xBtnResetAll->connect_clicked( LINK( this, ScOptSolverDlg, BtnHdl ) );
 
 Link aEditLink = LINK( this, ScOptSolverDlg, 
GetEditFocusHdl );
 Link aButtonLink = LINK( this, ScOptSolverDlg, 
GetButtonFocusHdl );
@@ -545,6 +547,29 @@ IMPL_LINK(ScOptSolverDlg, BtnHdl, weld::Button&, rBtn, 
void)
 m_xOptDlg.reset();
 });
 }
+else if ( == m_xBtnResetAll.get())
+{
+OUString sEmpty;
+m_xEdObjectiveCell->SetText(sEmpty);
+m_xEdTargetValue->SetText(sEmpty);
+m_xEdVariableCells->SetText(sEmpty);
+
+// Get default property values of solver implementations
+maEngine = maImplNames[0];
+maProperties = ScSolverUtil::GetDefaults( maEngine );
+
+// Clear all conditions (Constraints)
+maConditions.clear();
+std::unique_ptr pEmpty( new ScOptSolverSave(
+sEmpty, true, false, false,
+sEmpty, sEmpty, maConditions, maEngine, maProperties ) 
);
+mpDocShell->SetSolverSaveData( std::move(pEmpty) );
+ShowConditions();
+
+m_xRbMax->set_active(true);
+m_xEdObjectiveCell->GrabFocus();
+mpEdActive = m_xEdObjectiveCell.get();
+}
 }
 
 IMPL_LINK( ScOptSolverDlg, GetEditFocusHdl, formula::RefEdit&, rCtrl, void )
diff --git a/sc/uiconfig/scalc/ui/solverdlg.ui 
b/sc/uiconfig/scalc/ui/solverdlg.ui
index a4f63ef2b3e8..ccd87c6f54d1 100644
--- a/sc/uiconfig/scalc/ui/solverdlg.ui
+++ b/sc/uiconfig/scalc/ui/solverdlg.ui
@@ -20,37 +20,51 @@
 False
 end
 
-  
-O_ptions...
+  
+gtk-help
 True
 True
 True
-True
-
-  
-Opens the Solver 
Options dialog.
-  
-
+True
   
   
 False
 True
 0
+True
   
 
 
-  
-gtk-help
+  
+_Reset All
 True
 True
 True
-True
+True
   
   
-False
+True
 True
 1
-True
+  
+
+
+  
+O_ptions...
+True
+True
+True
+True
+
+  
+Opens the Solver 
Options dialog.
+  
+
+ 

[Libreoffice-commits] core.git: Branch 'libreoffice-7-1' - sc/source

2020-11-23 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/postit.cxx |8 
 1 file changed, 8 insertions(+)

New commits:
commit ef81ab795547ccdfda999a0490564ac6d9f5764f
Author: Caolán McNamara 
AuthorDate: Mon Nov 23 16:25:02 2020 +
Commit: Caolán McNamara 
CommitDate: Mon Nov 23 20:57:12 2020 +0100

tdf#138428 don't record SetName("ScPostIt") in undo

Change-Id: Iae87db47907078282e48035ad7892dbf52942e53
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106431
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 

diff --git a/sc/source/core/data/postit.cxx b/sc/source/core/data/postit.cxx
index f826e1d66478..7bb1b96eb2b4 100644
--- a/sc/source/core/data/postit.cxx
+++ b/sc/source/core/data/postit.cxx
@@ -382,9 +382,17 @@ void ScCaptionCreator::CreateCaption( bool bShown, bool 
bTailFront )
 *mrDoc.GetDrawLayer(), //  should ret a ref?
 aTextRect,
 aTailPos));
+
 // tdf#114956 a way to recognize that this SdrCaption is for a ScPostit in
 // SdrTextObj::AdjustTextFrameWidthAndHeight
+SdrModel& rModel = mxCaption->getSdrModelFromSdrObject();
+const bool bUndoEnabled = rModel.IsUndoEnabled();
+if (bUndoEnabled)
+rModel.EnableUndo(false);
 mxCaption->SetName("ScPostIt");
+if (bUndoEnabled)
+rModel.EnableUndo(true);
+
 // basic caption settings
 ScCaptionUtil::SetBasicCaptionSettings( *mxCaption, bShown );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits