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

2019-04-08 Thread Samuel Mehrbrodt (via logerrit)
 sc/source/ui/unoobj/shapeuno.cxx |   14 ++
 1 file changed, 10 insertions(+), 4 deletions(-)

New commits:
commit c45f22ce7c1560ec2deddc90a71da062d803f15d
Author: Samuel Mehrbrodt 
AuthorDate: Fri Mar 29 07:43:00 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Apr 8 13:44:55 2019 +0200

Related tdf#124329 Handle shapes resizing with the cell

The same as shapes just anchored to the cell.

Change-Id: I0ce03e4c650dd10bd89cee87aa26775c32703d06
Reviewed-on: https://gerrit.libreoffice.org/70065
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt 
(cherry picked from commit e587645f551c6c684f9f36606f8fa5e1b06004a1)
Reviewed-on: https://gerrit.libreoffice.org/70402
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 04ef95a81e9f..aed1d55e389a 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -510,7 +510,9 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& 
aPropertyName, const
 xShape->setPosition(aPoint);
 pDocSh->SetModified();
 }
-else if (ScDrawLayer::GetAnchorType(*pObj) 
== SCA_CELL)
+else if (ScDrawLayer::GetAnchorType(*pObj) 
== SCA_CELL
+ || 
ScDrawLayer::GetAnchorType(*pObj)
+== SCA_CELL_RESIZE)
 {
 awt::Size aUnoSize;
 awt::Point aCaptionPoint;
@@ -595,7 +597,9 @@ void SAL_CALL ScShapeObj::setPropertyValue(const OUString& 
aPropertyName, const
 xShape->setPosition(aPoint);
 pDocSh->SetModified();
 }
-else if (ScDrawLayer::GetAnchorType(*pObj) 
== SCA_CELL)
+else if (ScDrawLayer::GetAnchorType(*pObj) 
== SCA_CELL
+ || 
ScDrawLayer::GetAnchorType(*pObj)
+== SCA_CELL_RESIZE)
 {
 awt::Size aUnoSize;
 awt::Point aCaptionPoint;
@@ -724,7 +728,8 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const 
OUString& aPropertyName )
 uno::Reference xShape( mxShapeAgg, 
uno::UNO_QUERY );
 if (xShape.is())
 {
-if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
+if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL
+|| ScDrawLayer::GetAnchorType(*pObj) == 
SCA_CELL_RESIZE)
 {
 awt::Size aUnoSize;
 awt::Point aCaptionPoint;
@@ -784,7 +789,8 @@ uno::Any SAL_CALL ScShapeObj::getPropertyValue( const 
OUString& aPropertyName )
 uno::Reference xShape( mxShapeAgg, 
uno::UNO_QUERY );
 if (xShape.is())
 {
-if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL)
+if (ScDrawLayer::GetAnchorType(*pObj) == SCA_CELL
+|| ScDrawLayer::GetAnchorType(*pObj) == 
SCA_CELL_RESIZE)
 {
 awt::Size aUnoSize;
 awt::Point aCaptionPoint;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-03 Thread Jaromir Wysoglad (via logerrit)
 sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx |3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

New commits:
commit 1dc8088162a66a99217dae3258711cbfa8f9bc28
Author: Jaromir Wysoglad 
AuthorDate: Thu Mar 28 19:55:23 2019 +0100
Commit: Eike Rathke 
CommitDate: Wed Apr 3 11:18:55 2019 +0200

tdf#121103 ANOVA sum of squares formula correction

The ANOVA sum of squares is now hardcoded to use '$Sheet?' in the
source cell addless every time.

Change-Id: I215b719be11ecfc2ae20c5df8e86876bc22d50f0
Reviewed-on: https://gerrit.libreoffice.org/69899
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 66c08a0d308fd6119460546a906434bbc9d23c2e)
Reviewed-on: https://gerrit.libreoffice.org/70155
Reviewed-by: vyzigold 

diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx 
b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index c31fc9fb4c09..14662c18b3b0 100644
--- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -67,7 +67,7 @@ OUString lclCreateMultiParameterFormula(
 OUString aResult;
 for (size_t i = 0; i < aRangeList.size(); i++)
 {
-OUString aRangeString(aRangeList[i].Format(ScRefFlags::RANGE_ABS, 
pDocument, aAddressDetails));
+OUString aRangeString(aRangeList[i].Format(ScRefFlags::RANGE_ABS_3D, 
pDocument, aAddressDetails));
 OUString aFormulaString = aFormulaTemplate.replaceAll(aWildcard, 
aRangeString);
 aResult += aFormulaString;
 if(i != aRangeList.size() - 1) // Not Last
@@ -260,7 +260,6 @@ void 
ScAnalysisOfVarianceDialog::AnovaSingleFactor(AddressWalkerWriter& output,
 output.nextColumn();
 
 // Sum of Squares
-
 
aTemplate.setTemplate("=SUMPRODUCT(%SUM_RANGE%;%MEAN_RANGE%)-SUM(%SUM_RANGE%)^2/SUM(%COUNT_RANGE%)");
 aTemplate.autoReplaceAddress("%BETWEEN_SS%", output.current());
 output.writeFormula(aTemplate.getTemplate());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-19 Thread Libreoffice Gerrit user
 sc/source/ui/unoobj/docuno.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 0c70e9ab4713a50fec558d6c4e4dfb2517039fc8
Author: Serge Krot 
AuthorDate: Wed Mar 6 23:49:54 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Mar 19 10:23:23 2019 +0100

tdf#120161 sc: use selection to set required printed area

Change-Id: Id0798cbff2d327e2bb955fbbc530a201975f6003
Reviewed-on: https://gerrit.libreoffice.org/68833
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 03b6c20c66047af41ed2f78fe5dd229cd06392e8)
Reviewed-on: https://gerrit.libreoffice.org/69118
Reviewed-by: Serge Krot (CIB) 
Tested-by: Serge Krot (CIB) 
(cherry picked from commit f0b71fafd3a2fd6158c5952d601092179cba21e5)
Reviewed-on: https://gerrit.libreoffice.org/69263

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 1fd3c9158d7f..1d0928c34cbe 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1971,7 +1971,8 @@ void SAL_CALL ScModelObj::render( sal_Int32 nSelRenderer, 
const uno::Any& aSelec
 
 
 std::unique_ptr> pPrintFunc;
-if (m_pPrintState && m_pPrintState->nPrintTab == nTab)
+if (m_pPrintState && m_pPrintState->nPrintTab == nTab
+&& ! pSelRange) // tdf#120161 use selection to set required printed 
area
 pPrintFunc.reset(new ScPrintFunc(pDev, pDocShell, *m_pPrintState, 
()));
 else
 pPrintFunc.reset(new ScPrintFunc(pDev, pDocShell, nTab, 
pPrintFuncCache->GetFirstAttr(nTab), nTotalPages, pSelRange, 
()));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-14 Thread Libreoffice Gerrit user
 sc/source/ui/inc/printfun.hxx  |5 -
 sc/source/ui/view/printfun.cxx |   23 +--
 2 files changed, 21 insertions(+), 7 deletions(-)

New commits:
commit b0464b42d1416a521e6ce0e492f1628b5fb46910
Author: Luboš Luňák 
AuthorDate: Tue Mar 5 12:41:44 2019 +0100
Commit: Xisco Faulí 
CommitDate: Thu Mar 14 15:18:00 2019 +0100

do not access uninitialized values when printing (tdf#121439)

The assert in the bugreport is triggered by ScPrintFunc::CalcPages() passing
uninitialized values of nEndRow (and others). These variables apparently
get initialized only by constructors that take ScPrintState. These ctors
also set (the somewhat poorly named) bState and the call to CalcPages()
is guarded by this. However, GetPrintState() will simply create ScPrintState
filled with these uninitialized values and later on this will be used
with these ctors, so bState will be set, but nEndRow will be bogus.

Although 5217a2a0bf27e496cc429ee45dff7c239b466ae6 introduced tdf#121439,
this strange bState logic and unitialized variables has been these since
the initial commit, and the code doesn't take any precautions to check
whether the values are valid or not, so I assume this always was just lucky
enough to work and 5217a2a0bf finally triggered a problem.

Given that it's rather unclear to me how this is supposed to work properly,
just add an extra flag to both ScPrintFunc and ScPrintState marking whether
the values are set or not and make CalcPages() depends on this flag instead.

Change-Id: I0620de6562865c24f5a0edca2566b01546bf2e2b
Reviewed-on: https://gerrit.libreoffice.org/68739
Reviewed-by: Tomaž Vajngerl 
Tested-by: Jenkins
(cherry picked from commit 9432bab9f8f4a246d205ff2a460f60aeedba8ce1)
Reviewed-on: https://gerrit.libreoffice.org/69262
Reviewed-by: Luboš Luňák 
Reviewed-by: Xisco Faulí 
Tested-by: Xisco Faulí 

diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 2df47432c89a..fd2f486ac5ce 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -153,6 +153,7 @@ struct ScPrintState //  Save 
Variables from ScPrintFunc
 SCROW   nStartRow;
 SCCOL   nEndCol;
 SCROW   nEndRow;
+boolbPrintAreaValid; // the 4 variables above are set
 sal_uInt16  nZoom;
 size_t  nPagesX;
 size_t  nPagesY;
@@ -175,6 +176,7 @@ struct ScPrintState //  Save 
Variables from ScPrintFunc
 , nStartRow(0)
 , nEndCol(0)
 , nEndRow(0)
+, bPrintAreaValid(false)
 , nZoom(0)
 , nPagesX(0)
 , nPagesY(0)
@@ -212,7 +214,7 @@ private:
 const ScRange*  pUserArea;  //  Selection, if set in dialog
 
 const SfxItemSet*   pParamSet;  //  Selected template
-boolbState; // created from State-struct
+boolbFromPrintState;// created from State-struct
 
 //  Parameter from template:
 sal_uInt16  nLeftMargin;
@@ -261,6 +263,7 @@ private:
 SCROW   nStartRow;
 SCCOL   nEndCol;
 SCROW   nEndRow;
+boolbPrintAreaValid; // the 4 variables above are set
 
 sc::PrintPageRanges m_aRanges;
 
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 4ddc1f64f0ce..59d5ed9ca96f 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -191,7 +191,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions 
)
 pParamSet = nullptr;
 }
 
-if (!bState)
+if (!bFromPrintState)
 nZoom = 100;
 nManualZoom = 100;
 bClearWin = false;
@@ -214,13 +214,14 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* 
pNewPrinter, SCTAB nTa
 nPageStart  ( nPage ),
 nDocPages   ( nDocP ),
 pUserArea   ( pArea ),
-bState  ( false ),
+bFromPrintState ( false ),
 bSourceRangeValid   ( false ),
 bPrintCurrentTable  ( false ),
 bMultiArea  ( false ),
 mbHasPrintRange(true),
 nTabPages   ( 0 ),
 nTotalPages ( 0 ),
+bPrintAreaValid ( false ),
 pPageData   ( pData )
 {
 pDev = pPrinter.get();
@@ -247,6 +248,7 @@ ScPrintFunc::ScPrintFunc(ScDocShell* pShell, SfxPrinter* 
pNewPrinter,
 nStartRow   = rState.nStartRow;
 nEndCol = rState.nEndCol;
 nEndRow = rState.nEndRow;
+bPrintAreaValid = rState.bPrintAreaValid;
 nZoom   = rState.nZoom;
 m_aRanges.m_nPagesX = rState.nPagesX;
 m_aRanges.m_nPagesY = rState.nPagesY;
@@ -254,7 +256,7 @@ ScPrintFunc::ScPrintFunc(ScDocShell* pShell, SfxPrinter* 
pNewPrinter,
 nTotalPages = rState.nTotalPages;
 nPageStart  = 

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

2019-02-28 Thread Libreoffice Gerrit user
 sc/source/ui/docshell/docsh4.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f596b5f923907aae99977fc240a890f11affd386
Author: Noel Grandin 
AuthorDate: Thu Feb 28 11:41:01 2019 +0200
Commit: Caolán McNamara 
CommitDate: Thu Feb 28 18:03:51 2019 +0100

fix "doc will be saved" dialog message

looks like a copy/paste error in
commit 942f05996bc287923cdbcae12c64e57adf8ec975
Author: Caolán McNamara 
convert remaining ErrorBox to weld::MessageDialog

Change-Id: I52d38311b1e276fd799128e058ea0b9c902aef06
Reviewed-on: https://gerrit.libreoffice.org/68491
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit e76203f45a4c645447f8379ee2123f518a8aca77)
Reviewed-on: https://gerrit.libreoffice.org/68503
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 47992f8ea28d..1d4ad1830372 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -985,7 +985,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
 vcl::Window* pWin = GetActiveDialogParent();
 std::unique_ptr 
xQueryBox(Application::CreateMessageDialog(pWin ? pWin->GetFrameWeld() : 
nullptr,

VclMessageType::Question, VclButtonsType::YesNo,
-   
ScResId(STR_REIMPORT_AFTER_LOAD)));
+   
ScResId(STR_DOC_WILLBESAVED)));
 xQueryBox->set_default_response(RET_YES);
 if (xQueryBox->run() == RET_NO)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-02-08 Thread Libreoffice Gerrit user
 sc/source/core/data/column.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 439407a36e4085c17c65c620a1bb2ca95f4564b0
Author: Eike Rathke 
AuthorDate: Wed Feb 6 14:53:26 2019 +0100
Commit: Kohei Yoshida 
CommitDate: Sat Feb 9 01:10:48 2019 +0100

Resolves: tdf#121002 UpdateRefOnNonCopy::mbUpdated=true if references change

... somewhere in a previous shared formula group, so for the new groups
after split the column is added to sc::RefUpdateContext::maRegroupCols
in ScColumn::UpdateReference() to setup new listeners later, and true
returned there, which also results in ScTable::SetStreamValid(false) at
the end, which in this constellation wasn't the case.

It may have been a reason that some documents have individual
unrecalculated results stored (i.e. values moved within ranges that a
shared formula group pointed to) that can be corrected by recalculating
after load.

Said to be a regression from

commit 2f6a06856ad8df0c11a112d1e457b408e9a7af1d
CommitDate: Fri Jun 5 16:22:38 2015 +0200

tdf#90694 reset group area listeners when splitting group

but that only uncovered this misbehaviour.

Change-Id: I6b04b71898c3f1774452dd19790c208f3167d8eb
Reviewed-on: https://gerrit.libreoffice.org/67461
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit cdfa8b27f28328612b6734533981c1b363ced0a0)
Reviewed-on: https://gerrit.libreoffice.org/67466
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index d8f164e0c916..6e34a6757fe5 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2264,6 +2264,8 @@ class UpdateRefOnNonCopy
 p->SetDirty();
 }
 
+mbUpdated = true;
+
 // Move from clipboard is Cut, then do not copy the original
 // positions' formula cells to the Undo document.
 if (!mbClipboardSource || !bCellMoved)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2019-01-08 Thread Libreoffice Gerrit user
 sc/source/ui/pagedlg/scuitphfedit.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit a1f3bcc6312a56fee9825703394fe5b3a20a
Author: Caolán McNamara 
AuthorDate: Thu Dec 20 16:52:11 2018 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue Jan 8 11:37:29 2019 +0100

Resolves: tdf#114695 limit width of this combo

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

diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx 
b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 46d94e7d751d..f1c9d194da63 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -64,6 +64,10 @@ ScHFEditPage::ScHFEditPage( vcl::Window* pParent,
 m_pWndRight->SetLocation(Right);
 
 get(m_pLbDefined,"comboLB_DEFINED");
+// tdf#114695 override natural size with a small value
+// we expect this to get stretched to some larger but
+// limited size based on surrounding widgets
+m_pLbDefined->set_width_request(m_pLbDefined->approximate_digit_width() * 
20);
 
 get(m_pBtnText,"buttonBTN_TEXT");
 get(m_pBtnTable,"buttonBTN_TABLE");
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-12-31 Thread Libreoffice Gerrit user
 sc/source/filter/xml/xmlexprt.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9377e77b8b49a4b0bf045566bbe802b511ca1fd8
Author: Julien Nabet 
AuthorDate: Sun Dec 30 00:20:33 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Mon Dec 31 21:45:10 2018 +0100

tdf#114919: fix ods export in ODF 1.2 strict

See Valgrind trace here:
https://bugs.documentfoundation.org/attachment.cgi?id=147891
which contains bt

Due to a8b7c72425aabae87bfd2e141aa06f06319ae11c
"
add error to office:value-type for calc cells and fdo#51810
For cached value import we need the information which cells are error
cells. For ODF 1.2 extended we therefore export now calcext:office-value
with the additional value "error".
"

Change-Id: I13547ecc7ef8c1c4e1a236229d3b19d51f12470b
Reviewed-on: https://gerrit.libreoffice.org/65728
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit 5534bfef6426128af2147de995224d7cdf43a2bf)
Reviewed-on: https://gerrit.libreoffice.org/65738
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index c7131e4e5b08..8cd6ebc11085 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3245,7 +3245,7 @@ void ScXMLExport::WriteCell(ScMyCell& aCell, sal_Int32 
nEqualCellCount)
 {
 
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
 aCell.nNumberFormat, 
pDoc->GetValue(aCell.maCellAddress));
-if( getDefaultVersion() >= 
SvtSaveOptions::ODFVER_012 )
+if( getDefaultVersion() > 
SvtSaveOptions::ODFVER_012 )
 {
 
GetNumberFormatAttributesExportHelper()->SetNumberFormatAttributes(
 aCell.nNumberFormat, 
pDoc->GetValue(aCell.maCellAddress), false, XML_NAMESPACE_CALC_EXT, false );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-12-31 Thread Libreoffice Gerrit user
 sc/source/filter/xml/XMLExportDataPilot.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit c64564c6b520f4dbadb689e958dafa1591b3711d
Author: Julien Nabet 
AuthorDate: Sun Dec 30 12:51:25 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Mon Dec 31 21:43:59 2018 +0100

tdf#112484: repeat-item-labels is invalid in odf1.2 strict

Change-Id: I23d204ef3d4e466876bb3416d616dc1f3682ad4c
Reviewed-on: https://gerrit.libreoffice.org/65740
Tested-by: Jenkins
(cherry picked from commit 40a7e9c93855ac6cceb4c4189587998e21581de5)
Reviewed-on: https://gerrit.libreoffice.org/65749
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx 
b/sc/source/filter/xml/XMLExportDataPilot.cxx
index 436cf515ed1e..df52e39f8648 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -492,6 +492,7 @@ void ScXMLExportDataPilot::WriteLevels(const 
ScDPSaveDimension* pDim)
 ::sax::Converter::convertBool(sBuffer, pDim->GetShowEmpty());
 rExport.AddAttribute(XML_NAMESPACE_TABLE, XML_SHOW_EMPTY, 
sBuffer.makeStringAndClear());
 }
+if (rExport.getDefaultVersion() > SvtSaveOptions::ODFVER_012)
 {
 OUStringBuffer sBuffer;
 ::sax::Converter::convertBool(sBuffer, pDim->GetRepeatItemLabels());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-12-19 Thread Libreoffice Gerrit user
 sc/source/ui/condformat/condformatdlg.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 9396cf7edb101983c56f44ae814029ce78f0fc71
Author: Mike Kaganski 
AuthorDate: Tue Dec 4 21:28:46 2018 +0300
Commit: Eike Rathke 
CommitDate: Thu Dec 20 01:01:48 2018 +0100

tdf#117332: select replaced text to properly replace it next time

... othervise the next drag event will insert the new range immediately
after the just inserted, resulting in invalid reference.

Regression after commit 42aece949ec96c775b31216bddd723aa5321e966

  don't replace content of formula field when selecting range, tdf#58635

Change-Id: I7dfdc1ce041ebadf4406dbb605676d87cd489efa
Reviewed-on: https://gerrit.libreoffice.org/64574
Reviewed-by: Mike Kaganski 
Tested-by: Mike Kaganski 
(cherry picked from commit 6c5839d399c6277a7f2f0e214a20996761563525)
Reviewed-on: https://gerrit.libreoffice.org/65027
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 7776ea958f86..1df88cf003cc 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -655,7 +655,13 @@ void ScCondFormatDlg::SetReference(const ScRange& rRef, 
ScDocument*)
 OUString aRefStr(rRef.Format(nFlags, mpViewData->GetDocument(),
 
ScAddress::Details(mpViewData->GetDocument()->GetAddressConvention(), 0, 0)));
 if (pEdit != mpEdRange)
+{
+Selection sel = pEdit->GetSelection();
+sel.Justify();// in case of RtL selection
+sel.Max() = sel.Min() + aRefStr.getLength();
 pEdit->ReplaceSelected(aRefStr);
+pEdit->SetSelection(sel); // to replace it again with next drag 
event
+}
 else
 pEdit->SetRefString( aRefStr );
 updateTitle();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-12-11 Thread Libreoffice Gerrit user
 sc/source/core/data/dpgroup.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit 1c34812c11248649321b7106dfdc22f1d75091a9
Author: Katarina Behrens 
AuthorDate: Mon Dec 10 22:22:17 2018 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Dec 11 15:24:40 2018 +0100

crashtesting: ooo55266-3.ods some members are nullptr

Crashes since commit 6481bda69ade61cb5420156272fcf17edd43d620

tdf#121612: update pivot caches during saving to XLSX

without refresh, pivot cache export was skipped entirely

Change-Id: Ic68d4974d5cb9278d61938a59aa8f1a01b920f1f
Reviewed-on: https://gerrit.libreoffice.org/64903
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 837a65cdc0bef4ef6c48f7b867c7948c70352f05)
Reviewed-on: https://gerrit.libreoffice.org/64946
Tested-by: Thorsten Behrens 

diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index dd81548777a3..8a9ec6714561 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -1030,7 +1030,11 @@ long ScDPGroupTableData::Compare(long nDim, long 
nDataId1, long nDataId2)
 {
 if ( getIsDataLayoutDimension(nDim) )
 return 0;
-return ScDPItemData::Compare( *GetMemberById(nDim,  
nDataId1),*GetMemberById(nDim,  nDataId2) );
+const ScDPItemData* rItem1 = GetMemberById(nDim, nDataId1);
+const ScDPItemData* rItem2 = GetMemberById(nDim, nDataId2);
+if (rItem1 == nullptr || rItem2 == nullptr)
+return 0;
+return ScDPItemData::Compare( *rItem1,*rItem2);
 }
 
 #if DUMP_PIVOT_TABLE
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-12-09 Thread Libreoffice Gerrit user
 sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx   |2 +-
 sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx |4 ++--
 sc/source/ui/inc/TableFillingAndNavigationTools.hxx   |2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 89d65f96128edf3055aaa5cebdaf78d893d01187
Author: Eike Rathke 
AuthorDate: Sat Dec 8 18:19:12 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sun Dec 9 22:13:25 2018 +0100

Resolves: tdf#80583 create range list string with proper delimiter

... which is the to be used function parameter separator here. The
current document's grammar (from which the separator is obtained
in ScRangeList::Format() if not specified) may differ from the
forced English grammar later when compiling the formula, and all
formula expressions to be inserted use the language independent
';' semicolon function parameter separator.

Change-Id: I7a3deb6d50fc57ed434ede1f00bbe8c5c1361e0f
Reviewed-on: https://gerrit.libreoffice.org/64819
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 470a91cb041782e29664212d096bb16873ba57a0)
Reviewed-on: https://gerrit.libreoffice.org/64824
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx 
b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index 66672b095831..c31fc9fb4c09 100644
--- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -334,7 +334,7 @@ void 
ScAnalysisOfVarianceDialog::AnovaSingleFactor(AddressWalkerWriter& output,
 
 // Sum of Squares
 aTemplate.setTemplate("=DEVSQ(%RANGE_LIST%)");
-aTemplate.applyRangeList("%RANGE_LIST%", aRangeList);
+aTemplate.applyRangeList("%RANGE_LIST%", aRangeList, ';');
 output.writeFormula(aTemplate.getTemplate());
 output.nextColumn();
 
diff --git a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx 
b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
index 5200e541a8f5..b774f0525789 100644
--- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
+++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
@@ -66,10 +66,10 @@ void FormulaTemplate::applyRange(const OUString& aVariable, 
const ScRange& aRang
 mTemplate = mTemplate.replaceAll(aVariable, aString);
 }
 
-void FormulaTemplate::applyRangeList(const OUString& aVariable, const 
ScRangeList& aRangeList)
+void FormulaTemplate::applyRangeList(const OUString& aVariable, const 
ScRangeList& aRangeList, sal_Unicode cDelimiter)
 {
 OUString aString;
-aRangeList.Format(aString, ScRefFlags::RANGE_ABS_3D, mpDoc, 
mpDoc->GetAddressConvention());
+aRangeList.Format(aString, ScRefFlags::RANGE_ABS_3D, mpDoc, 
mpDoc->GetAddressConvention(), cDelimiter);
 mTemplate = mTemplate.replaceAll(aVariable, aString);
 }
 
diff --git a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx 
b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
index 9c00bf31e351..578d39665168 100644
--- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
+++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
@@ -46,7 +46,7 @@ public:
 void  autoReplaceUses3D(bool bUse3D) { mbUse3D = bUse3D; }
 
 void  applyRange(const OUString& aVariable, const ScRange& aRange, 
bool b3D = true);
-void  applyRangeList(const OUString& aVariable, const ScRangeList& 
aRangeList);
+void  applyRangeList(const OUString& aVariable, const ScRangeList& 
aRangeList, sal_Unicode cDelimiter );
 void  applyAddress(const OUString& aVariable, const ScAddress& 
aAddress, bool b3D = true);
 void  applyString(const OUString& aVariable, const OUString& aValue);
 void  applyNumber(const OUString& aVariable, sal_Int32 aValue);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-12-05 Thread Libreoffice Gerrit user
 sc/source/filter/oox/sheetdatacontext.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 41f19175c2e4c344c582c8b57a803f5ec4e5aaad
Author: Eike Rathke 
AuthorDate: Wed Dec 5 00:21:17 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Wed Dec 5 23:01:47 2018 +0100

Resolves: tdf#121887 RowModel::mnRow is 1-based, always

Basically this was always wrong.

Original code didn't treat the r attribute as optional and
resulted in an invalid -1 row for such cases, hence the RowModel
wasn't applied later.

Then

commit af8e6f4f544ecd01d3eda5f38bbd4779d5e8b2c6
CommitDate: Wed May 29 22:05:02 2013 +0200

r is an optional attribute in c and r, fdo#65059

introduced a 0-based SheetDataContext::mnRow but assigned that to
a 1-based RowModel::mnRow as well if r attribute was missing, and
did not update SheetDataContext::mnRow if r attribute was given.

commit ff56553e34dfed01b9226ce7a516dbeb6da32124
CommitDate: Thu Mar 13 18:39:22 2014 -0400

fdo#76032: This row index is 1-based whereas our own mnRow is 0-based.

then correctly assigned the decremented r attribute to
SheetDataContext::mnRow but did not touch the assignment to
RowModel::mnRow if r was not given. Probably confused by the
++mnRow already there which is correct but not sufficient for the
assignment.

Which we now finally fix herewith..

Change-Id: Iae1563ed01b95e7852ddad4fd59374c07186b493
Reviewed-on: https://gerrit.libreoffice.org/64580
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 76fbe494785faee1313d1c0be8ed2ca7b0d74f68)
Reviewed-on: https://gerrit.libreoffice.org/64639
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/oox/sheetdatacontext.cxx 
b/sc/source/filter/oox/sheetdatacontext.cxx
index 5f17d8c419b6..9732ce668d5c 100644
--- a/sc/source/filter/oox/sheetdatacontext.cxx
+++ b/sc/source/filter/oox/sheetdatacontext.cxx
@@ -272,7 +272,7 @@ void SheetDataContext::importRow( const AttributeList& 
rAttribs )
 mnRow = nRow-1; // to 0-based row index.
 }
 else
-aModel.mnRow = ++mnRow;
+aModel.mnRow = (++mnRow + 1);   // increment 0-based row index, to 
1-based model row
 mrAddressConv.checkRow( mnRow, true);
 mnCol = -1;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 811d39b4ed3487ac6eb81d04de70f9845fec32db
Author: Markus Mohrhard 
AuthorDate: Thu Nov 29 00:04:58 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Nov 29 14:03:10 2018 +0100

tdf#105236, only take number format from numeric cells

Change-Id: I55deaa1f0579582a45dc1e10bb578b680eb98647
Reviewed-on: https://gerrit.libreoffice.org/64200
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit fb04e7180cdf656dbbd3daa9c81615d9478229e0)
Reviewed-on: https://gerrit.libreoffice.org/64204
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 34ab089b86f0..89ebe89061ee 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -3161,7 +3161,7 @@ sal_uInt32 getDisplayNumberFormat(const ScDocument* pDoc, 
const ScAddress& rPos)
 for (const Item& rItem : m_aDataArray)
 {
 ScRefCellValue aCell(*m_pDocument, rItem.mAddress);
-if (!aCell.isEmpty())
+if (!aCell.isEmpty() && aCell.hasNumeric())
 {
 return 
static_cast(getDisplayNumberFormat(m_pDocument, rItem.mAddress));
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 8d370bbe3c15706872f8c0258ed1e21741d0228d
Author: Markus Mohrhard 
AuthorDate: Mon Nov 26 00:51:20 2018 +0100
Commit: Xisco Faulí 
CommitDate: Mon Nov 26 14:24:29 2018 +0100

tdf#108027, add external ref string items to the data array

Change-Id: Iaf607fca6d7e88f2c529ab4a374f34164813331a
Reviewed-on: https://gerrit.libreoffice.org/64009
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 72e204da9a062282e52d5060e7f633e3b21414ff)
Reviewed-on: https://gerrit.libreoffice.org/64012
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index fd1976a75b44..34ab089b86f0 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2653,7 +2653,7 @@ sal_Int32 
ScChart2DataSequence::FillCacheFromExternalRef(const ScTokenRef& pToke
 aItem.mbIsValue = false;
 aItem.maString = pMat->GetString(nC, nR).getString();
 
-m_aDataArray.emplace_back();
+m_aDataArray.emplace_back(aItem);
 ++nDataCount;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-26 Thread Libreoffice Gerrit user
 sc/source/core/data/drwlayer.cxx |  104 ---
 1 file changed, 76 insertions(+), 28 deletions(-)

New commits:
commit 24551cb78d4ae11101860ef98e9040a9105251df
Author: Armin Le Grand 
AuthorDate: Thu Nov 22 13:18:30 2018 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Nov 26 11:51:21 2018 +0100

tdf#116931 Fix scale when calc cells move indirectly

For the anchor mode 'To Cell (resize with cell)' there
were errors e.g. when the cell the object is in does
not scale but move. If that move went further than the
object is, wrong offsets emerged.
Also added full linear per-cell scale instead of only
scale (no translation through scale). Overhauled to
use liner transfomations, too.

Change-Id: Icff0fad168476c68ea10fd5830bf53bd7294b89f
Reviewed-on: https://gerrit.libreoffice.org/63803
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 
(cherry picked from commit 10a58ec15438d34a594437815882862c4576e2c0)
Reviewed-on: https://gerrit.libreoffice.org/63852
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index 5fd0945e6713..4f7f1978919f 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -651,11 +651,15 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const 
SdrObject* pObj, ScDrawObjData&
 aPos.setX(TwipsToHmm(aPos.X()));
 aPos.setY(TwipsToHmm(aPos.Y()));
 aPos += lcl_calcAvailableDiff(*pDoc, nCol1, nRow1, nTab1, 
rData.maStartOffset);
+
+// this sets the needed changed position (translation)
 aRect.SetPos(aPos);
 
 if (bCanResize)
 {
-tools::Rectangle aLastCellRect = rData.getLastCellRect();
+// all this stuff is additional stuff to evtl. not only translate the
+// range (Rectangle), but also check for and evtl. do corrections for 
it's size
+const tools::Rectangle aLastCellRect(rData.getLastCellRect());
 
 // If the row was hidden before, or we don't have a valid cell rect, 
calculate the
 // new rect based on the end point.
@@ -675,61 +679,105 @@ void ScDrawLayer::ResizeLastRectFromAnchor(const 
SdrObject* pObj, ScDrawObjData&
 // We calculate based on the last cell rect to be able to scale 
the image
 // as much as the cell was scaled.
 // Still, we keep the image in its current cell (to keep start 
anchor == end anchor)
-tools::Rectangle aCurrentCellRect = GetCellRect(*GetDocument(), 
rData.maStart, true);
-double fWidthFactor = 
static_cast(aCurrentCellRect.GetWidth())
-  / 
static_cast(aLastCellRect.GetWidth());
-double fHeightFactor = 
static_cast(aCurrentCellRect.GetHeight())
-   / 
static_cast(aLastCellRect.GetHeight());
+const tools::Rectangle 
aCurrentCellRect(GetCellRect(*GetDocument(), rData.maStart, true));
+long nCurrentWidth(aCurrentCellRect.GetWidth());
+long nCurrentHeight(aCurrentCellRect.GetHeight());
+const long nLastWidth(aLastCellRect.GetWidth());
+const long nLastHeight(aLastCellRect.GetHeight());
+
+// tdf#116931 Avoid and correct nifty numerical problems with the 
integer
+// based and converted values (GetCellRect uses multiplies with 
HMM_PER_TWIPS)
+if(nCurrentWidth + 1 == nLastWidth || nCurrentWidth == nLastWidth 
+ 1)
+{
+nCurrentWidth = nLastWidth;
+}
 
-bool bIsGrowingLarger = aLastCellRect.GetWidth() * 
aLastCellRect.GetHeight()
-< aCurrentCellRect.GetWidth() * 
aCurrentCellRect.GetHeight();
+if(nCurrentHeight + 1 == nLastHeight || nCurrentHeight == 
nLastHeight + 1)
+{
+nCurrentHeight = nLastHeight;
+}
 
-if (pObj->shouldKeepAspectRatio())
+// get intial ScalingFactors
+double fWidthFactor(nCurrentWidth == nLastWidth || 0 == nLastWidth
+? 1.0
+: static_cast(nCurrentWidth) / 
static_cast(nLastWidth));
+double fHeightFactor(nCurrentHeight == nLastHeight || 0 == 
nLastHeight
+? 1.0
+: static_cast(nCurrentHeight) / 
static_cast(nLastHeight));
+
+// check if we grow or shrink - and at all
+const bool bIsGrowing(nCurrentWidth > nLastWidth || nCurrentHeight 
> nLastHeight);
+const bool bIsShrinking(nCurrentWidth < nLastWidth || 
nCurrentHeight < nLastHeight);
+const bool bIsSizeChanged(bIsGrowing || bIsShrinking);
+
+// handle AspectRatio, only needed if size does change
+if(bIsSizeChanged && pObj->shouldKeepAspectRatio())
 {
 tools::Rectangle aRectIncludingOffset = aRect;
 aRectIncludingOffset.setWidth(aRect.GetWidth() + 

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

2018-11-22 Thread Libreoffice Gerrit user
 sc/source/core/tool/interpr4.cxx |   11 ++-
 1 file changed, 10 insertions(+), 1 deletion(-)

New commits:
commit 8bc69c4a45d1fc4fe73dd579bc5dc828aaa9b1e7
Author: Eike Rathke 
AuthorDate: Thu Nov 22 00:52:40 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Nov 22 22:00:45 2018 +0100

Resolves: tdf#113898 create JumpMatrix for svExternalDoubleRef scalar values

Change-Id: I45d2a1e573a7e4923aaaf5b69f3c4b39215aacc2
Reviewed-on: https://gerrit.libreoffice.org/63778
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 266aab73a88ae5b62fcddaf383107d8e7edc51f2)
Reviewed-on: https://gerrit.libreoffice.org/63797
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index ecb3bdb95e07..32238916e162 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1524,7 +1524,7 @@ bool ScInterpreter::ConvertMatrixParameters()
 case svExternalDoubleRef:
 {
 formula::ParamClass eType = 
ScParameterClassification::GetParameterType( pCur, nParams - i);
-if (eType == formula::ParamClass::Array)
+if (eType == formula::ParamClass::Value || eType == 
formula::ParamClass::Array)
 {
 sal_uInt16 nFileId = p->GetIndex();
 OUString aTabName = p->GetString().getString();
@@ -1540,6 +1540,15 @@ bool ScInterpreter::ConvertMatrixParameters()
 ScMatrixRef pMat = pTemp->GetMatrix();
 if (pMat)
 {
+if (eType == formula::ParamClass::Value)
+{   // only if single value expected
+SCSIZE nC, nR;
+pMat->GetDimensions( nC, nR);
+if (nJumpCols < nC)
+nJumpCols = nC;
+if (nJumpRows < nR)
+nJumpRows = nR;
+}
 formula::FormulaToken* pNew = new ScMatrixToken( 
pMat);
 pNew->IncRef();
 pStack[ sp - i ] = pNew;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-17 Thread Libreoffice Gerrit user
 sc/source/filter/xml/XMLExportIterator.hxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit f2c6156a90093d38e1ab304d11ffed90555d5fa1
Author: Eike Rathke 
AuthorDate: Wed Nov 14 15:57:36 2018 +0100
Commit: Caolán McNamara 
CommitDate: Sat Nov 17 17:50:07 2018 +0100

Resolves: tdf#119700 save correct table:last-row-spanned

Regression from

commit f6e6a6139e90d6e88fb65308e8592193ac602a8a
CommitDate: Mon Nov 21 07:49:06 2016 +

tdf#48140 Replace uno CellRangeAddress and CellAddress with direct 
calls

that calculated endrow-startcol instead of endrow-startrow.

Change-Id: Ie576f9abdcdc23fc5f0a06735caadc24e975360f
Reviewed-on: https://gerrit.libreoffice.org/63374
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 6e566c2b2b23d457a9fd47c16df15ce11e84c8e8)
Reviewed-on: https://gerrit.libreoffice.org/63382
Reviewed-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/xml/XMLExportIterator.hxx 
b/sc/source/filter/xml/XMLExportIterator.hxx
index 11d88f004f01..a5dbaa0bc697 100644
--- a/sc/source/filter/xml/XMLExportIterator.hxx
+++ b/sc/source/filter/xml/XMLExportIterator.hxx
@@ -157,7 +157,7 @@ struct ScMyAreaLink
 ScMyAreaLink() : nRefresh( 0 ) {}
 
 sal_Int32GetColCount() const { return aDestRange.aEnd.Col() - 
aDestRange.aStart.Col() + 1; }
-sal_Int32GetRowCount() const { return aDestRange.aEnd.Row() - 
aDestRange.aStart.Col() + 1; }
+sal_Int32GetRowCount() const { return aDestRange.aEnd.Row() - 
aDestRange.aStart.Row() + 1; }
 
 boolCompare( const ScMyAreaLink& rAreaLink ) const;
 booloperator<(const ScMyAreaLink& rAreaLink ) 
const;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-17 Thread Libreoffice Gerrit user
 sc/source/core/data/formulacell.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 725fb6c3061ddca4f7c2cb5b334708e62512cca3
Author: Luboš Luňák 
AuthorDate: Fri Oct 12 14:12:13 2018 +0200
Commit: Caolán McNamara 
CommitDate: Sat Nov 17 17:45:28 2018 +0100

don't access deleted cells

This copy code that got fixed in 2926c9e40e17, so fix it as well.

Change-Id: I0a038b57a428640dae8cdf17f33a2eab50b0187c
Reviewed-on: https://gerrit.libreoffice.org/63177
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit f9026deba0581759146205237eb739f37463ba47)
Reviewed-on: https://gerrit.libreoffice.org/63378
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index b7465341b15e..b43e908352ed 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -4259,6 +4259,8 @@ struct ScDependantsCalculator
 case svSingleRef:
 {
 ScSingleRefData aRef = *p->GetSingleRef(); // =Sheet1!A1
+if( aRef.IsDeleted())
+return false;
 ScAddress aRefPos = aRef.toAbs(mrPos);
 
 if (!mrDoc.TableExists(aRefPos.Tab()))
@@ -4297,6 +4299,8 @@ struct ScDependantsCalculator
 case svDoubleRef:
 {
 ScComplexRefData aRef = *p->GetDoubleRef();
+if( aRef.IsDeleted())
+return false;
 ScRange aAbs = aRef.toAbs(mrPos);
 
 // Multiple sheet
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-11-08 Thread Libreoffice Gerrit user
 sc/source/filter/oox/chartsheetfragment.cxx |   10 +-
 1 file changed, 9 insertions(+), 1 deletion(-)

New commits:
commit b6052b6f78a4486f129dbaef9db3106c4f289cae
Author: Markus Mohrhard 
AuthorDate: Tue Nov 6 21:42:43 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Nov 8 14:21:06 2018 +0100

tdf#107586, import chart sheet color

Change-Id: Ie7d728cd36c93d5f398266ee65be0e1bf14a0c97
Reviewed-on: https://gerrit.libreoffice.org/62974
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 06e90234e402717e3ef04cf712d34c9165dbc08e)
Reviewed-on: https://gerrit.libreoffice.org/62980
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/oox/chartsheetfragment.cxx 
b/sc/source/filter/oox/chartsheetfragment.cxx
index 70541ed4e620..00a90bb8eab0 100644
--- a/sc/source/filter/oox/chartsheetfragment.cxx
+++ b/sc/source/filter/oox/chartsheetfragment.cxx
@@ -50,7 +50,7 @@ ContextHandlerRef ChartsheetFragment::onCreateContext( 
sal_Int32 nElement, const
 {
 case XLS_TOKEN( sheetViews ):   return this;
 
-case XLS_TOKEN( sheetPr ):  
getWorksheetSettings().importChartSheetPr( rAttribs );  break;
+case XLS_TOKEN( sheetPr ):  
getWorksheetSettings().importChartSheetPr( rAttribs );  return this;
 case XLS_TOKEN( sheetProtection ):  
getWorksheetSettings().importChartProtection( rAttribs );   break;
 case XLS_TOKEN( pageMargins ):  
getPageSettings().importPageMargins( rAttribs );break;
 case XLS_TOKEN( pageSetup ):
getPageSettings().importChartPageSetup( getRelations(), rAttribs ); break;
@@ -75,6 +75,14 @@ ContextHandlerRef ChartsheetFragment::onCreateContext( 
sal_Int32 nElement, const
 case XLS_TOKEN( evenFooter ):   return this;// collect 
contents in onCharacters()
 }
 break;
+
+case XLS_TOKEN( sheetPr ):
+switch( nElement )
+{
+case XLS_TOKEN( tabColor ): 
getWorksheetSettings().importTabColor( rAttribs );  break;
+}
+break;
+
 }
 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-6-1' - sc/source

2018-10-29 Thread Libreoffice Gerrit user
 sc/source/ui/app/transobj.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit 968fac07d5e70c198459581f51e88179d3940d8a
Author: Vasily Melenchuk 
AuthorDate: Wed Oct 24 13:13:41 2018 +0200
Commit: Thorsten Behrens 
CommitDate: Tue Oct 30 04:56:50 2018 +0100

tdf#118747 sc: use manual height for previous rows in TransferObj

This can ensure, that visible area will not shift if autoheight
will change height of previous rows.

Change-Id: I66e013e9f3f27396f13b26fde37353cb63e47258
Reviewed-on: https://gerrit.libreoffice.org/62279
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit 1b9574ed8269f4ed9dde33856c1d74702a7fa4bb)
Reviewed-on: https://gerrit.libreoffice.org/62518
Tested-by: Xisco Faulí 

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index c3725e7202a0..fa76c05d133b 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -693,6 +693,12 @@ void ScTransferObj::InitDocShell(bool bLimitToPageSize)
 else
 rDestDoc.SetColWidth( nCol, 0, m_pDoc->GetColWidth( nCol, 
nSrcTab ) );
 
+if (nStartY > 0)
+{
+// Set manual height for all previous rows so we can ensure
+// that visible area will not change due to autoheight
+rDestDoc.SetManualHeight(0, nStartY - 1, 0, true);
+}
 for (SCROW nRow = nStartY; nRow <= nEndY; ++nRow)
 {
 if ( m_pDoc->RowHidden(nRow, nSrcTab) )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-26 Thread Libreoffice Gerrit user
 sc/source/filter/excel/xestyle.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit a5f229206260fbf8f47827786645c7a1bd048aa2
Author: Caolán McNamara 
AuthorDate: Fri Oct 19 10:10:27 2018 +0100
Commit: Michael Stahl 
CommitDate: Fri Oct 26 22:02:55 2018 +0200

index validity check looks dubious

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

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index b9986f338e48..bdf1e853a51d 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -2600,7 +2600,7 @@ sal_uInt16 XclExpXFBuffer::GetXFIndex( sal_uInt32 nXFId ) 
const
 sal_Int32 XclExpXFBuffer::GetXmlStyleIndex( sal_uInt32 nXFIndex ) const
 {
 OSL_ENSURE( nXFIndex < maStyleIndexes.size(), 
"XclExpXFBuffer::GetXmlStyleIndex - invalid index!" );
-if( nXFIndex > maStyleIndexes.size() )
+if( nXFIndex >= maStyleIndexes.size() )
 return 0;   // should be caught/debugged via above assert; return 
"valid" index.
 return maStyleIndexes[ nXFIndex ];
 }
@@ -2608,7 +2608,7 @@ sal_Int32 XclExpXFBuffer::GetXmlStyleIndex( sal_uInt32 
nXFIndex ) const
 sal_Int32 XclExpXFBuffer::GetXmlCellIndex( sal_uInt32 nXFIndex ) const
 {
 OSL_ENSURE( nXFIndex < maCellIndexes.size(), 
"XclExpXFBuffer::GetXmlStyleIndex - invalid index!" );
-if( nXFIndex > maCellIndexes.size() )
+if( nXFIndex >= maCellIndexes.size() )
 return 0;   // should be caught/debugged via above assert; return 
"valid" index.
 return maCellIndexes[ nXFIndex ];
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-26 Thread Libreoffice Gerrit user
 sc/source/ui/cctrl/checklistmenu.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 6ce730c54dd5cfebd25d0e2ae3ac07fad4586e57
Author: Caolán McNamara 
AuthorDate: Fri Oct 19 10:08:56 2018 +0100
Commit: Michael Stahl 
CommitDate: Fri Oct 26 22:02:16 2018 +0200

index validity check looks dubious

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

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index fb727e812a8c..86746a8dd1c4 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -822,7 +822,7 @@ void 
ScMenuFloatingWindow::ensureSubMenuVisible(ScMenuFloatingWindow* pSubMenu)
 
 void ScMenuFloatingWindow::ensureSubMenuNotVisible()
 {
-if (mnSelectedMenu <= maMenuItems.size() &&
+if (mnSelectedMenu < maMenuItems.size() &&
 maMenuItems[mnSelectedMenu].mpSubMenuWin &&
 maMenuItems[mnSelectedMenu].mpSubMenuWin->IsVisible())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-24 Thread Libreoffice Gerrit user
 sc/source/filter/excel/xeformula.cxx |6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

New commits:
commit d6f563b37d8a694c6c1d4c9ef3ba746c7f019517
Author: Eike Rathke 
AuthorDate: Mon Oct 22 22:07:54 2018 +0200
Commit: Eike Rathke 
CommitDate: Wed Oct 24 10:33:41 2018 +0200

Resolves: tdf#120689 omit  for ocMacro in OOXML

Change-Id: I7578d568d2afe5d3a45b31a8a349cd370b03fc67
Reviewed-on: https://gerrit.libreoffice.org/62204
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 4df55ffee791b9fcb4b2f5e6c64ad15b34316faf)
Reviewed-on: https://gerrit.libreoffice.org/62235
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/excel/xeformula.cxx 
b/sc/source/filter/excel/xeformula.cxx
index 3cd1bd9a06bf..e8cb691b5bdb 100644
--- a/sc/source/filter/excel/xeformula.cxx
+++ b/sc/source/filter/excel/xeformula.cxx
@@ -1632,7 +1632,11 @@ void XclExpFmlaCompImpl::AppendDefaultParam( 
XclExpFuncData& rFuncData )
 AppendEuroToolCallToken( rFuncData.GetExtFuncData() );
 break;
 case ocMacro:
-AppendMacroCallToken( rFuncData.GetExtFuncData() );
+// Do not write the OOXML  element.
+if (GetOutput() == EXC_OUTPUT_XML_2007)
+AppendNameToken( 0 ); // dummy to keep parameter count 
valid
+else
+AppendMacroCallToken( rFuncData.GetExtFuncData() );
 break;
 default:
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-22 Thread Libreoffice Gerrit user
 sc/source/ui/view/cellsh.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit fad764c02c7a9cd210bfa44ea0ce1ac5354d6427
Author: Xisco Fauli 
AuthorDate: Thu Oct 18 20:21:27 2018 +0200
Commit: Caolán McNamara 
CommitDate: Mon Oct 22 21:56:49 2018 +0200

tdf#120410: Disable insert/delete row/page break if sheet is protected

Follow-up on f7982d4dfa85f15a6f0c25e9795a5847ecfcbf31

Change-Id: I2defd3474fdbb0b87898df7734bb076ab95c8c08
Reviewed-on: https://gerrit.libreoffice.org/61950
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 812f63ba45ae6cd10ff2e9ed14ca01baeb4fe528)
Reviewed-on: https://gerrit.libreoffice.org/62177
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index cda4214c4d36..854794adfb9d 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -872,22 +872,22 @@ void ScCellShell::GetState(SfxItemSet )
 break;
 
 case FID_INS_ROWBRK:
-if ( nPosY==0 || (pDoc->HasRowBreak(nPosY, nTab) & 
ScBreakType::Manual) )
+if ( nPosY==0 || (pDoc->HasRowBreak(nPosY, nTab) & 
ScBreakType::Manual) || pDoc->IsTabProtected(nTab) )
 rSet.DisableItem( nWhich );
 break;
 
 case FID_INS_COLBRK:
-if ( nPosX==0 || (pDoc->HasColBreak(nPosX, nTab) & 
ScBreakType::Manual) )
+if ( nPosX==0 || (pDoc->HasColBreak(nPosX, nTab) & 
ScBreakType::Manual) || pDoc->IsTabProtected(nTab) )
 rSet.DisableItem( nWhich );
 break;
 
 case FID_DEL_ROWBRK:
-if ( nPosY==0 || !(pDoc->HasRowBreak(nPosY, nTab) & 
ScBreakType::Manual) )
+if ( nPosY==0 || !(pDoc->HasRowBreak(nPosY, nTab) & 
ScBreakType::Manual) || pDoc->IsTabProtected(nTab) )
 rSet.DisableItem( nWhich );
 break;
 
 case FID_DEL_COLBRK:
-if ( nPosX==0 || !(pDoc->HasColBreak(nPosX, nTab) & 
ScBreakType::Manual) )
+if ( nPosX==0 || !(pDoc->HasColBreak(nPosX, nTab) & 
ScBreakType::Manual) || pDoc->IsTabProtected(nTab) )
 rSet.DisableItem( nWhich );
 break;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-20 Thread Libreoffice Gerrit user
 sc/source/ui/view/gridwin.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 392ec204197c723b4dff4f7091df5afb46b5b9db
Author: Caolán McNamara 
AuthorDate: Fri Oct 19 09:56:30 2018 +0100
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Oct 20 10:49:49 2018 +0200

copy and paste error

Change-Id: If352e7a0f6e8dab2a9acc9aa2cde56b40cedb50c
Reviewed-on: https://gerrit.libreoffice.org/61993
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 eb812f7fb215..b2bd86673130 100644
--- a/sc/source/ui/view/gridwin.cxx
+++ b/sc/source/ui/view/gridwin.cxx
@@ -5605,7 +5605,7 @@ OString ScGridWindow::getCellCursor(const Fraction& 
rZoomX, const Fraction& rZoo
 SCROW nY = pViewData->GetCurY();
 
 Fraction defaultZoomX = pViewData->GetZoomX();
-Fraction defaultZoomY = pViewData->GetZoomX();
+Fraction defaultZoomY = pViewData->GetZoomY();
 
 pViewData->SetZoom(rZoomX, rZoomY, true);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-19 Thread Libreoffice Gerrit user
 sc/source/core/data/column4.cxx |   16 ++--
 1 file changed, 10 insertions(+), 6 deletions(-)

New commits:
commit c78c42f63f91f28dfae7340d379fa1b8136633c0
Author: Eike Rathke 
AuthorDate: Mon Oct 15 23:10:07 2018 +0200
Commit: Caolán McNamara 
CommitDate: Fri Oct 19 16:32:15 2018 +0200

Resolves: tdf#119623 record group positions also for top cells

So listeners can be re-established for remaining grouped cells if
top cell is deleted (which ends listening and probably was the
cause to exclude them here).

Change-Id: Ic91b74c65013452d56b5cfbc132722c4314743c8
Reviewed-on: https://gerrit.libreoffice.org/61808
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit fbec372ba829b3f32b3c0874920b2ee36220ef9d)
Reviewed-on: https://gerrit.libreoffice.org/61818
Tested-by: Xisco Faulí 
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/column4.cxx b/sc/source/core/data/column4.cxx
index 832351d275a7..d08321073668 100644
--- a/sc/source/core/data/column4.cxx
+++ b/sc/source/core/data/column4.cxx
@@ -1539,10 +1539,12 @@ void ScColumn::EndListeningIntersectedGroups(
 {
 ScFormulaCell* pFC = sc::formula_block::at(*it->data, aPos.second);
 ScFormulaCellGroupRef xGroup = pFC->GetCellGroup();
-if (xGroup && !pFC->IsSharedTop())
+if (xGroup)
 {
-// End listening.
-pFC->EndListeningTo(rCxt);
+if (!pFC->IsSharedTop())
+// End listening.
+pFC->EndListeningTo(rCxt);
+
 if (pGroupPos)
 // Record the position of the top cell of the group.
 pGroupPos->push_back(xGroup->mpTopCell->aPos);
@@ -1555,10 +1557,12 @@ void ScColumn::EndListeningIntersectedGroups(
 {
 ScFormulaCell* pFC = sc::formula_block::at(*it->data, aPos.second);
 ScFormulaCellGroupRef xGroup = pFC->GetCellGroup();
-if (xGroup && !pFC->IsSharedTop())
+if (xGroup)
 {
-// End listening.
-pFC->EndListeningTo(rCxt);
+if (!pFC->IsSharedTop())
+// End listening.
+pFC->EndListeningTo(rCxt);
+
 if (pGroupPos)
 {
 // Record the position of the bottom cell of the group.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-17 Thread Libreoffice Gerrit user
 sc/source/ui/app/transobj.cxx |   66 +-
 1 file changed, 47 insertions(+), 19 deletions(-)

New commits:
commit 7139b259394f0b2075794bc6c42dd9c64005096b
Author: Tor Lillqvist 
AuthorDate: Thu Jun 28 10:47:20 2018 +0300
Commit: Eike Rathke 
CommitDate: Wed Oct 17 21:45:39 2018 +0200

tdf#69460, tdf#118416: Don't copy whole columns to the clipboard

...for the BITMAP or PNG formats either.

Change-Id: Ib1739ceb917fe24dac412007fd6522e40f5517c4
Reviewed-on: https://gerrit.libreoffice.org/56577
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
Reviewed-on: https://gerrit.libreoffice.org/61845

diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx
index febb0793c980..c3725e7202a0 100644
--- a/sc/source/ui/app/transobj.cxx
+++ b/sc/source/ui/app/transobj.cxx
@@ -249,6 +249,49 @@ bool ScTransferObj::GetData( const 
datatransfer::DataFlavor& rFlavor, const OUSt
 
 if( HasFormat( nFormat ) )
 {
+ScRange aReducedBlock = m_aBlock;
+
+bool bReduceBlockFormat =
+nFormat == SotClipboardFormatId::HTML
+|| nFormat == SotClipboardFormatId::RTF
+|| nFormat == SotClipboardFormatId::RICHTEXT
+|| nFormat == SotClipboardFormatId::BITMAP
+|| nFormat == SotClipboardFormatId::PNG;
+
+if (bReduceBlockFormat && (m_aBlock.aEnd.Col() == MAXCOL || 
m_aBlock.aEnd.Row() == MAXROW) &&
+m_aBlock.aStart.Tab() == m_aBlock.aEnd.Tab())
+{
+// Shrink the block here so we don't waste time creating huge
+// output when whole columns or rows are selected.
+
+SCCOL nPrintAreaEndCol = 0;
+SCROW nPrintAreaEndRow = 0;
+const bool bIncludeVisual = (nFormat == 
SotClipboardFormatId::BITMAP ||
+nFormat == SotClipboardFormatId::PNG);
+if (bIncludeVisual)
+m_pDoc->GetPrintArea( m_aBlock.aStart.Tab(), nPrintAreaEndCol, 
nPrintAreaEndRow, true );
+
+// Shrink the area to allow pasting to external applications.
+// Shrink to real data area for HTML, RTF and RICHTEXT, but include
+// all objects and top-left area for BITMAP and PNG.
+SCCOL nStartCol = aReducedBlock.aStart.Col();
+SCROW nStartRow = aReducedBlock.aStart.Row();
+SCCOL nEndCol = aReducedBlock.aEnd.Col();
+SCROW nEndRow = aReducedBlock.aEnd.Row();
+bool bShrunk = false;
+m_pDoc->ShrinkToUsedDataArea( bShrunk, aReducedBlock.aStart.Tab(), 
nStartCol, nStartRow, nEndCol, nEndRow,
+false, bIncludeVisual /*bStickyTopRow*/, bIncludeVisual 
/*bStickyLeftCol*/,
+bIncludeVisual /*bConsiderCellNotes*/, bIncludeVisual 
/*bConsiderCellDrawObjects*/);
+
+if ( nPrintAreaEndRow > nEndRow )
+nEndRow = nPrintAreaEndRow;
+
+if ( nPrintAreaEndCol > nEndCol )
+nEndCol = nPrintAreaEndCol;
+
+aReducedBlock = ScRange(nStartCol, nStartRow, 
aReducedBlock.aStart.Tab(), nEndCol, nEndRow, aReducedBlock.aEnd.Tab());
+}
+
 if ( nFormat == SotClipboardFormatId::LINKSRCDESCRIPTOR || nFormat == 
SotClipboardFormatId::OBJECTDESCRIPTOR )
 {
 bOK = SetTransferableObjectDescriptor( m_aObjDesc );
@@ -298,21 +341,6 @@ bool ScTransferObj::GetData( const 
datatransfer::DataFlavor& rFlavor, const OUSt
 
 bool bIncludeFiltered = m_pDoc->IsCutMode() || m_bUsedForLink;
 
-bool bReduceBlockFormat = nFormat == SotClipboardFormatId::HTML || 
nFormat == SotClipboardFormatId::RTF
-|| nFormat == SotClipboardFormatId::RICHTEXT;
-ScRange aReducedBlock = m_aBlock;
-if (bReduceBlockFormat && (m_aBlock.aEnd.Col() == MAXCOL || 
m_aBlock.aEnd.Row() == MAXROW) && m_aBlock.aStart.Tab() == m_aBlock.aEnd.Tab())
-{
-bool bShrunk = false;
-//shrink the area to allow pasting to external applications
-SCCOL aStartCol = aReducedBlock.aStart.Col();
-SCROW aStartRow = aReducedBlock.aStart.Row();
-SCCOL aEndCol = aReducedBlock.aEnd.Col();
-SCROW aEndRow = aReducedBlock.aEnd.Row();
-m_pDoc->ShrinkToUsedDataArea( bShrunk, 
aReducedBlock.aStart.Tab(), aStartCol, aStartRow, aEndCol, aEndRow, false);
-aReducedBlock = ScRange(aStartCol, aStartRow, 
aReducedBlock.aStart.Tab(), aEndCol, aEndRow, aReducedBlock.aEnd.Tab());
-}
-
 ScImportExport aObj( m_pDoc, aReducedBlock );
 // Plain text ("Unformatted text") may contain embedded tabs and
 // line breaks but is not enclosed in quotes. Which makes it
@@ -363,13 +391,13 @@ bool ScTransferObj::GetData( const 
datatransfer::DataFlavor& rFlavor, const OUSt
 }
 else if ( nFormat == 

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

2018-10-11 Thread Libreoffice Gerrit user
 sc/source/core/tool/queryparam.cxx |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 88f10aed35c19cc43a88bbcd12b026cb32c0003f
Author: Eike Rathke 
AuthorDate: Sun Oct 7 00:24:31 2018 +0200
Commit: Caolán McNamara 
CommitDate: Thu Oct 11 10:00:00 2018 +0200

Resolves: tdf#73081 empty <> not-empty is also a match if numeric

This simplifies to match empty for the same conditions whether
numeric or not, an empty string does not result in numeric 0 here.

Change-Id: I923a3e1f07dd2691d3ac720fc28ba76986fe6c3d
Reviewed-on: https://gerrit.libreoffice.org/61486
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 9d8c89d9044edb5ad5c8bc4a8f0fd5868192714e)
Reviewed-on: https://gerrit.libreoffice.org/61495
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/queryparam.cxx 
b/sc/source/core/tool/queryparam.cxx
index 269eb700bb83..6e2fefa3f323 100644
--- a/sc/source/core/tool/queryparam.cxx
+++ b/sc/source/core/tool/queryparam.cxx
@@ -290,9 +290,9 @@ void ScQueryParamBase::FillInExcelSyntax(
  * This could be handled independently if all queries should support
  * it, needs to be evaluated if that actually is desired. */
 
-// (empty = empty) is a match, and (empty <> not-empty) also is a match
-if (rItem.meType == ScQueryEntry::ByString)
-rItem.mbMatchEmpty = ((rEntry.eOp == SC_EQUAL && 
rItem.maString.isEmpty())
+// (empty = empty) is a match, and (empty <> not-empty) also is a
+// match. (empty = 0) is not a match.
+rItem.mbMatchEmpty = ((rEntry.eOp == SC_EQUAL && 
rItem.maString.isEmpty())
 || (rEntry.eOp == SC_NOT_EQUAL && !rItem.maString.isEmpty()));
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-10-09 Thread Libreoffice Gerrit user
 sc/source/core/data/global.cxx |   15 +--
 1 file changed, 13 insertions(+), 2 deletions(-)

New commits:
commit 60011cefbccd91065dadf66896a688b807e76964
Author: Miklos Vajna 
AuthorDate: Mon Oct 1 21:27:49 2018 +0200
Commit: Christian Lohmaier 
CommitDate: Tue Oct 9 14:02:55 2018 +0200

tdf#115262 sc: fix cumulative placement error of images

Commit 708d1c5ab242b545ced598879233fc662d7e6cc0 (sc lok: emit
RowColumnHeader info in twips, 2015-11-02) improved precision of the
twip -> pixel conversion ratio, but ignored the detail that limited
precision used to silence cumulative errors that appear with larger
precision.

The original use-case was better precision of row/column headers for the
LOK API, so keep that as-is, but go back to the original behavior on the
desktop.

(cherry picked from commit 616fd241838069e18c59064e33c4b24f5ae112c6)

Change-Id: Ide169ab1745a9a9299caf3334559884ff7223cbe
Reviewed-on: https://gerrit.libreoffice.org/61312
Tested-by: Jenkins
Tested-by: Xisco Faulí 
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx
index 7c05743572a2..f3819735f6dc 100644
--- a/sc/source/core/data/global.cxx
+++ b/sc/source/core/data/global.cxx
@@ -487,8 +487,19 @@ void ScGlobal::InitPPT()
 {
 OutputDevice* pDev = Application::GetDefaultDevice();
 
-nScreenPPTX = double(pDev->GetDPIX()) / double(TWIPS_PER_INCH);
-nScreenPPTY = double(pDev->GetDPIY()) / double(TWIPS_PER_INCH);
+if (comphelper::LibreOfficeKit::isActive())
+{
+nScreenPPTX = double(pDev->GetDPIX()) / double(TWIPS_PER_INCH);
+nScreenPPTY = double(pDev->GetDPIY()) / double(TWIPS_PER_INCH);
+}
+else
+{
+// Avoid cumulative placement errors by intentionally limiting
+// precision.
+Point aPix1000 = pDev->LogicToPixel(Point(1000, 1000), 
MapMode(MapUnit::MapTwip));
+nScreenPPTX = aPix1000.X() / 1000.0;
+nScreenPPTY = aPix1000.Y() / 1000.0;
+}
 }
 
 const OUString& ScGlobal::GetClipDocName()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 9bc004d6187da610e146527585c678b5cd9432ae
Author: Eike Rathke 
AuthorDate: Thu Oct 4 19:25:39 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Oct 5 12:19:53 2018 +0200

Do not let end row creep above start row, tdf#69977 tdf#119305 follow-up

commit 3acc5a2383f5b0458e3caf1505fe6b8ad7dc3fb0
CommitDate: Tue Mar 27 13:26:30 2018 +0200

tdf#69977 improve creation of large charts

changed the loop such that it removed the stop condition for
rStartRow < rEndRow, and

commit aaa3c31ba79b1b3d335dcf55d72837a13411b45e
CommitDate: Tue Sep 11 20:29:04 2018 +0200

tdf#119305 Chart created from fully selected sheet only
targets header row

still checks only for a minimum of the original end row and the
last data row, which for an empty (no data) range selected may be
above the start row.

Change-Id: I9de08d09be62e86e7c946df701c49314fa4d682e
Reviewed-on: https://gerrit.libreoffice.org/61389
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 1371c2f4edab5086af6d0661de046252def29455)
Reviewed-on: https://gerrit.libreoffice.org/61391
Reviewed-by: Noel Grandin 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 4ae557f7d382..a4ff71ee3036 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1140,7 +1140,7 @@ 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::min(rEndRow, lastDataPos);
+rEndRow = std::max( rStartRow, std::min(rEndRow, lastDataPos));
 }
 
 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-6-1' - sc/source

2018-09-14 Thread Libreoffice Gerrit user
 sc/source/core/data/table1.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 634d30ce48d89c23ef8cc07ed66c05dc00e19b49
Author: Noel Grandin 
AuthorDate: Tue Sep 11 14:34:46 2018 +0200
Commit: Miklos Vajna 
CommitDate: Fri Sep 14 14:54:10 2018 +0200

tdf#119305 Chart created from fully selected sheet only targets header row

regression from
commit 3acc5a2383f5b0458e3caf1505fe6b8ad7dc3fb0
tdf#69977 improve creation of large charts

Change-Id: I09d02447b0e4691e98a44222608a3dc5edc95b0b
Reviewed-on: https://gerrit.libreoffice.org/60318
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit aaa3c31ba79b1b3d335dcf55d72837a13411b45e)
Reviewed-on: https://gerrit.libreoffice.org/60369
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 43d2a4a5c6b5..4ae557f7d382 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1137,8 +1137,10 @@ void ScTable::LimitChartArea( SCCOL& rStartCol, SCROW& 
rStartRow, SCCOL& rEndCol
 
 // Optimised loop for finding the bottom of the area, can be costly in 
large
 // spreadsheets.
+SCROW lastDataPos = 0;
 for (SCCOL i=rStartCol; i<=rEndCol; i++)
-rEndRow = std::min(rEndRow, aCol[i].GetLastDataPos());
+lastDataPos = std::max(lastDataPos, aCol[i].GetLastDataPos());
+rEndRow = std::min(rEndRow, lastDataPos);
 }
 
 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-6-1' - sc/source

2018-09-14 Thread Libreoffice Gerrit user
 sc/source/ui/drawfunc/futext.cxx |8 
 1 file changed, 4 insertions(+), 4 deletions(-)

New commits:
commit 895c0e9d7a8b67ef7f99b7ccee7c87e9820f16d4
Author: Noel Grandin 
AuthorDate: Tue Sep 11 13:18:09 2018 +0200
Commit: Noel Grandin 
CommitDate: Fri Sep 14 08:27:35 2018 +0200

tdf#119793 Crash on redo of rectangle movement and text

regression from
   commit be48eb2e82a3d8891ee84145567e2b89884f1fd6
   return std::unique_ptr from SdrMakeOutliner

Change-Id: Iec4421558ed29121973c87b9363da0303f71e203
Reviewed-on: https://gerrit.libreoffice.org/60317
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 4926b0f348dd1ddf170fe41df0cde4d426ab3b5f)
Reviewed-on: https://gerrit.libreoffice.org/60441

diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx
index e9646de57610..1212bba340b3 100644
--- a/sc/source/ui/drawfunc/futext.cxx
+++ b/sc/source/ui/drawfunc/futext.cxx
@@ -197,11 +197,11 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt)
 pO->SetVertical( bVertical );
 
 //!?? the default values are not correct when result is 
without outliner ???!?
-auto pUndoManager = >GetUndoManager();
+auto pOTemp = pO.get();
 if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, 
pO.release()) )
 {
 // subscribe EditEngine-UndoManager
-rViewShell.SetDrawTextUndo( pUndoManager );
+rViewShell.SetDrawTextUndo( >GetUndoManager() );
 
 OutlinerView* pOLV = pView->GetTextEditOutlinerView();
 if ( pOLV->MouseButtonDown(rMEvt) )
@@ -593,7 +593,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* 
pMousePixel,
 pO->SetVertical( bVertical );
 
 //!??  without returned Outliner the defaults are not correct 
???!?
-auto pUndoManager = >GetUndoManager();
+auto pOTemp = pO.get();
 if ( pView->SdrBeginTextEdit(pObj, pPV, pWindow, true, 
pO.release()) )
 {
 //  Toggle out of paste mode if we are in it, otherwise
@@ -603,7 +603,7 @@ void FuText::SetInEditMode(SdrObject* pObj, const Point* 
pMousePixel,
 rViewShell.UpdateCopySourceOverlay();
 
 //  EditEngine-UndoManager anmelden
-rViewShell.SetDrawTextUndo( pUndoManager );
+rViewShell.SetDrawTextUndo( >GetUndoManager() );
 
 pView->SetEditMode();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-12 Thread Libreoffice Gerrit user
 sc/source/core/tool/token.cxx |   12 
 1 file changed, 12 insertions(+)

New commits:
commit d76b64ad538f05afc5f18041e9d8c375f22be356
Author: Luboš Luňák 
AuthorDate: Mon Sep 10 12:35:26 2018 +0200
Commit: Miklos Vajna 
CommitDate: Wed Sep 12 09:07:11 2018 +0200

sync opcodes blacklisted for calc threading from master

This makes the branch use the same blacklist, i.e.
commits 4aecbe996349c7767ba3fb1e81db2ef6f94d39ba
and fbd79a36ca8110e37434bb2eb5cc83e892710392.

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

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 8d6fd7351aa2..db03b6a3f649 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1320,7 +1320,19 @@ void ScTokenArray::CheckForThreading( const 
FormulaToken& r )
 ocCell,
 ocInfo,
 ocStyle,
+ocDBAverage,
+ocDBCount,
+ocDBCount2,
+ocDBGet,
+ocDBMax,
+ocDBMin,
+ocDBProduct,
+ocDBStdDev,
+ocDBStdDevP,
 ocDBSum,
+ocDBVar,
+ocDBVarP,
+ocText,
 ocExternal,
 ocDde,
 ocWebservice,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-09-06 Thread Libreoffice Gerrit user
 sc/source/filter/xml/xmlimprt.cxx |   18 --
 1 file changed, 12 insertions(+), 6 deletions(-)

New commits:
commit 68817986a428bafc433528c49d99df5b58c7204d
Author: Eike Rathke 
AuthorDate: Wed Sep 5 12:41:39 2018 +0200
Commit: Markus Mohrhard 
CommitDate: Thu Sep 6 17:53:02 2018 +0200

Resolves: tdf#118850 disentangle the twisted wrong cell type vs format type

Change-Id: Idb5267c9bc50e8844654c2f2cd0d123fcbb7aa12
Reviewed-on: https://gerrit.libreoffice.org/60026
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit ede27cf598ed2aef41b9552b2c787ef8331400fc)
Reviewed-on: https://gerrit.libreoffice.org/60033
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/xml/xmlimprt.cxx 
b/sc/source/filter/xml/xmlimprt.cxx
index 86434cd10c0c..ca24d77523b5 100644
--- a/sc/source/filter/xml/xmlimprt.cxx
+++ b/sc/source/filter/xml/xmlimprt.cxx
@@ -1293,12 +1293,18 @@ void ScXMLImport::SetType(const uno::Reference 
& rPropertie
 sal_Int32 nCurrentCellType(
 GetNumberFormatAttributesExportHelper()->GetCellType(
 rNumberFormat, sCurrentCurrency, bIsStandard) & 
~util::NumberFormat::DEFINED);
-if ((nCellType != nCurrentCellType) && !((nCellType == 
util::NumberFormat::NUMBER &&
-((nCurrentCellType == util::NumberFormat::SCIENTIFIC) ||
-(nCurrentCellType == util::NumberFormat::FRACTION) ||
-(nCurrentCellType == util::NumberFormat::LOGICAL) ||
-(nCurrentCellType == 0))) || (nCurrentCellType == 
util::NumberFormat::TEXT)) && !((nCellType == util::NumberFormat::DATETIME) &&
-(nCurrentCellType == util::NumberFormat::DATE)))
+// If the (numeric) cell type (number, currency, date, time, boolean)
+// is different from the format type then for some combinations we may
+// have to apply a format, e.g. in case the generator deduced format
+// from type and did not apply a format but we don't keep a dedicated
+// type internally. Specifically this is necessary if the cell type is
+// not number but the format type is (i.e. General). Currency cells
+// need extra attention, see calls of ScXMLImport::IsCurrencySymbol()
+// and description within there and ScXMLImport::SetCurrencySymbol().
+if ((nCellType != nCurrentCellType) &&
+(nCellType != util::NumberFormat::NUMBER) &&
+(nCellType != util::NumberFormat::TEXT) &&
+(bIsStandard || (nCellType == util::NumberFormat::CURRENCY)))
 {
 if (!xNumberFormats.is())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 8767161e056b5d7fc8cf168d0541db86635d1041
Author: Caolán McNamara 
AuthorDate: Sun Sep 2 21:20:40 2018 +0100
Commit: Caolán McNamara 
CommitDate: Tue Sep 4 13:31:17 2018 +0200

ofz#10189 check container size

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

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


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

2018-09-04 Thread Libreoffice Gerrit user
 sc/source/core/tool/interpr2.cxx |   62 +++
 1 file changed, 50 insertions(+), 12 deletions(-)

New commits:
commit 184aee6abd202f6f4e2c18d21f96a0d1a9fd947f
Author: Eike Rathke 
AuthorDate: Mon Aug 27 15:05:54 2018 +0200
Commit: Caolán McNamara 
CommitDate: Tue Sep 4 10:01:04 2018 +0200

Resolves: tdf#119533 reintroduce time rounding but cut, tdf#118800 follow-up

 This is a combination of 2 commits.

Resolves: tdf#119533 reintroduce time rounding but cut, tdf#118800 follow-up

Regression from

commit c69e7266916ac1b8917477fb4eccdb9098da5792
CommitDate: Thu Jul 19 14:01:30 2018 +0200

tdf#118800 fix rounding error in Calc function HOUR, MINUTE, SECOND.

Rounding was only an error if it produced a value of a full day in
seconds, or if it otherwise led to an inappropriately rounded-up
individual value, but in general some rounding is necessary.

Instead of omitting rounding completely, basically round to
nanoseconds and then do not round individual hour,minute,second
values but instead truncate to the next magnitude so 23:59:59.
gives 23h59m59s instead of 24h0m0s

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

Shortcut small negative values to 0:0:0, tdf#119533 tdf#118800 follow-up

... instead of letting them end up as 24:0:0

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

0212a2b422a931a24fd2748aa2826a5b60d2a397

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

diff --git a/sc/source/core/tool/interpr2.cxx b/sc/source/core/tool/interpr2.cxx
index debe3509eb44..eb5352e843ae 100644
--- a/sc/source/core/tool/interpr2.cxx
+++ b/sc/source/core/tool/interpr2.cxx
@@ -142,28 +142,66 @@ void ScInterpreter::ScGetDay()
 PushDouble(static_cast(aDate.GetDay()));
 }
 
+/* TODO: move this to tools::Time so also SvNumberFormatter and everything else
+ * can use it and all display the same values. */
+static void lcl_getHourMinuteSecond( double fTimeInDays, sal_Int32& nHour, 
sal_Int32& nMinute, sal_Int32& nSecond )
+{
+const double fTime = fTimeInDays - rtl::math::approxFloor(fTimeInDays); // 
date part absent
+
+// If 0 then full day (or no day), shortcut.
+// If < 0 then approxFloor() effectively returned the ceiling (note this
+// also holds for negative fTimeInDays values) because of a near identical
+// value, shortcut this to a full day as well.
+// If >= 1.0 (actually == 1.0) then fTimeInDays is a negative small value
+// not significant for a representable time and approxFloor() returned -1,
+// shortcut to 0:0:0, otherwise it would become 24:0:0.
+if (fTime <= 0.0 || fTime >= 1.0)
+{
+nHour = nMinute = nSecond = 0;
+return;
+}
+
+// In seconds, including milli and nano.
+const double fRawSeconds = fTime * DATE_TIME_FACTOR;
+
+// Round to nanoseconds, which is the highest resolution this could be
+// influenced by.
+double fSeconds = rtl::math::round( fRawSeconds, 9);
+
+// If this ended up as a full day the original value was very very close
+// but not quite. Take that.
+if (fSeconds >= tools::Time::secondPerDay)
+fSeconds = fRawSeconds;
+
+// Now do not round values (specifically not up), but truncate to the next
+// magnitude, so 23:59:59.99 is still 23:59:59 and not 24:00:00 (or even
+// 00:00:00 which Excel does).
+nHour = fSeconds / tools::Time::secondPerHour;
+fSeconds -= nHour * tools::Time::secondPerHour;
+nMinute = fSeconds / tools::Time::secondPerMinute;
+fSeconds -= nMinute * tools::Time::secondPerMinute;
+nSecond = fSeconds;
+}
+
 void ScInterpreter::ScGetMin()
 {
-double fTime = GetDouble();
-fTime -= ::rtl::math::approxFloor(fTime);   // date part absent
-long nVal = 
static_cast(::rtl::math::approxFloor(fTime*DATE_TIME_FACTOR)) % 
::tools::Time::secondPerHour;
-PushDouble( static_cast(nVal / ::tools::Time::secondPerMinute) );
+sal_Int32 nHour, nMinute, nSecond;
+lcl_getHourMinuteSecond( GetDouble(), nHour, nMinute, nSecond);
+PushDouble( nMinute);
 }
 
 void ScInterpreter::ScGetSec()
 {
-double fTime = GetDouble();
-fTime -= ::rtl::math::approxFloor(fTime);   // date part absent
-long nVal = 
static_cast(::rtl::math::approxFloor(fTime*DATE_TIME_FACTOR)) % 
::tools::Time::secondPerMinute;
-PushDouble( static_cast(nVal) );
+sal_Int32 nHour, nMinute, nSecond;
+lcl_getHourMinuteSecond( GetDouble(), nHour, 

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

2018-09-04 Thread Libreoffice Gerrit user
 sc/source/core/tool/interpr3.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit da7929ed0ad5916f39111908fb7f897df8691c39
Author: Eike Rathke 
AuthorDate: Mon Aug 27 10:09:32 2018 +0200
Commit: Caolán McNamara 
CommitDate: Tue Sep 4 10:00:46 2018 +0200

Increase arbitrary sort elements limit from 10 to two full columns

The value 10 already was in the year 2000 initial commit,
probably some memory and performance constraints back then. At
least one full column should be sortable, make it two so we don't
bail out that early for functions like MODE() that can take
multiple ranges. In fact maybe ScMatrix::IsSizeAllocatable()
should be taken into account, which is much larger though and
QuickSort() might not play well with it.

Change-Id: I061abfd0f061c8df62c31468df744eb5dc7152be
Reviewed-on: https://gerrit.libreoffice.org/59637
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit e8cb36fd6234270c8c31147db35cccab9c234529)
Reviewed-on: https://gerrit.libreoffice.org/59660
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/interpr3.cxx b/sc/source/core/tool/interpr3.cxx
index b52a62fd3d20..28e8cd9a9c48 100644
--- a/sc/source/core/tool/interpr3.cxx
+++ b/sc/source/core/tool/interpr3.cxx
@@ -39,7 +39,9 @@
 using ::std::vector;
 using namespace formula;
 
-#define MAX_COUNT_DOUBLE_FOR_SORT 10
+/// Two columns of data should be sortable with GetSortArray() and QuickSort()
+// This is an arbitrary limit.
+#define MAX_COUNT_DOUBLE_FOR_SORT (MAXROWCOUNT * 2)
 
 const double ScInterpreter::fMaxGammaArgument = 171.624376956302;  // found 
experimental
 const double fMachEps = ::std::numeric_limits::epsilon();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit db376075d564e5a834a5db6de4c7e381159c66be
Author: Michael Weghorn 
AuthorDate: Thu Aug 30 12:59:06 2018 +0200
Commit: Eike Rathke 
CommitDate: Fri Aug 31 17:53:52 2018 +0200

tdf#112454 Also consider last SCTAB in loop

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

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

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


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

2018-08-31 Thread Libreoffice Gerrit user
 sc/source/core/data/attarray.cxx |   12 
 sc/source/core/data/table2.cxx   |3 +--
 2 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 2fffe4a50b6f541c1e43cf13a3a475caf94d203b
Author: Mike Kaganski 
AuthorDate: Thu Jul 19 15:12:15 2018 +0200
Commit: Eike Rathke 
CommitDate: Fri Aug 31 17:47:31 2018 +0200

tdf#117781: don't remove already applied conditional format data


... when deduplicating; only add new range. Check not to add the
same conditional format to a range more than once.

Change-Id: I0702b8e1462784cc71666ddfa6442a2827f00af5
Reviewed-on: https://gerrit.libreoffice.org/57725
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit e56eb9cb7ee80215c05d06f25349d7ab7ad06640)
Reviewed-on: https://gerrit.libreoffice.org/59866

diff --git a/sc/source/core/data/attarray.cxx b/sc/source/core/data/attarray.cxx
index d058b7e70b4f..3330cf14c10e 100644
--- a/sc/source/core/data/attarray.cxx
+++ b/sc/source/core/data/attarray.cxx
@@ -298,11 +298,15 @@ void ScAttrArray::AddCondFormat( SCROW nStartRow, SCROW 
nEndRow, sal_uInt32 nInd
 std::vector< sal_uInt32 > aCondFormatData;
 if(pItem)
 aCondFormatData = static_cast(pItem)->GetCondFormatData();
-aCondFormatData.push_back(nIndex);
+if (std::find(aCondFormatData.begin(), aCondFormatData.end(), 
nIndex)
+== aCondFormatData.end())
+{
+aCondFormatData.push_back(nIndex);
 
-ScCondFormatItem aItem;
-aItem.SetCondFormatData( aCondFormatData );
-pNewPattern->GetItemSet().Put( aItem );
+ScCondFormatItem aItem;
+aItem.SetCondFormatData( aCondFormatData );
+pNewPattern->GetItemSet().Put( aItem );
+}
 }
 else
 {
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index b7f95afebfed..e640b31622f4 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -569,14 +569,13 @@ bool CheckAndDeduplicateCondFormat(ScDocument* pDocument, 
ScConditionalFormat* p
 
 if (pOldFormat->EqualEntries(*pNewFormat, true))
 {
-pDocument->RemoveCondFormatData(pOldFormat->GetRange(), nTab, 
pOldFormat->GetKey());
 const ScRangeList& rNewRangeList = pNewFormat->GetRange();
 ScRangeList& rDstRangeList = pOldFormat->GetRangeList();
 for (size_t i = 0; i < rNewRangeList.size(); ++i)
 {
 rDstRangeList.Join(rNewRangeList[i]);
 }
-pDocument->AddCondFormatData(pOldFormat->GetRange(), nTab, 
pOldFormat->GetKey());
+pDocument->AddCondFormatData(rNewRangeList, nTab, 
pOldFormat->GetKey());
 return true;
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-31 Thread Libreoffice Gerrit user
 sc/source/core/tool/interpr1.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 0b84398784dfffca807965d678aeee5c2c302b66
Author: Michael Weghorn 
AuthorDate: Thu Aug 30 17:18:18 2018 +0200
Commit: Eike Rathke 
CommitDate: Fri Aug 31 13:57:00 2018 +0200

tdf#73078 Let 'Type()' return '1' for empty cells

Quote from tdf#73078:

> The function TYPE is specified with the Syntax:
> TYPE( Any value ) and the rule "If a Reference
> is provided, the reference is first dereferenced,
> and any formulas are evaluated."
> [ODF1.2 part2 section 6.13.33 TYP]
>
> Because of argument type "Any" the function cannot result
> in an error. Gnumeric, Apache OpenOffice, and Excel return
> the number 1 in this case.

Therefore, have LibreOffice return 1 as well, rather than
having an "Err:502" ("Error: Invalid argument").

Change-Id: I1e679645e7b2e70e185574f805cd410b0508cbd8
Reviewed-on: https://gerrit.libreoffice.org/59826
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 0383ccd4e7116c3d26edc1f86b7a74fe3cf649bd)
Reviewed-on: https://gerrit.libreoffice.org/59852
Tested-by: Eike Rathke 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index c78c0593e986..a2d0dfa0f865 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -2120,6 +2120,10 @@ void ScInterpreter::ScType()
 nType = 1;
 }
 break;
+case CELLTYPE_NONE:
+// always 1, s. tdf#73078
+nType = 1;
+break;
 case CELLTYPE_FORMULA :
 nType = 8;
 break;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 88897b74118fa6d269ce325aca6a4ac3ac1ae3de
Author: Eike Rathke 
AuthorDate: Wed Aug 15 10:52:38 2018 +0200
Commit: Caolán McNamara 
CommitDate: Thu Aug 23 16:41:11 2018 +0200

Resolves: tdf#119034 do not floor() for Logical A1

Either it is 0.0 or it is not.

Change-Id: I8e170e08b7a26ade65ca3b8db26a2d8c581e444c
Reviewed-on: https://gerrit.libreoffice.org/59057
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 0815f3460fa8a595a085d853e96b8ec0471f)
Reviewed-on: https://gerrit.libreoffice.org/59494
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 964b9e9e13a4..c78c0593e986 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -8083,7 +8083,7 @@ void ScInterpreter::ScAddressFunc()
 sTabStr = GetString().getString();
 
 FormulaGrammar::AddressConvention eConv = FormulaGrammar::CONV_OOO;  
// default
-if( nParamCount >= 4 && 0.0 == ::rtl::math::approxFloor( 
GetDoubleWithDefault( 1.0)))
+if (nParamCount >= 4 && 0.0 == GetDoubleWithDefault( 1.0))
 eConv = FormulaGrammar::CONV_XL_R1C1;
 else
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 40a7c1c1ef133950ddb4c2052d460a9ce2b02b15
Author: Eike Rathke 
AuthorDate: Wed Aug 22 20:00:16 2018 +0200
Commit: Eike Rathke 
CommitDate: Thu Aug 23 10:46:17 2018 +0200

Resolves: tdf#119402 +- typo sign flip

Regression from

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

Avoid temporary Date and normalization

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

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

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


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

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

New commits:
commit 826b2d68ee3985144e68966dc29bb3433d22b4d5
Author: Eike Rathke 
AuthorDate: Fri Aug 17 12:22:09 2018 +0200
Commit: Caolán McNamara 
CommitDate: Wed Aug 22 09:24:06 2018 +0200

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

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

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 691188f80d33..8d6fd7351aa2 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -3891,6 +3891,11 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
 {
 ScComplexRefData& rRef = *p->GetDoubleRef();
 ScRange aAbs = rRef.toAbs(rPos);
+
+if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || 
aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab())
+// Sheet references not affected.
+break;
+
 if (rCxt.maRange.In(aAbs))
 {
 // This range is entirely within the shifted 
region.
@@ -3913,10 +3918,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
 // column range of the reference is not 
entirely in the deleted column range.
 break;
 
-if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || 
aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab())
-// wrong tables
-break;
-
 ScRange aDeleted = rCxt.maRange;
 aDeleted.aStart.IncRow(rCxt.mnRowDelta);
 
aDeleted.aEnd.SetRow(aDeleted.aStart.Row()-rCxt.mnRowDelta-1);
@@ -3973,10 +3974,6 @@ sc::RefUpdateResult ScTokenArray::AdjustReferenceInName(
 // row range of the reference is not entirely 
in the deleted row range.
 break;
 
-if (aAbs.aStart.Tab() > rCxt.maRange.aEnd.Tab() || 
aAbs.aEnd.Tab() < rCxt.maRange.aStart.Tab())
-// wrong tables
-break;
-
 ScRange aDeleted = rCxt.maRange;
 aDeleted.aStart.IncCol(rCxt.mnColDelta);
 
aDeleted.aEnd.SetCol(aDeleted.aStart.Col()-rCxt.mnColDelta-1);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-22 Thread Libreoffice Gerrit user
 sc/source/core/tool/interpr1.cxx |   16 
 1 file changed, 16 insertions(+)

New commits:
commit 886b39fbd4f2401922b1c5af0a06ad09efb59d93
Author: Eike Rathke 
AuthorDate: Mon Aug 20 12:59:59 2018 +0200
Commit: Caolán McNamara 
CommitDate: Wed Aug 22 09:21:43 2018 +0200

Resolves: tdf#119137 treat scalar non-reference non-array argument as matrix

... of size 1x1 so all further checks are applicable as for any other array.

Change-Id: I0c8926bc56f5e451ca4847e0f0c76a1be97418f2
Reviewed-on: https://gerrit.libreoffice.org/59317
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit 7d785183dda20942459616110bab041f9293a399)
Reviewed-on: https://gerrit.libreoffice.org/59329
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index c0558c869ad4..964b9e9e13a4 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -6222,7 +6222,23 @@ void ScInterpreter::IterateParametersIfs( 
double(*ResultFunc)( const sc::ParamIf
 nMainTab2 = 0;
 }
 break;
+// Treat a scalar value as 1x1 matrix.
+case svDouble:
+pMainMatrix = GetNewMat(1,1);
+nMainCol1 = nMainCol2 = 0;
+nMainRow1 = nMainRow2 = 0;
+nMainTab1 = nMainTab2 = 0;
+pMainMatrix->PutDouble( GetDouble(), 0, 0);
+break;
+case svString:
+pMainMatrix = GetNewMat(1,1);
+nMainCol1 = nMainCol2 = 0;
+nMainRow1 = nMainRow2 = 0;
+nMainTab1 = nMainTab2 = 0;
+pMainMatrix->PutString( GetString(), 0, 0);
+break;
 default:
+PopError();
 PushError( FormulaError::IllegalParameter);
 return;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 30c178dcb3301527ad92bbd245d1525ab77e314e
Author: Julien Nabet 
AuthorDate: Thu Aug 16 19:57:52 2018 +0200
Commit: Julien Nabet 
CommitDate: Fri Aug 17 07:17:01 2018 +0200

Related tdf#118547: don't change protection symbol if nTab == TABLEID_DOC

See Eike's comment in https://gerrit.libreoffice.org/#/c/59035/

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

diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 6533068bcd04..54677815d542 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2541,7 +2541,7 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& 
rPassword )
 if ( nTab == TABLEID_DOC || rMark.GetSelectCount() <= 1 )
 {
 bChanged = rFunc.Unprotect( nTab, rPassword, false );
-if (bChanged)
+if (bChanged && nTab != TABLEID_DOC)
 SetTabProtectionSymbol(nTab, false);
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 2d7997886b834efe50f16700c8e9f2675a8f223c
Author: Caolán McNamara 
AuthorDate: Thu Aug 16 15:23:11 2018 +0100
Commit: Caolán McNamara 
CommitDate: Thu Aug 16 22:19:44 2018 +0200

data->sort->options->copy sort results to, enter "asd"->ok crashes

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

diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx
index 6009f8b35b4b..1f7a71c249be 100644
--- a/sc/source/ui/dbgui/tpsort.cxx
+++ b/sc/source/ui/dbgui/tpsort.cxx
@@ -755,7 +755,7 @@ DeactivateRC ScTabPageSortOptions::DeactivatePage( 
SfxItemSet* pSetP )
 
 if ( !bPosInputOk )
 {
-std::unique_ptr 
xBox(Application::CreateMessageDialog(GetTabDialog()->GetFrameWeld(),
+std::unique_ptr 
xBox(Application::CreateMessageDialog(GetDialogController()->getDialog(),
   VclMessageType::Warning, 
VclButtonsType::Ok,
   
ScResId(STR_INVALID_TABREF)));
 xBox->run();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 99762024dc5a2d5514c517c96c588949e30328b7
Author: Julien Nabet 
AuthorDate: Tue Aug 14 22:01:42 2018 +0200
Commit: Christian Lohmaier 
CommitDate: Thu Aug 16 11:52:48 2018 +0200

Related tdf#118547: Lock mark on protected sheet tab

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

Change-Id: I2c4e55f8929b1979e71a4040dfac1ba7cff51aeb
Reviewed-on: https://gerrit.libreoffice.org/59035
Tested-by: Jenkins
Reviewed-by: Julien Nabet 
(cherry picked from commit d064ced9e9db3f924dd954b86c40f21addab1c68)
Reviewed-on: https://gerrit.libreoffice.org/59040
Reviewed-by: Christian Lohmaier 

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


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

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

New commits:
commit fa89d83cdf29ea2dc33ed99aed67df5df5424036
Author: Caolán McNamara 
AuthorDate: Wed Aug 15 10:42:33 2018 +0100
Commit: Caolán McNamara 
CommitDate: Wed Aug 15 15:00:56 2018 +0200

tdf#115086 crash in assignLabelsToDataSequence

since...

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

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

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

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


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

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

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

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

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

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


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

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

New commits:
commit c9f9641c4654e7b867c604a347a568c0a6e97ce8
Author: Maxim Monastirsky 
AuthorDate: Mon Aug 6 23:50:21 2018 +0300
Commit: Adolfo Jayme Barrientos 
CommitDate: Wed Aug 8 20:41:46 2018 +0200

tdf#119128 toggle INSERT/OVERWRITE is broken

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

Change-Id: I2b5e3fe9cb885ed20e7528fdfe2fd59f5ef05f42
Reviewed-on: https://gerrit.libreoffice.org/58658
Tested-by: Jenkins
Reviewed-by: Maxim Monastirsky 
(cherry picked from commit 92a4e4eac7520541a433e40836cafa4e29edf47f)
Reviewed-on: https://gerrit.libreoffice.org/58709
Reviewed-by: Adolfo Jayme Barrientos 

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


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

2018-08-03 Thread Libreoffice Gerrit user
 sc/source/core/data/column3.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 26300f5d4c4e6241baf8cadcfea094e7969814a5
Author: Caolán McNamara 
AuthorDate: Wed Aug 1 08:55:23 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Fri Aug 3 18:32:20 2018 +0200

forcepoint#55 invalid iterator increment

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

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 0ad5117d7d10..7b760b3daa48 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -3080,6 +3080,8 @@ public:
 if (xCurGrp)
 {
 // Move to the cell after the last cell of the current 
group.
+if (xCurGrp->mnLength > std::distance(it, itEnd))
+throw css::lang::IllegalArgumentException();
 std::advance(it, xCurGrp->mnLength);
 nRow += xCurGrp->mnLength;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-08-03 Thread Libreoffice Gerrit user
 sc/source/filter/xml/XMLTableShapeImportHelper.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit a5b84a6888deaa406786b350a0adcf9ef9020f48
Author: Caolán McNamara 
AuthorDate: Wed Aug 1 11:48:30 2018 +0100
Commit: Michael Stahl 
CommitDate: Fri Aug 3 10:55:03 2018 +0200

forcepoint#64 null deref

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

diff --git a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx 
b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
index 75410c627865..a81396b1cf8b 100644
--- a/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
+++ b/sc/source/filter/xml/XMLTableShapeImportHelper.cxx
@@ -201,7 +201,7 @@ void XMLTableShapeImportHelper::finishShape(
 // the group
 Point aStartPoint( rShape->getPosition().X,rShape->getPosition().Y 
);
 uno::Reference< drawing::XShape > xChild( rShapes, uno::UNO_QUERY 
);
-if (SvxShape* pGroupShapeImp = SvxShape::getImplementation( 
lcl_getTopLevelParent( xChild ) ))
+if (SvxShape* pGroupShapeImp = xChild.is() ? 
SvxShape::getImplementation(lcl_getTopLevelParent(xChild)) : nullptr)
 {
 if (SdrObject *pSdrObj = pGroupShapeImp->GetSdrObject())
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-28 Thread Libreoffice Gerrit user
 sc/source/ui/navipi/content.cxx   |2 +-
 sc/uiconfig/scalc/ui/navigatorpanel.ui|4 ++--
 sc/uiconfig/scalc/ui/sidebaralignment.ui  |   10 +-
 sc/uiconfig/scalc/ui/sidebarcellappearance.ui |8 
 sc/uiconfig/scalc/ui/sidebarnumberformat.ui   |4 ++--
 sd/uiconfig/simpress/ui/navigatorpanel.ui |2 +-
 svx/uiconfig/ui/defaultshapespanel.ui |   20 ++--
 svx/uiconfig/ui/sidebarparagraph.ui   |   16 
 svx/uiconfig/ui/sidebartextpanel.ui   |   18 +-
 sw/uiconfig/swriter/ui/navigatorpanel.ui  |2 +-
 10 files changed, 43 insertions(+), 43 deletions(-)

New commits:
commit 082c736bca22ee3c3fb86c7d68cc875eaa6bde38
Author: Jim Raykowski 
AuthorDate: Sun Jul 15 13:01:02 2018 -0800
Commit: Caolán McNamara 
CommitDate: Sat Jul 28 20:37:43 2018 +0200

tdf#118764 Add missing tab stops in sidebar panels

Change-Id: I09d5df8d7f07eb4b6c4341d9cd281131fc2df23b
Reviewed-on: https://gerrit.libreoffice.org/57535
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 
Reviewed-on: https://gerrit.libreoffice.org/58216
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 3f8271c43999..4cd69244142f 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -123,7 +123,7 @@ ScDocShell* ScContentTree::GetManualOrCurrent()
 //  ScContentTree
 
 ScContentTree::ScContentTree(vcl::Window* pParent, ScNavigatorDlg* 
pNavigatorDlg)
-: SvTreeListBox(pParent, WB_BORDER)
+: SvTreeListBox(pParent, WB_BORDER | WB_TABSTOP)
 , pParentWindow(pNavigatorDlg)
 , nRootType(ScContentId::ROOT)
 , bHiddenDoc(false)
diff --git a/sc/uiconfig/scalc/ui/navigatorpanel.ui 
b/sc/uiconfig/scalc/ui/navigatorpanel.ui
index 4be59692a978..c8cb3478e5a4 100644
--- a/sc/uiconfig/scalc/ui/navigatorpanel.ui
+++ b/sc/uiconfig/scalc/ui/navigatorpanel.ui
@@ -77,7 +77,7 @@
 
   
 True
-False
+True
 icons
 
   
@@ -186,7 +186,7 @@
 
   
 True
-False
+True
 Document
 
   
diff --git a/sc/uiconfig/scalc/ui/sidebaralignment.ui 
b/sc/uiconfig/scalc/ui/sidebaralignment.ui
index 246598c51a4d..e1107325eb12 100644
--- a/sc/uiconfig/scalc/ui/sidebaralignment.ui
+++ b/sc/uiconfig/scalc/ui/sidebaralignment.ui
@@ -38,7 +38,7 @@
 
   
 True
-False
+True
 True
 Horizontal 
Alignment
 start
@@ -102,7 +102,7 @@
 
   
 True
-False
+True
 Vertical 
Alignment
 end
 False
@@ -153,7 +153,7 @@
 
   
 True
-False
+True
 False
 
   
@@ -215,7 +215,7 @@
 
   
 True
-False
+True
 False
 
   
@@ -380,7 +380,7 @@
 
   
 True
-False
+True
 True
 Select the angle for 
rotation.
 
diff --git a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui 
b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
index 792b3798386d..0cf884eda1be 100644
--- a/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
+++ b/sc/uiconfig/scalc/ui/sidebarcellappearance.ui
@@ -37,7 +37,7 @@
 
   
 True
-False
+True
 True
 Select the 
background color of the selected cells.
 
@@ -80,7 +80,7 @@
 
   
 True
-False
+True
 center
 
   
@@ -115,7 +115,7 @@
 
   
 True
-False
+True
 
   
 False
@@ -149,7 +149,7 @@
 
   
 True
-False
+True
 True
 Select the line 
color of the borders.
 
diff --git a/sc/uiconfig/scalc/ui/sidebarnumberformat.ui 
b/sc/uiconfig/scalc/ui/sidebarnumberformat.ui
index 7ad1af1f8fcb..e717b9486c66 100644
--- a/sc/uiconfig/scalc/ui/sidebarnumberformat.ui
+++ b/sc/uiconfig/scalc/ui/sidebarnumberformat.ui
@@ -33,7 +33,7 @@
 

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

2018-07-25 Thread Libreoffice Gerrit user
 sc/source/filter/excel/xlstyle.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 51c7a6f68ef25d7c292dc988400a2c59ef479017
Author: Caolán McNamara 
AuthorDate: Tue Jul 24 10:21:43 2018 +0100
Commit: Eike Rathke 
CommitDate: Thu Jul 26 01:18:56 2018 +0200

valgrind: use of unit value exporting tdf107162-1.ots to xls

Conditional jump or move depends on uninitialised value(s)
   at 0x4554B657: SetApiUnderline (xlstyle.cxx:487)
   by 0x4554B657: (anonymous 
namespace)::lclSetApiFontSettings(XclFontData&, rtl::OUString const&, float, 
float, com::sun::star::awt::FontSlant, short, short) (xlstyle.cxx:583)
   by 0x4554C096: XclFontPropSetHelper::ReadFontProperties(XclFontData&, 
ScfPropertySet const&, XclFontPropSetType, short) (xlstyle.cxx:679)
   by 0x4546D8BE: 
XclExpTbxControlObj::XclExpTbxControlObj(XclExpObjectManager&, 
com::sun::star::uno::Reference const&, 
tools::Rectangle const*) (xeescher.cxx:753)
   by 0x45593D99: 
XclEscherEx::CreateTBXCtrlObj(com::sun::star::uno::Reference
 const&, tools::Rectangle const*) (xcl97esc.cxx:441)
   by 0x45594E85: 
XclEscherEx::StartShape(com::sun::star::uno::Reference
 const&, tools::Rectangle const*) (xcl97esc.cxx:254)
   by 0x44E4FFBC: ImplEESdrWriter::ImplWriteShape(ImplEESdrObject&, 
EscherSolverContainer&, bool) (eschesdo.cxx:164)
   by 0x44E510C3: ImplEESdrWriter::ImplWriteShape(ImplEESdrObject&, 
EscherSolverContainer&, bool) (eschesdo.cxx:215)
   by 0x44E5452B: ImplEESdrWriter::ImplWritePage(EscherSolverContainer&) 
(eschesdo.cxx:848)
   by 0x44E54D27: ImplWriteCurrentPage (eschesdo.cxx:932)
   by 0x44E54D27: EscherEx::AddSdrPage(SdrPage const&) (eschesdo.cxx:945)
   by 0x454696BC: XclExpObjectManager::ProcessDrawing(SdrPage const*) 
(xeescher.cxx:1523)
   by 0x45407A35: ExcTable::FillAsTableBinary(short) (excdoc.cxx:518)
   by 0x454088B8: ExcDocument::ReadDoc() (excdoc.cxx:767)

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

diff --git a/sc/source/filter/excel/xlstyle.cxx 
b/sc/source/filter/excel/xlstyle.cxx
index 673b2a5bf62c..e9095b580cad 100644
--- a/sc/source/filter/excel/xlstyle.cxx
+++ b/sc/source/filter/excel/xlstyle.cxx
@@ -659,8 +659,8 @@ void XclFontPropSetHelper::ReadFontProperties( XclFontData& 
rFontData,
 case EXC_FONTPROPSET_CONTROL:
 {
 OUString aApiFontName;
-float fApiHeight, fApiWeight;
-sal_Int16 nApiFamily, nApiCharSet, nApiPosture, nApiUnderl, 
nApiStrikeout;
+float fApiHeight(0.0), fApiWeight(0.0);
+sal_Int16 nApiFamily(0), nApiCharSet(0), nApiPosture(0), 
nApiUnderl(0), nApiStrikeout(0);
 
 // read font properties
 maHlpControl.ReadFromPropertySet( rPropSet );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

ofz#9431 don't check attribs of Invalid column

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

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


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

2018-07-18 Thread Libreoffice Gerrit user
 sc/source/core/tool/interpr4.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit cc2c11c2e4a99adf00d184507d6925c9af37e1bd
Author: Eike Rathke 
AuthorDate: Tue Jul 17 16:49:39 2018 +0200
Commit: Markus Mohrhard 
CommitDate: Thu Jul 19 01:42:47 2018 +0200

Related: tdf#117016 DoubleRefToVars: always put in order

... as all callers expect, whatever dynamic range creating process
may have created it.

Change-Id: I47b2e174d5bf4d5c23f10685526b48eee07dd6a4
Reviewed-on: https://gerrit.libreoffice.org/57567
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 6db5e1bdd67531fab14b375d6c624237d38de297)
Reviewed-on: https://gerrit.libreoffice.org/57621
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index c600cdca34b1..7c149d95d94a 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -948,6 +948,12 @@ void ScInterpreter::DoubleRefToVars( const 
formula::FormulaToken* p,
 const ScComplexRefData& rCRef = *p->GetDoubleRef();
 SingleRefToVars( rCRef.Ref1, rCol1, rRow1, rTab1);
 SingleRefToVars( rCRef.Ref2, rCol2, rRow2, rTab2);
+if (rCol2 < rCol1)
+std::swap( rCol2, rCol1);
+if (rRow2 < rRow1)
+std::swap( rRow2, rRow1);
+if (rTab2 < rTab1)
+std::swap( rTab2, rTab1);
 if (!pDok->m_TableOpList.empty())
 {
 ScRange aRange( rCol1, rRow1, rTab1, rCol2, rRow2, rTab2 );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-17 Thread Libreoffice Gerrit user
 sc/source/filter/excel/xestyle.cxx |7 +++
 1 file changed, 7 insertions(+)

New commits:
commit 91eec155eb9433343c7e549907960855b6e91e7b
Author: Markus Mohrhard 
AuthorDate: Mon Jul 16 00:43:02 2018 +0200
Commit: Eike Rathke 
CommitDate: Tue Jul 17 11:48:41 2018 +0200

tdf#113646, export font size for dxf records

Change-Id: I6dd6b0ef858fd933603be4435f7810c739b72ef0
Reviewed-on: https://gerrit.libreoffice.org/57471
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 14c2ca1b4efad2dcdc40e6d5c218cedd487857aa)
Reviewed-on: https://gerrit.libreoffice.org/57529
Reviewed-by: Eike Rathke 

diff --git a/sc/source/filter/excel/xestyle.cxx 
b/sc/source/filter/excel/xestyle.cxx
index dd74300e4774..f8c077ce7860 100644
--- a/sc/source/filter/excel/xestyle.cxx
+++ b/sc/source/filter/excel/xestyle.cxx
@@ -1160,6 +1160,13 @@ void XclExpDxfFont::SaveXml(XclExpXmlStream& rStrm)
 FSEND);
 }
 
+if (maDxfData.nFontHeight)
+{
+rStyleSheet->singleElement(XML_sz,
+XML_val, OString::number(*maDxfData.nFontHeight/20).getStr(),
+FSEND);
+}
+
 if (maDxfData.eUnder)
 {
 const char* pVal = getUnderlineOOXValue(maDxfData.eUnder.get());
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-16 Thread Libreoffice Gerrit user
 sc/source/filter/excel/xecontent.cxx |   54 ++-
 1 file changed, 53 insertions(+), 1 deletion(-)

New commits:
commit 62aae6918e33a2535462d1e7be2278a7f9745009
Author: Markus Mohrhard 
AuthorDate: Sat Jul 14 15:16:46 2018 +0200
Commit: Eike Rathke 
CommitDate: Mon Jul 16 18:23:39 2018 +0200

tdf#117816, work around MS Excel bug with containsText cond format

This is a combination o the following two master commits:

tdf#117816, work around MS Excel bug with containsText cond format

Excel seems to require the formula that is equal to the containsText
condition.

According to cfRule (18.3.1.10) "Only rules with a type attribute
 value of expression support formula syntax." which contradicts the
MS EXCEL behavior.

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

related tdf#117816, add more work arounds for MS Excel bugs

Another set of cases where MS Excel needs the formula.

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

diff --git a/sc/source/filter/excel/xecontent.cxx 
b/sc/source/filter/excel/xecontent.cxx
index 8cd7de4b5066..aa92499f135b 100644
--- a/sc/source/filter/excel/xecontent.cxx
+++ b/sc/source/filter/excel/xecontent.cxx
@@ -936,6 +936,50 @@ bool IsTextRule(ScConditionMode eMode)
 return false;
 }
 
+bool RequiresFixedFormula(ScConditionMode eMode)
+{
+switch(eMode)
+{
+case ScConditionMode::NoError:
+case ScConditionMode::Error:
+case ScConditionMode::BeginsWith:
+case ScConditionMode::EndsWith:
+case ScConditionMode::ContainsText:
+case ScConditionMode::NotContainsText:
+return true;
+default:
+break;
+}
+
+return false;
+}
+
+OString GetFixedFormula(ScConditionMode eMode, const ScAddress& rAddress, 
const OString& rText)
+{
+OStringBuffer aBuffer;
+OStringBuffer aPosBuffer = XclXmlUtils::ToOString(aBuffer, rAddress);
+OString aPos = aPosBuffer.makeStringAndClear();
+switch (eMode)
+{
+case ScConditionMode::Error:
+return "";
+case ScConditionMode::NoError:
+return "";
+case ScConditionMode::BeginsWith:
+return OString("LEFT(" + aPos + ",LEN(\"" + rText + "\"))=\"" + 
rText + "\"");
+case ScConditionMode::EndsWith:
+return OString("RIGHT(" + aPos +",LEN(\"" + rText + "\"))=\"" + 
rText + "\"");
+case ScConditionMode::ContainsText:
+return OString("NOT(ISERROR(SEARCH(\"" + rText + "\"," + aPos + 
")))");
+case ScConditionMode::NotContainsText:
+return OString("ISERROR(SEARCH(\"" +  rText + "\"," + aPos + "))");
+default:
+break;
+}
+
+return OString("");
+}
+
 }
 
 void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
@@ -981,7 +1025,15 @@ void XclExpCFImpl::SaveXml( XclExpXmlStream& rStrm )
 XML_text, aText.getStr(),
 XML_dxfId, OString::number( GetDxfs().GetDxfId( 
mrFormatEntry.GetStyle() ) ).getStr(),
 FSEND );
-if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
+
+if (RequiresFixedFormula(eOperation))
+{
+rWorksheet->startElement( XML_formula, FSEND );
+OString aFormula = GetFixedFormula(eOperation, 
mrFormatEntry.GetValidSrcPos(), aText);
+rWorksheet->writeEscaped(aFormula.getStr());
+rWorksheet->endElement( XML_formula );
+}
+else if(!IsTextRule(eOperation) && !IsTopBottomRule(eOperation))
 {
 rWorksheet->startElement( XML_formula, FSEND );
 std::unique_ptr 
pTokenArray(mrFormatEntry.CreateFlatCopiedTokenArray(0));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-16 Thread Libreoffice Gerrit user
 sc/source/core/data/docpool.cxx |   33 ++---
 1 file changed, 22 insertions(+), 11 deletions(-)

New commits:
commit aa79f08a2ef5b9390b7e9ad91b3fe2da200bfe32
Author: Markus Mohrhard 
AuthorDate: Mon Jul 16 00:38:58 2018 +0200
Commit: Eike Rathke 
CommitDate: Mon Jul 16 18:00:56 2018 +0200

related tdf#113646, keep cjk, ctl font items in sync

If the default style and default pool items are no longer in sync,
our script detection assumes that any style without an explicitly
set font has script type CTL or CJK.

Use the same selection idea for both cases and at the same time
use the *_SPREADSHEET font items for the default pool items.

Change-Id: I6a5bb14a3fabab11627ad52b9e79554fdcedac89
Reviewed-on: https://gerrit.libreoffice.org/57470
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit 952cbfd2de0801081665a8ff05600eb7ea1cf82f)
Reviewed-on: https://gerrit.libreoffice.org/57473
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/data/docpool.cxx b/sc/source/core/data/docpool.cxx
index 587f666116ad..4b12fb9e1442 100644
--- a/sc/source/core/data/docpool.cxx
+++ b/sc/source/core/data/docpool.cxx
@@ -74,10 +74,24 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 // ATTR_FONT_TWOLINES (not used) was changed to ATTR_USERDEF (not saved in 
binary format) in 641c
 
+namespace {
+
+SvxFontItem* getDefaultFontItem(LanguageType eLang, DefaultFontType nFontType, 
sal_uInt16 nItemId)
+{
+vcl::Font aDefFont = OutputDevice::GetDefaultFont( nFontType, eLang, 
GetDefaultFontFlags::OnlyOne );
+SvxFontItem* pNewItem = new SvxFontItem( aDefFont.GetFamilyType(), 
aDefFont.GetFamilyName(), aDefFont.GetStyleName(),
+aDefFont.GetPitch(), aDefFont.GetCharSet(), nItemId );
+
+return pNewItem;
+}
+
+}
+
 static SfxItemInfo const  aItemInfos[] =
 {
 { SID_ATTR_CHAR_FONT,   true },// ATTR_FONT
@@ -179,18 +193,15 @@ ScDocumentPool::ScDocumentPool()
 mvPoolDefaults(ATTR_ENDINDEX-ATTR_STARTINDEX+1),
 mnCurrentMaxKey(0)
 {
+
+LanguageType nDefLang, nCjkLang, nCtlLang;
+bool bAutoSpell;
+ScModule::GetSpellSettings( nDefLang, nCjkLang, nCtlLang, bAutoSpell );
+
 //  latin font from GetDefaultFonts is not used, 
DEFAULTFONT_LATIN_SPREADSHEET instead
-vcl::Font aStdFont = OutputDevice::GetDefaultFont( 
DefaultFontType::LATIN_SPREADSHEET, LANGUAGE_ENGLISH_US,
-
GetDefaultFontFlags::OnlyOne );
-SvxFontItem* pStdFont = new SvxFontItem( aStdFont.GetFamilyType(),
-aStdFont.GetFamilyName(), 
aStdFont.GetStyleName(),
-aStdFont.GetPitch(), 
aStdFont.GetCharSet(),
-ATTR_FONT );
-
-SvxFontItem* pCjkFont = new SvxFontItem( ATTR_CJK_FONT );
-SvxFontItem* pCtlFont = new SvxFontItem( ATTR_CTL_FONT );
-SvxFontItem aDummy( ATTR_FONT );
-GetDefaultFonts( aDummy, *pCjkFont, *pCtlFont );
+SvxFontItem* pStdFont = getDefaultFontItem(nDefLang, 
DefaultFontType::LATIN_SPREADSHEET, ATTR_FONT);
+SvxFontItem* pCjkFont = getDefaultFontItem(nCjkLang, 
DefaultFontType::CJK_SPREADSHEET, ATTR_CJK_FONT);
+SvxFontItem* pCtlFont = getDefaultFontItem(nCtlLang, 
DefaultFontType::CTL_SPREADSHEET, ATTR_CTL_FONT);
 
 SvxBoxInfoItem* pGlobalBorderInnerAttr = new SvxBoxInfoItem( 
ATTR_BORDER_INNER );
 auto pSet = o3tl::make_unique( *this, 
svl::Items{} );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-14 Thread Libreoffice Gerrit user
 sc/source/core/opencl/formulagroupcl.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 75181d83c1eb2d9683eaa2ea6290826435c99001
Author: Luboš Luňák 
AuthorDate: Thu Jul 5 12:09:34 2018 +0200
Commit: Eike Rathke 
CommitDate: Sat Jul 14 22:22:18 2018 +0200

disable OpenCL for XIRR

The function actually fails with sc/qa/.../xirr.fods if OpenCL is forced
(and mnOpenCLMinimumFormulaGroupSize is disabled). As far as I can tell
the OpenCL function gets the proper data and returns incorect data,
so it's the function itself that is buggy. No idea how to debug it,
feel free to.

Change-Id: I8879c6fdcfe8ecd2bc40fd3e0d1c13cddb1c2051
Reviewed-on: https://gerrit.libreoffice.org/57002
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 406ebf8e36ab1d1e10fb1d55101d7fc66add0c4b)
Reviewed-on: https://gerrit.libreoffice.org/57227
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 84ee1cc30798..2106e2288aad 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3136,11 +3136,11 @@ 
DynamicKernelSoPArguments::DynamicKernelSoPArguments(const ScCalcConfig& config,
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i],
 new OpMDuration, nResultSize));
 }
-else if (pChild->GetExternal() == 
"com.sun.star.sheet.addin.Analysis.getXirr")
+/*else if (pChild->GetExternal() == 
"com.sun.star.sheet.addin.Analysis.getXirr")
 {
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts, 
ft->Children[i],
 new OpXirr, nResultSize));
-}
+}*/
 else if (pChild->GetExternal() == 
"com.sun.star.sheet.addin.Analysis.getOddlprice")
 {
 mvSubArguments.push_back(SoPHelper(mCalcConfig, ts,
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-13 Thread Libreoffice Gerrit user
 sc/source/core/tool/interpr1.cxx |   34 +-
 1 file changed, 33 insertions(+), 1 deletion(-)

New commits:
commit 2dc7a3b7515ffd6181d740aca4ad6e0549ea4a3a
Author: Eike Rathke 
AuthorDate: Tue Jul 10 15:58:17 2018 +0200
Commit: Markus Mohrhard 
CommitDate: Fri Jul 13 22:00:45 2018 +0200

Resolves: tdf#118624 let RAND() in array/matrix mode fill a matrix

... instead of only top left that is referenced for other
elements.

Change-Id: I718946d7e4327b152e2d9f80712395fd7ab67dee
Reviewed-on: https://gerrit.libreoffice.org/57235
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 8afccbd129ecda81ff00dd2c6e5e10af254ae0ef)
Reviewed-on: https://gerrit.libreoffice.org/57247
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 33cd8c3f840e..c83951d59b79 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1733,7 +1733,39 @@ void ScInterpreter::ScPi()
 
 void ScInterpreter::ScRandom()
 {
-PushDouble(::comphelper::rng::uniform_real_distribution());
+if (bMatrixFormula && pMyFormulaCell)
+{
+SCCOL nCols;
+SCROW nRows;
+pMyFormulaCell->GetMatColsRows( nCols, nRows);
+// ScViewFunc::EnterMatrix() might be asking for
+// ScFormulaCell::GetResultDimensions(), which here are none so create
+// a 1x1 matrix at least which exactly is the case when EnterMatrix()
+// asks for a not selected range.
+if (nCols == 0)
+nCols = 1;
+if (nRows == 0)
+nRows = 1;
+ScMatrixRef pResMat = GetNewMat( static_cast(nCols), 
static_cast(nRows));
+if (!pResMat)
+PushError( FormulaError::MatrixSize);
+else
+{
+for (SCCOL i=0; i < nCols; ++i)
+{
+for (SCROW j=0; j < nRows; ++j)
+{
+pResMat->PutDouble( 
comphelper::rng::uniform_real_distribution(),
+static_cast(i), static_cast(j));
+}
+}
+PushMatrix( pResMat);
+}
+}
+else
+{
+PushDouble( comphelper::rng::uniform_real_distribution());
+}
 }
 
 void ScInterpreter::ScTrue()
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-12 Thread Eike Rathke
 sc/source/ui/navipi/content.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c73b9d69abf1b26dc2c6f9d6700b2a5f2c9e6f36
Author: Eike Rathke 
Date:   Thu Jul 12 13:24:57 2018 +0200

SvTreeListBox::DoubleClickHdl: Navigator return more to be done, tdf#117063

Change-Id: I2b232cd9ea791273e8a776bf88fa45ee0ad5edf0
(cherry picked from commit 08ac6e6f991cffcb1fed7bd1bb4ec67e94817507)
Reviewed-on: https://gerrit.libreoffice.org/57329
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 

diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 34df68b39cd9..3f8271c43999 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -438,7 +438,7 @@ IMPL_LINK_NOARG(ScContentTree, ContentDoubleClickHdl, 
SvTreeListBox*, bool)
 ScNavigatorDlg::ReleaseFocus(); // set focus into document
 }
 
-return false;
+return true;
 }
 
 void ScContentTree::MouseButtonDown( const MouseEvent& rMEvt )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-09 Thread Eike Rathke
 sc/source/ui/view/cellsh1.cxx |   14 +-
 1 file changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 822add7e1de83ba3a405c1927cb0924c7d6a748a
Author: Eike Rathke 
Date:   Mon Jul 9 19:31:26 2018 +0200

Resolves: tdf#118638 preset include format patterns for anonymous subtotals

Change-Id: I48bc9d5e2bbdee58687dd87e38cad8e9af9de408
Reviewed-on: https://gerrit.libreoffice.org/57194
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit bf34c041ed1869e7e544cf75966c9f42960cb2d3)
Reviewed-on: https://gerrit.libreoffice.org/57206
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index 3f9a13c03e62..f489346019c1 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -2998,12 +2998,17 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
 ScSubTotalParam aSubTotalParam;
 SfxItemSet aArgSet( GetPool(), svl::Items{} );
 
+bool bAnonymous;
+
 // Only get existing named database range.
 ScDBData* pDBData = pTabViewShell->GetDBData(true, SC_DB_OLD);
-if (!pDBData)
+if (pDBData)
+bAnonymous = false;
+else
 {
 // No existing DB data at this position.  Create an
 // anonymous DB.
+bAnonymous = true;
 pDBData = pTabViewShell->GetAnonymousDBData();
 ScRange aDataRange;
 pDBData->GetArea(aDataRange);
@@ -3012,6 +3017,13 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
 
 pDBData->GetSubTotalParam( aSubTotalParam );
 aSubTotalParam.bRemoveOnly = false;
+if (bAnonymous)
+{
+// Preset sort formatting along with values and also create formula
+// cells with "needs formatting". Subtotals on data of different types
+// doesn't make much sense anyway.
+aSubTotalParam.bIncludePattern = true;
+}
 
 aArgSet.Put( ScSubTotalItem( SCITEM_SUBTDATA, GetViewData(), 
 ) );
 ScAbstractDialogFactory* pFact = ScAbstractDialogFactory::Create();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-09 Thread bvarga91
 sc/source/ui/vba/vbaworkbooks.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 9837faeaab59e030e500ed21da92dd6bed2806fe
Author: bvarga91 
Date:   Thu Jul 5 23:14:01 2018 +0200

tdf#118153 VBA Macro: add XLSX support to Workbooks.Open

by accepting "MS Excel 2007 XML" in isSpreadSheetFile().

Test example:

Workbooks.Open Filename:="/tmp/test.xlsx"

Change-Id: Id7102325c96842bb413b1fb7bb8162e8bca41f4e
Reviewed-on: https://gerrit.libreoffice.org/57030
Reviewed-by: László Németh 
Tested-by: László Németh 
(cherry picked from commit fc434c8fd62ccb6d083af075f1ab83da6bd76b8d)
Reviewed-on: https://gerrit.libreoffice.org/57174
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/ui/vba/vbaworkbooks.cxx 
b/sc/source/ui/vba/vbaworkbooks.cxx
index 03be645b2487..9ca8f9610eea 100644
--- a/sc/source/ui/vba/vbaworkbooks.cxx
+++ b/sc/source/ui/vba/vbaworkbooks.cxx
@@ -169,6 +169,7 @@ ScVbaWorkbooks::isSpreadSheetFile( const OUString& sType )
 {
 // include calc_QPro etc. ? ( not for the moment anyway )
 return sType.startsWith( "calc_MS" )
+  || sType.startsWith( "MS Excel" )
   || sType.startsWith( "calc8" )
   || sType.startsWith( "calc_StarOffice" );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

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

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


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

2018-07-07 Thread Eike Rathke
 sc/source/ui/undo/undotab.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit f9bc663d8d33d00ba3019151c82f0710b199d387
Author: Eike Rathke 
Date:   Fri Jul 6 15:33:08 2018 +0200

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

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

diff --git a/sc/source/ui/undo/undotab.cxx b/sc/source/ui/undo/undotab.cxx
index 8b27f5b317ed..e5b976e07374 100644
--- a/sc/source/ui/undo/undotab.cxx
+++ b/sc/source/ui/undo/undotab.cxx
@@ -1256,6 +1256,8 @@ void ScUndoTabProtect::DoProtect(bool bProtect)
 ScTabViewShell* pViewShell = ScTabViewShell::GetActiveViewShell();
 if (pViewShell)
 {
+if (ScTabView* pTabView = pViewShell->GetViewData().GetView())
+pTabView->SetTabProtectionSymbol( mnTab, bProtect);
 pViewShell->UpdateLayerLocks();
 pViewShell->UpdateInputHandler(true);   // so that input can be 
immediately entered again
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-06 Thread Eike Rathke
 sc/source/ui/view/viewfunc.cxx |   11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 3eeb0096ac7c5beb48441eabc032cde38745a549
Author: Eike Rathke 
Date:   Fri Jul 6 14:53:10 2018 +0200

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

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

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

diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index e7c8be1aa0d9..0b5103924185 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2487,12 +2487,14 @@ void ScViewFunc::ProtectSheet( SCTAB nTab, const 
ScTableProtection& rProtect )
 
 ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
 for (; itr != itrEnd; ++itr)
+{
 rFunc.ProtectSheet(*itr, rProtect);
+SetTabProtectionSymbol(*itr, true);
+}
 
 if (bUndo)
 pDocSh->GetUndoManager()->LeaveListAction();
 
-SetTabProtectionSymbol(nTab, true);
 UpdateLayerLocks(); //! broadcast to all views
 }
 
@@ -2550,8 +2552,13 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& 
rPassword )
 
 ScMarkData::iterator itr = rMark.begin(), itrEnd = rMark.end();
 for (; itr != itrEnd; ++itr)
+{
 if ( rFunc.Unprotect( *itr, rPassword, false ) )
-bChanged = true;
+{
+bChanged = true;
+SetTabProtectionSymbol( *itr, false);
+}
+}
 
 if (bUndo)
 pDocSh->GetUndoManager()->LeaveListAction();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-06 Thread Xisco Fauli
 sc/source/ui/view/viewfunc.cxx |5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 16fcf30fa53a55fdcd82826fd4d73bbd1b6bd883
Author: Xisco Fauli 
Date:   Fri Jul 6 11:01:06 2018 +0200

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

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

diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 306d020ec947..e7c8be1aa0d9 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -2557,10 +2557,11 @@ bool ScViewFunc::Unprotect( SCTAB nTab, const OUString& 
rPassword )
 pDocSh->GetUndoManager()->LeaveListAction();
 }
 
-SetTabProtectionSymbol(nTab, false);
-
 if (bChanged)
+{
+SetTabProtectionSymbol(nTab, false);
 UpdateLayerLocks(); //! broadcast to all views
+}
 
 return bChanged;
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-06 Thread Eike Rathke
 sc/source/core/data/table1.cxx |  186 +
 1 file changed, 98 insertions(+), 88 deletions(-)

New commits:
commit e281e2036710ea4f719672ec4ef285161358d27e
Author: Eike Rathke 
Date:   Wed Jul 4 14:43:53 2018 +0200

Limit GetNextPos() loops to range also for nMoveX, tdf#68290 follow-up

 This is a combination of 4 commits.

Remove now moot OSL_ENSURE

Change-Id: Ifaf18cfa74a57898f4762a284ec088ece8b8270e
(cherry picked from commit 2a269251f86b6bed3f24310bca96c796847bd42f)

Turn SAL_WARN into assert

... as it indicates a programming error.

Change-Id: I526846fe695fc7ed28336ea20cdba0c0db2e922a
(cherry picked from commit 4bfa5d08c6ef94706e340f78ea1052e94a8c5915)

Limit GetNextPos() loops to range also for nMoveX, tdf#68290 follow-up

And straighten the code a bit to use one init block and return
early if nothing marked or not protected.

Change-Id: I4c9247479a137cb7f9435180f3f54667d28a29ef
Reviewed-on: https://gerrit.libreoffice.org/57025
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit cef1e0986a66dd95b3fd4cf61c4cda1a1c4c8234)

GetNextPos: init end cols/rows with current pos, tdf#68290 follow-up

Using the added move value to obtain the print area could had
placed them outside of the sheet already.

Change-Id: I5fd97a7dd8ca92ab76cdfbb5c9a2b76ccc3f4c16
(cherry picked from commit c6b601603967b0ddc32755ee29049580696f1a3d)
Reviewed-on: https://gerrit.libreoffice.org/57045
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 9b672f67b054..43d2a4a5c6b5 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1366,67 +1366,73 @@ bool ScTable::SkipRow( const SCCOL nCol, SCROW& rRow, 
const SCROW nMovY,
 void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, SCCOL nMovX, SCROW nMovY,
 bool bMarked, bool bUnprotected, const 
ScMarkData& rMark ) const
 {
-bool bSheetProtected = IsProtected();
+// Ensure bMarked is set only if there is a mark.
+assert( !bMarked || rMark.IsMarked() || rMark.IsMultiMarked());
+
+const bool bSheetProtected = IsProtected();
 
 if ( bUnprotected && !bSheetProtected ) // Is sheet really protected?
 bUnprotected = false;
 
-sal_uInt16 nWrap = 0;
-SCCOL nCol = rCol;
-SCROW nRow = rRow;
-
-nCol = sal::static_int_cast( nCol + nMovX );
-nRow = sal::static_int_cast( nRow + nMovY );
+SCCOL nCol = rCol + nMovX;
+SCROW nRow = rRow + nMovY;
 
-OSL_ENSURE( !nMovY || !bUnprotected,
-"GetNextPos with bUnprotected horizontal not implemented" );
-
-if ( nMovY && (bMarked || bUnprotected))
+SCCOL nStartCol, nEndCol;
+SCROW nStartRow, nEndRow;
+if (bMarked)
 {
-bool  bUp= ( nMovY < 0 );
-const SCCOL nColAdd = (bUp ? -1 : 1);
-SCCOL nStartCol, nEndCol;
-SCROW nStartRow, nEndRow;
-if (bMarked && rMark.IsMarked())
-{
-ScRange aRange( ScAddress::UNINITIALIZED);
+ScRange aRange( ScAddress::UNINITIALIZED);
+if (rMark.IsMarked())
 rMark.GetMarkArea( aRange);
-nStartCol = aRange.aStart.Col();
-nStartRow = aRange.aStart.Row();
-nEndCol = aRange.aEnd.Col();
-nEndRow = aRange.aEnd.Row();
-}
-else if (bMarked && rMark.IsMultiMarked())
-{
-ScRange aRange( ScAddress::UNINITIALIZED);
+else if (rMark.IsMultiMarked())
 rMark.GetMultiMarkArea( aRange);
-nStartCol = aRange.aStart.Col();
-nStartRow = aRange.aStart.Row();
-nEndCol = aRange.aEnd.Col();
-nEndRow = aRange.aEnd.Row();
-}
-else if (bUnprotected)
+else
 {
-nStartCol = 0;
-nStartRow = 0;
-nEndCol = nCol;
-nEndRow = nRow;
-pDocument->GetPrintArea( nTab, nEndCol, nEndRow, true );
-// Add some cols/rows to the print area (which is "content or
-// visually different from empty") to enable travelling through
-// protected forms with empty cells and no visual indicator.
-// 42 might be good enough and not too much..
-nEndCol = std::min( nEndCol+42, MAXCOL);
-nEndRow = std::min( nEndRow+42, MAXROW);
+// Covered by assert() above, but for NDEBUG build.
+if (ValidColRow(nCol,nRow))
+{
+rCol = nCol;
+rRow = nRow;
+}
+return;
 }
-else
+nStartCol = aRange.aStart.Col();
+nStartRow = aRange.aStart.Row();
+nEndCol = aRange.aEnd.Col();
+nEndRow = aRange.aEnd.Row();
+}
+else if (bUnprotected)
+{
+   

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

2018-07-04 Thread Eike Rathke
 sc/source/core/data/table1.cxx |   75 +++--
 1 file changed, 58 insertions(+), 17 deletions(-)

New commits:
commit 7d0426a26f59ecf19a5e58b1554af884ddc56948
Author: Eike Rathke 
Date:   Wed Jul 4 20:43:34 2018 +0200

Limit GetNextPos() loops to range, if available, tdf#68290 follow-up

It's unnecessary to check all columns if there was a range marked
anyway. Also use GetPrintArea() only for bUnprotected and enlarge
the result a bit to cover the case where a protected form may be
empty but not have vidsual indications either.

Also adding nMoveY to nCol was nonsense all the time already, what
was actually meant is to add the direction of movement. Worked by
chance because nMoveY was always +1/-1.

Change-Id: Ic1175a607a1169f3ef0e28d0f3a91f8c526314f4
Reviewed-on: https://gerrit.libreoffice.org/56966
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7903fa04d2d2233fe193eef7dfd3c203430edcc6)
Reviewed-on: https://gerrit.libreoffice.org/56977

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 65b1b288fce7..9b672f67b054 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1384,45 +1384,86 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, 
SCCOL nMovX, SCROW nMovY,
 if ( nMovY && (bMarked || bUnprotected))
 {
 bool  bUp= ( nMovY < 0 );
-SCROW nUsedY = nRow;
-SCCOL nUsedX = nCol;
+const SCCOL nColAdd = (bUp ? -1 : 1);
+SCCOL nStartCol, nEndCol;
+SCROW nStartRow, nEndRow;
+if (bMarked && rMark.IsMarked())
+{
+ScRange aRange( ScAddress::UNINITIALIZED);
+rMark.GetMarkArea( aRange);
+nStartCol = aRange.aStart.Col();
+nStartRow = aRange.aStart.Row();
+nEndCol = aRange.aEnd.Col();
+nEndRow = aRange.aEnd.Row();
+}
+else if (bMarked && rMark.IsMultiMarked())
+{
+ScRange aRange( ScAddress::UNINITIALIZED);
+rMark.GetMultiMarkArea( aRange);
+nStartCol = aRange.aStart.Col();
+nStartRow = aRange.aStart.Row();
+nEndCol = aRange.aEnd.Col();
+nEndRow = aRange.aEnd.Row();
+}
+else if (bUnprotected)
+{
+nStartCol = 0;
+nStartRow = 0;
+nEndCol = nCol;
+nEndRow = nRow;
+pDocument->GetPrintArea( nTab, nEndCol, nEndRow, true );
+// Add some cols/rows to the print area (which is "content or
+// visually different from empty") to enable travelling through
+// protected forms with empty cells and no visual indicator.
+// 42 might be good enough and not too much..
+nEndCol = std::min( nEndCol+42, MAXCOL);
+nEndRow = std::min( nEndRow+42, MAXROW);
+}
+else
+{
+SAL_WARN("sc.core","ScTable::GetNextPos - bMarked but not marked");
+nStartCol = 0;
+nStartRow = 0;
+nEndCol = MAXCOL;
+nEndRow = MAXROW;
+}
 
 if (bMarked)
 nRow = rMark.GetNextMarked( nCol, nRow, bUp );
-pDocument->GetPrintArea( nTab, nUsedX, nUsedY );
 
-while ( SkipRow( nCol, nRow, nMovY, rMark, bUp, nUsedY, bMarked, 
bSheetProtected ))
+while ( SkipRow( nCol, nRow, nMovY, rMark, bUp, nEndRow, bMarked, 
bSheetProtected ))
 ;
 
-while ( nRow < 0 || nRow > MAXROW )
+while ( nRow < nStartRow || nRow > nEndRow )
 {
-nCol = sal::static_int_cast( nCol + 
static_cast(nMovY) );
+nCol += nColAdd;
 
-while ( ValidCol(nCol) && ColHidden(nCol) )
-nCol = sal::static_int_cast( nCol + 
static_cast(nMovY) );   //  skip hidden rows (see above)
-if (nCol < 0)
+while (nStartCol <= nCol && nCol <= nEndCol && ValidCol(nCol) && 
ColHidden(nCol))
+nCol += nColAdd;//  skip hidden cols
+
+if (nCol < nStartCol)
 {
-nCol = (bSheetProtected ? nUsedX : MAXCOL);
+nCol = nEndCol;
 
 if (++nWrap >= 2)
 return;
 }
-else if (nCol > MAXCOL || ( nCol > nUsedX && bSheetProtected ))
+else if (nCol > nEndCol)
 {
-nCol = 0;
+nCol = nStartCol;
 
 if (++nWrap >= 2)
 return;
 }
-if (nRow < 0)
-nRow = MAXROW;
-else if (nRow > MAXROW)
-nRow = 0;
+if (nRow < nStartRow)
+nRow = nEndRow;
+else if (nRow > nEndRow)
+nRow = nStartRow;
 
 if (bMarked)
 nRow = rMark.GetNextMarked( nCol, nRow, bUp );
 
-while ( SkipRow( 

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

2018-07-04 Thread Henry Castro
 sc/source/ui/docshell/docsh.cxx  |  542 +++
 sc/source/ui/docshell/docsh2.cxx |   42 +--
 sc/source/ui/docshell/docsh3.cxx |  152 +-
 sc/source/ui/docshell/docsh4.cxx |  342 
 sc/source/ui/docshell/docsh5.cxx |  228 
 sc/source/ui/docshell/docsh6.cxx |   66 ++--
 sc/source/ui/docshell/docsh8.cxx |   40 +-
 sc/source/ui/inc/docsh.hxx   |   70 ++---
 8 files changed, 741 insertions(+), 741 deletions(-)

New commits:
commit 6d7d6d2474e7c37da25cfb6ec88bfb84eb08b62b
Author: Henry Castro 
Date:   Thu May 31 17:39:26 2018 -0400

sc: prefix members of ScDocShell

Change-Id: I7c2a4e5e850b26da515719f7df869f12c49b0ad3
Reviewed-on: https://gerrit.libreoffice.org/55148
Tested-by: Jenkins 
Reviewed-by: Henry Castro 
Reviewed-on: https://gerrit.libreoffice.org/56650
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 

diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx
index d2ae9a945c18..6fb0b4dc2a52 100644
--- a/sc/source/ui/docshell/docsh.cxx
+++ b/sc/source/ui/docshell/docsh.cxx
@@ -209,7 +209,7 @@ void ScDocShell::FillClass( SvGlobalName* pClassName,
 
 std::set ScDocShell::GetDocColors()
 {
-return aDocument.GetDocColors();
+return m_aDocument.GetDocColors();
 }
 
 void ScDocShell::DoEnterHandler()
@@ -239,16 +239,16 @@ HiddenInformation ScDocShell::GetHiddenInformationState( 
HiddenInformation nStat
 
 if ( nStates & HiddenInformation::RECORDEDCHANGES )
 {
-if ( aDocument.GetChangeTrack() && 
aDocument.GetChangeTrack()->GetFirst() )
+if ( m_aDocument.GetChangeTrack() && 
m_aDocument.GetChangeTrack()->GetFirst() )
   nState |= HiddenInformation::RECORDEDCHANGES;
 }
 if ( nStates & HiddenInformation::NOTES )
 {
-SCTAB nTableCount = aDocument.GetTableCount();
+SCTAB nTableCount = m_aDocument.GetTableCount();
 bool bFound = false;
 for (SCTAB nTab = 0; nTab < nTableCount && !bFound; ++nTab)
 {
-if (aDocument.HasTabNotes(nTab)) //TODO:
+if (m_aDocument.HasTabNotes(nTab)) //TODO:
 bFound = true;
 }
 
@@ -261,17 +261,17 @@ HiddenInformation ScDocShell::GetHiddenInformationState( 
HiddenInformation nStat
 
 void ScDocShell::BeforeXMLLoading()
 {
-aDocument.EnableIdle(false);
+m_aDocument.EnableIdle(false);
 
 // prevent unnecessary broadcasts and updates
-OSL_ENSURE(pModificator == nullptr, "The Modificator should not exist");
-pModificator = new ScDocShellModificator( *this );
+OSL_ENSURE(m_pModificator == nullptr, "The Modificator should not exist");
+m_pModificator = new ScDocShellModificator( *this );
 
-aDocument.SetImportingXML( true );
-aDocument.EnableExecuteLink( false );   // #i101304# to be safe, prevent 
nested loading from external references
-aDocument.EnableUndo( false );
+m_aDocument.SetImportingXML( true );
+m_aDocument.EnableExecuteLink( false );   // #i101304# to be safe, prevent 
nested loading from external references
+m_aDocument.EnableUndo( false );
 // prevent unnecessary broadcasts and "half way listeners"
-aDocument.SetInsertingFromOtherDoc( true );
+m_aDocument.SetInsertingFromOtherDoc( true );
 }
 
 void ScDocShell::AfterXMLLoading(bool bRet)
@@ -280,22 +280,22 @@ void ScDocShell::AfterXMLLoading(bool bRet)
 {
 UpdateLinks();
 // don't prevent establishing of listeners anymore
-aDocument.SetInsertingFromOtherDoc( false );
+m_aDocument.SetInsertingFromOtherDoc( false );
 if ( bRet )
 {
-ScChartListenerCollection* pChartListener = 
aDocument.GetChartListenerCollection();
+ScChartListenerCollection* pChartListener = 
m_aDocument.GetChartListenerCollection();
 if (pChartListener)
 pChartListener->UpdateDirtyCharts();
 
 // #95582#; set the table names of linked tables to the new path
-SCTAB nTabCount = aDocument.GetTableCount();
+SCTAB nTabCount = m_aDocument.GetTableCount();
 for (SCTAB i = 0; i < nTabCount; ++i)
 {
-if (aDocument.IsLinked( i ))
+if (m_aDocument.IsLinked( i ))
 {
 OUString aName;
-aDocument.GetName(i, aName);
-OUString aLinkTabName = aDocument.GetLinkTab(i);
+m_aDocument.GetName(i, aName);
+OUString aLinkTabName = m_aDocument.GetLinkTab(i);
 sal_Int32 nLinkTabNameLength = aLinkTabName.getLength();
 sal_Int32 nNameLength = aName.getLength();
 if (nLinkTabNameLength < nNameLength)
@@ -326,8 +326,8 @@ void ScDocShell::AfterXMLLoading(bool bRet)
 (aName[nIndex - 1] == '#') && // before 
the table name should be the # char
   

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

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

New commits:
commit 867dec9f720b7f704aef4fd3d560b8015fc776a7
Author: Eike Rathke 
Date:   Wed Jul 4 14:27:38 2018 +0200

Check for HasAttrFlags::Protected instead ATTR_PROTECTION, tdf#68290 
follow-up

ATTR_PROTECTION at ScAttrArray is not sufficient as also
conditional formatting may apply protection to otherwise
unprotected cells. This now actually enables travelling
Enter->Right in the sample document of tdf#68290 to advance to the
next row / first col if at the end of a row for such protected
cells.

This matches what the ScTabView::MoveCursorRel() call then does
via ScTabView::SkipCursorHorizontal() and
ScTabView::SkipCursorVertical() (additionally checking protection
options for selectable cells which should be done in
ScTable::GetNextPos() as well). Actually when getting things
straight the call to MoveCursorRel() may not be needed anymore and
MoveCursorAbs() could be sufficient, but *only* if we can
differentiate between viewshell cursor travel and UNO
gotoNext()/gotoPrevious() calls.

Change-Id: I0fcb0ecd748bbde982b260db4f4696166cfc5e78
Reviewed-on: https://gerrit.libreoffice.org/56947
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 94af1b1100e8b48f755ec66b190d2017aae1dc00)
Reviewed-on: https://gerrit.libreoffice.org/56953

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index e7faf4d87f10..65b1b288fce7 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1303,7 +1303,10 @@ bool ScTable::ValidNextPos( SCCOL nCol, SCROW nRow, 
const ScMarkData& rMark,
 if (bMarked && !rMark.IsCellMarked(nCol,nRow))
 return false;
 
-if (bUnprotected && GetAttr(nCol,nRow,ATTR_PROTECTION)->GetProtection())
+/* TODO: for cursor movement *only* this should even take the protection
+ * options (select locked, select unlocked) into account, see
+ * ScTabView::SkipCursorHorizontal() and ScTabView::SkipCursorVertical(). 
*/
+if (bUnprotected && pDocument->HasAttrib(nCol, nRow, nTab, nCol, nRow, 
nTab, HasAttrFlags::Protected))
 return false;
 
 if (bMarked || bUnprotected)//TODO: also in other case ???
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-04 Thread Luboš Luňák
 sc/source/core/tool/interpr1.cxx |2 ++
 1 file changed, 2 insertions(+)

New commits:
commit 1fcd620eeb0bdc37d110b37e18fe73c144f26d43
Author: Luboš Luňák 
Date:   Tue Jun 26 16:08:41 2018 +0200

use ScInterpreterContext in ScMin()

Otherwise fdo#74583-1 asserts with calc's threading.

Change-Id: I2ba46a15d1d5216b279ae21d92ae52353e470df6
Reviewed-on: https://gerrit.libreoffice.org/56479
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit ceabe204a7547988df8851e5d807ec83105e190c)
Reviewed-on: https://gerrit.libreoffice.org/56515

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index d4bd096e7fe9..dd1aaca90d53 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3561,6 +3561,7 @@ void ScInterpreter::ScMin( bool bTextAsZero )
 FormulaError nErr = FormulaError::NONE;
 PopDoubleRef( aRange, nParamCount, nRefInList);
 ScValueIterator aValIter( pDok, aRange, mnSubTotalFlags, 
bTextAsZero );
+aValIter.SetInterpreterContext(  );
 if (aValIter.GetFirst(nVal, nErr))
 {
 if (nMin > nVal)
@@ -3718,6 +3719,7 @@ void ScInterpreter::ScMax( bool bTextAsZero )
 FormulaError nErr = FormulaError::NONE;
 PopDoubleRef( aRange, nParamCount, nRefInList);
 ScValueIterator aValIter( pDok, aRange, mnSubTotalFlags, 
bTextAsZero );
+aValIter.SetInterpreterContext(  );
 if (aValIter.GetFirst(nVal, nErr))
 {
 if (nMax < nVal)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-03 Thread Eike Rathke
 sc/source/ui/view/output2.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 8bb1ab5c4456526e2411ba8f953e41daef8b429b
Author: Eike Rathke 
Date:   Tue Jul 3 15:00:26 2018 +0200

Resolves: tdf#118221 whole cell kerning default is off

So set that at OutputDevice, there is no cell attribute for
kerning, all kerning on is handled by EditEngine output.

Change-Id: I23ac2b2cf59f3a4651cc9b614df03860a9cb9146
Reviewed-on: https://gerrit.libreoffice.org/56866
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 36eed54d3dfed6551fd2ad944feff7e217c56e82)
Reviewed-on: https://gerrit.libreoffice.org/56877

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 49bfb0670dc4..3dfaaa9889f9 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -392,6 +392,10 @@ void ScDrawStringsVars::SetPattern(
 if (pOutput->mbSyntaxMode)
 pOutput->SetSyntaxColor(, rCell);
 
+// There is no cell attribute for kerning, default is kerning OFF, all
+// kerning is stored at an EditText object that is drawn using EditEngine.
+aFont.SetKerning( FontKerning::NONE);
+
 pDev->SetFont( aFont );
 if ( pFmtDevice != pDev )
 pFmtDevice->SetFont( aFont );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-03 Thread Vasily Melenchuk
 sc/source/core/data/dociter.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit dd645e70108f31aab611634e77c120e5efe52d05
Author: Vasily Melenchuk 
Date:   Thu Jun 28 17:44:39 2018 +0300

tdf#118086: calc: invalid row autoheight fixed

RowHeightContext should be initialized for each tab separately.
Reusage of same data was causing invalid heights for next pages.

Change-Id: Ib10518a8eef416e2197d0f6232fc981ce748882b
Reviewed-on: https://gerrit.libreoffice.org/56603
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
(cherry picked from commit e2fce4f05084061efb64e53444ab5d2d0d05b612)
Reviewed-on: https://gerrit.libreoffice.org/56861
Reviewed-by: Christian Lohmaier 

diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 959ffd24610e..3f76513cb8d1 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -2576,13 +2576,13 @@ void ScDocRowHeightUpdater::update()
 Fraction aZoom(1, 1);
 itr = mpTabRangesArray->begin();
 sal_uInt32 nProgressStart = 0;
-sc::RowHeightContext aCxt(mfPPTX, mfPPTY, aZoom, aZoom, mpOutDev);
 for (; itr != itrEnd; ++itr)
 {
 SCTAB nTab = itr->mnTab;
 if (!ValidTab(nTab) || nTab >= mrDoc.GetTableCount() || 
!mrDoc.maTabs[nTab])
 continue;
 
+sc::RowHeightContext aCxt(mfPPTX, mfPPTY, aZoom, aZoom, mpOutDev);
 ScFlatBoolRowSegments::RangeData aData;
 ScFlatBoolRowSegments::RangeIterator aRangeItr(*itr->mpRanges);
 for (bool bFound = aRangeItr.getFirst(aData); bFound; bFound = 
aRangeItr.getNext(aData))
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-03 Thread Luboš Luňák
 sc/source/core/tool/token.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 2c7a550a1e752f7add05381ae5932e1b00d705a5
Author: Luboš Luňák 
Date:   Wed Jun 27 14:14:38 2018 +0200

blacklist ocGetPivotData for calc's threading

There appears to be a lot of caching involved in the code invoked
by ScGetPivotData(). Testcase is e.g. tdf#89186-1 (with minimal
formula size disabled again).

Change-Id: If7e2a972898c358dc8f80cf238f8d5ccf541f16d
Reviewed-on: https://gerrit.libreoffice.org/56525
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 7e1cabd96526cb7befc5ea5073358093efbe12d0)
Reviewed-on: https://gerrit.libreoffice.org/56565
Reviewed-by: Miklos Vajna 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index f7f285e488ad..691188f80d33 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1323,7 +1323,8 @@ void ScTokenArray::CheckForThreading( const FormulaToken& 
r )
 ocDBSum,
 ocExternal,
 ocDde,
-ocWebservice
+ocWebservice,
+ocGetPivotData
 });
 
 // Don't enable threading once we decided to disable it.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-03 Thread Mike Kaganski
 sc/source/filter/oox/formulabuffer.cxx |   22 +++---
 1 file changed, 19 insertions(+), 3 deletions(-)

New commits:
commit ee0d0b0d21889441dec04c3b17fc99087cf8ef96
Author: Mike Kaganski 
Date:   Fri Jun 29 20:08:50 2018 +1000

tdf#118441: also keep string-formula results for shared formulas

... like it is done for normal cells.
So, the cells that have markup like



Test(B2:Z2)
0





0



now are handled (wrt restoring the stored result value) just like
cells with this markup without sharing have long been handled:



Test(B1:Z1)
0



Change-Id: Ifcf62cf6d073faff310aa8553c6f57f42ae588cc
Reviewed-on: https://gerrit.libreoffice.org/56675
Tested-by: Jenkins
Reviewed-by: Mike Kaganski 
(cherry picked from commit e6c43ed9e6bb41b64bcc8105ad006c999deebcd7)
Reviewed-on: https://gerrit.libreoffice.org/56756
Reviewed-by: Eike Rathke 

diff --git a/sc/source/filter/oox/formulabuffer.cxx 
b/sc/source/filter/oox/formulabuffer.cxx
index 0e5a5f796be8..f09a11244de9 100644
--- a/sc/source/filter/oox/formulabuffer.cxx
+++ b/sc/source/filter/oox/formulabuffer.cxx
@@ -109,7 +109,8 @@ void applySharedFormulas(
 ScDocumentImport& rDoc,
 SvNumberFormatter& rFormatter,
 std::vector& rSharedFormulas,
-std::vector& rCells )
+std::vector& rCells,
+bool bGeneratorKnownGood)
 {
 sc::SharedFormulaGroups aGroups;
 {
@@ -132,6 +133,7 @@ void applySharedFormulas(
 }
 
 {
+svl::SharedStringPool& rStrPool = rDoc.getDoc().GetSharedStringPool();
 // Process formulas that use shared formulas.
 for (const FormulaBuffer::SharedFormulaDesc& rDesc : rCells)
 {
@@ -149,7 +151,7 @@ void applySharedFormulas(
 continue;
 }
 
-// Set cached formula results. For now, we only use numeric
+// Set cached formula results. For now, we only use numeric and 
string-formula
 // results. Find out how to utilize cached results of other types.
 switch (rDesc.mnValueType)
 {
@@ -157,6 +159,19 @@ void applySharedFormulas(
 // numeric value.
 pCell->SetResultDouble(rDesc.maCellValue.toDouble());
 break;
+case XML_str:
+if (bGeneratorKnownGood)
+{
+// See applyCellFormulaValues
+svl::SharedString aSS = 
rStrPool.intern(rDesc.maCellValue);
+pCell->SetResultToken(new 
formula::FormulaStringToken(aSS));
+// If we don't reset dirty, then e.g. disabling macros 
makes all cells
+// that use macro functions to show #VALUE!
+pCell->ResetDirty();
+pCell->SetChanged(false);
+break;
+}
+SAL_FALLTHROUGH;
 default:
 // Mark it for re-calculation.
 pCell->SetDirty();
@@ -291,7 +306,8 @@ void processSheetFormulaCells(
 const Sequence& rExternalLinks, bool bGeneratorKnownGood 
)
 {
 if (rItem.mpSharedFormulaEntries && rItem.mpSharedFormulaIDs)
-applySharedFormulas(rDoc, rFormatter, *rItem.mpSharedFormulaEntries, 
*rItem.mpSharedFormulaIDs);
+applySharedFormulas(rDoc, rFormatter, *rItem.mpSharedFormulaEntries,
+*rItem.mpSharedFormulaIDs, bGeneratorKnownGood);
 
 if (rItem.mpCellFormulas)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-07-02 Thread Eike Rathke
 sc/source/ui/dbgui/scuiasciiopt.cxx |   30 
 sc/source/ui/docshell/impex.cxx |   54 +---
 sc/source/ui/inc/impex.hxx  |   13 
 sc/source/ui/inc/scuiasciiopt.hxx   |3 +-
 4 files changed, 83 insertions(+), 17 deletions(-)

New commits:
commit 33b7319e2e08812a2f7d3126e4b1ec90875d6165
Author: Eike Rathke 
Date:   Mon Jul 2 14:41:59 2018 +0200

Resolves: tdf#56910 detect a Space (blank) separator if not selected

On populating the CSV import dialog for the first time attempt to
detect a possible space (blank) separator if field separators
don't include it already. This can be necessary because of the
"accept broken misquoted CSV fields" feature that tries to ignore
trailing blanks after a quoted field and if no separator follows
continues to add content to the field assuming the single double
quote was in error. If this blank separator is detected it is
added to field separators and the line and subsequent lines are
reread with the new separators.

Change-Id: I3c6d74ce8883f1d279a810e800e54b349d85ac71
Reviewed-on: https://gerrit.libreoffice.org/56810
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit c807e7ea7a0725a4d8375eda07d6f70870e0d50a)
Reviewed-on: https://gerrit.libreoffice.org/56814

diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx 
b/sc/source/ui/dbgui/scuiasciiopt.cxx
index b885e9b9c7ec..aeb718be4d08 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -288,7 +288,8 @@ ScImportAsciiDlg::ScImportAsciiDlg( vcl::Window* pParent, 
const OUString& aDatNa
 aColumnUser ( ScResId( SCSTR_COLUMN_USER ) ),
 aTextSepList(SCSTR_TEXTSEP),
 mcTextSep   ( ScAsciiOptions::cDefaultTextSep ),
-meCall(eCall)
+meCall(eCall),
+mbDetectSpaceSep(eCall != SC_TEXTTOCOLUMNS)
 {
 get(pFtCharSet, "textcharset");
 get(pLbCharSet, "charset");
@@ -558,7 +559,7 @@ void ScImportAsciiDlg::dispose()
 ModalDialog::dispose();
 }
 
-bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString  )
+bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString , sal_Unicode& 
rcDetectSep )
 {
 if (nLine >= ASCIIDLG_MAXROWS || !mpDatStream)
 return false;
@@ -591,7 +592,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString 
 )
 break;
 }
 rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators,
-mcTextSep);
+mcTextSep, rcDetectSep);
 mnStreamPos = mpDatStream->Tell();
 mpRowPosArray[++mnRowPosCount] = mnStreamPos;
 } while (nLine >= mnRowPosCount && mpDatStream->good());
@@ -606,7 +607,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, OUString 
 )
 else
 {
 Seek( mpRowPosArray[nLine]);
-rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators, 
mcTextSep);
+rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators, 
mcTextSep, rcDetectSep);
 mnStreamPos = mpDatStream->Tell();
 }
 
@@ -805,6 +806,12 @@ IMPL_LINK( ScImportAsciiDlg, LbColTypeHdl, ListBox&, 
rListBox, void )
 
 IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl, ScCsvTableBox&, void)
 {
+// Checking the separator can only be done once for the very first time
+// when the dialog wasn't already presented to the user.
+// As a side effect this has the benefit that the check is only done on the
+// first set of visible lines.
+sal_Unicode cDetectSep = (mbDetectSpaceSep && !pRbFixed->IsChecked() && 
!pCkbSpace->IsChecked() ? 0 : 0x);
+
 sal_Int32 nBaseLine = mpTableBox->GetFirstVisLine();
 sal_Int32 nRead = mpTableBox->GetVisLineCount();
 // If mnRowPosCount==0, this is an initializing call, read ahead for row
@@ -817,12 +824,25 @@ IMPL_LINK_NOARG(ScImportAsciiDlg, UpdateTextHdl, 
ScCsvTableBox&, void)
 sal_Int32 i;
 for (i = 0; i < nRead; i++)
 {
-if (!GetLine( nBaseLine + i, maPreviewLine[i]))
+if (!GetLine( nBaseLine + i, maPreviewLine[i], cDetectSep))
 break;
 }
 for (; i < CSV_PREVIEW_LINES; i++)
 maPreviewLine[i].clear();
 
+if (mbDetectSpaceSep)
+{
+mbDetectSpaceSep = false;
+if (cDetectSep == ' ')
+{
+// Expect space to be appended by now so all subsequent
+// GetLine()/ReadCsvLine() actually used it.
+assert(maFieldSeparators.endsWith(" "));
+// Preselect Space in UI.
+pCkbSpace->Check();
+}
+}
+
 mpTableBox->Execute( CSVCMD_SETLINECOUNT, mnRowPosCount);
 bool bMergeSep = pCkbAsOnce->IsChecked();
 bool bRemoveSpace = pCkbRemoveSpace->IsChecked();
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index 3b3068764f24..854bc92b9635 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ 

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

2018-06-30 Thread Luboš Luňák
 sc/source/core/tool/interpr1.cxx |   34 --
 1 file changed, 16 insertions(+), 18 deletions(-)

New commits:
commit d90a25d2fe3c6fe46aa3e21ff5cd48aab4251840
Author: Luboš Luňák 
Date:   Fri Jun 22 13:28:25 2018 +0200

thread-safe initialization of transliteration objects

Otherwise causes problem with ooo#70213-3 (and
mnOpenCLMinimumFormulaGroupSize disabled).

Change-Id: I3acfad34476e74595b55a559df5bfd72945a1869
Reviewed-on: https://gerrit.libreoffice.org/56291
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 8617c8ed9047e46808c292bd68e5b573aa7af74d)
Reviewed-on: https://gerrit.libreoffice.org/56451

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 9adedd0729ea..d4bd096e7fe9 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -3388,29 +3388,27 @@ void ScInterpreter::ScChar()
 
 static OUString lcl_convertIntoHalfWidth( const OUString & rStr )
 {
-static bool bFirstASCCall = true;
-static utl::TransliterationWrapper aTrans( 
::comphelper::getProcessComponentContext(), TransliterationFlags::NONE );
-
-if( bFirstASCCall )
-{
-aTrans.loadModuleByImplName( "FULLWIDTH_HALFWIDTH_LIKE_ASC", 
LANGUAGE_SYSTEM );
-bFirstASCCall = false;
-}
-
+// Make the initialization thread-safe. Since another function needs to be 
called, move it all to another
+// function and thread-safely initialize a static reference in this 
function.
+auto init = []() -> utl::TransliterationWrapper&
+{
+static utl::TransliterationWrapper trans( 
::comphelper::getProcessComponentContext(), TransliterationFlags::NONE );
+trans.loadModuleByImplName( "FULLWIDTH_HALFWIDTH_LIKE_ASC", 
LANGUAGE_SYSTEM );
+return trans;
+};
+static utl::TransliterationWrapper& aTrans( init());
 return aTrans.transliterate( rStr, 0, sal_uInt16( rStr.getLength() ) );
 }
 
 static OUString lcl_convertIntoFullWidth( const OUString & rStr )
 {
-static bool bFirstJISCall = true;
-static utl::TransliterationWrapper aTrans( 
::comphelper::getProcessComponentContext(), TransliterationFlags::NONE );
-
-if( bFirstJISCall )
-{
-aTrans.loadModuleByImplName( "HALFWIDTH_FULLWIDTH_LIKE_JIS", 
LANGUAGE_SYSTEM );
-bFirstJISCall = false;
-}
-
+auto init = []() -> utl::TransliterationWrapper&
+{
+static utl::TransliterationWrapper trans( 
::comphelper::getProcessComponentContext(), TransliterationFlags::NONE );
+trans.loadModuleByImplName( "HALFWIDTH_FULLWIDTH_LIKE_JIS", 
LANGUAGE_SYSTEM );
+return trans;
+};
+static utl::TransliterationWrapper& aTrans( init());
 return aTrans.transliterate( rStr, 0, sal_uInt16( rStr.getLength() ) );
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-29 Thread Nickson Thanda
 sc/source/ui/app/inputhdl.cxx |   31 ++-
 1 file changed, 22 insertions(+), 9 deletions(-)

New commits:
commit 828cea44d910d8f0e27519b4283c9038bcb022ac
Author: Nickson Thanda 
Date:   Thu Jun 14 17:13:26 2018 +0100

tdf#36867 - Undo autocapitalization when inserting a cell in Calc

Change-Id: Ia70144d6c86b1b08e14425bf537e9c39d585a614
Reviewed-on: https://gerrit.libreoffice.org/55820
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 0e0ceebc0d6facf803ad089ef38d559355407c54)
Reviewed-on: https://gerrit.libreoffice.org/56590

diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 54f6acb4bbeb..adb1c2437cac 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -2628,6 +2628,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode 
)
 boolbForget = false; // Remove due to validity?
 
 OUString aString = GetEditText(mpEditEngine.get());
+OUString aPreAutoCorrectString(aString);
 EditView* pActiveView = pTopView ? pTopView : pTableView;
 if (bModified && pActiveView && !aString.isEmpty() && 
!lcl_IsNumber(aString))
 {
@@ -2648,6 +2649,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode 
)
 aString = GetEditText(mpEditEngine.get());
 }
 lcl_RemoveTabs(aString);
+lcl_RemoveTabs(aPreAutoCorrectString);
 
 // Test if valid (always with simple string)
 if ( bModified && nValidation && pActiveViewSh )
@@ -2871,12 +2873,14 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode )
 
 if (bOldMod && !bProtected && !bForget)
 {
+bool bInsertPreCorrectedString = true;
 // No typographic quotes in formulas
 if (aString.startsWith("="))
 {
 SvxAutoCorrect* pAuto = SvxAutoCorrCfg::Get().GetAutoCorrect();
 if ( pAuto )
 {
+bInsertPreCorrectedString = false;
 OUString aReplace(pAuto->GetStartDoubleQuote());
 if( aReplace.isEmpty() )
 aReplace = 
ScGlobal::pLocaleData->getDoubleQuotationMarkStart();
@@ -2915,17 +2919,26 @@ void ScInputHandler::EnterHandler( ScEnterMode 
nBlockMode )
 else if ( nBlockMode == ScEnterMode::MATRIX )
 nId = FID_INPUTLINE_MATRIX;
 
-ScInputStatusItem aItem( FID_INPUTLINE_STATUS,
- aCursorPos, aCursorPos, aCursorPos,
- aString, pObject.get() );
-
-if (!aMisspellRanges.empty())
-aItem.SetMisspellRanges();
-
 const SfxPoolItem* aArgs[2];
-aArgs[0] = 
 aArgs[1] = nullptr;
-rBindings.Execute( nId, aArgs );
+
+if ( bInsertPreCorrectedString && aString != aPreAutoCorrectString 
)
+{
+   ScInputStatusItem aItem(FID_INPUTLINE_STATUS,
+   aCursorPos, aCursorPos, aCursorPos,
+   aPreAutoCorrectString, pObject.get());
+aArgs[0] = 
+rBindings.Execute(nId, aArgs);
+}
+
+ScInputStatusItem aItemCorrected(FID_INPUTLINE_STATUS,
+ aCursorPos, aCursorPos, 
aCursorPos,
+ aString, pObject.get());
+if ( !aMisspellRanges.empty() )
+aItemCorrected.SetMisspellRanges();
+
+aArgs[0] = 
+rBindings.Execute(nId, aArgs);
 }
 
 pLastState.reset(); // pLastState still contains the old text
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-29 Thread Stephan Bergmann
 sc/source/core/data/document.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit c82a56901b2075a741e43eb20f3483da8ecadd80
Author: Stephan Bergmann 
Date:   Wed Jun 27 09:20:38 2018 +0200

Null deref in ScDocument::IsClipboardSource

Appears to be a regression introduced with
b6b1ded0a0539e7be1b5338de378a3276a6ff445 "sc: replace ScCaptionPtr with
std::shared_ptr, tdf#117997, tdf#117228".  Reported e.g. as
 during
CppunitTest_sc_subsequent_export_test and CppunitTest_sc_ucalc:

> /sc/source/core/data/document.cxx:2574:28: runtime error: member call on 
null pointer of type 'ScDocShell'
> #0 0x2b9971542d76 in ScDocument::IsClipboardSource() const 
/sc/source/core/data/document.cxx:2574:28
> #1 0x2b99722b7762 in ScFormulaCell::ScFormulaCell(ScFormulaCell 
const&, ScDocument&, ScAddress const&, ScCloneFlags) 
/sc/source/core/data/formulacell.cxx:844:14
> #2 0x2b996fee35b0 in ScCellValue::assign(ScCellValue const&, 
ScDocument&, ScCloneFlags) /sc/source/core/data/cellvalue.cxx:395:29
> #3 0x2b997312db22 in ScChangeTrack::Clone(ScDocument*) const 
/sc/source/core/tool/chgtrack.cxx:4565:25
> #4 0x2b99cd1728be in XclExpChangeTrack::CreateTempChangeTrack() 
/sc/source/filter/xcl97/XclExpChangeTrack.cxx:1561:12
> #5 0x2b99cd169a74 in XclExpChangeTrack::XclExpChangeTrack(XclExpRoot 
const&) /sc/source/filter/xcl97/XclExpChangeTrack.cxx:1418:39
> #6 0x2b99cab087c0 in ExcDocument::ReadDoc() 
/sc/source/filter/excel/excdoc.cxx:788:41
> #7 0x2b99cadddc2e in ExportBiff5::Write() 
/sc/source/filter/excel/expop2.cxx:112:5
> #8 0x2b99cab8ee83 in lcl_ExportExcelBiff(SfxMedium&, ScDocument*, 
SvStream*, bool, unsigned short) /sc/source/filter/excel/excel.cxx:181:16
> #9 0x2b99cab8d342 in 
ScFormatFilterPluginImpl::ScExportExcel5(SfxMedium&, ScDocument*, 
ExportFormatExcel, unsigned short) /sc/source/filter/excel/excel.cxx:219:16
> #10 0x2b99768df9d2 in ScDocShell::ConvertTo(SfxMedium&) 
/sc/source/ui/docshell/docsh.cxx:2419:30
> #11 0x2b998a7e2550 in SfxObjectShell::SaveTo_Impl(SfxMedium&, 
SfxItemSet const*) /sfx2/source/doc/objstor.cxx:1513:19
> #12 0x2b998a7fe5e2 in SfxObjectShell::DoSaveAs(SfxMedium&) 
/sfx2/source/doc/objstor.cxx:1900:17
> #13 0x2b9985a31bb6 in ScBootstrapFixture::saveAndReload(ScDocShell*, 
rtl::OUString const&, rtl::OUString const&, rtl::OUString const&, 
SfxFilterFlags) /sc/qa/unit/helper/qahelper.cxx:664:5
> #14 0x2b9985a34593 in ScBootstrapFixture::saveAndReload(ScDocShell*, 
int) /sc/qa/unit/helper/qahelper.cxx:686:28
> #15 0x2b9956fca835 in ScExportTest::testTrackChangesSimpleXLSX() 
/sc/qa/unit/subsequent_export-test.cxx:2618:29
> #16 0x2b9957203058 in void std::_Mem_fn_base::operator()<, void>(ScExportTest*) const 
/home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:600:11
> #17 0x2b9957202d63 in void std::_Bind (ScExportTest*)>::__call(std::tuple<>&&, 
std::_Index_tuple<0ul>) 
/home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:1073:11
> #18 0x2b9957202771 in void std::_Bind (ScExportTest*)>::operator()<, void>() 
/home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:1131:11
> #19 0x2b9957201149 in std::_Function_handler (ScExportTest*)> 
>::_M_invoke(std::_Any_data const&) 
/home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:1871:2
> #20 0x2b9957203ad0 in std::function::operator()() const 
/home/tdf/lode/opt_private/lib/gcc/x86_64-unknown-linux-gnu/5.2.0/../../../../include/c++/5.2.0/functional:2271:14
> #21 0x2b99571ff885 in CppUnit::TestCaller::runTest() 
/workdir/UnpackedTarball/cppunit/include/cppunit/TestCaller.h:175:7
> #22 0x2b990c338e7d in CppUnit::TestCaseMethodFunctor::operator()() 
const /workdir/UnpackedTarball/cppunit/src/cppunit/TestCase.cpp:32:5
> #23 0x2b99294cb4d6 in (anonymous 
namespace)::Protector::protect(CppUnit::Functor const&, 
CppUnit::ProtectorContext const&) /test/source/vclbootstrapprotector.cxx:48:14
> #24 0x2b990c2f7947 in 
CppUnit::ProtectorChain::ProtectFunctor::operator()() const 
/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
> #25 0x2b991bcad7a6 in (anonymous 
namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext 
const&) 
/unotest/source/cpp/unobootstrapprotector/unobootstrapprotector.cxx:89:12
> #26 0x2b990c2f7947 in 
CppUnit::ProtectorChain::ProtectFunctor::operator()() const 
/workdir/UnpackedTarball/cppunit/src/cppunit/ProtectorChain.cpp:20:12
> #27 0x2b9917d39e13 in (anonymous 
namespace)::Prot::protect(CppUnit::Functor const&, CppUnit::ProtectorContext 

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

2018-06-27 Thread Dennis Francis
 sc/source/core/data/drwlayer.cxx |5 -
 sc/source/core/data/table2.cxx   |7 ---
 2 files changed, 4 insertions(+), 8 deletions(-)

New commits:
commit b491bb4b1e2eb6745ced3e958550ea8526cd2f2a
Author: Dennis Francis 
Date:   Thu Jun 21 15:13:44 2018 +0530

tdf#112452 : Refine the fix for tdf#94561

Do the changes in 7c0f6b9d0fb8d7d9e54865ccf1047bb8f8148101
only if the destination is not an undo document.

Also removes the below unnecessary change in that commit.

if ( IsNoteCaption( pOldObject ) )
{
pOldObject = aIter.Next();
continue;
}

Change-Id: Ib18324ed16e91dbd932d449858a489dc09c53713
Reviewed-on: https://gerrit.libreoffice.org/56287
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit eebd2c72ce2d6003975de6b5bfe14b204b382a6e)
Reviewed-on: https://gerrit.libreoffice.org/56474
Reviewed-by: Dennis Francis 

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index d8c4069c135c..0fae0c873dbf 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -453,11 +453,6 @@ void ScDrawLayer::ScCopyPage( sal_uInt16 nOldPos, 
sal_uInt16 nNewPos )
 SdrObject* pOldObject = aIter.Next();
 while (pOldObject)
 {
-if ( IsNoteCaption( pOldObject ) )
-{
-pOldObject = aIter.Next();
-continue;
-}
 ScDrawObjData* pOldData = GetObjData(pOldObject);
 if (pOldData)
 {
diff --git a/sc/source/core/data/table2.cxx b/sc/source/core/data/table2.cxx
index 0f4e91090ffa..6f136059508d 100644
--- a/sc/source/core/data/table2.cxx
+++ b/sc/source/core/data/table2.cxx
@@ -1127,19 +1127,20 @@ void ScTable::CopyToTable(
 if (!ValidColRow(nCol1, nRow1) || !ValidColRow(nCol2, nRow2))
 return;
 
+bool bIsUndoDoc = pDestTab->pDocument->IsUndo();
 if (nFlags != InsertDeleteFlags::NONE)
 {
 InsertDeleteFlags nTempFlags( nFlags &
 ~InsertDeleteFlags( InsertDeleteFlags::NOTE | 
InsertDeleteFlags::ADDNOTES));
 for (SCCOL i = nCol1; i <= nCol2; i++)
-aCol[i].CopyToColumn(rCxt, nRow1, nRow2, nTempFlags, bMarked,
+aCol[i].CopyToColumn(rCxt, nRow1, nRow2, bIsUndoDoc ? nFlags : 
nTempFlags, bMarked,
 pDestTab->aCol[i], pMarkData, bAsLink, 
bGlobalNamesToLocal);
 }
 
 if (!bColRowFlags)  // Column widths/Row heights/Flags
 return;
 
-if(pDestTab->pDocument->IsUndo() && (nFlags & InsertDeleteFlags::ATTRIB))
+if(bIsUndoDoc && (nFlags & InsertDeleteFlags::ATTRIB))
 {
 pDestTab->mpCondFormatList.reset(new 
ScConditionalFormatList(pDestTab->pDocument, *mpCondFormatList));
 }
@@ -1247,7 +1248,7 @@ void ScTable::CopyToTable(
 if(nFlags & InsertDeleteFlags::OUTLINE) // also only when bColRowFlags
 pDestTab->SetOutlineTable( pOutlineTable.get() );
 
-if (bCopyCaptions && (nFlags & (InsertDeleteFlags::NOTE | 
InsertDeleteFlags::ADDNOTES)))
+if (!bIsUndoDoc && bCopyCaptions && (nFlags & (InsertDeleteFlags::NOTE | 
InsertDeleteFlags::ADDNOTES)))
 {
 bool bCloneCaption = (nFlags & InsertDeleteFlags::NOCAPTIONS) == 
InsertDeleteFlags::NONE;
 CopyCaptionsToTable( nCol1, nRow1, nCol2, nRow2, pDestTab, 
bCloneCaption);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-25 Thread Luboš Luňák
 sc/source/core/tool/token.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit c8d3f7210f7a0daa265d71d9b034fae30a31916b
Author: Luboš Luňák 
Date:   Thu Jun 21 16:26:35 2018 +0200

blacklist ocDde and ocWebservice for calc's threading

fdo#35927-1 (with minimal formula size disabled) crashes
in LinkManager::CloseCachedComps(). The whole LinkManager class feels
thread-unsafe, so just blacklist.

Change-Id: Idd7ec6b47f5269c977b600dadfc3a05a5287a86d
Reviewed-on: https://gerrit.libreoffice.org/56241
Reviewed-by: Luboš Luňák 
Tested-by: Luboš Luňák 
(cherry picked from commit 0a4a42e98479996b2f3bb19a884c057518fece4f)
Reviewed-on: https://gerrit.libreoffice.org/56372
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 4848afef0b01..f7f285e488ad 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1321,7 +1321,9 @@ void ScTokenArray::CheckForThreading( const FormulaToken& 
r )
 ocInfo,
 ocStyle,
 ocDBSum,
-ocExternal
+ocExternal,
+ocDde,
+ocWebservice
 });
 
 // Don't enable threading once we decided to disable it.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-21 Thread Aron Budea
 sc/source/ui/view/output2.cxx |   14 ++
 1 file changed, 6 insertions(+), 8 deletions(-)

New commits:
commit b86a8857e6488bac1224a9eed471bcf930994399
Author: Aron Budea 
Date:   Wed Jun 20 17:52:13 2018 +0200

tdf#66089 tdf#105720: only rely on bPixelToLogic

Left-aligned currency symbols were put in preceding cells
sometimes, because fill width was calculated incorrectly.

Commit 37210da00a9190f7765fa9c1e4a08629d2f4c2c4 fixed the issue
for LOK, but the bug was still reproducible in Calc if setting
"Use printer metrics for text formatting" was enabled.

Change-Id: I6cf90493cbf98c5020acd5faf1d0f3cf2def5c25
Reviewed-on: https://gerrit.libreoffice.org/56172
Tested-by: Jenkins
Reviewed-by: Jan Holesovsky 
(cherry picked from commit 93e9a3e2b545c853f53ffe28d2795f55ad29f304)
Reviewed-on: https://gerrit.libreoffice.org/56215

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 9327f6cb856f..49bfb0670dc4 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -75,7 +75,6 @@
 
 #include 
 #include 
-#include 
 
 #include 
 #include 
@@ -567,19 +566,18 @@ void ScDrawStringsVars::RepeatToFill( long nColWidth )
 if ( nRepeatPos == -1 || nRepeatPos > aString.getLength() )
 return;
 
-const bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
-
 long nCharWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nRepeatChar));
 
-if ( nCharWidth < 1 || (bIsTiledRendering && nCharWidth < 
TWIPS_PER_PIXEL)) return;
-
-if (bPixelToLogic)
-nColWidth = 
pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width();
+if ( nCharWidth < 1 || (bPixelToLogic && nCharWidth < 
pOutput->mpRefDevice->PixelToLogic(Size(1,0)).Width()) )
+return;
 
 // Are there restrictions on the cell type we should filter out here ?
 long nTextWidth = aTextSize.Width();
-if ( bIsTiledRendering )
+if ( bPixelToLogic )
+{
+nColWidth = 
pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width();
 nTextWidth = 
pOutput->mpRefDevice->PixelToLogic(Size(nTextWidth,0)).Width();
+}
 
 long nSpaceToFill = ( nColWidth - nTextWidth );
 if ( nSpaceToFill <= nCharWidth )
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-20 Thread Marco Cecchetti
 sc/source/ui/view/output2.cxx |   13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit 5f3c08cf061ae9c6c4cad74e6671c41394f00630
Author: Marco Cecchetti 
Date:   Thu Jun 14 12:32:48 2018 +0200

tdf#105720: lok: sc: currency symbol is displayed in the preceding cell

Change-Id: I6175cfeab3d8bc3a757c8522aa9c7a7e49c4bf2b
Reviewed-on: https://gerrit.libreoffice.org/55790
Reviewed-by: Marco Cecchetti 
Tested-by: Marco Cecchetti 
(cherry picked from commit 37210da00a9190f7765fa9c1e4a08629d2f4c2c4)
Reviewed-on: https://gerrit.libreoffice.org/56214
Tested-by: Jenkins
Reviewed-by: Aron Budea 

diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index 60fa18819e16..9327f6cb856f 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -75,6 +75,7 @@
 
 #include 
 #include 
+#include 
 
 #include 
 #include 
@@ -566,13 +567,21 @@ void ScDrawStringsVars::RepeatToFill( long nColWidth )
 if ( nRepeatPos == -1 || nRepeatPos > aString.getLength() )
 return;
 
+const bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
+
 long nCharWidth = pOutput->pFmtDevice->GetTextWidth(OUString(nRepeatChar));
-if ( nCharWidth < 1) return;
+
+if ( nCharWidth < 1 || (bIsTiledRendering && nCharWidth < 
TWIPS_PER_PIXEL)) return;
+
 if (bPixelToLogic)
 nColWidth = 
pOutput->mpRefDevice->PixelToLogic(Size(nColWidth,0)).Width();
+
 // Are there restrictions on the cell type we should filter out here ?
-long nSpaceToFill = ( nColWidth - aTextSize.Width() );
+long nTextWidth = aTextSize.Width();
+if ( bIsTiledRendering )
+nTextWidth = 
pOutput->mpRefDevice->PixelToLogic(Size(nTextWidth,0)).Width();
 
+long nSpaceToFill = ( nColWidth - nTextWidth );
 if ( nSpaceToFill <= nCharWidth )
 return;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-20 Thread Markus Mohrhard
 sc/source/filter/orcus/xmlcontext.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 2acaf22274068fbc4181120084aa372254e11686
Author: Markus Mohrhard 
Date:   Wed Jun 20 00:04:55 2018 +0200

push the data from the temporary storage to the document for XML source

Change-Id: I93d489ef9b3fa105db2d364ad9133a26d5366361
Reviewed-on: https://gerrit.libreoffice.org/56126
Tested-by: Jenkins
Reviewed-by: Markus Mohrhard 
(cherry picked from commit ca49ed9c4342917ba616170e95d7614224a13a4b)
Reviewed-on: https://gerrit.libreoffice.org/56135
Reviewed-by: Eike Rathke 

diff --git a/sc/source/filter/orcus/xmlcontext.cxx 
b/sc/source/filter/orcus/xmlcontext.cxx
index 1e343ff57a38..5e97db9f84e9 100644
--- a/sc/source/filter/orcus/xmlcontext.cxx
+++ b/sc/source/filter/orcus/xmlcontext.cxx
@@ -289,6 +289,7 @@ void ScOrcusXMLContextImpl::importXML(const 
ScOrcusImportXMLParam& rParam)
 }
 
 filter.read_file(path);
+aFactory.finalize();
 }
 catch (const std::exception&)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 011a9d000e32ec55e9ef46237fc1f5a578f78f9b
Author: Eike Rathke 
Date:   Wed Jun 20 18:07:54 2018 +0200

Related: tdf#117049 treat yet unknown result as initial 0.0

For the first =A1+B1 in B1 with iterations the result could had
been #VALUE! depending on string conversion calculation settings.

Change-Id: I8d7a745d67ba7a20f7a66e8aa143642d08ea5111
Reviewed-on: https://gerrit.libreoffice.org/56173
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 93dcfa7ee157dd865f5d266d1f877014462eac72)
Reviewed-on: https://gerrit.libreoffice.org/56179

diff --git a/sc/source/core/tool/formularesult.cxx 
b/sc/source/core/tool/formularesult.cxx
index c1ed01516113..ad10f51a36ba 100644
--- a/sc/source/core/tool/formularesult.cxx
+++ b/sc/source/core/tool/formularesult.cxx
@@ -274,7 +274,12 @@ namespace {
 inline bool isValue( formula::StackVar sv )
 {
 return sv == formula::svDouble || sv == formula::svError
-|| sv == formula::svEmptyCell;
+|| sv == formula::svEmptyCell
+// The initial unitialized result value is double 0.0, even if the type
+// is unknown, so the interpreter asking for it gets that double
+// instead of having to convert a string which may result in #VALUE!
+// (otherwise the unknown would be neither error nor double nor string)
+|| sv == formula::svUnknown;
 }
 
 inline bool isString( formula::StackVar sv )
@@ -457,6 +462,8 @@ double ScFormulaResult::GetDouble() const
 ;   // nothing
 }
 }
+// Note that we reach here also for the default ctor and
+// formula::svUnknown from GetType().
 return 0.0;
 }
 if (mbEmpty)
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-20 Thread Eike Rathke
 sc/source/core/data/formulacell.cxx |   15 ++-
 1 file changed, 10 insertions(+), 5 deletions(-)

New commits:
commit 8cbd64985af140b2afac6ea2fd3b9b93300f6f7c
Author: Eike Rathke 
Date:   Wed Jun 20 17:22:14 2018 +0200

Resolves: tdf#117049 do not re-interpret a single circular self-reference

... to not execute the calculation twice, which added an implicit
iteration step.

Change-Id: I943f770d32ebe84a8359f2f94c1f0bf5731b6f88
Reviewed-on: https://gerrit.libreoffice.org/56170
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 678f8ab7eb90f5b0dd99328957b21d11e3be68b4)
Reviewed-on: https://gerrit.libreoffice.org/56178

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index e996b8c2318f..d20ea590441d 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -1610,11 +1610,16 @@ void ScFormulaCell::Interpret()
 else
 {
 bResumeIteration = false;
-// Close circle once.
-pDocument->IncInterpretLevel();
-rRecursionHelper.GetList().back().pCell->InterpretTail( 
pDocument->GetNonThreadedContext(),
-
SCITP_CLOSE_ITERATION_CIRCLE);
-pDocument->DecInterpretLevel();
+// Close circle once. If 'this' is self-referencing only
+// (e.g. counter or self-adder) then it is already
+// implicitly closed.
+if (rRecursionHelper.GetList().size() > 1)
+{
+pDocument->IncInterpretLevel();
+rRecursionHelper.GetList().back().pCell->InterpretTail(
+pDocument->GetNonThreadedContext(), 
SCITP_CLOSE_ITERATION_CIRCLE);
+pDocument->DecInterpretLevel();
+}
 // Start at 1, init things.
 rRecursionHelper.StartIteration();
 // Mark all cells being in iteration.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-20 Thread Winfried Donkers
 sc/source/core/tool/interpr1.cxx |   39 ++-
 1 file changed, 30 insertions(+), 9 deletions(-)

New commits:
commit ad6bdc81f3b47cc46a7751e93e59fb92edd28baf
Author: Winfried Donkers 
Date:   Thu Jun 14 20:55:23 2018 +0200

tdf#77517 make Calc function ROW accept external references.

Change-Id: Ibd4f858abe825652c3df68ce7a21cbf16feea735
Reviewed-on: https://gerrit.libreoffice.org/55824
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
Tested-by: Eike Rathke 
(cherry picked from commit b1740fba0d1e6e3d69c3781734509317f42a0e4f)
Reviewed-on: https://gerrit.libreoffice.org/56129

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index e87e28d9c4db..9adedd0729ea 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4361,7 +4361,7 @@ void ScInterpreter::ScRow()
 sal_uInt8 nParamCount = GetByte();
 if ( MustHaveParamCount( nParamCount, 0, 1 ) )
 {
-double nVal = 0;
+double nVal = 0.0;
 if (nParamCount == 0)
 {
 nVal = aPos.Row() + 1;
@@ -4400,15 +4400,39 @@ void ScInterpreter::ScRow()
 nVal = static_cast(nRow1 + 1);
 }
 break;
+case svExternalSingleRef :
+{
+sal_uInt16 nFileId;
+OUString aTabName;
+ScSingleRefData aRef;
+PopExternalSingleRef( nFileId, aTabName, aRef );
+ScAddress aAbsRef = aRef.toAbs( aPos );
+nVal = static_cast( aAbsRef.Row() + 1 );
+}
+break;
 case svDoubleRef :
+case svExternalDoubleRef :
 {
-SCCOL nCol1;
 SCROW nRow1;
-SCTAB nTab1;
-SCCOL nCol2;
 SCROW nRow2;
-SCTAB nTab2;
-PopDoubleRef( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+if ( GetStackType() == svDoubleRef )
+{
+SCCOL nCol1;
+SCTAB nTab1;
+SCCOL nCol2;
+SCTAB nTab2;
+PopDoubleRef( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 
);
+}
+else
+{
+sal_uInt16 nFileId;
+OUString aTabName;
+ScComplexRefData aRef;
+PopExternalDoubleRef( nFileId, aTabName, aRef );
+ScRange aAbs = aRef.toAbs( aPos );
+nRow1 = aAbs.aStart.Row();
+nRow2 = aAbs.aEnd.Row();
+}
 if (nRow2 > nRow1)
 {
 ScMatrixRef pResMat = GetNewMat( 1,
@@ -4421,8 +4445,6 @@ void ScInterpreter::ScRow()
 PushMatrix(pResMat);
 return;
 }
-else
-nVal = 0.0;
 }
 else
 nVal = static_cast(nRow1 + 1);
@@ -4430,7 +4452,6 @@ void ScInterpreter::ScRow()
 break;
 default:
 SetError( FormulaError::IllegalParameter );
-nVal = 0.0;
 }
 }
 PushDouble( nVal );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

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

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

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

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


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

2018-06-20 Thread Luboš Luňák
 sc/source/ui/docshell/documentlinkmgr.cxx |   50 +-
 1 file changed, 29 insertions(+), 21 deletions(-)

New commits:
commit c2b5dada28a88df7bbf42f32a1d7d9b783784c2d
Author: Luboš Luňák 
Date:   Wed Jun 13 18:08:23 2018 +0200

avoid race condition in DocumentLinkManager::getLinkManager()

Change-Id: Ib8ffcf32e4a4dc80539828611adabb3beef1dafa
Reviewed-on: https://gerrit.libreoffice.org/55764
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
Reviewed-on: https://gerrit.libreoffice.org/56142
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/ui/docshell/documentlinkmgr.cxx 
b/sc/source/ui/docshell/documentlinkmgr.cxx
index c0fcfe0920ab..b1b66a9a8a8d 100644
--- a/sc/source/ui/docshell/documentlinkmgr.cxx
+++ b/sc/source/ui/docshell/documentlinkmgr.cxx
@@ -17,6 +17,7 @@
  *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
  */
 
+#include 
 #include 
 #include 
 #include 
@@ -36,7 +37,7 @@ struct DocumentLinkManagerImpl
 {
 SfxObjectShell* mpShell;
 std::unique_ptr> mpDataStream;
-std::unique_ptr mpLinkManager;
+std::atomic mpLinkManager;
 
 DocumentLinkManagerImpl(const DocumentLinkManagerImpl&) = delete;
 const DocumentLinkManagerImpl& operator=(const DocumentLinkManagerImpl&) = 
delete;
@@ -47,15 +48,17 @@ struct DocumentLinkManagerImpl
 ~DocumentLinkManagerImpl()
 {
 // Shared base links
-if (mpLinkManager)
+sfx2::LinkManager* linkManager = mpLinkManager;
+if (linkManager)
 {
-sfx2::SvLinkSources aTemp = mpLinkManager->GetServers();
+sfx2::SvLinkSources aTemp = linkManager->GetServers();
 for (sfx2::SvLinkSources::const_iterator it = aTemp.begin(); it != 
aTemp.end(); ++it)
 (*it)->Closed();
 
-if (!mpLinkManager->GetLinks().empty())
-mpLinkManager->Remove(0, mpLinkManager->GetLinks().size());
+if (!linkManager->GetLinks().empty())
+linkManager->Remove(0, linkManager->GetLinks().size());
 }
+delete linkManager;
 }
 };
 
@@ -83,23 +86,25 @@ const DataStream* DocumentLinkManager::getDataStream() const
 
 sfx2::LinkManager* DocumentLinkManager::getLinkManager( bool bCreate )
 {
-if (!mpImpl->mpLinkManager && bCreate && mpImpl->mpShell)
-mpImpl->mpLinkManager.reset(new sfx2::LinkManager(mpImpl->mpShell));
-return mpImpl->mpLinkManager.get();
+if (bCreate && mpImpl->mpShell)
+return comphelper::doubleCheckedInit( mpImpl->mpLinkManager,
+[this]() { return new sfx2::LinkManager(mpImpl->mpShell); } );
+return mpImpl->mpLinkManager;
 }
 
 const sfx2::LinkManager* DocumentLinkManager::getExistingLinkManager() const
 {
-return mpImpl->mpLinkManager.get();
+return mpImpl->mpLinkManager;
 }
 
 bool DocumentLinkManager::idleCheckLinks()
 {
-if (!mpImpl->mpLinkManager)
+sfx2::LinkManager* pMgr = mpImpl->mpLinkManager;
+if (!pMgr)
 return false;
 
 bool bAnyLeft = false;
-const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks();
+const sfx2::SvBaseLinks& rLinks = pMgr->GetLinks();
 for (const auto & rLink : rLinks)
 {
 sfx2::SvBaseLink* pBase = rLink.get();
@@ -127,10 +132,11 @@ bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks() 
const
 
 bool DocumentLinkManager::hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, 
bool bWebService) const
 {
-if (!mpImpl->mpLinkManager)
+sfx2::LinkManager* pMgr = mpImpl->mpLinkManager;
+if (!pMgr)
 return false;
 
-const sfx2::SvBaseLinks& rLinks = mpImpl->mpLinkManager->GetLinks();
+const sfx2::SvBaseLinks& rLinks = pMgr->GetLinks();
 for (const auto & rLink : rLinks)
 {
 sfx2::SvBaseLink* pBase = rLink.get();
@@ -147,10 +153,10 @@ bool 
DocumentLinkManager::hasDdeOrOleOrWebServiceLinks(bool bDde, bool bOle, boo
 
 bool DocumentLinkManager::updateDdeOrOleOrWebServiceLinks(weld::Window* pWin)
 {
-if (!mpImpl->mpLinkManager)
+sfx2::LinkManager* pMgr = mpImpl->mpLinkManager;
+if (!pMgr)
 return false;
 
-sfx2::LinkManager* pMgr = mpImpl->mpLinkManager.get();
 const sfx2::SvBaseLinks& rLinks = pMgr->GetLinks();
 
 // If the update takes longer, reset all values so that nothing
@@ -210,10 +216,10 @@ bool 
DocumentLinkManager::updateDdeOrOleOrWebServiceLinks(weld::Window* pWin)
 
 void DocumentLinkManager::updateDdeLink( const OUString& rAppl, const 
OUString& rTopic, const OUString& rItem )
 {
-if (!mpImpl->mpLinkManager)
+sfx2::LinkManager* pMgr = mpImpl->mpLinkManager;
+if (!pMgr)
 return;
 
-sfx2::LinkManager* pMgr = mpImpl->mpLinkManager.get();
 const sfx2::SvBaseLinks& rLinks = pMgr->GetLinks();
 
 for (const auto & rLink : rLinks)
@@ -235,11 +241,12 @@ void DocumentLinkManager::updateDdeLink( const OUString& 
rAppl, const OUString&
 
 size_t DocumentLinkManager::getDdeLinkCount() const
 {
-if 

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

2018-06-20 Thread Luboš Luňák
 sc/source/core/tool/formulagroup.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 4a0bf6f4f30a3b020dcab1e1e7b2517948cc4b9c
Author: Luboš Luňák 
Date:   Fri Jun 15 18:25:00 2018 +0200

do not allow threading in SwInterpreter for threading-disabled tokens

If a token is not suitable for the generic threading code, it's presumably
not suitable for threading with SwInterpreter either. This is possibly
already handled by checks in CheckToken(), but this can't hurt, just
in case a token is in CheckForThreading() but not in CheckToken().

Change-Id: Ib969a21e9021fc6debc2131dc718419c6b25d363
Reviewed-on: https://gerrit.libreoffice.org/55886
Reviewed-by: Michael Meeks 
Tested-by: Luboš Luňák 
(cherry picked from commit 39dc45b23a6aacb6439162cbbb7762f3d0c0b5fb)
Reviewed-on: https://gerrit.libreoffice.org/56140
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/core/tool/formulagroup.cxx 
b/sc/source/core/tool/formulagroup.cxx
index b494d25d1146..ffd961ae7b99 100644
--- a/sc/source/core/tool/formulagroup.cxx
+++ b/sc/source/core/tool/formulagroup.cxx
@@ -368,7 +368,7 @@ bool FormulaGroupInterpreterSoftware::interpret(ScDocument& 
rDoc, const ScAddres
 
 static const bool bThreadingProhibited = 
std::getenv("SC_NO_THREADED_CALCULATION");
 
-bool bUseThreading = !bThreadingProhibited && 
ScCalcConfig::isThreadingEnabled();
+bool bUseThreading = !bThreadingProhibited && 
ScCalcConfig::isThreadingEnabled() && rCode.IsEnabledForThreading();
 
 SvNumberFormatter* pFormatter = 
rDoc.GetNonThreadedContext().GetFormatTable();
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-19 Thread Winfried Donkers
 sc/source/core/tool/interpr1.cxx |   40 ++-
 1 file changed, 31 insertions(+), 9 deletions(-)

New commits:
commit d5c8199a94d0e2f722fff6637b930205a6641adf
Author: Winfried Donkers 
Date:   Mon Jun 18 19:31:47 2018 +0200

tdf#77517 make Calc function COLUMN accept external references.

Change-Id: Ife00755586be9a42ac5cf1f9b3debb396db1b45f
Reviewed-on: https://gerrit.libreoffice.org/56055
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 28f3e44e99283ede636c28c68bffb2b9df0bbcf8)
Reviewed-on: https://gerrit.libreoffice.org/56128

diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index 712c0537e330..e87e28d9c4db 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -4258,7 +4258,7 @@ void ScInterpreter::ScColumn()
 sal_uInt8 nParamCount = GetByte();
 if ( MustHaveParamCount( nParamCount, 0, 1 ) )
 {
-double nVal = 0;
+double nVal = 0.0;
 if (nParamCount == 0)
 {
 nVal = aPos.Col() + 1;
@@ -4297,15 +4297,40 @@ void ScInterpreter::ScColumn()
 nVal = static_cast(nCol1 + 1);
 }
 break;
+case svExternalSingleRef :
+{
+sal_uInt16 nFileId;
+OUString aTabName;
+ScSingleRefData aRef;
+PopExternalSingleRef( nFileId, aTabName, aRef );
+ScAddress aAbsRef = aRef.toAbs( aPos );
+nVal = static_cast( aAbsRef.Col() + 1 );
+}
+break;
+
 case svDoubleRef :
+case svExternalDoubleRef :
 {
 SCCOL nCol1;
-SCROW nRow1;
-SCTAB nTab1;
 SCCOL nCol2;
-SCROW nRow2;
-SCTAB nTab2;
-PopDoubleRef( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 );
+if ( GetStackType() == svDoubleRef )
+{
+SCROW nRow1;
+SCTAB nTab1;
+SCROW nRow2;
+SCTAB nTab2;
+PopDoubleRef( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2 
);
+}
+else
+{
+sal_uInt16 nFileId;
+OUString aTabName;
+ScComplexRefData aRef;
+PopExternalDoubleRef( nFileId, aTabName, aRef );
+ScRange aAbs = aRef.toAbs( aPos );
+nCol1 = aAbs.aStart.Col();
+nCol2 = aAbs.aEnd.Col();
+}
 if (nCol2 > nCol1)
 {
 ScMatrixRef pResMat = GetNewMat(
@@ -4318,8 +4343,6 @@ void ScInterpreter::ScColumn()
 PushMatrix(pResMat);
 return;
 }
-else
-nVal = 0.0;
 }
 else
 nVal = static_cast(nCol1 + 1);
@@ -4327,7 +4350,6 @@ void ScInterpreter::ScColumn()
 break;
 default:
 SetError( FormulaError::IllegalParameter );
-nVal = 0.0;
 }
 }
 PushDouble( nVal );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-19 Thread Caolán McNamara
 sc/source/ui/view/viewfun2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 2f448d2ddf00579bb452c3d2e7a5287e8e78ff62
Author: Caolán McNamara 
Date:   Tue Jun 19 15:59:17 2018 +0100

Resolves: tdf#118226 yes/no reversed

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

diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index a8724a863ecd..6d3b79c10079 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2101,7 +2101,7 @@ void ScViewFunc::Solve( const ScSolveParam& rParam )
   VclMessageType::Question, 
VclButtonsType::YesNo, aMsgStr));
 xBox->set_title(ScResId(STR_MSSG_DOSUBTOTALS_0));
 xBox->set_default_response(RET_NO);
-if (xBox->run() == RET_NO)
+if (xBox->run() == RET_YES)
 EnterValue( nDestCol, nDestRow, nDestTab, nSolveResult );
 
 GetViewData().GetViewShell()->UpdateInputHandler( true );
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

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

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

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

Effectively a regression from

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

More on ScCellIterator usage migration.

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

Change-Id: Iec97d58080016c28bc9a7e47d056e4d301263928
(cherry picked from commit cfe2e4eb835c06b24adabd60c7a3fddbd3f4dbc9)
Reviewed-on: https://gerrit.libreoffice.org/55803
Reviewed-by: Eike Rathke 
Tested-by: Jenkins

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


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

2018-06-12 Thread Luboš Luňák
 sc/source/core/tool/token.cxx |   25 +++--
 1 file changed, 15 insertions(+), 10 deletions(-)

New commits:
commit 36b2b687afa58d4d2043115b5bd9df58e6b9710a
Author: Luboš Luňák 
Date:   Tue Jun 12 13:03:09 2018 +0200

do not even consider ScTokenArray for OpenCL if it's disabled

If sc/qa/unit/data/ods/functions.ods is run with OpenCL disabled
(and the mnOpenCLMinimumFormulaGroupSize check disabled too), then
ScTokenArray::CheckToken() considers the token for OpenCL, and if
the token is ocExternal, it passes all the related OpenCL checks,
and thus ScTokenArray::CheckForThreading() is never called.
However, since OpenCL is disabled, then actually the threaded code
will be executed, since the blacklisting for ocExternal has not been
done.

Change-Id: Ib4d4d63d3925746f6e13da0611ac869e9a094b5b
Reviewed-on: https://gerrit.libreoffice.org/55676
Reviewed-by: Michael Meeks 
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 
(cherry picked from commit fb4ad5b0c766440e1a47d991c6cbc9cb017ada59)
Reviewed-on: https://gerrit.libreoffice.org/55719
Reviewed-by: Luboš Luňák 
Tested-by: Luboš Luňák 

diff --git a/sc/source/core/tool/token.cxx b/sc/source/core/tool/token.cxx
index 7eb36aac5ced..cddc6294abd9 100644
--- a/sc/source/core/tool/token.cxx
+++ b/sc/source/core/tool/token.cxx
@@ -1819,9 +1819,18 @@ void ScTokenArray::GenHash()
 
 void ScTokenArray::ResetVectorState()
 {
-meVectorState = FormulaVectorEnabled;
-mbOpenCLEnabled = true;
-mbThreadingEnabled = !ScCalcConfig::isOpenCLEnabled() && 
ScCalcConfig::isThreadingEnabled();
+if(ScCalcConfig::isOpenCLEnabled())
+{
+meVectorState = FormulaVectorEnabled;
+mbOpenCLEnabled = true;
+mbThreadingEnabled = false;
+}
+else
+{
+meVectorState = FormulaVectorDisabled;
+mbOpenCLEnabled = false;
+mbThreadingEnabled = ScCalcConfig::isThreadingEnabled();
+}
 }
 
 bool ScTokenArray::IsFormulaVectorDisabled() const
@@ -1887,11 +1896,9 @@ bool ScTokenArray::IsValidReference( ScRange& rRange, 
const ScAddress& rPos ) co
 
 ScTokenArray::ScTokenArray() :
 FormulaTokenArray(),
-mnHashValue(0),
-meVectorState(FormulaVectorEnabled),
-mbOpenCLEnabled(true),
-mbThreadingEnabled(!ScCalcConfig::isOpenCLEnabled() && 
ScCalcConfig::isThreadingEnabled())
+mnHashValue(0)
 {
+ResetVectorState();
 }
 
 ScTokenArray::~ScTokenArray()
@@ -1929,9 +1936,7 @@ bool ScTokenArray::EqualTokens( const ScTokenArray* 
pArr2) const
 void ScTokenArray::Clear()
 {
 mnHashValue = 0;
-meVectorState = FormulaVectorEnabled;
-mbOpenCLEnabled = true;
-mbThreadingEnabled = !ScCalcConfig::isOpenCLEnabled() && 
ScCalcConfig::isThreadingEnabled();
+ResetVectorState();
 FormulaTokenArray::Clear();
 }
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-12 Thread Luboš Luňák
 sc/source/core/data/grouptokenconverter.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit bfd0290977b0ae37b9644713d701fca31d88b973
Author: Luboš Luňák 
Date:   Tue Jun 12 11:59:26 2018 +0200

don't use opencl with deleted cells

Without this testFormulaRefUpdateDeleteAndShiftLeft2 fails with OpenCL
enabled (and the mnOpenCLMinimumFormulaGroupSize check disabled).
If I'm getting it right, anything working with #REF! (=invalid reference)
should result in #REF! too, but without this fix the function effectively
converted the #REF! to an empty cell.

Change-Id: Icdda64ad751d7c0e9c0d5995673e4fb30c4c9ac4
Reviewed-on: https://gerrit.libreoffice.org/55672
Reviewed-by: Michael Meeks 
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 
(cherry picked from commit 2926c9e40e17a806e29b95d08ddf186904103d33)
Reviewed-on: https://gerrit.libreoffice.org/55713
Reviewed-by: Luboš Luňák 
Tested-by: Luboš Luňák 

diff --git a/sc/source/core/data/grouptokenconverter.cxx 
b/sc/source/core/data/grouptokenconverter.cxx
index 5fc6b292214e..a388b34d04ec 100644
--- a/sc/source/core/data/grouptokenconverter.cxx
+++ b/sc/source/core/data/grouptokenconverter.cxx
@@ -116,6 +116,8 @@ bool ScGroupTokenConverter::convert( const ScTokenArray& 
rCode, sc::FormulaLogge
 case svSingleRef:
 {
 ScSingleRefData aRef = *p->GetSingleRef();
+if( aRef.IsDeleted())
+return false;
 ScAddress aRefPos = aRef.toAbs(mrPos);
 if (aRef.IsRowRel())
 {
@@ -178,6 +180,8 @@ bool ScGroupTokenConverter::convert( const ScTokenArray& 
rCode, sc::FormulaLogge
 
 #if 0
 ScComplexRefData aRef = *p->GetDoubleRef();
+if( aRef.IsDeleted())
+return false;
 ScRange aAbs = aRef.toAbs(mrPos);
 
 // Multiple sheets not handled by vector/matrix.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-12 Thread Luboš Luňák
 sc/source/core/data/formulacell.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b5c9472db78fe556bff79164bb91249b285641af
Author: Luboš Luňák 
Date:   Tue Jun 12 12:20:13 2018 +0200

pass ScInterpreterContext to GetFormula()

Change-Id: Iebfb6cb2a9dd60190a2b18cff87163ed49493105
Reviewed-on: https://gerrit.libreoffice.org/55674
Tested-by: Jenkins 
Reviewed-by: Luboš Luňák 
(cherry picked from commit 6b03d6f3b29964c6311b97af5734529285a37f3f)
Reviewed-on: https://gerrit.libreoffice.org/55712
Tested-by: Luboš Luňák 

diff --git a/sc/source/core/data/formulacell.cxx 
b/sc/source/core/data/formulacell.cxx
index 1bec26aab99a..e1a80effa3b3 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -988,7 +988,7 @@ void ScFormulaCell::GetFormula( OUStringBuffer& rBuffer,
 
 if (pCell)
 {
-pCell->GetFormula( rBuffer, eGrammar);
+pCell->GetFormula( rBuffer, eGrammar, pContext );
 return;
 }
 else
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-06-09 Thread Luboš Luňák
 sc/source/core/data/column.cxx  |2 +-
 sc/source/core/data/column2.cxx |2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 1e42a970c582b1ecfb652559c90a027554984ab7
Author: Luboš Luňák 
Date:   Fri Jun 8 21:14:19 2018 +0200

properly go to next row when walking mdds container

Since only elements from nOffset up to nEnd are iterated, then the 
difference
is not just nEnd but (nEnd-nOffset).
Without this, ScColumn::HandleRefArrayForParallelism() skips some cells
and e.g. fdo#77750-1 asserts in ScFormulaCell::MaybeInterpret().

Change-Id: I4d595e9faff51f08bf074d549185c24aa00d8a45
Reviewed-on: https://gerrit.libreoffice.org/55488
Tested-by: Jenkins 
Reviewed-by: Kohei Yoshida 
Tested-by: Kohei Yoshida 
(cherry picked from commit cbe3ae1894800a5fddbd598403be54f9495cc964)
Reviewed-on: https://gerrit.libreoffice.org/55502
Reviewed-by: Luboš Luňák 
Tested-by: Luboš Luňák 

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index ae6813988293..d7c25de498de 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -184,7 +184,7 @@ sc::MatrixEdge ScColumn::GetBlockMatrixEdges( SCROW nRow1, 
SCROW nRow2, sc::Matr
 bOpen = false;  // bottom edge closes
 }
 
-nRow += nEnd;
+nRow += nEnd - nOffset;
 }
 if (bOpen)
 nEdges |= MatrixEdge::Open; // not closed, matrix continues
diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 3c856fd161cd..6eb7697d074f 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -2841,7 +2841,7 @@ bool ScColumn::HandleRefArrayForParallelism( SCROW nRow1, 
SCROW nRow2 )
 // Loop inside the formula block.
 (*itCell)->MaybeInterpret();
 }
-nRow += nEnd;
+nRow += nEnd - nOffset;
 break;
 }
 default:
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


  1   2   >