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

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

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

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

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

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

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

2019-09-04 Thread Eike Rathke (via logerrit)
 sc/source/ui/docshell/docsh.cxx  |   13 --
 sc/source/ui/docshell/docsh4.cxx |   64 +--
 sc/source/ui/docshell/externalrefmgr.cxx |1 
 sc/source/ui/inc/docsh.hxx   |2 
 4 files changed, 49 insertions(+), 31 deletions(-)

New commits:
commit 3d59261bfa6f02a36b20cd117ed25422c59fbe4f
Author: Eike Rathke 
AuthorDate: Fri Aug 16 15:36:15 2019 +0200
Commit: Caolán McNamara 
CommitDate: Wed Sep 4 12:02:21 2019 +0200

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

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

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

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

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

Backported. Also includes

commit 1663b1e8233db6c6d1c2b35639ad984961084009
CommitDate: Tue Feb 26 21:15:57 2019 +0100

tdf#120736: For Calc shared documents also check the original 
document URL

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

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

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

2019-08-09 Thread Eike Rathke (via logerrit)
 sc/source/ui/view/viewfun2.cxx |   63 -
 1 file changed, 37 insertions(+), 26 deletions(-)

New commits:
commit d3bbac9d0c75eaf59ab78b5f98f47d722874f194
Author: Eike Rathke 
AuthorDate: Thu Jun 20 18:02:38 2019 +0200
Commit: Caolán McNamara 
CommitDate: Fri Aug 9 09:59:46 2019 +0200

Resolves: tdf#108209 let auto fill handle double click stop at existing data

Also consolidate the code to take both, left and right, data areas
into account, still preferring left if it exists.

Change-Id: I3d46b32f3790fd367fe92712fbcab0c392294599
Reviewed-on: https://gerrit.libreoffice.org/74462
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7dd57a914be5f8fc2b53b7725c16625887cf7439)
Reviewed-on: https://gerrit.libreoffice.org/77157
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 565fa987e0e3..1b948b916746 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -1630,40 +1630,51 @@ void ScViewFunc::FillCrossDblClick()
 
 if ( nEndY < MAXROW )
 {
-if ( nStartX > 0 )
+const bool bDataLeft = (nStartX > 0);
+if (bDataLeft || nEndX < MAXCOL)
 {
-SCCOL nMovX = nStartX - 1;
-SCROW nMovY = nStartY;
+// Check that there is
+// 1) data immediately left (preferred) or right of start (row) of 
selection
+// 2) data there below
+// 3) no data immediately below selection
 
-if ( pDoc->HasData( nMovX, nStartY, nTab ) &&
- pDoc->HasData( nMovX, nStartY + 1, nTab ) )
+SCCOL nMovX = (bDataLeft ? nStartX - 1 : nEndX + 1);
+SCROW nMovY = nStartY;
+bool bDataFound = (pDoc->HasData( nMovX, nStartY, nTab) && 
pDoc->HasData( nMovX, nStartY + 1, nTab));
+if (!bDataFound && bDataLeft && nEndX < MAXCOL)
 {
-pDoc->FindAreaPos( nMovX, nMovY, nTab, SC_MOVE_DOWN );
-
-if ( nMovY > nEndY )
-{
-FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY,
-  nMovY - nEndY );
-return;
-}
+nMovX = nEndX + 1;  // check right
+bDataFound = (pDoc->HasData( nMovX, nStartY, nTab) && 
pDoc->HasData( nMovX, nStartY + 1, nTab));
 }
-}
 
-if ( nEndX < MAXCOL )
-{
-SCCOL nMovX = nEndX + 1;
-SCROW nMovY = nStartY;
-
-if ( pDoc->HasData( nMovX, nStartY, nTab ) &&
- pDoc->HasData( nMovX, nStartY + 1, nTab ) )
+if (bDataFound && pDoc->IsBlockEmpty( nTab, nStartX, nEndY + 1, 
nEndX, nEndY + 1, true))
 {
-pDoc->FindAreaPos( nMovX, nMovY, nTab, SC_MOVE_DOWN );
+// Get end of data left or right.
+pDoc->FindAreaPos( nMovX, nMovY, nTab, SC_MOVE_DOWN);
+// Find minimum end row of below empty area and data right.
+for (SCCOL nX = nStartX; nX <= nEndX; ++nX)
+{
+SCROW nY = nEndY + 1;
+// Get next row with data in this column.
+pDoc->FindAreaPos( nX, nY, nTab, SC_MOVE_DOWN);
+if (nMovY == MAXROW && nY == MAXROW)
+{
+// FindAreaPos() returns MAXROW also if there is no
+// data at all from the start, so check if that
+// contains data if the nearby (left or right) data
+// ends there and increment if no data here, pretending
+// the next data would be thereafter so nMovY will not
+// be decremented.
+if (!pDoc->HasData( nX, nY, nTab))
+++nY;
+}
+if (nMovY > nY - 1)
+nMovY = nY - 1;
+}
 
-if ( nMovY > nEndY )
+if (nMovY > nEndY)
 {
-FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY,
-  nMovY - nEndY );
-return;
+FillAuto( FILL_TO_BOTTOM, nStartX, nStartY, nEndX, nEndY, 
nMovY - nEndY);
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

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

New commits:
commit 32cf2f6614526e560623498afe4d80b29fc52649
Author: Jim Raykowski 
AuthorDate: Mon Jul 15 23:41:55 2019 -0800
Commit: Xisco Faulí 
CommitDate: Fri Aug 2 17:18:44 2019 +0200

tdf#122774 Make all ScCheckListMenuWindow items keyboard accessible

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

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

This patch also provides a hack fix for tdf#122772

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

diff --git a/sc/source/ui/cctrl/checklistmenu.cxx 
b/sc/source/ui/cctrl/checklistmenu.cxx
index 492c64b3d1c7..587e2e41a353 100644
--- a/sc/source/ui/cctrl/checklistmenu.cxx
+++ b/sc/source/ui/cctrl/checklistmenu.cxx
@@ -1207,6 +1207,7 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, TriStateHdl, 
Button*, void)
 }
 
 mePrevToggleAllState = maChkToggleAll->GetState();
+maTabStops.SetTabStop(maChkToggleAll); // Needed for when accelerator is 
used
 }
 
 IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, Edit&, void)
@@ -1282,7 +1283,14 @@ IMPL_LINK_NOARG(ScCheckListMenuWindow, EdModifyHdl, 
Edit&, void)
 maChkToggleAll->SetState( TRISTATE_INDET );
 
 if ( !maConfig.mbAllowEmptySet )
-maBtnOk->Enable( nSelCount != 0);
+{
+const bool bEmptySet( nSelCount == 0 );
+maChecks->Enable( !bEmptySet );
+maChkToggleAll->Enable( !bEmptySet );
+maBtnSelectSingle->Enable( !bEmptySet );
+maBtnUnselectSingle->Enable( !bEmptySet );
+maBtnOk->Enable( !bEmptySet );
+}
 }
 
 IMPL_LINK( ScCheckListMenuWindow, CheckHdl, SvTreeListBox*, pChecks, void )
@@ -1320,14 +1328,27 @@ void ScCheckListMenuWindow::MouseMove(const MouseEvent& 
rMEvt)
 
 bool ScCheckListMenuWindow::EventNotify(NotifyEvent& rNEvt)
 {
-if (rNEvt.GetType() == MouseNotifyEvent::KEYUP)
+MouseNotifyEvent nType = rNEvt.GetType();
+if (HasFocus() && nType == MouseNotifyEvent::GETFOCUS)
+{
+setSelectedMenuItem( 0 , false, false );
+return true;
+}
+if (nType == MouseNotifyEvent::KEYINPUT)
 {
 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
-bool bShift = rCode.IsShift();
-if (rCode.GetCode() == KEY_TAB)
+const sal_uInt16 nCode = rCode.GetCode();
+if (rCode.IsMod2()) // Hack to prevent tdf#122772
+{
+if (nCode == KEY_DOWN || nCode == KEY_RIGHT)
+return true;
+}
+else
 {
-maTabStops.CycleFocus(bShift);
+bool bShift = rCode.IsShift();
+if (nCode == KEY_TAB)
+maTabStops.CycleFocus(bShift);
 return true;
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

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

New commits:
commit bb329b0fbcc416b122885511f6120992bb369959
Author: Eike Rathke 
AuthorDate: Thu Jun 27 14:12:32 2019 +0200
Commit: Caolán McNamara 
CommitDate: Wed Jul 17 21:31:10 2019 +0200

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

Regression from

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

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

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

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

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

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

New commits:
commit 0bdda083c5a7fca62942b3e9bef018d4c8135fe7
Author: Eike Rathke 
AuthorDate: Thu Jul 11 15:50:07 2019 +0200
Commit: Mike Kaganski 
CommitDate: Fri Jul 12 16:24:57 2019 +0200

Postpone loading of all external references, including INDIRECT()

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

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

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

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

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

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

Postpone filter detection until link update is allowed

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

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

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

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

New commits:
commit 364effd7143c31a6c0c49d08c81a08293a94667d
Author: Eike Rathke 
AuthorDate: Wed Jun 26 18:33:07 2019 +0200
Commit: Caolán McNamara 
CommitDate: Thu Jun 27 10:03:23 2019 +0200

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

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

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

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

Backported.

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

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

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

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

New commits:
commit ed9cb51dfddf066b0b19681e86c42121aa9cce9c
Author: Eike Rathke 
AuthorDate: Fri Jun 14 21:53:18 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Jun 16 21:07:18 2019 +0200

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

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

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

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

2019-06-13 Thread Eike Rathke (via logerrit)
 sc/source/core/tool/compiler.cxx |9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

New commits:
commit 4ca3ac84912ab387b27d3f6c1a288a1ba12eb730
Author: Eike Rathke 
AuthorDate: Thu Jun 13 20:25:49 2019 +0200
Commit: Michael Weghorn 
CommitDate: Fri Jun 14 07:51:17 2019 +0200

Resolves: tdf#113541 handle external reference in Excel syntax

... not only OOXML. This wasn't only a problem when creating a
reference by clicking or travelling to a cell in the external
document, but also when editing an external reference in Excel_A1
or Excel_R1C1 reference syntax.

Change-Id: Iee3d529ff9834e5013a61c2056238277f33356fe
Reviewed-on: https://gerrit.libreoffice.org/73979
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 69903b5c5f9b9015c88931c0eb8a47b52ea3de12)
Reviewed-on: https://gerrit.libreoffice.org/73988
Reviewed-by: Michael Weghorn 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 7ed3845f967e..edb4f9fadb0b 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2125,11 +2125,14 @@ Label_MaskStateMachine:
 }
 else if( nMask & ScCharFlags::Char )
 {
-// '[' is a special case in OOXML, it can start an external
-// reference ID like [1]Sheet1!A1 that needs to be scanned
+// '[' is a special case in Excel syntax, it can start an
+// external reference, ID in OOXML like [1]Sheet1!A1 or
+// Excel_A1 [filename]Sheet!A1 or Excel_R1C1
+// [filename]Sheet!R1C1 that needs to be scanned
 // entirely, or can be ocTableRefOpen, of which the first
 // transforms an ocDBArea into an ocTableRef.
-if (c == '[' && FormulaGrammar::isOOXML( meGrammar) && 
eLastOp != ocDBArea && maTableRefs.empty())
+if (c == '[' && FormulaGrammar::isExcelSyntax( meGrammar)
+&& eLastOp != ocDBArea && maTableRefs.empty())
 {
 nMask &= ~ScCharFlags::Char;
 goto Label_MaskStateMachine;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-12 Thread Caolán McNamara (via logerrit)
 sc/source/core/data/dpcache.cxx |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 6feaa8cab9e63a1f13a5bb272aad992f9a5b58ae
Author: Caolán McNamara 
AuthorDate: Tue Jun 11 09:44:40 2019 +0100
Commit: Dennis Francis 
CommitDate: Wed Jun 12 09:48:36 2019 +0200

Resolves: tdf#125808 empty labels in pivot table from registered data source

since...

commit 238cadd315901cbacfd9304bb1205e9f53f13eae
Date:   Wed Apr 10 04:30:25 2019 +0530

dpcache : use case-insensitive normalization of...

Change-Id: I19057bde268ec07561da323bc694536dcad03a95
Reviewed-on: https://gerrit.libreoffice.org/73821
Tested-by: Jenkins
Reviewed-by: Dennis Francis 

diff --git a/sc/source/core/data/dpcache.cxx b/sc/source/core/data/dpcache.cxx
index fce310bd1ee6..5420185887e9 100644
--- a/sc/source/core/data/dpcache.cxx
+++ b/sc/source/core/data/dpcache.cxx
@@ -374,8 +374,8 @@ std::vector normalizeLabels(const 
std::vector& rColDat
 
 std::vector normalizeLabels(const ScDPCache::DBConnector& rDB, const 
sal_Int32 nLabelCount)
 {
-std::vector aLabels(nLabelCount+1);
-aLabels.push_back(ScResId(STR_PIVOT_DATA));
+std::vector aLabels(1u, ScResId(STR_PIVOT_DATA));
+aLabels.reserve(nLabelCount + 1);
 
 LabelSet aExistingNames;
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-06-10 Thread Eike Rathke (via logerrit)
 sc/source/core/data/column3.cxx |   52 +---
 1 file changed, 49 insertions(+), 3 deletions(-)

New commits:
commit 4d51531130988d87839bb7b0c077a5df43b2a6be
Author: Eike Rathke 
AuthorDate: Mon May 20 21:44:02 2019 +0200
Commit: Caolán McNamara 
CommitDate: Mon Jun 10 22:46:06 2019 +0200

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

Change-Id: I4036061b9e8f01d99f04f20dfbbd2cf23d3a9b59
Reviewed-on: https://gerrit.libreoffice.org/72632
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 478e051f4ea13b15120fdf74faf94a6c2cfcb50c)
Reviewed-on: https://gerrit.libreoffice.org/72848
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/data/column3.cxx b/sc/source/core/data/column3.cxx
index 30d9fc26631f..903111b20769 100644
--- a/sc/source/core/data/column3.cxx
+++ b/sc/source/core/data/column3.cxx
@@ -1947,13 +1947,14 @@ bool ScColumn::ParseString(
 
 sal_uInt32 nIndex = 0;
 sal_uInt32 nOldIndex = 0;
+SvNumFormatType eNumFormatType = SvNumFormatType::ALL;
 sal_Unicode cFirstChar;
 if (!aParam.mpNumFormatter)
 aParam.mpNumFormatter = GetDoc()->GetFormatTable();
 
 nIndex = nOldIndex = GetNumberFormat( GetDoc()->GetNonThreadedContext(), 
nRow );
 if ( rString.getLength() > 1
-&& aParam.mpNumFormatter->GetType(nIndex) != SvNumFormatType::TEXT 
)
+&& (eNumFormatType = aParam.mpNumFormatter->GetType(nIndex)) != 
SvNumFormatType::TEXT )
 cFirstChar = rString[0];
 else
 cFirstChar = 0; // Text
@@ -2009,11 +2010,56 @@ bool ScColumn::ParseString(
 {
 if (aParam.mbDetectNumberFormat)
 {
-if (!aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, 
nVal))
+// Editing a date prefers the format's locale's edit date
+// format's date acceptance patterns and YMD order.
+/* TODO: this could be determined already far above when
+ * starting to edit a date "cell" and passed down. A problem
+ * could also be if a new date was typed over or written by a
+ * macro assuming the current locale if that conflicts somehow.
+ * You can't have everything. See tdf#116579 and tdf#125109. */
+if (eNumFormatType == SvNumFormatType::ALL)
+eNumFormatType = aParam.mpNumFormatter->GetType(nIndex);
+bool bForceFormatDate = (eNumFormatType == 
SvNumFormatType::DATE
+|| eNumFormatType == SvNumFormatType::DATETIME);
+const SvNumberformat* pOldFormat = nullptr;
+NfEvalDateFormat eEvalDateFormat = 
NF_EVALDATEFORMAT_INTL_FORMAT;
+if (bForceFormatDate)
+{
+ScRefCellValue aCell = GetCellValue(nRow);
+if (aCell.meType == CELLTYPE_VALUE)
+{
+// Only for an actual date (serial number), not an
+// arbitrary string or formula or empty cell.
+// Also ensure the edit date format's pattern is used,
+// not the display format's.
+pOldFormat = aParam.mpNumFormatter->GetEntry( 
nOldIndex);
+if (!pOldFormat)
+bForceFormatDate = false;
+else
+{
+nIndex = aParam.mpNumFormatter->GetEditFormat( 
aCell.getValue(), nOldIndex, eNumFormatType,
+pOldFormat->GetLanguage(), pOldFormat);
+eEvalDateFormat = 
aParam.mpNumFormatter->GetEvalDateFormat();
+aParam.mpNumFormatter->SetEvalDateFormat( 
NF_EVALDATEFORMAT_FORMAT_INTL);
+}
+}
+else
+{
+bForceFormatDate = false;
+}
+}
+
+const bool bIsNumberFormat = 
aParam.mpNumFormatter->IsNumberFormat(rString, nIndex, nVal);
+
+if (bForceFormatDate)
+aParam.mpNumFormatter->SetEvalDateFormat( eEvalDateFormat);
+
+if (!bIsNumberFormat)
 break;
 
 // convert back to the original language if a built-in format 
was detected
-const SvNumberformat* pOldFormat = 
aParam.mpNumFormatter->GetEntry( nOldIndex );
+if (!pOldFormat)
+pOldFormat = aParam.mpNumFormatter->GetEntry( nOldIndex );
 if ( pOldFormat )
 nIndex = 
aParam.mpNumFormatter->GetFormatForLanguageIfBuiltIn( nIndex, 
pOldFormat->GetLanguage() );
 
___
Libreoffice-commits mailing list

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

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

New commits:
commit 7e5554ca2e1f37168444592de623f5214194b537
Author: Eike Rathke 
AuthorDate: Sat Jun 1 00:18:46 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Sat Jun 1 04:07:39 2019 +0200

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

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

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

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

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

2019-05-27 Thread Caolán McNamara (via logerrit)
 sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx |   55 ++-
 1 file changed, 29 insertions(+), 26 deletions(-)

New commits:
commit e2df8f0245e93d7342fa6f65693b0d97639c3dae
Author: Caolán McNamara 
AuthorDate: Sun May 26 14:18:03 2019 +0100
Commit: Michael Stahl 
CommitDate: Mon May 27 11:33:12 2019 +0200

Resolves: rhbz#1713827 protect against null ViewShell

like SfxHintId::ScAccCursorChanged does

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

diff --git a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx 
b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
index 269379812e6f..adbf5d041d0d 100644
--- a/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
+++ b/sc/source/ui/Accessibility/AccessibleSpreadsheet.cxx
@@ -651,35 +651,38 @@ void ScAccessibleSpreadsheet::Notify( SfxBroadcaster& 
rBC, const SfxHint& rHint
 CommitTableModelChange(maRange.aStart.Row(), 
maRange.aStart.Col(), maRange.aEnd.Row(), maRange.aEnd.Col(), 
AccessibleTableModelChangeType::UPDATE);
 else
 mbDelIns = false;
-ScViewData& rViewData = mpViewShell->GetViewData();
-ScAddress aNewCell = rViewData.GetCurPos();
-if( maActiveCell == aNewCell)
+if (mpViewShell)
 {
-ScDocument* pScDoc= GetDocument(mpViewShell);
-if (pScDoc)
+ScViewData& rViewData = mpViewShell->GetViewData();
+ScAddress aNewCell = rViewData.GetCurPos();
+if( maActiveCell == aNewCell)
 {
-OUString 
valStr(pScDoc->GetString(aNewCell.Col(),aNewCell.Row(),aNewCell.Tab()));
-if(m_strCurCellValue != valStr)
-{
-AccessibleEventObject aEvent;
-aEvent.EventId = AccessibleEventId::VALUE_CHANGED;
-mpAccCell->CommitChange(aEvent);
-m_strCurCellValue=valStr;
-}
-OUString tabName;
-pScDoc->GetName( maActiveCell.Tab(), tabName );
-if( m_strOldTabName != tabName )
+ScDocument* pScDoc= GetDocument(mpViewShell);
+if (pScDoc)
 {
-AccessibleEventObject aEvent;
-aEvent.EventId = AccessibleEventId::NAME_CHANGED;
-OUString sOldName(ScResId(STR_ACC_TABLE_NAME));
-sOldName = sOldName.replaceFirst("%1", 
m_strOldTabName);
-aEvent.OldValue <<= sOldName;
-OUString sNewName(ScResId(STR_ACC_TABLE_NAME));
-sOldName = sNewName.replaceFirst("%1", tabName);
-aEvent.NewValue <<= sNewName;
-CommitChange( aEvent );
-m_strOldTabName = tabName;
+OUString 
valStr(pScDoc->GetString(aNewCell.Col(),aNewCell.Row(),aNewCell.Tab()));
+if(m_strCurCellValue != valStr)
+{
+AccessibleEventObject aEvent;
+aEvent.EventId = AccessibleEventId::VALUE_CHANGED;
+mpAccCell->CommitChange(aEvent);
+m_strCurCellValue=valStr;
+}
+OUString tabName;
+pScDoc->GetName( maActiveCell.Tab(), tabName );
+if( m_strOldTabName != tabName )
+{
+AccessibleEventObject aEvent;
+aEvent.EventId = AccessibleEventId::NAME_CHANGED;
+OUString sOldName(ScResId(STR_ACC_TABLE_NAME));
+sOldName = sOldName.replaceFirst("%1", 
m_strOldTabName);
+aEvent.OldValue <<= sOldName;
+OUString sNewName(ScResId(STR_ACC_TABLE_NAME));
+sOldName = sNewName.replaceFirst("%1", tabName);
+aEvent.NewValue <<= sNewName;
+CommitChange( aEvent );
+m_strOldTabName = tabName;
+}
 }
 }
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-08 Thread Caolán McNamara (via logerrit)
 sc/source/ui/attrdlg/tabpages.cxx |   71 +++---
 sc/source/ui/inc/tabpages.hxx |   25 -
 2 files changed, 81 insertions(+), 15 deletions(-)

New commits:
commit 2376db068d8194d3455681a559369e50743e29f3
Author: Caolán McNamara 
AuthorDate: Tue May 7 12:06:30 2019 +0100
Commit: Caolán McNamara 
CommitDate: Wed May 8 13:10:52 2019 +0200

Resolves: tdf#125106 fix cell protect TriState toggles

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

diff --git a/sc/source/ui/attrdlg/tabpages.cxx 
b/sc/source/ui/attrdlg/tabpages.cxx
index 4e82125791dc..6ce555b62085 100644
--- a/sc/source/ui/attrdlg/tabpages.cxx
+++ b/sc/source/ui/attrdlg/tabpages.cxx
@@ -49,10 +49,10 @@ ScTabPageProtection::ScTabPageProtection(TabPageParent 
pParent, const SfxItemSet
 //  States will be set in Reset
 bTriEnabled = bDontCare = bProtect = bHideForm = bHideCell = bHidePrint = 
false;
 
-m_xBtnProtect->connect_toggled(LINK(this, ScTabPageProtection, 
ButtonClickHdl));
-m_xBtnHideCell->connect_toggled(LINK(this, ScTabPageProtection, 
ButtonClickHdl));
-m_xBtnHideFormula->connect_toggled(LINK(this, ScTabPageProtection, 
ButtonClickHdl));
-m_xBtnHidePrint->connect_toggled(LINK(this, ScTabPageProtection, 
ButtonClickHdl));
+m_xBtnProtect->connect_toggled(LINK(this, ScTabPageProtection, 
ProtectClickHdl));
+m_xBtnHideCell->connect_toggled(LINK(this, ScTabPageProtection, 
HideCellClickHdl));
+m_xBtnHideFormula->connect_toggled(LINK(this, ScTabPageProtection, 
HideFormulaClickHdl));
+m_xBtnHidePrint->connect_toggled(LINK(this, ScTabPageProtection, 
HidePrintClickHdl));
 }
 
 ScTabPageProtection::~ScTabPageProtection()
@@ -98,14 +98,10 @@ void ScTabPageProtection::Reset( const SfxItemSet* 
rCoreAttrs )
 bHidePrint = pProtAttr->GetHidePrint();
 }
 
-//  Start Controls
-if (bTriEnabled)
-{
-m_xBtnProtect->set_state(TRISTATE_INDET);
-m_xBtnHideCell->set_state(TRISTATE_INDET);
-m_xBtnHideFormula->set_state(TRISTATE_INDET);
-m_xBtnHidePrint->set_state(TRISTATE_INDET);
-}
+aHideCellState.bTriStateEnabled = bTriEnabled;
+aProtectState.bTriStateEnabled = bTriEnabled;
+aHideFormulaState.bTriStateEnabled = bTriEnabled;
+aHidePrintState.bTriStateEnabled = bTriEnabled;
 
 UpdateButtons();
 }
@@ -148,7 +144,51 @@ DeactivateRC ScTabPageProtection::DeactivatePage( 
SfxItemSet* pSetP )
 return DeactivateRC::LeavePage;
 }
 
-IMPL_LINK(ScTabPageProtection, ButtonClickHdl, weld::ToggleButton&, rBox, void)
+void TriStateEnabled::ButtonToggled(weld::ToggleButton& rToggle)
+{
+if (bTriStateEnabled)
+{
+switch (eState)
+{
+case TRISTATE_INDET:
+rToggle.set_state(TRISTATE_FALSE);
+break;
+case TRISTATE_TRUE:
+rToggle.set_state(TRISTATE_INDET);
+break;
+case TRISTATE_FALSE:
+rToggle.set_state(TRISTATE_TRUE);
+break;
+}
+}
+eState = rToggle.get_state();
+}
+
+IMPL_LINK(ScTabPageProtection, ProtectClickHdl, weld::ToggleButton&, rBox, 
void)
+{
+aProtectState.ButtonToggled(rBox);
+ButtonClick(rBox);
+}
+
+IMPL_LINK(ScTabPageProtection, HideCellClickHdl, weld::ToggleButton&, rBox, 
void)
+{
+aHideCellState.ButtonToggled(rBox);
+ButtonClick(rBox);
+}
+
+IMPL_LINK(ScTabPageProtection, HideFormulaClickHdl, weld::ToggleButton&, rBox, 
void)
+{
+aHideFormulaState.ButtonToggled(rBox);
+ButtonClick(rBox);
+}
+
+IMPL_LINK(ScTabPageProtection, HidePrintClickHdl, weld::ToggleButton&, rBox, 
void)
+{
+aHidePrintState.ButtonToggled(rBox);
+ButtonClick(rBox);
+}
+
+void ScTabPageProtection::ButtonClick(weld::ToggleButton& rBox)
 {
 TriState eState = rBox.get_state();
 if (eState == TRISTATE_INDET)
@@ -192,6 +232,11 @@ void ScTabPageProtection::UpdateButtons()
 m_xBtnHidePrint->set_state(bHidePrint ? TRISTATE_TRUE : 
TRISTATE_FALSE);
 }
 
+aHideCellState.eState = m_xBtnHideCell->get_state();
+aProtectState.eState = m_xBtnProtect->get_state();
+aHideFormulaState.eState = m_xBtnHideFormula->get_state();
+aHidePrintState.eState = m_xBtnHidePrint->get_state();
+
 bool bEnable = (m_xBtnHideCell->get_state() != TRISTATE_TRUE);
 {
 m_xBtnProtect->set_sensitive(bEnable);
diff --git a/sc/source/ui/inc/tabpages.hxx b/sc/source/ui/inc/tabpages.hxx
index 8abd667ca7c7..5d195bb3cde2 100644
--- a/sc/source/ui/inc/tabpages.hxx
+++ b/sc/source/ui/inc/tabpages.hxx
@@ -22,6 +22,18 @@
 
 #include 
 
+struct TriStateEnabled
+{
+TriState eState;
+bool bTriStateEnabled;
+TriStateEnabled()
+: eState(TRISTATE_INDET)
+, bTriStateEnabled(true)
+{
+}
+void 

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

2019-05-07 Thread Eike Rathke (via logerrit)
 sc/source/ui/view/viewfun6.cxx |5 +
 1 file changed, 5 insertions(+)

New commits:
commit 905634202afe1d8562ae321909a40ff6117af2ad
Author: Eike Rathke 
AuthorDate: Mon May 6 15:42:20 2019 +0200
Commit: Adolfo Jayme Barrientos 
CommitDate: Tue May 7 16:51:42 2019 +0200

Resolves: tdf#124315 clear "Enter pastes" mode and marching ants overlay

Change-Id: Ief20ca2631c66c3c23410019ee0b7dfd9bd742a0
Reviewed-on: https://gerrit.libreoffice.org/71864
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 67d95af78b26d799e68859761dfe72771f71aeab)
Reviewed-on: https://gerrit.libreoffice.org/71874
Tested-by: Jenkins 
Reviewed-by: Adolfo Jayme Barrientos 

diff --git a/sc/source/ui/view/viewfun6.cxx b/sc/source/ui/view/viewfun6.cxx
index 8ab2a6d29e2d..f58008b2a4c4 100644
--- a/sc/source/ui/view/viewfun6.cxx
+++ b/sc/source/ui/view/viewfun6.cxx
@@ -329,6 +329,11 @@ void ScViewFunc::InsertCurrentTime(SvNumFormatType 
nReqFmt, const OUString& rUnd
 }
 else
 {
+// Clear "Enter pastes" mode.
+rViewData.SetPasteMode( ScPasteFlags::NONE );
+// Clear CopySourceOverlay in each window of a split/frozen tabview.
+rViewData.GetViewShell()->UpdateCopySourceOverlay();
+
 bool bForceReqFmt = false;
 const double fCell = rDoc.GetValue( aCurPos);
 // Combine requested date/time stamp with existing cell time/date, if 
any.
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-05-07 Thread Serge Krot (via logerrit)
 sc/source/core/data/table1.cxx |7 ---
 1 file changed, 7 deletions(-)

New commits:
commit 4d76f6232289f6a875b30a4cc7dec1226ffb70cb
Author: Serge Krot 
AuthorDate: Tue May 7 10:10:33 2019 +0200
Commit: Xisco Faulí 
CommitDate: Tue May 7 15:47:42 2019 +0200

tdf#124829 sc: fix crash during progress update

Call reschedule() during update of the cells height is not
thread safe.

Change-Id: Ia938aead79a048f12a53aa55c034e84ce3bf433b
Reviewed-on: https://gerrit.libreoffice.org/71892
Reviewed-by: Noel Grandin 
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens 
Signed-off-by: Xisco Fauli 
Reviewed-on: https://gerrit.libreoffice.org/71908

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index 9377c7111a6e..324fcc5284c2 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -109,7 +109,6 @@ void GetOptimalHeightsInColumn(
 
 sal_uLong nWeightedCount = nProgressStart + 
rCol.back().GetWeightedCount(nStartRow, nEndRow);
 const SCCOL maxCol = (rCol.size() - 1); // last col done already above
-const SCCOL progressUpdateStep = rCol.size() / 10;
 for (SCCOL nCol=0; nColSetState( nWeightedCount );
-
-if ((nCol % progressUpdateStep) == 0)
-{
-// try to make sure the progress dialog is painted before 
continuing
-Application::Reschedule(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-2' - sc/source

2019-04-30 Thread Caolán McNamara (via logerrit)
 sc/source/ui/miscdlgs/acredlin.cxx |   45 +++--
 1 file changed, 28 insertions(+), 17 deletions(-)

New commits:
commit 80c1d52946d3d60721f7d76e537caa722a5ca5a6
Author: Caolán McNamara 
AuthorDate: Tue Apr 23 11:06:20 2019 +0100
Commit: Miklos Vajna 
CommitDate: Tue Apr 30 15:18:16 2019 +0200

multiple concatted AcceptChgDat stored in config

FillInfo is called more often than Initialize, so we've ended up
with multiple AcceptChgDat strings

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

diff --git a/sc/source/ui/miscdlgs/acredlin.cxx 
b/sc/source/ui/miscdlgs/acredlin.cxx
index b1294a0ddff6..3349eee8e910 100644
--- a/sc/source/ui/miscdlgs/acredlin.cxx
+++ b/sc/source/ui/miscdlgs/acredlin.cxx
@@ -1714,34 +1714,43 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, CommandHdl, 
SvSimpleTable*, void)
 }
 }
 
-void ScAcceptChgDlg::Initialize(SfxChildWinInfo *pInfo)
+namespace
 {
-OUString aStr;
-if(pInfo!=nullptr)
+//at one point we were writing multiple AcceptChgDat strings,
+//so strip all of them and keep the results of the last one
+OUString lcl_StripAcceptChgDat(OUString )
 {
-if ( !pInfo->aExtraString.isEmpty() )
+OUString aStr;
+while (true)
 {
-sal_Int32 nPos = pInfo->aExtraString.indexOf("AcceptChgDat:");
-
+sal_Int32 nPos = rExtraString.indexOf("AcceptChgDat:");
+if (nPos == -1)
+break;
 // Try to read the alignment string "ALIGN:(...)"; if it is missing
 // we have an old version
-if ( nPos != -1 )
+sal_Int32 n1 = rExtraString.indexOf('(', nPos);
+if ( n1 != -1 )
 {
-sal_Int32 n1 = pInfo->aExtraString.indexOf('(', nPos);
-if ( n1 != -1 )
+sal_Int32 n2 = rExtraString.indexOf(')', n1);
+if ( n2 != -1 )
 {
-sal_Int32 n2 = pInfo->aExtraString.indexOf(')', n1);
-if ( n2 != -1 )
-{
-// cut out alignment string
-aStr = pInfo->aExtraString.copy(nPos, n2 - nPos + 1);
-pInfo->aExtraString = 
pInfo->aExtraString.replaceAt(nPos, n2 - nPos + 1, "");
-aStr = aStr.copy( n1-nPos+1 );
-}
+// cut out alignment string
+aStr = rExtraString.copy(nPos, n2 - nPos + 1);
+rExtraString = rExtraString.replaceAt(nPos, n2 - nPos + 1, 
"");
+aStr = aStr.copy( n1-nPos+1 );
 }
 }
 }
+return aStr;
 }
+}
+
+void ScAcceptChgDlg::Initialize(SfxChildWinInfo *pInfo)
+{
+OUString aStr;
+if (pInfo && !pInfo->aExtraString.isEmpty())
+aStr = lcl_StripAcceptChgDat(pInfo->aExtraString);
+
 SfxModelessDialog::Initialize(pInfo);
 
 if ( !aStr.isEmpty())
@@ -1760,6 +1769,8 @@ void ScAcceptChgDlg::Initialize(SfxChildWinInfo *pInfo)
 void ScAcceptChgDlg::FillInfo(SfxChildWinInfo& rInfo) const
 {
 SfxModelessDialog::FillInfo(rInfo);
+//remove any old one before adding a new one
+lcl_StripAcceptChgDat(rInfo.aExtraString);
 rInfo.aExtraString += "AcceptChgDat:(";
 
 sal_uInt16  nCount=pTheView->TabCount();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-26 Thread Noel Grandin (via logerrit)
 sc/source/filter/oox/sheetdatabuffer.cxx |3 +++
 1 file changed, 3 insertions(+)

New commits:
commit 9dac5b11bc9d8b9709611846d6ded07cecacc94c
Author: Noel Grandin 
AuthorDate: Wed Apr 24 18:51:08 2019 +0200
Commit: Noel Grandin 
CommitDate: Fri Apr 26 22:05:21 2019 +0200

tdf67629 FILEOPEN Particular .xlsx hangs Spreadsheet

Seems like this is a somewhat pathological document, has lots of
duplicated ranges. Checking for duplicates makes it load in <10s on my
machine

Change-Id: I25da24e0f8b1d4ad99d00474be168c75586ea579
Reviewed-on: https://gerrit.libreoffice.org/71251
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit e1ebb5cb58edc325bb30bb5eb992665fb861960f)
Reviewed-on: https://gerrit.libreoffice.org/71379

diff --git a/sc/source/filter/oox/sheetdatabuffer.cxx 
b/sc/source/filter/oox/sheetdatabuffer.cxx
index ba323332b24d..1c120fe05392 100644
--- a/sc/source/filter/oox/sheetdatabuffer.cxx
+++ b/sc/source/filter/oox/sheetdatabuffer.cxx
@@ -672,6 +672,9 @@ void SheetDataBuffer::setCellFormat( const CellModel& 
rModel )
  * It is sufficient to check if the row range size is one
  */
 if (!rRangeList.empty() &&
+*pLastRange == rModel.maCellAddr)
+; // do nothing - this probably bad data
+else if (!rRangeList.empty() &&
 pLastRange->aStart.Tab() == rModel.maCellAddr.Tab() &&
 pLastRange->aStart.Row() == pLastRange->aEnd.Row() &&
 pLastRange->aStart.Row() == rModel.maCellAddr.Row() &&
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-24 Thread Katarina Behrens (via logerrit)
 sc/source/core/data/document.cxx |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

New commits:
commit 26984ec23769404496e5898b2cbbaeabc6ac6a4b
Author: Katarina Behrens 
AuthorDate: Tue Apr 23 11:59:40 2019 +0200
Commit: Thorsten Behrens 
CommitDate: Wed Apr 24 13:33:38 2019 +0200

Skip clipboard queries while the document is still loading

Use-case here is .ods document with 16k tracked changes. For every
tracked change, Calc generates a formula cell. For every formula
cell, clipboard content is queried (via ScDocument::IsClipboardSource,
ScModule::GetClipDoc respectively). This is dog-slow on Windows

Therefore don't query clipboard content while the document is in
the process of being loaded. Instead return from ScDocument::
IsClipboardSource early and return 'false' because at this point
of time it can't be reliably determined whether this doc is a clipboard
source anyway

Change-Id: If5aa62cbfb62fb326a3c73b4d9be839127d3c03b
Reviewed-on: https://gerrit.libreoffice.org/71121
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 
(cherry picked from commit 9c8aa1c217f016fae9a57c6a4feca43551e5068e)
Reviewed-on: https://gerrit.libreoffice.org/71146
Tested-by: Jenkins
Reviewed-by: Katarina Behrens 

diff --git a/sc/source/core/data/document.cxx b/sc/source/core/data/document.cxx
index dae92c818b37..b54ef92a1410 100644
--- a/sc/source/core/data/document.cxx
+++ b/sc/source/core/data/document.cxx
@@ -2564,7 +2564,8 @@ void ScDocument::SetClipParam(const ScClipParam& rParam)
 
 bool ScDocument::IsClipboardSource() const
 {
-if (bIsClip || mpShell == nullptr)
+if (bIsClip || mpShell == nullptr ||
+(mpShell && mpShell->IsLoading()))
 return false;
 
 ScDocument* pClipDoc = ScModule::GetClipDoc();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-11 Thread Miklos Vajna (via logerrit)
 sc/source/ui/view/notemark.cxx |   17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

New commits:
commit 600fbb77a0869723dd00b6ec1643bac1be2e211c
Author: Miklos Vajna 
AuthorDate: Thu Apr 11 09:13:59 2019 +0200
Commit: Luboš Luňák 
CommitDate: Thu Apr 11 17:25:04 2019 +0200

tdf#122767 sc opengl: fix rendering artifacts after hiding a cell comment

Actually this is not specific to opengl, affects e.g. the Linux gen
backend as well, it just doesn't happen with the Windows gdi backend.

The rendering of the caption itself was OK. Focusing on the arrow
polygon at the end of the comment's "tail" (connector polyline):

- What gets painted is determined by SdrCaptionObj ->
  ViewContactOfSdrCaptionObj::createViewIndependentPrimitive2DSequence(),
  which produces a PolyPolygonColorPrimitive2D, which is then processed by
  VclPixelProcessor2D::tryDrawPolyPolygonColorPrimitive2DDirect().

- The polygon passed to VCL there is within the bounds of the
  invalidation rectangle set in ScNoteMarker::TimeHdl().

So it seems the only reason sometimes these 1px rendering artifacts are
left around is anti-aliasing. Fix those by simply extending the
invalidation rectangle in each direction.

(cherry picked from commit 37aa4f0d64e276c46821ef6122483fb6b4c04781)

Change-Id: I37b8e666999d3ff5ee1328fca7ac017ee8c7e9e0
Reviewed-on: https://gerrit.libreoffice.org/70585
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 

diff --git a/sc/source/ui/view/notemark.cxx b/sc/source/ui/view/notemark.cxx
index b18d54a44173..87da6bed 100644
--- a/sc/source/ui/view/notemark.cxx
+++ b/sc/source/ui/view/notemark.cxx
@@ -172,21 +172,30 @@ void ScNoteMarker::InvalidateWin()
 {
 if (m_bVisible)
 {
-m_pWindow->Invalidate( OutputDevice::LogicToLogic(m_aRect, m_aMapMode, 
m_pWindow->GetMapMode()) );
+// Extend the invalidated rectangle by 1 pixel in each direction in 
case AA would slightly
+// paint outside the nominal area.
+tools::Rectangle aRect(m_aRect);
+const Size aPixelSize = m_pWindow->PixelToLogic(Size(1, 1));
+aRect.AdjustLeft(-aPixelSize.getWidth());
+aRect.AdjustTop(-aPixelSize.getHeight());
+aRect.AdjustRight(aPixelSize.getWidth());
+aRect.AdjustBottom(aPixelSize.getHeight());
+
+m_pWindow->Invalidate( OutputDevice::LogicToLogic(aRect, m_aMapMode, 
m_pWindow->GetMapMode()) );
 
 if ( m_pRightWin || m_pBottomWin )
 {
 Size aWinSize = m_pWindow->PixelToLogic( 
m_pWindow->GetOutputSizePixel(), m_aMapMode );
 if ( m_pRightWin )
-m_pRightWin->Invalidate( OutputDevice::LogicToLogic(m_aRect,
+m_pRightWin->Invalidate( OutputDevice::LogicToLogic(aRect,
 lcl_MoveMapMode( m_aMapMode, Size( 
aWinSize.Width(), 0 ) ),
 m_pRightWin->GetMapMode()) );
 if ( m_pBottomWin )
-m_pBottomWin->Invalidate( OutputDevice::LogicToLogic(m_aRect,
+m_pBottomWin->Invalidate( OutputDevice::LogicToLogic(aRect,
 lcl_MoveMapMode( m_aMapMode, Size( 0, 
aWinSize.Height() ) ),
 m_pBottomWin->GetMapMode()) );
 if ( m_pDiagWin )
-m_pDiagWin->Invalidate( OutputDevice::LogicToLogic(m_aRect,
+m_pDiagWin->Invalidate( OutputDevice::LogicToLogic(aRect,
 lcl_MoveMapMode( m_aMapMode, aWinSize 
),
 m_pDiagWin->GetMapMode()) );
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - 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 acc33b803ebff910139c7a7cabba6aa2e242fad3
Author: Samuel Mehrbrodt 
AuthorDate: Fri Mar 29 07:43:00 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Apr 8 13:44:20 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/70401
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/ui/unoobj/shapeuno.cxx b/sc/source/ui/unoobj/shapeuno.cxx
index 49ce7146ccd1..739fd4223fb1 100644
--- a/sc/source/ui/unoobj/shapeuno.cxx
+++ b/sc/source/ui/unoobj/shapeuno.cxx
@@ -507,7 +507,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;
@@ -591,7 +593,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;
@@ -719,7 +723,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;
@@ -779,7 +784,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-2' - sc/source

2019-04-06 Thread Dennis Francis (via logerrit)
 sc/source/ui/undo/undoblk.cxx |4 
 1 file changed, 4 deletions(-)

New commits:
commit 559dadd0d6eaa61dab7e0bc2a510b87b7109be22
Author: Dennis Francis 
AuthorDate: Thu Apr 4 14:07:11 2019 +0530
Commit: Dennis Francis 
CommitDate: Sat Apr 6 16:05:30 2019 +0200

tdf#124326 : ScUndoDragDrop : don't do update references...

on undo, as all affected formula-cells are preserved in original
form in the undo document. This is ensured by the drag-drop
move-block code (ScDocFunc::MoveBlock) which in-turn calls
ScDocument::UpdateReference, which records all original
formula-cells to the undo-document.

Anyway the sc::RefMovedHint object created in ScUndoDragDrop::Undo
is wrong, as it operates on original data-range(aCxt.maRange = aSrcRange)
which is interpreted as "old data-range" in the context of undo-move
operation.

Change-Id: Ic48cc3fa51fdb17e9338f65ac95b8e8d30c2c92c
Reviewed-on: https://gerrit.libreoffice.org/70315
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
(cherry picked from commit 9079da7f62febaf4cef0b77320c31b4e8bb6b5a5)
Reviewed-on: https://gerrit.libreoffice.org/70327

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 71e29b1ee357..6e0f254d34bb 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1355,10 +1355,6 @@ void ScUndoDragDrop::Undo()
 pName->UpdateReference(aCxt, nTab);
 }
 
-// Notify all listeners of the destination range, and have them update 
their references.
-sc::RefMovedHint aHint(aDestRange, ScAddress(nColDelta, nRowDelta, 
nTabDelta), aCxt);
-rDoc.BroadcastRefMoved(aHint);
-
 ScValidationDataList* pValidList = rDoc.GetValidationList();
 if (pValidList)
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-04-03 Thread Dennis Francis (via logerrit)
 sc/source/ui/undo/undoblk.cxx |   28 +---
 1 file changed, 1 insertion(+), 27 deletions(-)

New commits:
commit 01f5cc7c6a1467ec3a788ffb0fb29a6a64963578
Author: Dennis Francis 
AuthorDate: Fri Mar 29 18:34:22 2019 +0530
Commit: Eike Rathke 
CommitDate: Wed Apr 3 12:15:44 2019 +0200

tdf#120270 : ScUndoDragDrop - Notifying listeners of the area...

is not enough. This needs to be done recursively, ie notify the
listeners, notify the listeners of the listeners and so on.
ScDocument::BroadcastCells() seems to do exactly that, so lets
use it here intead of collect+notify.

Change-Id: Ifa273fea5f08af661958cd9b4c3d01d9044b8727
Reviewed-on: https://gerrit.libreoffice.org/70044
Reviewed-by: Dennis Francis 
Tested-by: Dennis Francis 
(cherry picked from commit 86ba9cdc69976d9cdb7d6ec1a527012647abf10d)
Reviewed-on: https://gerrit.libreoffice.org/70179
Tested-by: Jenkins
Reviewed-by: Eike Rathke 

diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 4e982824e2ea..71e29b1ee357 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1317,22 +1317,6 @@ void ScUndoDragDrop::DoUndo( ScRange aRange )
 maPaintRanges.Join(aPaintRange);
 }
 
-namespace {
-
-class DataChangeNotifier
-{
-ScHint const maHint;
-public:
-DataChangeNotifier() : maHint(SfxHintId::ScDataChanged, ScAddress()) {}
-
-void operator() ( SvtListener* p )
-{
-p->Notify(maHint);
-}
-};
-
-}
-
 void ScUndoDragDrop::Undo()
 {
 mnPaintExtFlags = 0;
@@ -1385,17 +1369,7 @@ void ScUndoDragDrop::Undo()
 DoUndo(aDestRange);
 DoUndo(aSrcRange);
 
-// Notify all area listeners whose listened areas are partially moved, 
to
-// recalculate.
-std::vector aListeners;
-rDoc.CollectAllAreaListeners(aListeners, aSrcRange, 
sc::AreaPartialOverlap);
-
-// Remove any duplicate listener entries.  We must ensure that we 
notify
-// each unique listener only once.
-std::sort(aListeners.begin(), aListeners.end());
-aListeners.erase(std::unique(aListeners.begin(), aListeners.end()), 
aListeners.end());
-
-std::for_each(aListeners.begin(), aListeners.end(), 
DataChangeNotifier());
+rDoc.BroadcastCells(aSrcRange, SfxHintId::ScDataChanged, false);
 }
 else
 DoUndo(aDestRange);
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - 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 205f9756f70fe32db169d6f81795f4c66382d014
Author: Jaromir Wysoglad 
AuthorDate: Thu Mar 28 19:55:23 2019 +0100
Commit: Eike Rathke 
CommitDate: Wed Apr 3 11:18:42 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/70153

diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx 
b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index a655c8c1bd51..1f823fae8204 100644
--- a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
+++ b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
@@ -67,7 +67,7 @@ OUString lclCreateMultiParameterFormula(
 OUStringBuffer 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.append(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-2' - sc/source

2019-03-28 Thread Luboš Luňák (via logerrit)
 sc/source/core/data/simpleformulacalc.cxx |   10 ++
 sc/source/core/tool/interpr1.cxx  |   23 +--
 2 files changed, 19 insertions(+), 14 deletions(-)

New commits:
commit e68e9b2d61376b989bd4f61d38b7e06d0ee591cb
Author: Luboš Luňák 
AuthorDate: Tue Mar 12 15:41:46 2019 +0100
Commit: Xisco Faulí 
CommitDate: Thu Mar 28 14:41:41 2019 +0100

avoid a crash with an editor-forced matrix formula (tdf#123479)

Normally when ScInterpreter has bMatrixFormula set, pMyFormulaCell
is set as well (done in the ctor). But in some rare cases,
this may not be so, and some functions such as ScRandom() already
check for this. But not all do, tdf#123479 specifically crashes
because ec97496525f82f added AssertFormulaMatrix() to force
bMatrixFormula be set without pMyFormulaCell being set, and ScColumn()
doesn't handle this case.

Fix this by trying to pass ScFormulaCell* to ScInterpreter when
AssertFormulaMatrix() is used, this should ensure the result
in the formula editor fits better the edited formula. Since there
still may be cases when the cell is not set (e.g. editing a new
formula), also handle that case gracefully.

Ideally ScSimpleFormulaCalculator should pass ScMarkData to ScInterpreter
in such cases so that those functions use that when they can't use
GetMatColsRows(), but currently the handling of selections is rather
poor in the formula edit dialog: Non-array formulas are simply entered
in one cell and the selection is ignored, in case of a multi-selection
there's an error dialog only after the dialog is closed, and the result
field of the dialog is rather small and doesn't scroll, so e.g. matrix
result of ScRandom() wouldn't show more than one item anyway. Given that
tdf#123479 is a priority bug, better just fix it and possibly handle
selections better somewhen later.

Change-Id: I5fcbe1e358fac3623d4917eb0ead8eae00a1e153
Reviewed-on: https://gerrit.libreoffice.org/69161
Reviewed-by: Dennis Francis 
Reviewed-by: Markus Mohrhard 
Tested-by: Luboš Luňák 
(cherry picked from commit ade1df0948563b532a5d293c31d46a4f042559ee)
Reviewed-on: https://gerrit.libreoffice.org/69849
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/simpleformulacalc.cxx 
b/sc/source/core/data/simpleformulacalc.cxx
index 3ed2c173f3c6..972f5091cad5 100644
--- a/sc/source/core/data/simpleformulacalc.cxx
+++ b/sc/source/core/data/simpleformulacalc.cxx
@@ -45,14 +45,14 @@ void ScSimpleFormulaCalculator::Calculate()
 return;
 
 mbCalculated = true;
-ScInterpreter aInt(nullptr, mpDoc, mpDoc->GetNonThreadedContext(), maAddr, 
*mpCode);
-
-std::unique_ptr pNewLinkMgr( new 
sfx2::LinkManager(mpDoc->GetDocumentShell()) );
-aInt.SetLinkManager( pNewLinkMgr.get() );
 
+ScInterpreter aInt(mpDoc->GetFormulaCell( maAddr ), mpDoc, 
mpDoc->GetNonThreadedContext(), maAddr, *mpCode);
 if (mbMatrixFormula)
 aInt.AssertFormulaMatrix();
 
+std::unique_ptr pNewLinkMgr( new 
sfx2::LinkManager(mpDoc->GetDocumentShell()) );
+aInt.SetLinkManager( pNewLinkMgr.get() );
+
 formula::StackVar aIntType = aInt.Interpret();
 if ( aIntType == formula::svMatrixCell )
 {
@@ -94,6 +94,8 @@ bool ScSimpleFormulaCalculator::IsValue()
 
 bool ScSimpleFormulaCalculator::IsMatrix()
 {
+Calculate();
+
 return mbMatrixResult;
 }
 
diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx
index fc0600368b7f..e7d00deb6aac 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -1738,11 +1738,12 @@ void ScInterpreter::ScPi()
 
 void ScInterpreter::ScRandom()
 {
-if (bMatrixFormula && pMyFormulaCell)
+if (bMatrixFormula)
 {
-SCCOL nCols;
-SCROW nRows;
-pMyFormulaCell->GetMatColsRows( nCols, nRows);
+SCCOL nCols = 0;
+SCROW nRows = 0;
+if(pMyFormulaCell)
+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()
@@ -4385,9 +4386,10 @@ void ScInterpreter::ScColumn()
 nVal = aPos.Col() + 1;
 if (bMatrixFormula)
 {
-SCCOL nCols;
-SCROW nRows;
-pMyFormulaCell->GetMatColsRows( nCols, nRows);
+SCCOL nCols = 0;
+SCROW nRows = 0;
+if (pMyFormulaCell)
+pMyFormulaCell->GetMatColsRows( nCols, nRows);
 if (nCols == 0)
 {
 // Happens if called via ScViewFunc::EnterMatrix()
@@ -4488,9 +4490,10 @@ void ScInterpreter::ScRow()
 nVal = aPos.Row() + 1;
 

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

2019-03-25 Thread Tomáš Chvátal (via logerrit)
 sc/source/core/tool/interpr1.cxx |   14 --
 1 file changed, 12 insertions(+), 2 deletions(-)

New commits:
commit 04074fe336be514d3d3f3537e6ff915a7604f6f4
Author: Tomáš Chvátal 
AuthorDate: Fri Mar 15 16:43:31 2019 +0100
Commit: Caolán McNamara 
CommitDate: Mon Mar 25 16:35:05 2019 +0100

Use RegexMatcher.find(pos, status) call on old ICU

The RegexMatcher.find(status) is new since icu 55 and this works even
on the old releases thus revert there to the available albeit slower
call.

Change-Id: I964c10efd15515b04ac9037cda3b5b309910baf5
Reviewed-on: https://gerrit.libreoffice.org/69311
Tested-by: Jenkins
Reviewed-by: Eike Rathke 
Reviewed-on: https://gerrit.libreoffice.org/69312
Reviewed-by: Tomáš Chvátal 
Tested-by: Tomáš Chvátal 
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 c9c3624bb019..fc0600368b7f 100644
--- a/sc/source/core/tool/interpr1.cxx
+++ b/sc/source/core/tool/interpr1.cxx
@@ -9411,7 +9411,12 @@ void ScInterpreter::ScRegex()
 {
 // Find n-th occurrence.
 sal_Int32 nCount = 0;
-while (aRegexMatcher.find( status) && U_SUCCESS(status) && ++nCount < 
nOccurrence)
+#if (U_ICU_VERSION_MAJOR_NUM < 55)
+int32_t nStartPos = 0;
+while (aRegexMatcher.find(nStartPos, status) && U_SUCCESS(status) && 
++nCount < nOccurrence)
+#else
+while (aRegexMatcher.find(status) && U_SUCCESS(status) && ++nCount < 
nOccurrence)
+#endif
 ;
 if (U_FAILURE(status))
 {
@@ -9451,7 +9456,12 @@ void ScInterpreter::ScRegex()
 {
 // Replace n-th occurrence of match with replacement.
 sal_Int32 nCount = 0;
-while (aRegexMatcher.find( status) && U_SUCCESS(status))
+#if (U_ICU_VERSION_MAJOR_NUM < 55)
+int32_t nStartPos = 0;
+while (aRegexMatcher.find(nStartPos, status) && U_SUCCESS(status))
+#else
+while (aRegexMatcher.find(status) && U_SUCCESS(status))
+#endif
 {
 // XXX NOTE: After several RegexMatcher::find() the
 // RegexMatcher::appendReplacement() still starts at the
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-25 Thread Noel Grandin (via logerrit)
 sc/source/filter/excel/xistream.cxx |4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 2508f949f1f20bb353f8bef1bd908f9cf3b039ef
Author: Noel Grandin 
AuthorDate: Mon Mar 25 12:03:22 2019 +0200
Commit: Caolán McNamara 
CommitDate: Mon Mar 25 16:30:56 2019 +0100

tdf#124318 FILEOPEN: XLS Hyperlink URL incorrect

regression from
commit 52f69445c55c9af8ad97bee6da335b4592d56d4d
Date:   Wed Aug 1 17:03:18 2018 +0200
loplugin:stringloop in sc

Change-Id: I7d481ea27866fc146c5de9d027aa7bb308f14e52
Reviewed-on: https://gerrit.libreoffice.org/69652
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit 756252ce13f541049af620983f6741223d44573b)
Reviewed-on: https://gerrit.libreoffice.org/69660
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/filter/excel/xistream.cxx 
b/sc/source/filter/excel/xistream.cxx
index e48d596bd5ef..649c8f9ce2df 100644
--- a/sc/source/filter/excel/xistream.cxx
+++ b/sc/source/filter/excel/xistream.cxx
@@ -867,7 +867,9 @@ OUString XclImpStream::ReadRawUniString( sal_uInt16 nChars, 
bool b16Bit )
 }
 
 *pcEndChar = '\0';
-aRet.append( pcBuffer.get(), pcUniChar - pcBuffer.get()  );
+// this has the side-effect of only copying as far as the first null, 
which appears to be intentional. e.g.
+// see tdf#124318
+aRet.append( pcBuffer.get() );
 
 nCharsLeft = nCharsLeft - nReadSize;
 if( nCharsLeft > 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-2' - sc/source

2019-03-19 Thread Libreoffice Gerrit user
 sc/source/core/tool/parclass.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit e0baddc00570692e09834f165b4e1913575fc338
Author: Eike Rathke 
AuthorDate: Wed Feb 27 13:57:25 2019 +0100
Commit: Caolán McNamara 
CommitDate: Tue Mar 19 13:46:58 2019 +0100

Related: tdf#122301 TRANSPOSE() with ForceArrayReturn on caller

 This is a combination of 2 commits.

Related: tdf#122301 TRANSPOSE() with ForceArrayReturn on caller

As stated in

ECMA-376-1:2016 OOXML 18.17.7.327 TRANSPOSE
"The formula containing the call to TRANSPOSE shall be an array
formula [...]"

Similar to

commit d0ded163d8e93dc5b10d7a7c9bdab1d0a6a50bac
CommitDate: Wed Jan 16 11:17:14 2019 +0100

Related: tdf#122301 FREQUENCY() with ForceArrayReturn on caller

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

ocMatTrans with ForceArray

Now that OOXML reveiled that the formula expression containing a
TRANSPOSE() call shall be in array mode, the old comment about
Excel not forcing array on the argument (in BIFF token class)
makes sense. Use ForceArray and remove now moot comment.

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

Change-Id: I617bfcc0b8ecb244df3441ab885ec926efd77e3f
ab2bced788de3429aab2bb7c3ca7f24d5dbf0340
Reviewed-on: https://gerrit.libreoffice.org/69275
Tested-by: Jenkins
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/parclass.cxx b/sc/source/core/tool/parclass.cxx
index ce6c9094cc71..a5c55d1a49c0 100644
--- a/sc/source/core/tool/parclass.cxx
+++ b/sc/source/core/tool/parclass.cxx
@@ -173,7 +173,7 @@ const ScParameterClassification::RawData 
ScParameterClassification::pRawData[] =
 { ocMatDet,  {{ ForceArray 
  }, 0, Value }},
 { ocMatInv,  {{ ForceArray 
  }, 0, Value }},
 { ocMatMult, {{ ForceArray, ForceArray 
  }, 0, Value }},
-{ ocMatTrans,{{ Array  
  }, 0, Value }}, // strange, but Xcl doesn't force MatTrans array
+{ ocMatTrans,{{ ForceArray 
  }, 0, ForceArrayReturn }},
 { ocMatValue,{{ Reference, Value, Value
  }, 0, Value }},
 { ocMatch,   {{ Value, ReferenceOrForceArray, Value
  }, 0, Value }},
 { ocMax, {{ ReferenceOrRefArray
  }, 1, Value }},
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

2019-03-19 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 9e9fb722f10a7e49093566e746ed50632895344c
Author: Luboš Luňák 
AuthorDate: Tue Mar 5 12:41:44 2019 +0100
Commit: Xisco Faulí 
CommitDate: Tue Mar 19 10:58:03 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/69261
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/inc/printfun.hxx b/sc/source/ui/inc/printfun.hxx
index 7115b7f20845..7184e6e15e3a 100644
--- a/sc/source/ui/inc/printfun.hxx
+++ b/sc/source/ui/inc/printfun.hxx
@@ -150,6 +150,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;
@@ -172,6 +173,7 @@ struct ScPrintState //  Save 
Variables from ScPrintFunc
 , nStartRow(0)
 , nEndCol(0)
 , nEndRow(0)
+, bPrintAreaValid(false)
 , nZoom(0)
 , nPagesX(0)
 , nPagesY(0)
@@ -209,7 +211,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;
@@ -258,6 +260,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 42cb2fb3f90a..8b6e4d588df9 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  = rState.nPageStart;
 nDocPages   = rState.nDocPages;
-

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

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

New commits:
commit f0b71fafd3a2fd6158c5952d601092179cba21e5
Author: Serge Krot 
AuthorDate: Wed Mar 6 23:49:54 2019 +0100
Commit: Thorsten Behrens 
CommitDate: Thu Mar 14 10:18:07 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) 

diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx
index 3c6baec93899..6f60c4895741 100644
--- a/sc/source/ui/unoobj/docuno.cxx
+++ b/sc/source/ui/unoobj/docuno.cxx
@@ -1985,7 +1985,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-2' - sc/source

2019-03-13 Thread Libreoffice Gerrit user
 sc/source/core/data/column2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 90752744ec69241c41140db9f21bb0c9aabea957
Author: Serge Krot 
AuthorDate: Thu Feb 28 10:41:40 2019 +0100
Commit: Xisco Faulí 
CommitDate: Wed Mar 13 20:08:39 2019 +0100

tdf#121040 sc: use pixel-per-twips in X for horizontal value conversion

Change-Id: I25bc3b3ec42ef5b026c2cd9572e8ff1863ed8c2d
Reviewed-on: https://gerrit.libreoffice.org/68492
Reviewed-by: Thorsten Behrens 
Tested-by: Thorsten Behrens 
(cherry picked from commit 1b4cfd79240f153703a02d63639b3895ab7c1d1b)
Reviewed-on: https://gerrit.libreoffice.org/69206
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 1590ab55380b..2a8a135f3f88 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -347,7 +347,7 @@ long ScColumn::GetNeededSize(
 long nDocPixel = static_cast( ( pDocument->GetColWidth( 
nCol,nTab ) -
 pMargin->GetLeftMargin() - 
pMargin->GetRightMargin() -
 nIndent )
-* nPPT );
+* nPPTX );
 nDocPixel = (nDocPixel * 9) / 10;   // for safety
 if ( aSize.Width() > nDocPixel )
 bEditEngine = 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-2' - sc/source

2019-03-01 Thread Libreoffice Gerrit user
 sc/source/core/data/column2.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit b21d76201e8355207721cc442fc4f204f3061a76
Author: Luboš Luňák 
AuthorDate: Mon Feb 25 14:37:48 2019 +0100
Commit: Michael Meeks 
CommitDate: Fri Mar 1 12:32:03 2019 +0100

avoid std::out_of_range thrown by mdds (tdf#122643)

Calling GetLastDataRow/Pos() with MAXROW as the last row is apparently
fine, but if that's an invalid row, but anything beyond that is not ok.
ScDependantsCalculator::trimLength() may use such larger "last" row
value because it works on a range of cells.

Change-Id: I819a4d20a4765e23af6208df5f2e208ac44b694c
Reviewed-on: https://gerrit.libreoffice.org/68349
Tested-by: Jenkins
Reviewed-by: Michael Meeks 
Reviewed-by: Kohei Yoshida 
(cherry picked from commit beba45a5639bc32ca6893885ca3b1f07e3175c08)
Reviewed-on: https://gerrit.libreoffice.org/68512

diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx
index 1124c162c0c2..1590ab55380b 100644
--- a/sc/source/core/data/column2.cxx
+++ b/sc/source/core/data/column2.cxx
@@ -1305,7 +1305,7 @@ SCROW ScColumn::GetLastDataPos() const
 SCROW ScColumn::GetLastDataPos( SCROW nLastRow, bool bConsiderCellNotes,
 bool bConsiderCellDrawObjects ) const
 {
-sc::CellStoreType::const_position_type aPos = maCells.position(nLastRow);
+sc::CellStoreType::const_position_type aPos = 
maCells.position(std::min(nLastRow,MAXROW));
 
 if (bConsiderCellNotes && !IsNotesEmptyBlock(nLastRow, nLastRow))
 return nLastRow;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - 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 d9ccfe80c592d25cc12193474206f8998e317050
Author: Noel Grandin 
AuthorDate: Thu Feb 28 11:41:01 2019 +0200
Commit: Caolán McNamara 
CommitDate: Thu Feb 28 17:35:07 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/68502
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 a4312467b4fe..e0214146bce9 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -984,7 +984,7 @@ void ScDocShell::Execute( SfxRequest& rReq )
 {
 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-2' - sc/source

2019-02-13 Thread Libreoffice Gerrit user
 sc/source/core/tool/compiler.cxx |   26 +++---
 1 file changed, 23 insertions(+), 3 deletions(-)

New commits:
commit 99b0a3702d9c04c68d33adb9fbf1fd289618cc89
Author: Eike Rathke 
AuthorDate: Tue Jan 29 15:25:52 2019 +0100
Commit: Caolán McNamara 
CommitDate: Wed Feb 13 10:02:47 2019 +0100

Resolves: tdf#93951 set remainder as bad string if not parsed as valid

Change-Id: Ieb9fa5e9cd2d5919a36fbe65ced107eab33c72e2
Reviewed-on: https://gerrit.libreoffice.org/67090
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit 7d6f30d04c51088b26815c241a7473c48822c6c3)
Reviewed-on: https://gerrit.libreoffice.org/67115
Reviewed-by: Caolán McNamara 
Tested-by: Caolán McNamara 

diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index eef51bbeecff..7ed3845f967e 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -2630,6 +2630,7 @@ Label_MaskStateMachine:
 }
 if ( bi18n )
 {
+const sal_Int32 nOldSrcPos = nSrcPos;
 nSrcPos = nSrcPos + nSpaces;
 OUStringBuffer aSymbol;
 mnRangeOpPosInSymbol = -1;
@@ -2649,11 +2650,15 @@ Label_MaskStateMachine:
 SetError( nErr );  // parsed chars as string
 }
 if ( aRes.EndPos <= nSrcPos )
-{   // ?!?
+{
+// Could not parse anything meaningful.
+assert(!aRes.TokenType);
 nErr = FormulaError::IllegalChar;
 SetError( nErr );
-nSrcPos = aFormula.getLength();
-aSymbol.truncate();
+// Caller has to act on an empty symbol for
+// nSrcPos < aFormula.getLength()
+nSrcPos = nOldSrcPos;
+aSymbol.setLength(0);
 }
 else
 {
@@ -4117,7 +4122,22 @@ bool ScCompiler::NextNewToken( bool bInArray )
 sal_Int32 nSpaces = NextSymbol(bInArray);
 
 if (!cSymbol[0])
+{
+if (nSrcPos < aFormula.getLength())
+{
+// Nothing could be parsed, remainder as bad string.
+// NextSymbol() must had set an error for this.
+assert( pArr->GetCodeError() != FormulaError::NONE);
+const OUString aBad( aFormula.copy( nSrcPos));
+svl::SharedString aSS = pDoc->GetSharedStringPool().intern( aBad);
+maRawToken.SetString( aSS.getData(), aSS.getDataIgnoreCase());
+maRawToken.NewOpCode( ocBad);
+nSrcPos = aFormula.getLength();
+// Add bad string as last token.
+return true;
+}
 return false;
+}
 
 if( nSpaces )
 {
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

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

New commits:
commit 5468cf114b55124f08660ce75be7ca50de49ef0b
Author: Eike Rathke 
AuthorDate: Mon Feb 11 16:28:22 2019 +0100
Commit: Xisco Faulí 
CommitDate: Tue Feb 12 13:48:52 2019 +0100

Resolves: tdf#123052 correctly init pNextRows[] values for up/back 
unprotected

Regression from

commit ec68d58afd53ffd5f0f524503dec607e52385c72
CommitDate: Fri Jul 6 14:25:07 2018 +0200

GetNextPos: deduplicate some nMovX code

Change-Id: I0352d44eda587d2c340df4c7d8fe35b7b8591fc1
Reviewed-on: https://gerrit.libreoffice.org/67693
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit febe6a57f9bc9145ffc8e9faeb34b8ac5af1c718)
Reviewed-on: https://gerrit.libreoffice.org/67696
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx
index cef056314e2e..9377c7111a6e 100644
--- a/sc/source/core/data/table1.cxx
+++ b/sc/source/core/data/table1.cxx
@@ -1523,8 +1523,16 @@ void ScTable::GetNextPos( SCCOL& rCol, SCROW& rRow, 
SCCOL nMovX, SCROW nMovY,
 const SCROW nRowAdd = (bUp ? -1 : 1);
 sal_uInt16 nWrap = 0;
 
-for (SCCOL i = 0; i < nColCount; ++i)
-pNextRows[i] = (i + nStartCol < nCol) ? (nRow + nRowAdd) : 
nRow;
+if (bUp)
+{
+for (SCCOL i = 0; i < nColCount; ++i)
+pNextRows[i] = (i + nStartCol > nCol) ? (nRow + nRowAdd) : 
nRow;
+}
+else
+{
+for (SCCOL i = 0; i < nColCount; ++i)
+pNextRows[i] = (i + nStartCol < nCol) ? (nRow + nRowAdd) : 
nRow;
+}
 do
 {
 SCROW nNextRow = pNextRows[nCol - nStartCol] + nRowAdd;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

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

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

New commits:
commit 650f3ee43c22a00c15799d31995b22fc8e0742c9
Author: Eike Rathke 
AuthorDate: Wed Feb 6 14:53:26 2019 +0100
Commit: Kohei Yoshida 
CommitDate: Sat Feb 9 01:10:10 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/67465
Reviewed-by: Kohei Yoshida 

diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx
index bfd11e038bf0..a7119c52dc64 100644
--- a/sc/source/core/data/column.cxx
+++ b/sc/source/core/data/column.cxx
@@ -2262,6 +2262,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-2' - 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 f9f0c64be932e290a556e58ab9feea4a5d655f9d
Author: Julien Nabet 
AuthorDate: Sun Dec 30 00:20:33 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Mon Dec 31 21:48:08 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/65737
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/xml/xmlexprt.cxx 
b/sc/source/filter/xml/xmlexprt.cxx
index 6f4109e4f5f7..2d7b2f4fbc45 100644
--- a/sc/source/filter/xml/xmlexprt.cxx
+++ b/sc/source/filter/xml/xmlexprt.cxx
@@ -3248,7 +3248,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-2' - sc/source

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

New commits:
commit 924c704719bb99bd3036f693ccf11e35d68e5768
Author: Julien Nabet 
AuthorDate: Sun Dec 30 12:51:25 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Mon Dec 31 21:44:16 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/65748
Reviewed-by: Markus Mohrhard 

diff --git a/sc/source/filter/xml/XMLExportDataPilot.cxx 
b/sc/source/filter/xml/XMLExportDataPilot.cxx
index 3dad7e282501..a39784c7f8ab 100644
--- a/sc/source/filter/xml/XMLExportDataPilot.cxx
+++ b/sc/source/filter/xml/XMLExportDataPilot.cxx
@@ -493,6 +493,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-2' - sc/source

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

New commits:
commit 316e43730713b6c69318f8d4f1d093fcc862d5b7
Author: Noel Grandin 
AuthorDate: Wed Dec 26 20:57:31 2018 +0200
Commit: Noel Grandin 
CommitDate: Thu Dec 27 11:34:05 2018 +0100

tdf#122331 Autofilter disappeared after export to XLSX

regression from
commit c135f51b050dfa7ef095fe8a5b73cde37219a8dd
loplugin:returnconstant in XclExpAutofilter

Change-Id: Iea7ac925aff47699292b4c3d758e99cd2d081560
Reviewed-on: https://gerrit.libreoffice.org/65625
Tested-by: Jenkins
Reviewed-by: Noel Grandin 
(cherry picked from commit d080cd838c7ab182e70ed5e8c1deff10b2306f24)
Reviewed-on: https://gerrit.libreoffice.org/65635
Reviewed-by: Xisco Faulí 
Tested-by: Xisco Faulí 

diff --git a/sc/source/filter/excel/excrecds.cxx 
b/sc/source/filter/excel/excrecds.cxx
index d8dd91cbb78c..626a6b42b993 100644
--- a/sc/source/filter/excel/excrecds.cxx
+++ b/sc/source/filter/excel/excrecds.cxx
@@ -706,7 +706,7 @@ bool XclExpAutofilter::AddEntry( const ScQueryEntry& rEntry 
)
 if (GetOutput() != EXC_OUTPUT_BINARY && rItems.size() > 1)
 {
 AddMultiValueEntry(rEntry);
-return true;
+return false;
 }
 
 bool bConflict = 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-2' - sc/source

2018-12-20 Thread Libreoffice Gerrit user
 sc/source/ui/pagedlg/scuitphfedit.cxx |4 
 1 file changed, 4 insertions(+)

New commits:
commit 2923760cb8da0d6106e12bcb3d0ab1cc970d41ce
Author: Caolán McNamara 
AuthorDate: Thu Dec 20 16:52:11 2018 +
Commit: Caolán McNamara 
CommitDate: Thu Dec 20 22:13:31 2018 +0100

Resolves: tdf#114695 limit width of this combo

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

diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx 
b/sc/source/ui/pagedlg/scuitphfedit.cxx
index 36cbaf11f1b5..a851b3086ffe 100644
--- a/sc/source/ui/pagedlg/scuitphfedit.cxx
+++ b/sc/source/ui/pagedlg/scuitphfedit.cxx
@@ -66,6 +66,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-2' - sc/source

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

New commits:
commit 264c0bd303fa77932959e4265d2dd05a29a4da09
Author: Mike Kaganski 
AuthorDate: Tue Dec 4 21:28:46 2018 +0300
Commit: Xisco Faulí 
CommitDate: Mon Dec 17 09:46:07 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/65026
Tested-by: Jenkins
Reviewed-by: Xisco Faulí 

diff --git a/sc/source/ui/condformat/condformatdlg.cxx 
b/sc/source/ui/condformat/condformatdlg.cxx
index 64952101d0ea..79e0e3f233d6 100644
--- a/sc/source/ui/condformat/condformatdlg.cxx
+++ b/sc/source/ui/condformat/condformatdlg.cxx
@@ -674,7 +674,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-2' - sc/source

2018-12-13 Thread Libreoffice Gerrit user
 sc/source/core/data/dptabres.cxx |1 +
 1 file changed, 1 insertion(+)

New commits:
commit 26df14014ff8a7b4625f12123f32c5655f9b7071
Author: Eike Rathke 
AuthorDate: Wed Dec 12 17:59:36 2018 +0100
Commit: Eike Rathke 
CommitDate: Thu Dec 13 11:42:51 2018 +0100

Reset WelfordRunner in ScDPAggData::Reset()

Change-Id: I170b6bc5557f6d0d982751ace3dccc94c6778808
Reviewed-on: https://gerrit.libreoffice.org/65048
Reviewed-by: Eike Rathke 
Tested-by: Jenkins
(cherry picked from commit ec3ab1c671e00b9c32f6cdb529fb43e49f1e8689)
Reviewed-on: https://gerrit.libreoffice.org/65057

diff --git a/sc/source/core/data/dptabres.cxx b/sc/source/core/data/dptabres.cxx
index d989875b7359..b0084cefbb42 100644
--- a/sc/source/core/data/dptabres.cxx
+++ b/sc/source/core/data/dptabres.cxx
@@ -665,6 +665,7 @@ ScDPAggData* ScDPAggData::GetChild()
 
 void ScDPAggData::Reset()
 {
+maWelford = WelfordRunner();
 fVal = 0.0;
 fAux = 0.0;
 nCount = SC_DPAGG_EMPTY;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - 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 080fa0aa57ca0dfe158ab30c55a89b9d9288aca0
Author: Katarina Behrens 
AuthorDate: Mon Dec 10 22:22:17 2018 +0100
Commit: Thorsten Behrens 
CommitDate: Tue Dec 11 14:06:35 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/64945

diff --git a/sc/source/core/data/dpgroup.cxx b/sc/source/core/data/dpgroup.cxx
index a834efc7cdc2..4a07417e4981 100644
--- a/sc/source/core/data/dpgroup.cxx
+++ b/sc/source/core/data/dpgroup.cxx
@@ -1023,7 +1023,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-2' - sc/source

2018-12-08 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 740175916fd4cea821249201fa2af1fb2a3db867
Author: Eike Rathke 
AuthorDate: Sat Dec 8 18:19:12 2018 +0100
Commit: Eike Rathke 
CommitDate: Sat Dec 8 22:30:46 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/64823

diff --git a/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx 
b/sc/source/ui/StatisticsDialogs/AnalysisOfVarianceDialog.cxx
index 154bd2f73c34..a655c8c1bd51 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 9c972d84b636..376dd26c5e32 100644
--- a/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
+++ b/sc/source/ui/StatisticsDialogs/TableFillingAndNavigationTools.cxx
@@ -69,10 +69,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 65bd90a3db24..dd5cdcae1e51 100644
--- a/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
+++ b/sc/source/ui/inc/TableFillingAndNavigationTools.hxx
@@ -41,7 +41,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-2' - sc/source sc/uiconfig

2018-12-07 Thread Libreoffice Gerrit user
 sc/source/ui/inc/tabbgcolordlg.hxx  |   13 +++-
 sc/source/ui/miscdlgs/tabbgcolordlg.cxx |   87 
 sc/uiconfig/scalc/ui/tabcolordialog.ui  |   45 +++-
 3 files changed, 98 insertions(+), 47 deletions(-)

New commits:
commit 45b030a3e219bc2876472e1ada12cff602ec6549
Author: Jim Raykowski 
AuthorDate: Fri Nov 30 00:43:22 2018 -0900
Commit: Heiko Tietze 
CommitDate: Fri Dec 7 12:48:44 2018 +0100

tdf#105225 Add palette choice to calc tab background color dialog

Change-Id: I9891a20d3bc3de51fec84fb54c7aae42f7142662
Reviewed-on: https://gerrit.libreoffice.org/64329
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
Tested-by: Heiko Tietze 
Reviewed-by: Noel Grandin 
(cherry picked from commit 0a139d98477c116f14041b3c4ebb7bb6204808d3)
Reviewed-on: https://gerrit.libreoffice.org/64747

diff --git a/sc/source/ui/inc/tabbgcolordlg.hxx 
b/sc/source/ui/inc/tabbgcolordlg.hxx
index 4b27a4fe73e6..f5c2d330f344 100644
--- a/sc/source/ui/inc/tabbgcolordlg.hxx
+++ b/sc/source/ui/inc/tabbgcolordlg.hxx
@@ -21,6 +21,7 @@
 #define INCLUDED_SC_SOURCE_UI_INC_TABBGCOLORDLG_HXX
 
 #include 
+#include 
 
 class ScTabBgColorDlg : public weld::GenericDialogController
 {
@@ -36,7 +37,7 @@ public:
 class ScTabBgColorValueSet : public ColorValueSet
 {
 public:
-ScTabBgColorValueSet();
+ScTabBgColorValueSet(std::unique_ptr pWindow);
 virtual ~ScTabBgColorValueSet() override;
 
 void SetDialog(ScTabBgColorDlg* pTabBgColorDlg)
@@ -50,14 +51,18 @@ public:
 };
 
 private:
+PaletteManager  m_aPaletteManager;
 Color   m_aTabBgColor;
 const OUString  m_aTabBgColorNoColorText;
-ScTabBgColorValueSetm_aTabBgColorSet;
-std::unique_ptr m_xTabBgColorSet;
+
+std::unique_ptr m_xSelectPalette;
+std::unique_ptr m_xTabBgColorSet;
+std::unique_ptr m_xTabBgColorSetWin;
 std::unique_ptr m_xBtnOk;
 
-voidFillColorValueSets_Impl();
+void FillPaletteLB();
 
+DECL_LINK(SelectPaletteLBHdl, weld::ComboBox&, void);
 DECL_LINK(TabBgColorDblClickHdl_Impl, SvtValueSet*, void);
 DECL_LINK(TabBgColorOKHdl_Impl, weld::Button&, void);
 };
diff --git a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx 
b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
index 7ea90d530b4d..f9c0eb0ce502 100644
--- a/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
+++ b/sc/source/ui/miscdlgs/tabbgcolordlg.cxx
@@ -30,6 +30,8 @@
 #include 
 #include 
 
+#include 
+
 #define HDL(hdl) LINK(this,ScTabBgColorDlg,hdl)
 
 ScTabBgColorDlg::ScTabBgColorDlg(weld::Window* pParent, const OUString& rTitle,
@@ -37,16 +39,30 @@ ScTabBgColorDlg::ScTabBgColorDlg(weld::Window* pParent, 
const OUString& rTitle,
 : GenericDialogController(pParent, "modules/scalc/ui/tabcolordialog.ui", 
"TabColorDialog")
 , m_aTabBgColor(rDefaultColor)
 , m_aTabBgColorNoColorText(rTabBgColorNoColorText)
-, m_xTabBgColorSet(new weld::CustomWeld(*m_xBuilder, "colorset", 
m_aTabBgColorSet))
+, m_xSelectPalette(m_xBuilder->weld_combo_box("paletteselector"))
+, m_xTabBgColorSet(new 
ScTabBgColorValueSet(m_xBuilder->weld_scrolled_window("colorsetwin")))
+, m_xTabBgColorSetWin(new weld::CustomWeld(*m_xBuilder, "colorset", 
*m_xTabBgColorSet))
 , m_xBtnOk(m_xBuilder->weld_button("ok"))
 {
-m_aTabBgColorSet.SetDialog(this);
-m_aTabBgColorSet.SetColCount(SvxColorValueSet::getColumnCount());
+m_xTabBgColorSet->SetDialog(this);
+m_xTabBgColorSet->SetColCount(SvxColorValueSet::getColumnCount());
 
 m_xDialog->set_title(rTitle);
 
-FillColorValueSets_Impl();
-m_aTabBgColorSet.SetDoubleClickHdl(HDL(TabBgColorDblClickHdl_Impl));
+const WinBits nBits(m_xTabBgColorSet->GetStyle() | WB_NAMEFIELD | 
WB_ITEMBORDER | WB_NONEFIELD | WB_3DLOOK | WB_NO_DIRECTSELECT | 
WB_NOPOINTERFOCUS);
+m_xTabBgColorSet->SetStyle(nBits);
+m_xTabBgColorSet->SetText(m_aTabBgColorNoColorText);
+
+const sal_uInt32 nColCount = SvxColorValueSet::getColumnCount();
+const sal_uInt32 nRowCount(10);
+const sal_uInt32 nLength = SvxColorValueSet::getEntryEdgeLength();
+Size aSize(m_xTabBgColorSet->CalcWindowSizePixel(Size(nLength, nLength), 
nColCount, nRowCount));
+m_xTabBgColorSetWin->set_size_request(aSize.Width() + 8, aSize.Height() + 
8);
+
+FillPaletteLB();
+
+m_xSelectPalette->connect_changed(LINK(this, ScTabBgColorDlg, 
SelectPaletteLBHdl));
+m_xTabBgColorSet->SetDoubleClickHdl(HDL(TabBgColorDblClickHdl_Impl));
 m_xBtnOk->connect_clicked(HDL(TabBgColorOKHdl_Impl));
 }
 
@@ -59,48 +75,37 @@ void ScTabBgColorDlg::GetSelectedColor( Color& rColor ) 
const
 rColor = m_aTabBgColor;
 }
 
-void ScTabBgColorDlg::FillColorValueSets_Impl()
+void ScTabBgColorDlg::FillPaletteLB()
 {
-SfxObjectShell* pDocSh = SfxObjectShell::Current();
-const SfxPoolItem* pItem = nullptr;
-XColorListRef pColorList;
-
-OSL_ENSURE( pDocSh, "DocShell not found!" );
-
-   

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

2018-12-06 Thread Libreoffice Gerrit user
 sc/source/core/opencl/op_math.cxx |6 ++
 1 file changed, 6 insertions(+)

New commits:
commit b6dbe0abef3e73f0f5c06073ccb8338831bf0522
Author: Luboš Luňák 
AuthorDate: Tue Dec 4 12:58:11 2018 +0100
Commit: Luboš Luňák 
CommitDate: Thu Dec 6 15:35:55 2018 +0100

OpenCL SQRT() error checking

Change-Id: I6208cf21f53d1a2a0eb4f08962c7bddcc372aab5
Reviewed-on: https://gerrit.libreoffice.org/64545
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 581c7e4a0ec50aaa13112985c7e79cd66628f997)
Reviewed-on: https://gerrit.libreoffice.org/64612

diff --git a/sc/source/core/opencl/op_math.cxx 
b/sc/source/core/opencl/op_math.cxx
index ec4a75daa9eb..41e6a5818166 100644
--- a/sc/source/core/opencl/op_math.cxx
+++ b/sc/source/core/opencl/op_math.cxx
@@ -1277,6 +1277,10 @@ void OpSqrt::GenSlidingWindowFunction(std::stringstream 
,
 ss << "arg0=";
 ss << tmpCur->GetDouble() << ";\n";
 }
+else
+{
+throw Unhandled( __FILE__, __LINE__ );
+}
 }
 else
 {
@@ -1284,6 +1288,8 @@ void OpSqrt::GenSlidingWindowFunction(std::stringstream 
,
 ss << vSubArguments[0]->GenSlidingWindowDeclRef();
 ss << ";\n";
 }
+ss << "if( arg0 < 0 )\n";
+ss << "return CreateDoubleError(IllegalArgument);\n";
 ss << "return sqrt(arg0);\n";
 ss << "}";
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - 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 8f237e07a08abf703e0da15030bd708fde28e616
Author: Eike Rathke 
AuthorDate: Wed Dec 5 00:21:17 2018 +0100
Commit: Eike Rathke 
CommitDate: Wed Dec 5 22:43:37 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/64638

diff --git a/sc/source/filter/oox/sheetdatacontext.cxx 
b/sc/source/filter/oox/sheetdatacontext.cxx
index e3a3aea9fade..4206cde2a617 100644
--- a/sc/source/filter/oox/sheetdatacontext.cxx
+++ b/sc/source/filter/oox/sheetdatacontext.cxx
@@ -275,7 +275,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-2' - sc/source

2018-12-05 Thread Libreoffice Gerrit user
 sc/source/core/opencl/op_statistical.cxx |7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 64d54e91a054e31b0a8378036577ff890ad7eb28
Author: Luboš Luňák 
AuthorDate: Tue Nov 27 16:21:43 2018 +0100
Commit: Luboš Luňák 
CommitDate: Wed Dec 5 10:58:52 2018 +0100

fixes for OpenCL COVAR()

Change-Id: Ie171eea334de65b993554146c11adb95e0dbb85e
Reviewed-on: https://gerrit.libreoffice.org/64245
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 9a446225f4d395b584887eb42851e40cf2ab1fc7)
Reviewed-on: https://gerrit.libreoffice.org/64535

diff --git a/sc/source/core/opencl/op_statistical.cxx 
b/sc/source/core/opencl/op_statistical.cxx
index d18b3ffceec1..fd4508727d87 100644
--- a/sc/source/core/opencl/op_statistical.cxx
+++ b/sc/source/core/opencl/op_statistical.cxx
@@ -6843,6 +6843,7 @@ void OpPoisson::GenSlidingWindowFunction(
 void OpCovar::GenSlidingWindowFunction(std::stringstream& ss,
 const std::string , SubArguments& vSubArguments)
 {
+CHECK_PARAMETER_COUNT(2,2);
 ss << "\ndouble " << sSymName;
 ss << "_"<< BinFuncName() <<"(";
 for (size_t i = 0; i < vSubArguments.size(); i++)
@@ -6944,7 +6945,7 @@ void OpCovar::GenSlidingWindowFunction(std::stringstream& 
ss,
 else {
 ss << "int i = 0; i < " << nCurWindowSizeX << " && ";
 ss << " i + gid0 < " << pCurDVRX->GetArrayLength();
-ss << " && i + gid0 < " << pCurDVRX->GetArrayLength();
+ss << " && i + gid0 < " << pCurDVRY->GetArrayLength();
 ss << "; i++) {\n";
 ss << "if ((isnan(";
 ss << vSubArguments[0]->GenSlidingWindowDeclRef() << ")) || ";
@@ -7054,6 +7055,10 @@ void 
OpCovar::GenSlidingWindowFunction(std::stringstream& ss,
 ss << "}\n";
 ss << "}";
 }
+else
+{
+throw Unhandled(__FILE__, __LINE__);
+}
 }
 else {
 ss << "int cnt0 = 0,cnt1 = 0;\n";
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit b347009a4fb12b01100e97d9577b94449966f873
Author: heiko tietze 
AuthorDate: Tue Dec 4 11:24:53 2018 +0100
Commit: Heiko Tietze 
CommitDate: Wed Dec 5 08:10:38 2018 +0100

tdf#117425 - Increase the length of the Name Box drop down menu

Now 20 MRU plus...

Change-Id: I069021bf1f42da793f7ec79a7e0eacbea519bc14
Reviewed-on: https://gerrit.libreoffice.org/64515
Tested-by: Jenkins
Reviewed-by: Heiko Tietze 
(cherry picked from commit 271a767d9d8f473ef7829cbf16febe656420959c)
Reviewed-on: https://gerrit.libreoffice.org/64530

diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 71abccec99a4..3669d3840793 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1808,7 +1808,7 @@ ScPosWnd::ScPosWnd( vcl::Window* pParent ) :
 Size aSize( GetTextWidth( "GW9:GW9" ),
 GetTextHeight() );
 aSize.AdjustWidth(25 );// FIXME: ??
-aSize.setHeight( CalcWindowSizePixel(11) ); // Functions: 10 MRU + 
"others..."
+aSize.setHeight( CalcWindowSizePixel(21) ); // Functions: 20 MRU + 
"others..."
 SetSizePixel( aSize );
 
 FillRangeNames();
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

2018-12-04 Thread Libreoffice Gerrit user
 sc/source/core/opencl/formulagroupcl.cxx |7 +++
 sc/source/core/opencl/opbase.cxx |3 +++
 sc/source/core/opencl/opbase.hxx |   19 +++
 3 files changed, 29 insertions(+)

New commits:
commit 4678d37fdc64145b10f997668fd2890ddb3c8462
Author: Luboš Luňák 
AuthorDate: Fri Nov 16 16:47:59 2018 +0100
Commit: Luboš Luňák 
CommitDate: Tue Dec 4 16:05:39 2018 +0100

add a macro for detecting incorrect number of parameters in opencl

Change-Id: Id8253537025cc373c1ff183c0059158489e11750
Reviewed-on: https://gerrit.libreoffice.org/64239
Tested-by: Jenkins
Reviewed-by: Luboš Luňák 
(cherry picked from commit 433b1fdd3fc588cb542bb834117752dbef4e8236)
Reviewed-on: https://gerrit.libreoffice.org/64469

diff --git a/sc/source/core/opencl/formulagroupcl.cxx 
b/sc/source/core/opencl/formulagroupcl.cxx
index 7df68fc77fab..e18eeb9932d0 100644
--- a/sc/source/core/opencl/formulagroupcl.cxx
+++ b/sc/source/core/opencl/formulagroupcl.cxx
@@ -3640,6 +3640,13 @@ DynamicKernel* DynamicKernel::create( const 
ScCalcConfig& rConfig, const ScToken
 delete pDynamicKernel;
 return nullptr;
 }
+catch (const InvalidParameterCount& ipc)
+{
+SAL_INFO("sc.opencl", "Dynamic formula compiler: InvalidParameterCount 
" << ipc.mParameterCount
+<< " at " << ipc.mFile << ":" << ipc.mLineNumber);
+delete pDynamicKernel;
+return nullptr;
+}
 catch (const OpenCLError& oce)
 {
 // I think OpenCLError exceptions are actually exceptional 
(unexpected), so do use SAL_WARN
diff --git a/sc/source/core/opencl/opbase.cxx b/sc/source/core/opencl/opbase.cxx
index e4ba2a0a6d93..2d026475a088 100644
--- a/sc/source/core/opencl/opbase.cxx
+++ b/sc/source/core/opencl/opbase.cxx
@@ -34,6 +34,9 @@ OpenCLError::OpenCLError( const std::string& function, cl_int 
error, const std::
 Unhandled::Unhandled( const std::string& fn, int ln ) :
 mFile(fn), mLineNumber(ln) {}
 
+InvalidParameterCount::InvalidParameterCount( int parameterCount, const 
std::string& file, int ln ) :
+mParameterCount(parameterCount), mFile(file), mLineNumber(ln) {}
+
 DynamicKernelArgument::DynamicKernelArgument( const ScCalcConfig& config, 
const std::string& s,
 const FormulaTreeNodeRef& ft ) :
 mCalcConfig(config), mSymName(s), mFormulaTree(ft) { }
diff --git a/sc/source/core/opencl/opbase.hxx b/sc/source/core/opencl/opbase.hxx
index 5833796726a1..8fef4d3e1d09 100644
--- a/sc/source/core/opencl/opbase.hxx
+++ b/sc/source/core/opencl/opbase.hxx
@@ -60,6 +60,25 @@ public:
 int const mLineNumber;
 };
 
+class InvalidParameterCount
+{
+public:
+InvalidParameterCount( int parameterCount, const std::string& file, int ln 
);
+
+int mParameterCount;
+std::string mFile;
+int const mLineNumber;
+};
+
+// Helper macro to be used in code emitting OpenCL code for Calc functions.
+// Requires the vSubArguments parameter.
+#define CHECK_PARAMETER_COUNT(min, max) \
+do { \
+const int count = vSubArguments.size(); \
+if( count < ( min ) || count > ( max )) \
+throw InvalidParameterCount( count, __FILE__, __LINE__ ); \
+} while( false )
+
 typedef std::shared_ptr FormulaTreeNodeRef;
 
 class FormulaTreeNode
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


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

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

New commits:
commit 5908f1ea0a19482a999c2e00aeaae05eabc1e8e6
Author: Markus Mohrhard 
AuthorDate: Thu Nov 29 00:04:58 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Thu Nov 29 07:40:06 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/64203

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 448652397cee..5fc78815f602 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -3145,7 +3145,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-2' - 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 bc6f854412f7e7073f38821c3cd4a79de421de77
Author: Markus Mohrhard 
AuthorDate: Mon Nov 26 00:51:20 2018 +0100
Commit: Markus Mohrhard 
CommitDate: Mon Nov 26 17:37:20 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/64011
Reviewed-by: Xisco Faulí 
Tested-by: Xisco Faulí 

diff --git a/sc/source/ui/unoobj/chart2uno.cxx 
b/sc/source/ui/unoobj/chart2uno.cxx
index 233b0fe6ba73..448652397cee 100644
--- a/sc/source/ui/unoobj/chart2uno.cxx
+++ b/sc/source/ui/unoobj/chart2uno.cxx
@@ -2637,7 +2637,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-2' - 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 a63cd8bbe7cf881daa8dc7a7f32f3e5ac384e902
Author: Armin Le Grand 
AuthorDate: Thu Nov 22 13:18:30 2018 +0100
Commit: Thorsten Behrens 
CommitDate: Mon Nov 26 11:50:42 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/63851
Reviewed-by: Thorsten Behrens 

diff --git a/sc/source/core/data/drwlayer.cxx b/sc/source/core/data/drwlayer.cxx
index dc24b9e0d410..540e320d1999 100644
--- a/sc/source/core/data/drwlayer.cxx
+++ b/sc/source/core/data/drwlayer.cxx
@@ -642,11 +642,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.
@@ -666,61 +670,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-2' - 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 358d7c5630e0a3b5c1afe5a2aef4c0ec0f54fd34
Author: Eike Rathke 
AuthorDate: Thu Nov 22 00:52:40 2018 +0100
Commit: Eike Rathke 
CommitDate: Thu Nov 22 19:04:51 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/63794

diff --git a/sc/source/core/tool/interpr4.cxx b/sc/source/core/tool/interpr4.cxx
index 070510deb1f6..cc3672cbdbeb 100644
--- a/sc/source/core/tool/interpr4.cxx
+++ b/sc/source/core/tool/interpr4.cxx
@@ -1527,7 +1527,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();
@@ -1543,6 +1543,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-2' - sc/source

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

New commits:
commit c81e6d249f58dd03b4875380a11143e15ddb1e9a
Author: Caolán McNamara 
AuthorDate: Sat Nov 17 21:37:22 2018 +
Commit: Adolfo Jayme Barrientos 
CommitDate: Sun Nov 18 16:39:25 2018 +0100

Resolves: tdf#121409 missing dialog parent

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

diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index 3c5a8f5130d9..ba3896ecab2e 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -847,7 +847,7 @@ void ScFormatShell::ExecuteStyle( SfxRequest& rReq )
 
 ScAbstractDialogFactory* pFact = 
ScAbstractDialogFactory::Create();
 
-
pDlg.disposeAndReset(pFact->CreateScStyleDlg(rReq.GetFrameWeld(), *pStyleSheet, 
bPage));
+
pDlg.disposeAndReset(pFact->CreateScStyleDlg(pTabViewShell->GetFrameWeld(), 
*pStyleSheet, bPage));
 short nResult = pDlg->Execute();
 pTabViewShell->SetInFormatDialog(false);
 
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits